From Unstructured Data to In-Context Learning: Exploring What Tasks Can Be Learned and When

Large language models (LLMs) like transformers demonstrate impressive in-context learning (ICL) capabilities, allowing them to make predictions for new tasks based on prompt exemplars without parameter updates. While existing ICL theories often assume structured training data resembling ICL tasks (e.g., x-y pairs for linear regression), LLMs are typically trained unsupervised on unstructured text, such as web content, which lacks clear parallels to tasks like word analogy. To address this gap, we examine what enables ICL in models trained on unstructured data, focusing on critical sequence model requirements and training data structure. We find that many ICL capabilities can emerge simply from co-occurrence of semantically related word pairs in unstructured data; word analogy completion, for example, can provably arise purely through co-occurrence modeling, using classical language models like continuous bag of words (CBOW), without needing positional information or attention mechanisms. However, positional information becomes crucial for logic reasoning tasks requiring generalization to unseen tokens. Finally, we identify two cases where ICL fails: one in logic reasoning tasks that require generalizing to new, unseen patterns, and another in analogy completion where relevant word pairs appear only in fixed training positions. These findings suggest that LLMs' ICL abilities depend heavily on the structural elements within their training data.

Paper

Similar papers

Peer review

Reviewer xShA6/10 · confidence 2/52024-07-07

Summary

The paper basically presents three theoretical analyses related to ICL. The section 2 shows that we can use CBOW to do the (country)-(capital) kind of ICL. The section 3 shows that positional embeddings, multiple layers in autoregressive LM, and blocked noise structures are important for ICL. The section 4 shows that ICL could fail when there are systematic and consistent mismatches between the training sequence and testing sequence.

Strengths

I think this paper is easy to follow and most explanations are clear (One minor suggestion: it would be more clear to also illustrate the correct answer of each prompt and provide some brief explanations such as the prompt in section 3 tries to repeat the first letter of a word). I choose fair in the presentation rating because I feel that the paper oversells its contributions in the title and abstract. All the claims are supported by both strong theoretical conclusions and empirical simulations. The theoretical contributions are novel to me but I am not a theoretical researcher. Since the situations/preconditions of the claims are extremely simple, I think its significancy is not high for practitioners, but the contributions might be significant for theoretical researchers and might inspire the follow-up work.

Weaknesses

I think the main weakness of this paper is the mismatch between scope it seems to cover and its actual scope. The title and abstract suggests that this paper tries to study why the ICL works well given the unstructured training data in practice, but what the paper actually did is thoroughly studying 3 toy situations. I understand that we often have to simplify the situations in order to get strong theoretical conclusions. I also think that, at least to me, it is difficult to derive those theoretical results in such simplified situations and all the toy situations are relevant to the ICL. Nevertheless, I think these situations are not very representative to most of the practical ICL settings. After all, most ICL is beyond just relying the co-occurrence statistics of the sentences like CBOW, finding the first letter of the word, and repeating some words in the context. I understand that nowadays, one paper often needs to oversell its scope in the title and abstract to get attentions. Hence, although I suggest that the authors can revise the main storyline to reduce the overselling, I am fine with the current title and abstract if this paper is accepted at the end. I am also not a researcher who studies theory, so I do not know how significant or novel these theoretical results are. Therefore, I would like to let other researchers who have better theoretical background to rate this paper.

Questions

I have no specific question to the authors, so I think the rebuttal won't change my opinion. I won't lower my score if the authors choose to skip the rebuttal to my comments.

Rating

6

Confidence

2

Soundness

4

Presentation

3

Contribution

2

Limitations

The limitation discussion in the appendix K is fair.

Reviewer xShA2024-08-07

Thank you for willing to revise the title and abstract

I raise my presentation score from 2 to 3 and overall score from 5 to 6. Nevertheless, I remain my confidence to 2 because I think the main contribution of this paper is its theoretical analyses but I do not have sufficient background to judgement the this main contribution.

Reviewer xEmA5/10 · confidence 4/52024-07-12

Summary

This paper studies the emergence of in-context learning (ICL) in both CBOW (Mikolov et al,. 2013) and Transformer models. The focus is on simple synthetic settings that can be studied both theoretically and through synthetic experiments with small models. The paper identifies co-occurence as a key ingredient for ICL to emerge in CBOW. Then the paper considers how positional information is critical for a Transformer (or any) model to identify certain order-dependent patterns. Finally, the paper presents two sythetic scenarios involving repetition in which ICL fails with a simple model.

Strengths

- The paper begins by identifying synthetic scenarios in which co-occurrence within a sentence is sufficient for a continous bag-of-worlds (CBOW) model to be able to perform ICL. The paper proves two theorems identifying when co-occurrence statistics are sufficient to ensure that CBOW could perform ICL. - The paper then proves that positional information is required to perform certain sythetic tasks related to the ordering of tokens. - Finally, the paper identifies two sythetic settings in which one might expect ICL to work. - Sythetic experiments support each of the above claims.

Weaknesses

- The paper states that "ICL is achievable by only modeling co-occurrence information using [CBOW]". However, this seems to miss the generality with which the term ICL is used. That is, ICL is commonly used for generation tasks such as full-sentence machine translation (not just the simple token-level translation examples in this paper). So to say that "ICL is achievable" seems like a misuse of the terminology. Without a more careful definition of ICL, this statement is invalid. - After showing that Llama 2 is unable to use ICL to translate the word English words "soon" and "main" to Indonesian, the paper claims that "these models should be equally likely to produce the correct answer for any given [word], irrespective of its relevance to the in-context examples. However, our experiment demonstrates that this is not the case". This is a huge leap for a poorly designed experiment. Llama 2 was trained on 98.08% English data. The amount of Indonesian language data may have been miniscule. As such, co-occurence may offer an explanation for the result, but adjacency might be equally informative. To speak of co-occurrence without any discussion of adjacency seems a bit odd here. This same issue appears later in the paper's claim "This suggests ICL may arise from co-occurrence information", whereas a claim that it is informed by co-occurrence might be more apt. - It is not clear to this reader why one would expect the setting in Section 4.1 to succeed via ICL in the first place. For example, we also wouldn't expect these settings to suceeed if they were presented to a supervised learner either because of the mismatch between the training examples and the prompt example. - The paper relegates the entire 2.5 page related work section to the appendix. It would be better to include more in the main paper; at present only lines 25-32 in the Intro address prior work making it difficult to position this paper early on.

Questions

- In line 258, the paper claims that "each token in V should be present as the first token in both the training and test sets." But shouldn't we be interested in whether this is really required in the largest of LLMs? Is there any way to connect this result back to larger models?

Rating

5

Confidence

4

Soundness

3

Presentation

2

Contribution

2

Limitations

Yes

Reviewer xEmA2024-08-13

Reply to rebuttal

Thanks for the thorough response. You've mostly addressed my concerns, but one of the small (but still important!) odd claims you make is not, and that is raised again below -- hopefully more clearly this time. > We have updated the paper to clarify that this statement applies to ICL tasks with known input-output pairings Great. Qualifying definitions of ICL seems very important. > the experiments in Section 2.4 do not involve any rare languages, and the same conclusion applies. Sorry -- I think you latched on to my rare languages point and missed the broader question about poor experimental design. The paper still claims in lines 75-77 that "If ICL stems from the ability of LLMs to recognize consistent mappings in test prompts, these models should be equally likely to produce the correct answer for any given [word], irrespective of its relevance to the in-context examples. However, our experiment demonstrates that this is not the case". But why would anyone expect that a model should be equally likely to produce a correct answer for any given word irrespective of its relevance to the in-context examples? That is, your if/then statement does not seem like something most researchers would agree with. For example, decades of work on NLP and machine learning have shown that when learning through parameter estimation (instead of ICL), the relevance of the training examples to the test examples is of critical importance (i.e. the entire NLP literature on domain adaptation) (see [1] and [2]). Similarly, recent work on retrieval augmented ICL and the like has shown that large gains are possible when one retrieves a collection of in-context examples that are relevant (usually in an nearest-neighbor embedding sense) to the test instance (see [3] and [4]). In other words, the dominant view is that the when a model is learning (either via fine-tuning or ICL), whether the test instance is relevant to training examples is a critical factor. (Note that the citations here are just ones I could quickly find for MT. But I imagine you could find similar papers supporting this for, say, classification tasks closer to your experiment in Section 2.4 as well.) In other words, it seems reasonable that one should counter your statement "our experiment demonstrates this is not the case" by pointing out that the LLM could simply be learning to recognize consistent mappings in test prompts /and/ that the mappings it infers may be domain specific. That would better align with the fields current understanding of how learning, be it through parameter estimation or ICL, happens in most models (LLMs and other varieties too). This is a relatively minor issue with the paper, but the claim seems so outlandish that I'm returning back to it here. [1] "A Survey of Domain Adaptation for Neural Machine Translation" [2] "Domain Adaptation and Multi-Domain Adaptation for Neural Machine Translation: A Survey" [3] "Towards Robust In-Context Learning for Machine Translation with Large Language Models" [4] "Efficient Machine Translation Domain Adaptation" > We have expanded the Introduction section to better relate our work to existing literature and clarify its position in the ICL research landscape. Great! > In practice, this condition is likely met due to the vast size of LLMs' pre-training data. That seems reasonable. ----- Under the assumption that lines 75-77 can be fixed easily, I'm bumping my score up to a 5.

Authorsrebuttal2024-08-13

Thank you for your response! We completely agree with your point and will make the necessary revisions to lines 75-77.

Reviewer cRrU7/10 · confidence 3/52024-07-14

Summary

The paper studies the emergence of ICL using a synthetic setting. Particularly, it focuses on the importance of concurrence statistics to ICL, and shows that under some simplified conditions, a CBOW-styled model is proven to complete the correct completion for an ICL example. The paper additionally proves the importance of position encodings in the studied setting, showing that when the ICL task is inherently task dependent, position encodings is necessary for good performance.

Strengths

The paper studies an important problem. The approach---reconstructing LM behavior in much "shallower" models---is intriguing and can be applied to additional problems concerning LMs. The technical claims are well presented and the paper is overall very readable.

Weaknesses

The main weakness is that the paper studies a very synthetic setting. I understand some simplification are needed for the derivation of theoretical results, and this is OK. But, for example, it would be interesting to try deriving results on cases where the input consists of valid grammatical sentences, rather than a concatenation of tuples. If that is not possible, the paper should clearly state the disparity between "real" ICL setting and this setting. While LMs can be presented with tuples in inference time, they are usually not trained on such tuples, but rather on free form language.

Questions

The experimental results use cross entropy loss rather than the squared loss used in the theory. Why?

Rating

7

Confidence

3

Soundness

4

Presentation

3

Contribution

3

Limitations

See above.

Authorsrebuttal2024-08-13

Thanks for the clarification. We confirmed that the experimental results with the squared loss align with the theoretical findings. However, we did not include it in the paper because the squared loss is rarely used in practice. Concretely, in the context of Theorem 1, an accuracy of $1$ is achieved when $(p_0, p_1, p_2) = (0, 1, 0)$ or $(0, 0, 1)$ under the squared loss in the clean scenario, consistent with our theoretical results. The full results with the squared loss are as follows: - In the clean scenario, an accuracy of $1$ is achieved for each of the 6 $(p_0, p_1, p_2)$ tuples. - In the corrupted scenario, an accuracy of $0$ is achieved when $(p_0, p_1, p_2) = (0, 1, 0)$, while an accuracy of $1$ is achieved for the remaining 5 tuples. Under the setting of Theorem 2, the balanced accuracy when $(p_0, p_1, p_2) = (0, 0, 1)$ is $1$ under the squared loss, also confirming our theoretical results.

Reviewer cRrU2024-08-13

Response

Thanks for the clarification. I maintain my positive assessment.

Reviewer nuMZ6/10 · confidence 2/52024-07-16

Summary

The paper investigates the emergence of ICL from training on unstructured data. It explores two types of ICL tasks: the first involves input-output pairings that frequently co-occur within sentences, and the second comprises recognizable patterns that do not commonly co-occur. The authors demonstrate that the first task can be addressed by modeling co-occurrence information, and highlight the importance of positional information and blocked noise structures through the second task. Additionally, the paper discusses scenarios where ICL fails. Both theoretical and experimental evidence are provided in the paper.

Strengths

- It enhances understanding of how the structure of training data influences the emergence of ICL capabilities - the paper provides a mix of theoretical proofs and empirical validations to support its claims

Weaknesses

- There is a lack of experiment details in the paper, such as the number of training sentences used, the frequency of each input-output pair's repetitions within training sentences, and the methodology for generating training and evaluation data. - The scope of the experiments is limited, using small datasets and simplistic model architectures. Moreover, there is an absence of real-world data. - There is uncertainty about whether the findings would scale well to complex real-world data, larger models and higher embedding dimensions.

Questions

Can you add examples of training sentences and prompts for experiments?

Rating

6

Confidence

2

Soundness

3

Presentation

2

Contribution

3

Limitations

Limitations are discussed in the paper.

Reviewer cRrU2024-08-12

Reponse

Thanks for your response. Please note I asked why the squared loss was not *also* used in the experiments.

Reviewer nuMZ2024-08-13

Response to the Rebuttal

I appreciate the authors' responses during the rebuttal. The experimental details are helpful for the comprehension of the work. I would like to maintain my original score as I am not very confident in my assessment over the theoretical contributions of this work.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC