mlsanityData to 14 Oct 2026

In-context Learning Generalizes, But Not Always Robustly: The Case of Syntax

arXiv 2311.07811 ↗First posted 13 Nov 2023cs.CLcited by 22

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) is now a common method for teaching large language models (LLMs) new tasks: given labeled examples in the input context, the LLM learns to perform the task without weight updates. Do models guided via ICL infer the underlying structure of the task defined by the context, or do they rely on superficial heuristics that only generalize to identically distributed examples? We address this question using transformations tasks and an NLI task that assess sensitivity to syntax - a requirement for robust language understanding. We further investigate whether out-of-distribution generalization can be improved via chain-of-thought prompting, where the model is provided with a sequence of intermediate computation steps that illustrate how the task ought to be performed. In experiments with models from the GPT, PaLM, and Llama 2 families, we find large variance across LMs. The variance is explained more by the composition of the pre-training corpus and supervision methods than by model size; in particular, models pre-trained on code generalize better, and benefit more from chain-of-thought prompting.

Key facts. Cited by 22 papers in the map (data through 14 Oct 2026). Builds on 40 of its 53 references that are in the map. First posted on arXiv 13 Nov 2023.

Builds on

40 of 53 references.

References · 40

  1. 2017Attention Is All You Needcited by 60,361
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2022Training language models to follow instructions with human feedbackcited by 15,971
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  5. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  6. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  7. 2019BART: Denoising Sequence-to-Sequence Pre-training for Natural Language Generation, Translation, and Comprehensioncited by 5,893
  8. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,326
  9. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,780
  10. 2017A Broad-Coverage Challenge Corpus for Sentence Understanding through Inferencecited by 2,682
  11. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  12. 2022Rethinking the Role of Demonstrations: What Makes In-Context Learning Work?cited by 1,434
28 more
  1. 2023Language Models Don't Always Say What They Think: Unfaithful Explanations in Chain-of-Thought Promptingcited by 1,122
  2. 2019Right for the Wrong Reasons: Diagnosing Syntactic Heuristics in Natural Language Inferencecited by 876
  3. 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
  4. 2019BLiMP: The Benchmark of Linguistic Minimal Pairs for Englishcited by 564
  5. 2021MetaICL: Learning to Learn In Contextcited by 454
  6. 2023Larger language models do in-context learning differentlycited by 394
  7. 2016Assessing the Ability of LSTMs to Learn Syntax-Sensitive Dependenciescited by 354
  8. 2022Language Models Are Greedy Reasoners: A Systematic Formal Analysis of Chain-of-Thoughtcited by 337
  9. 2021Do Prompt-Based Models Really Understand the Meaning of their Prompts?cited by 326
  10. 2022Prompting GPT-3 To Be Reliablecited by 260
  11. 2023A Comprehensive Capability Analysis of GPT-3 and GPT-3.5 Series Modelscited by 246
  12. 2018Targeted Syntactic Evaluation of Language Modelscited by 242
  13. 2022Neural Theory-of-Mind? On the Limits of Social Intelligence in Large LMscited by 220
  14. 2023Inverse Scaling: When Bigger Isn't Bettercited by 207
  15. 2020A Systematic Assessment of Syntactic Generalization in Neural Language Modelscited by 165
  16. 2022Language Models of Code are Few-Shot Commonsense Learnerscited by 160
  17. 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 152
  18. 2023Sudden Drops in the Loss: Syntax Acquisition, Phase Transitions, and Simplicity Bias in MLMscited by 124
  19. 2020How Can We Accelerate Progress Towards Human-like Linguistic Generalization?cited by 114
  20. 2020Does syntax need to grow on trees? Sources of hierarchical inductive bias in sequence-to-sequence networkscited by 72
  21. 2021Provable Limitations of Acquiring Meaning from Ungrounded Form: What Will Future Language Models Understand?cited by 55
  22. 2022Transformers generalize differently from information stored in context vs in weightscited by 49
  23. 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
  24. 2020Can neural networks acquire a structural bias from raw linguistic data?cited by 35
  25. 2018Revisiting the poverty of the stimulus: hierarchical generalization without a hierarchical bias in recurrent neural networkscited by 33
  26. 2022Coloring the Blank Slate: Pre-training Imparts a Hierarchical Inductive Bias to Sequence-to-sequence Modelscited by 28
  27. 2019Quantity doesn't buy quality syntax with neural language modelscited by 25
  28. 2021Transformers Generalize Linearlycited by 19

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 6; 2025: 12; 2026: 4.

22 papers.

Sort:

By area:

  1. 2024How Does Code Pretraining Affect Language Model Task Performance?cited by 28
  2. 2024Learning Syntax Without Planting Trees: Understanding Hierarchical Generalization in Transformerscited by 24
  3. 2025AdaReasoner: Adaptive Reasoning Enables More Flexible Thinking in Large Language Modelscited by 17
  4. 2024Characterizing the Role of Similarity in the Property Inferences of Language Modelscited by 11
  5. 2024Sometimes I am a Tree: Data Drives Unstable Hierarchical Generalizationcited by 10
  6. 2025Optimizing Decomposition for Optimal Claim Verificationcited by 10
  7. 2024Look Further Ahead: Testing the Limits of GPT-4 in Path Planningcited by 7
  8. 2025Rapid Word Learning Through Meta In-Context Learningcited by 4
  9. 2025ObscuraCoder: Powering Efficient Code LM Pre-Training Via Obfuscation Groundingcited by 4
  10. 2025ICL CIPHERS: Quantifying "Learning" in In-Context Learning via Substitution Cipherscited by 4
  11. 2025Improving the OOD Performance of Closed-Source LLMs on NLI Through Strategic Data Selectioncited by 4
  12. 2024Experimental Contexts Can Facilitate Robust Semantic Property Inference in Language Models, but Inconsistentlycited by 3
10 more
  1. 2025Exploring Explanations Improves the Robustness of In-Context Learningcited by 2
  2. 2026Simulating Human Memory with Language Modelscited by 2
  3. 2025Learning Linear Regression with Low-Rank Tasks in-Contextcited by 1
  4. 2025Bearing Syntactic Fruit with Stack-Augmented Neural Networkscited by 1
  5. 2025Analogical Structure, Minimal Contextual Cues and Contrastive Distractors: Input Design for Sample-Efficient Linguistic Rule Inductioncited by 1
  6. 2026Towards Effective In-context Cross-domain Knowledge Transfer via Domain-invariant-neurons-based Retrievalcited by 1
  7. 2026Reason Analogically via Cross-domain Prior Knowledge: An Empirical Study of Cross-domain Knowledge Transfer for In-Context Learningcited by 1
  8. 2025Towards Contamination Resistant Benchmarkscited by 0
  9. 2025The Dog the Cat Chased Stumped the Model: Measuring When Language Models Abandon Structure for Shortcutscited by 0
  10. 2026Towards Spec Learning: Inference-Time Alignment from Preference Pairscited by 0

Similar, not cited

Close in wording, no citation either way

  1. 2025On the generalization of language models from in-context learning and finetuning: a controlled study
  2. 2023Skills-in-Context Prompting: Unlocking Compositionality in Large Language Models
  3. 2024Does In-Context Learning Really Learn? Rethinking How Large Language Models Respond and Solve Tasks via In-Context Learning
  4. 2023The Mystery of In-Context Learning: A Comprehensive Survey on Interpretation and Analysis
  5. 2026Beyond the Prompt in Large Language Models: Comprehension, In-Context Learning, and Chain-of-Thought
  6. 2024In-Context Language Learning: Architectures and Algorithms
  7. 2024Efficient LLM Context Distillation
  8. 2024Larger Language Models Don't Care How You Think: Why Chain-of-Thought Prompting Fails in Subjective Tasks