The sudden emergence of induction circuits and the ability to perform in-context copying in LLMs coincides with a sharp drop in training loss over a short span of the training process. This co-occurrence has been cited as evidence that it marks the point at which a wide range of in-context learning (ICL) capabilities begin to emerge. To analyze the training dynamics of few-shot abstractive ICL capabilities (i.e., tasks where the answer is not contained in the input context), we propose Hapax, a training regime that omits the loss contribution of tokens predictable by the induction circuit to control training pressure for copying. Using this intervention, we find that abstractive ICL capabilities can still emerge, despite a substantial reduction in inductive copying and the absence of the characteristic phase changes observed during Vanilla training. Analysis of attention heads shows that Hapax-trained models develop fewer and weaker induction heads. Together, these results suggest that the developmental link between emergent phenomena associated with induction circuits and the emergence of abstractive ICL is weaker than previously hypothesized. More broadly, Hapax provides a controlled framework for analyzing how copying-related training signals shape the development of in-context learning.
Figures & tables
Figure 1: An overview of the Hapax training regime. To suppress inductive copying, we introduce Hapax where positions predictable by induction heads within a context window do not contribute to the loss (gray positions).
Figure 2: Demonstration of the induction circuit. Previous token heads allow each token to store which token came previously. Induction heads do a match-and-copy operation to reproduce the subsequence that appeared earlier in the context.
Figure 3: Repetition performance in both random token and natural text settings. Hapax models struggle with repetition, which is solvable with induction circuits. This shows the Hapax training can control copying behavior. Accuracy is measured over 1000 randomly generated samples with s=25 .
Figure 4: The mean absolute gap between the Standard and Target Excluded evaluation is 4.7% for Vanilla versus 0.8% for Hapax over training, demonstrating that Hapax is less affected by induction-driven label copying. The target-excluded curves of both models emerge at similar times, indicating that Hapax does not delay the onset of abstractive ICL learning despite the reduction of copying.
Vanilla vs. Hapax
Task Category
Vanilla
Hapax
Sig.
> Vanilla
Algorithmic ( n=8 )
Standard
28.6 ± 0.9
27.3 ± 0.8
5
1/5 (20%)
Target excl.
25.7 ± 0.8
31.7 ± 0.9
8
7/8 (88%)
Linguistic ( n=4 )
Standard
30.3 ± 2.2
39.8 ± 1.9
4
4/4 (100%)
Table 1: Abstractive task performance summary at step 19900 over 34 tasks. Sig. gives the number of tasks with significant accuracy differences under McNemar tests with joint Benjamini–Hochberg correction (FDR level 0.05 ). The > Vanilla column gives the number and fraction of those significant tasks where the corresponding variant has higher accuracy than vanilla. Standard does not exclude the target label in few-shot demonstrations; Target excl. excludes the target label. Individual task names, accuracies and task category explanations are given in Appendix A.1 .
Figure 5: Comparison of token-loss metrics across training. Unlike the regular (All Samples) TLD, each Hapax variant is able to achieve non-trivial ICL capabilities on its corresponding distribution. Since the regular distribution is dominated by induction-predictable positions, its gains primarily reflect exact copying rather than abstractive ICL. Computing the metric on targeted subsets thus reveals distinct emergence patterns across the distributions of interest. Metrics are computed on randomly sampled validation data.
Figure 6: Prefix-matching scores of attention heads across training. Each line is one head. Opacity is proportional to peak score attained throughout training (heads with peak <0.1 omitted). Many heads in the Vanilla model peak suddenly and then decay (Mean plot), with 12 of 128 reaching > 80% prefix-matching score. Hapax variants do not display such a transition and only 1 head in Hapax ever exceeds 80%.
Figure 7: Logit lens on top-10 attention heads with the highest prefix-matching scores on the random repetition task (Section 4.1 ). For each head, we measure whether the target token rs appears among its top- k promoted tokens. Bars show the percentage averaged over the top-10 attention heads with the highest prefix-matching scores. Although these heads attend to rs , Hapax variants increasingly fail to promote it at the output. See Figure A14 for per-head contributions.
Figure 8: (a) Demonstration of the patching setup. (b) Induction scores for the randomly initialized Vanilla model before and after patching layer L4 from the step-5000 Vanilla model. At this checkpoint, L4 is the earliest layer with a strong previous-token head (Figure A20 ). Patching L4 increases the maximum prefix-matching score from 0.076 to 0.122. Red dots mark the top three prefix-matching heads after patching, which also rank highly at the final checkpoint.
Figure 9: Validation loss over the first 5000 steps for the Vanilla, Hapax , and Random-Masked models. Random masking removes the same number of positions per context as Hapax (31.7% of positions), but selects them at random. At step 5000 the Random-Masked model reaches a validation loss of 2.70, against 2.67 for Vanilla and 3.76 for Hapax . The gap between Vanilla and Hapax therefore cannot be attributed solely to the reduction in supervised positions.
Appendix figures & tables57 assets
Supplementary material from the paper’s appendix.
Appendix
Hapax
Thresh- Hapax
Task Category
Van.
Hapax
Sig.
> Van.
Van.
Thresh
Sig.
> Van.
Algorithmic ( n=8 )
Standard
28.6 ± 0.9
27.3 ± 0.8
5
1/5 (20%)
28.6 ± 0.9
15.3 ± 0.8
7
0/7 (0%)
Target excl.
25.7 ± 0.8
31.7 ± 0.9
8
7/8 (88%)
25.7 ± 0.8
19.1 ± 0.8
7
3/7 (43%)
Linguistic ( n=4 )
Standard
30.3 ± 2.2
39.8 ± 1.9
4
4/4 (100%)
30.3 ± 2.2
18.3 ± 2.0
4
2/4 (50%)
Appendix
Table A1: Abstractive task performance summary for the 1B model at step 19900 over 34 tasks. Macro-averaged accuracies (%) within each family are shown with 95% confidence intervals (normal approximation on the macro mean per category). Sig. gives the number of tasks with significant accuracy differences under McNemar tests with joint Benjamini–Hochberg correction ( α=0.05 ). The > Vanilla column gives the number and fraction of those significant tasks where the corresponding variant has higher accuracy than vanilla. Standard includes the target label in demonstrations; Target excl. withholds the target label.
Task
Vanilla (%)
Hapax (%)
Task
Vanilla (%)
Hapax (%)
AG News
32.7 ± 1.3 †
5.6 ± 0.6
Antonym
0.7 ± 0.3
2.2 ± 0.6 †
Capitalize (Full Word)
78.2 ± 2.8 †
59.0 ± 3.4
Capitalize First Letter
37.1 ± 3.3
66.8 ± 3.2 †
Capitalize Last Letter
9.3 ± 2.0 †
3.8 ± 1.3
Capitalize Second Letter
11.9 ± 2.3 †
2.4 ± 1.1
Chinese→English
4.1 ± 1.2
6.8 ± 1.6 †
CommonsenseQA
20.4 ± 1.1 †
5.2 ± 0.6
Country-Capital
29.6 ± 6.5
42.3 ± 7.0 †
Country-Currency
5.4 ± 4.6
5.4 ± 4.6
French→English
11.0 ± 2.0
11.9 ± 2.0
Indonesian→English
1.0 ± 0.6
0.6 ± 0.5
Appendix
Table A2: Performance comparison on abstractive in-context learning tasks (5-Shot) for Vanilla and Hapax . Values show accuracy ± 95% CI margin (binomial normal-approximation per task). Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax (%)
Task
Vanilla (%)
Hapax (%)
Adjective V Verb 3
58.8 ± 3.1 †
41.7 ± 3.1
Adjective V Verb 5
52.7 ± 3.1 †
31.2 ± 2.9
Alphabetically Last 5
18.6 ± 2.4
15.5 ± 2.2
Animal V Object 3
49.4 ± 3.1 †
26.0 ± 2.7
Animal V Object 5
37.1 ± 3.0 †
17.5 ± 2.4
Choose First Of 3
94.9 ± 1.4 †
19.1 ± 2.4
Choose First Of 5
95.6 ± 1.3 †
17.1 ± 2.3
Alphabetically First 3
35.5 ± 3.0 †
26.8 ± 2.7
Alphabetically First 5
19.9 ± 2.5 †
13.8 ± 2.1
Alphabetically Last 3
32.6 ± 2.9 †
24.4 ± 2.7
Choose Middle Of 5
25.8 ± 2.7 †
13.4 ± 2.1
Color V Animal 3
63.4 ± 3.0
60.2 ± 3.0
Appendix
Table A3: Performance comparison on extractive in-context learning tasks (5-Shot) for Vanilla and Hapax models. Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax Thresh (%)
Task
Vanilla (%)
Hapax Thresh (%)
AG News
32.7 ± 1.3 †
1.1 ± 0.3
Antonym
0.7 ± 0.3
7.3 ± 1.0 †
Capitalize (Full Word)
78.2 ± 2.8 †
35.9 ± 3.3
Capitalize First Letter
37.1 ± 3.3 †
24.0 ± 2.9
Capitalize Last Letter
9.3 ± 2.0 †
4.1 ± 1.4
Capitalize Second Letter
11.9 ± 2.3 †
3.7 ± 1.3
Chinese→English
4.1 ± 1.2
10.1 ± 1.9 †
CommonsenseQA
20.4 ± 1.1 †
0.0 ± 0.0
Country-Capital
29.6 ± 6.5
29.1 ± 6.5
Country-Currency
5.4 ± 4.6
2.2 ± 2.5
French→English
11.0 ± 2.0
14.5 ± 2.2 †
Indonesian→English
1.0 ± 0.6
1.0 ± 0.6
Appendix
Table A4: Performance comparison on abstractive in-context learning tasks (5-Shot) for Vanilla and Thresholded- Hapax . Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax Thresh (%)
Task
Vanilla (%)
Hapax Thresh (%)
Adjective V Verb 3
58.8 ± 3.1
56.1 ± 3.1
Adjective V Verb 5
52.7 ± 3.1 †
39.4 ± 3.0
Alphabetically Last 5
18.6 ± 2.4 †
13.0 ± 2.1
Animal V Object 3
49.4 ± 3.1 †
27.3 ± 2.8
Animal V Object 5
37.1 ± 3.0 †
16.3 ± 2.3
Choose First Of 3
94.9 ± 1.4 †
30.7 ± 2.9
Choose First Of 5
95.6 ± 1.3 †
27.0 ± 2.8
Alphabetically First 3
35.5 ± 3.0 †
28.1 ± 2.8
Alphabetically First 5
19.9 ± 2.5 †
14.5 ± 2.2
Alphabetically Last 3
32.6 ± 2.9 †
24.5 ± 2.7
Choose Middle Of 5
25.8 ± 2.7 †
7.4 ± 1.6
Color V Animal 3
63.4 ± 3.0 †
18.6 ± 2.4
Appendix
Table A5: Performance comparison on extractive in-context learning tasks (5-Shot) for Vanilla and Thresholded- Hapax . Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax (%)
Task
Vanilla (%)
Hapax (%)
AG News
0.3 ± 0.1
7.4 ± 0.7 †
Antonym
0.6 ± 0.3
2.5 ± 0.6 †
Capitalize (Full Word)
78.2 ± 2.8 †
59.0 ± 3.4
Capitalize First Letter
36.5 ± 3.3
74.0 ± 3.0 †
Capitalize Last Letter
3.1 ± 1.2
6.3 ± 1.7 †
Capitalize Second Letter
0.3 ± 0.3
3.2 ± 1.2 †
Chinese→English
4.1 ± 1.2
6.8 ± 1.6 †
CommonsenseQA
11.2 ± 0.9 †
10.0 ± 0.8
Country-Capital
30.7 ± 6.6
42.3 ± 7.0 †
Country-Currency
5.4 ± 4.6
8.6 ± 5.7
French→English
11.0 ± 2.0
11.9 ± 2.0
Indonesian→English
1.0 ± 0.6
0.6 ± 0.5
Appendix
Table A6: Performance comparison on abstractive in-context learning tasks (5-Shot) for Vanilla and Hapax by ensuring that the target answer for each test instance is not included in the 5-shot examples. Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax Thresh (%)
Task
Vanilla (%)
Hapax Thresh (%)
AG News
0.3 ± 0.1
3.4 ± 0.5 †
Antonym
0.6 ± 0.3
6.9 ± 1.0 †
Capitalize (Full Word)
78.2 ± 2.8 †
35.9 ± 3.3
Capitalize First Letter
36.5 ± 3.3 †
26.9 ± 3.0
Capitalize Last Letter
3.1 ± 1.2
8.0 ± 1.9 †
Capitalize Second Letter
0.3 ± 0.3
7.8 ± 1.9 †
Chinese→English
4.1 ± 1.2
10.1 ± 1.9 †
CommonsenseQA
11.2 ± 0.9 †
0.0 ± 0.0
Country-Capital
30.7 ± 6.6
29.1 ± 6.5
Country-Currency
5.4 ± 4.6
3.2 ± 3.4
French→English
11.0 ± 2.0
14.5 ± 2.2 †
Indonesian→English
1.0 ± 0.6
1.0 ± 0.6
Appendix
Table A7: Performance comparison on abstractive in-context learning tasks (5-Shot) for Vanilla and Thresholded- Hapax by ensuring that the target answer for each test instance is not included in the 5-shot examples. Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task family
Tasks included
Description
Algorithmic (8)
Capitalize (Full Word), Capitalize First Letter, Capitalize Last Letter, Capitalize Second Letter, Lowercase First Letter, Lowercase Last Letter, Next Capital Letter, Word Length
Tasks solvable by a character-level rule, such as capitalization, character selection, or counting.
Linguistic (4)
Antonym, Present-Past, Singular-Plural, Synonym
Tasks that require lexical or morphological knowledge.
Knowledge (11)
Country-Capital, Country-Currency, Landmark-Country, National Parks, Next Item, Park-Country, Person-Instrument, Person-Occupation, Person-Sport, Previous Item, Product-Company
Tasks that require parametric world knowledge.
Translation (8)
Chinese → English, French → English, Indonesian → English, Italian → English, Japanese → English, Polish → English, Portuguese → English, Spanish → English
Tasks where an input word is mapped from a source language to its target-language equivalent.
Sentence-level (3)
AG News, CommonsenseQA, Sentiment
Classification tasks over full passages.
Appendix
Table A8: Task categories and their constituent tasks. The four-way categorization follows Hendel et al. (2023) , extended with a Sentence-level family covering classification tasks that operate over full passages.
Figure A1: For Vanilla, Hapax , and Thresholded-Hapax , increasing the number of demonstrations from 1-shot to 5-shot improves accuracy on the majority of tasks. This suggests that the models benefit from the in-context demonstrations, rather than relying solely on zero-shot or parametric task knowledge.
Figure A2: Probability Difference for random repetition task of the Top 10 Prefix-Matching heads for vanilla model.
Figure A3: Probability Difference for random repetition task of the Top 10 Prefix-Matching heads for Hapax model.
Figure A4: Probability Difference for random repetition task of the Top 10 Prefix-Matching heads for Thresholded- Hapax .
Figure A5: Probability difference values of random repetition task for Thresholded- Hapax .
Figure A6: Probability difference values of random repetition task for Hapax .
Figure A7: Probability difference values of random repetition task for Vanilla model.
Figure A8: Accuracy difference values of random repetition task for Thresholded- Hapax .
Figure A9: Accuracy difference values of random repetition task for Hapax
Figure A10: Accuracy difference values of random repetition task for Vanilla model.
Figure A11: The non-repeating natural text repetition accuracy. Instead of giving a repeated sequence r1r2...rsr1r2...rs−1 we only give r1r2...rs−1 . This shows that the initial increase seen in the natural text repetition also occurs for non-repeating samples.
Figure A12: Validation Loss of Vanilla and Hapax model. Despite having increased loss value, as mentioned in the main paper, the validation loss also is mostly affected by the prediction of exact copying instances.
Figure A13: Loss values at individual token positions. The loss value for Non-Extractive Samples is lower for both token positions than the Vanilla in Hapax .
Figure A14: Per-head analysis of the percentage of times the target token is included in the top-k promoted tokens for the top 10 prefix-matching heads.
Figure A15: Similar to the findings from Yin and Steinhardt (2025) , we find FV heads and find them to be causally more important than heads with high prefix-matching scores.
Figure A16: Ablation of previous-token head is more destructive in Vanilla, whereas the influence of ablation is progressively lower on the accuracy for hapax and thresholded hapax.
Figure A17: Using the concept head scores from Feucht et al. (2025) , we display the scores of the models from best to worst. The trends are similar for both the Vanilla and Hapax models, indicating that suppressing inductive copying does not noticeably affect the causal concept head metrics.
Figure A18: Prefix-Matching Scores across Vanilla and Hapax models. Hapax model has fewer heads that have a strong prefix-matching score.
Figure A19: Prefix Matching Scores for Thresholded- Hapax .
Figure A20: Previous Token Head of vanilla model at step 5000. L4 is the first layer that has a strong previous token head, which is L4 H1.
Figure B21: Cosine similarities of nearest N neighbors for clean model.
Figure B22: Average edit distance of nearest neighbors for vanilla model.
Figure B23: Low edit-distance pairs appear across a broad range of cosine similarities, suggesting that edit distance over-treats tokens as equivalent. The analysis is done on the same pairs analyzed in B22 .
Figure B24: Relationship between string-level similarity (edit distance) and embedding similarity for the top-50 nearest neighbors. Many token pairs with low edit distance also have low embedding similarity (28.56%). However, 1% of the token pairs with cosine similarity above 0.3 are still not captured. Since attention heads attend by hidden state similarity, we want to make sure we are removing such similar tokens, which motivates our use of cosine similarity.
Figure C25: Examples of sentence completions generated for the evaluation. Each prompt seed is used to generate completions by both models. In both examples, the vanilla model’s generation was rated with 0 (Not Fluent), while Hapax received 1 (Somewhat Fluent). Names in the second example have been redacted.
Figure C26: GPT-4o-mini as a judge rates 100 samples of natural text generated by each model based on fluency.
Task
Pool
Used
Task
Pool
Used
FV abstractive ICL
AG News
7,600
5,000
Antonym
2,398
2,398
Capitalize (Full Word)
813
813
Capitalize First Letter
813
813
Capitalize Last Letter
814
814
Capitalize Second Letter
787
787
Chinese → English
981
981
CommonsenseQA
10,962
5,000
Country-Capital
197
189
Country-Currency
197
93
Appendix
Table D9: Per-task evaluation sample sizes for FV ICL tasks. Pool is the benchmark size. Used is the number of samples used after the filtering logic is applied.
Figure D27: French–English example. Accuracy uses prefix matching on the gold word (optional leading space). The continuation must equal the gold token or immediately follow it with a separator character: space, newline, tab, ’ , , , . , or end.
Figure D28: Label distribution of Person-Instrument task.
Figure D29: Label distribution of Capitalize Second Letter task.
Figure E30: Random repetition accuracy for models trained with prefix-matching loss. Two lambda values that reduces the prefix-matching score are still able to learn random repetition.
Figure E31: Example attention pattern of a model trained with a loss function that penalizes prefix-matching scores. Red squares indicate prefix-matching positions. Although the model does not display the typical attention pattern for induction, it learns to read the copying information from 1-offset positions.
Figure E32: When the optimizer state for induction heads is reinitialized in combination with the weights, the model gets stuck and tries to relearn induction heads. We plot prefix-matching scores before we reinitialize, which is why certain data points exceed 0.3.
Figure E33: Number of induction heads that exceed the 0.25 threshold for the reinitialized model (160M). Since we reinitialize heads that exceed 0.3, we plot heads that exceed 0.25. The reinitialization causes the model to create three times more induction heads as compared to its vanilla version.
Figure E34: Number of attention heads that exceed 0.25 threshold for a vanilla model (160M).
Figure E35: Accuracies of sample tasks over training for the Vanilla model. Random repetition accuracy is the first task to improve, and its rise coincides with the training step where the loss drops sharply (Figure A12 ). This motivates examining whether the decrease in loss and the increase in inductive copying translate into meaningful gains on abstractive tasks, which according to our evidence are not tightly coupled.
Figure G36: Comparison of token-loss metrics across training for seed 1337.
Figure G37: Comparison of token-loss metrics across training for seed 2807.
Figure G38: Comparison of prefix-matching scores across training for seed 1337.
Figure G39: Comparison of prefix-matching scores across training for seed 2807.
Figure H40: Loss values at individual token positions for 2.8B models. The loss value for Non-Extractive Samples is lower for both token positions than the Vanilla in Hapax .
Vanilla vs. Hapax (2.8B)
Task Category
Van.
Hapax
Sig.
> Van.
Algorithmic ( n=8 )
Standard
25.1 ± 0.9
30.0 ± 0.8
6
3/6 (50%)
Target excl.
23.2 ± 0.8
34.8 ± 0.8
7
7/7 (100%)
Linguistic ( n=4 )
Standard
36.1 ± 2.1
41.8 ± 1.9
3
3/3 (100%)
Appendix
Table H10: Abstractive task performance summary for the 2.8b model at step 24900 over 34 tasks. Macro-averaged accuracies (%) within each family are shown with 95% confidence intervals (normal approximation on the macro mean per category). Sig. gives the number of tasks with significant accuracy differences under McNemar tests with joint Benjamini–Hochberg correction ( α=0.05 ). The > Vanilla column gives the number and fraction of those significant tasks where the corresponding variant has higher accuracy than vanilla. Standard includes the target label in demonstrations; Target excl. withholds the target label.
Figure H41: Repetition performance in both random token and natural text settings for 2.8B models. Hapax models struggle with repetition, which is solvable with induction circuits. This shows the Hapax training can control copying behavior. Accuracy is measured over 1000 randomly generated samples with s=25 .
Figure H42: Comparison of abstractive-icl accuracy plots across training for seeds 1337 and 2807.
Task
Vanilla (%)
Hapax (%)
Task
Vanilla (%)
Hapax (%)
AG News
42.0 ± 1.4 †
23.7 ± 1.2
Antonym
2.3 ± 0.6
7.9 ± 1.1 †
Capitalize (Full Word)
72.8 ± 3.1
81.3 ± 2.7 †
Capitalize First Letter
40.3 ± 3.4
60.8 ± 3.4 †
Capitalize Last Letter
7.2 ± 1.8 †
4.8 ± 1.5
Capitalize Second Letter
8.3 ± 1.9 †
4.1 ± 1.4
Chinese→English
11.0 ± 2.0
14.1 ± 2.2 †
CommonsenseQA
19.9 ± 1.1 †
17.0 ± 1.0
Country-Capital
48.7 ± 7.1
61.4 ± 6.9 †
Country-Currency
12.9 ± 6.8
21.5 ± 8.4
French→English
19.2 ± 2.5
25.1 ± 2.7 †
Indonesian→English
1.7 ± 0.8
2.3 ± 0.9
Appendix
Table H11: Performance comparison on abstractive in-context learning tasks (5-Shot) for Vanilla and Hapax 2.8B. Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax (%)
Task
Vanilla (%)
Hapax (%)
AG News
3.4 ± 0.5
35.9 ± 1.3 †
Antonym
2.4 ± 0.6
8.2 ± 1.1 †
Capitalize (Full Word)
72.8 ± 3.1
81.3 ± 2.7 †
Capitalize First Letter
35.9 ± 3.3
71.6 ± 3.1 †
Capitalize Last Letter
4.9 ± 1.5
8.1 ± 1.9 †
Capitalize Second Letter
1.9 ± 1.0
6.4 ± 1.7 †
Chinese→English
11.0 ± 2.0
14.1 ± 2.2 †
CommonsenseQA
14.0 ± 1.0
44.3 ± 1.4 †
Country-Capital
48.7 ± 7.1
61.4 ± 6.9 †
Country-Currency
14.0 ± 7.0
23.7 ± 8.6
French→English
19.2 ± 2.5
25.1 ± 2.7 †
Indonesian→English
1.7 ± 0.8
2.3 ± 0.9
Appendix
Table H12: Performance comparison on abstractive in-context learning tasks (5-Shot) for Vanilla and Hapax 2.8B by ensuring that the target answer for each test instance is not included in the 5-shot examples. Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Task
Vanilla (%)
Hapax (%)
Task
Vanilla (%)
Hapax (%)
Color vs Animal (3)
56.6 ± 3.1 †
48.1 ± 3.1
CoNLL: Location
48.0 ± 1.5 †
35.1 ± 1.4
Concept vs Object (3)
76.7 ± 2.6 †
55.4 ± 3.1
CoNLL: Person
58.3 ± 1.8 †
12.1 ± 1.2
Choose Middle of 3
40.8 ± 3.0 †
25.7 ± 2.7
Alphabetically Last (3)
31.5 ± 2.9 †
25.0 ± 2.7
Alphabetically Last (5)
19.2 ± 2.4 †
14.9 ± 2.2
Object vs Concept (3)
58.0 ± 3.1 †
37.6 ± 3.0
Object vs Concept (5)
57.6 ± 3.1 †
31.5 ± 2.9
Fruit vs Animal (5)
22.1 ± 2.6 †
7.8 ± 1.7
Animal vs Object (3)
50.5 ± 3.1 †
34.8 ± 3.0
Verb vs Adjective (3)
77.7 ± 2.6 †
64.4 ± 3.0
Appendix
Table H13: Performance comparison on extractive in-context learning tasks (5-Shot) for Vanilla and Hapax models. Values show accuracy ± 95% CI margin. Bold indicates higher performance; † denotes statistical significance ( p<0.05 ) according to McNemar’s test.
Figure H43: Prefix-matching scores of attention heads across training for 2.8B. Each line is one head. Opacity is proportional to peak score attained throughout training (heads with peak <0.1 omitted).
Figure H44: Comparison of token-loss metrics across training on 2.8B models. Unlike the regular (All Samples) TLD, our proposed variants on non-extractive samples progress gradually, with each Hapax variant being able to achieve non-trivial ICL capabilities on its corresponding distribution. Since the regular distribution is dominated by induction-predictable positions, its gains primarily reflect exact copying rather than abstractive ICL. Computing the metric on targeted subsets thus reveals distinct emergence patterns across the distributions of interest. Metrics are computed on randomly sampled validation data.
In-context learning (ICL) allows language models to adapt their behavior from instructions and demonstrations in a prompt, but accuracy alone does not reveal how contextual information controls their predictions. We study the acquisition and trainability of ICL with a controlled diagnostic that separates copying a nearby demonstration from integrating information across the prompt. Across 17 models, about a third prefer the copied answer, a few are undecided, and the rest prefer the rule-consistent answer, which goes with higher accuracy and with control by the requested value rather than the closest conflicting example. Checkpoint analyses show that models begin prioritizing task-relevant prompt tokens over conflicting examples long before their accuracy improves beyond chance level. In matched training experiments, synthetic documents that define endings and then query them shift models toward compositional responses on the controlled diagnostic, whereas fine-tuning on definition exercises built from rewritten real documents improves accuracy when prompts reassign label meanings. The results suggest that ICL is not acquired as a single, uniform capability. Instead, prompt control, answer preference, construction without candidates, and transfer can develop along distinct trajectories.
In-Context Learning (ICL) enables pretrained LLMs to adapt to downstream tasks by conditioning on a small set of input-output demonstrations, without any parameter updates. Although there have been many theoretical efforts to explain how ICL works, most either rely on strong architectural or data assumptions, or fail to capture the impact of key practical factors such as demonstration selection, Chain-of-Thought (CoT) prompting, the number of demonstrations, and prompt templates. We address this gap by establishing a theoretical analysis of ICL under mild assumptions that links these design choices to generalization behavior. We derive an upper bound on the ICL test loss, showing that performance is governed by (i) the quality of selected demonstrations, quantified by Lipschitz constants of the ICL loss along paths connecting test prompts to pretraining samples, (ii) an intrinsic ICL capability of the pretrained model, and (iii) the degree of distribution shift. Within the same framework, we analyze CoT prompting as inducing a task decomposition and show that it is beneficial when demonstrations are well chosen at each substep and the resulting subtasks are easier to learn. Finally, we characterize how ICL performance sensitivity to prompt templates varies with the number of demonstrations. Together, our study shows that pretraining equips the model with the ability to generalize beyond observed tasks, while CoT enables the model to compose simpler subtasks into more complex ones, and demonstrations and instructions enable it to retrieve similar or complex tasks, including those that can be composed into more complex ones, jointly supporting generalization to unseen tasks. All theoretical insights are corroborated by experiments.
Xuhan Tong, Yuchen Zeng, Jiawei Zhang
Department of Computer Sciences, University of Wisconsin-Madison · Microsoft Research
Specialized attention heads dubbed induction heads (IHs) have been argued to underlie the remarkable in-context learning capabilities of modern language models; yet, a precise characterization of their emergence, especially in the context of language modeling, remains wanting. In this study, we investigate the relationship between statistical properties of the training data and IH formation in both natural and synthetic training data settings. We show that: (1) a simple equation combining batch size and context size predicts the point at which IHs form and that this emergence point is agnostic to model size; (2) surface bigram repetition frequency and reliability strongly affect the formation of IHs, and we find an effective decision boundary in terms of these two values; (3) local dependency with high bigram repetition frequency and reliability is sufficient for IH formation, but categoriality and the shape of the marginal distribution appear to modulate IH formation near the decision boundary.