Transformers generalize differently from information stored in context vs in weights
Not on the map. Why?
Abstract (arXiv)
Transformer models can use two fundamentally different kinds of information: information stored in weights during training, and information provided ``in-context'' at inference time. In this work, we show that transformers exhibit different inductive biases in how they represent and generalize from the information in these two sources. In particular, we characterize whether they generalize via parsimonious rules (rule-based generalization) or via direct comparison with observed examples (exemplar-based generalization). This is of important practical consequence, as it informs whether to encode information in weights or in context, depending on how we want models to use that information. In transformers trained on controlled stimuli, we find that generalization from weights is more rule-based whereas generalization from context is largely exemplar-based. In contrast, we find that in transformers pre-trained on natural language, in-context learning is significantly rule-based, with larger models showing more rule-basedness. We hypothesise that rule-based generalization from in-context information might be an emergent consequence of large-scale training on language, which has sparse rule-like structure. Using controlled stimuli, we verify that transformers pretrained on data containing sparse rule-like structure exhibit more rule-based generalization.
Key facts. Cited by 49 papers in the map (data through 14 Oct 2026). Builds on 12 of its 16 references that are in the map. First posted on arXiv 11 Oct 2022.
Builds on
12 of 16 references.
References · 12
- 2017Attention Is All You Needcited by 60,361
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2021Prefix-Tuning: Optimizing Continuous Prompts for Generationcited by 3,915
- 2021The Power of Scale for Parameter-Efficient Prompt Tuningcited by 3,795
- 2022Training Compute-Optimal Large Language Modelscited by 3,019
- 2019Invariant Risk Minimizationcited by 1,854
- 2018ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustnesscited by 1,432
- 2019Does Learning Require Memorization? A Short Tale about a Long Tailcited by 460
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2022Black-Box Tuning for Language-Model-as-a-Servicecited by 256
- 2019When redundancy is useful: A Bayesian approach to 'overinformative' referring expressionscited by 21
- 2021Distinguishing rule- and exemplar-based generalization in learning systemscited by 12
Built on by
Citing papers per year: 2022: 4; 2023: 16; 2024: 12; 2025: 8; 2026: 9.
49 papers.
Sort:
By area:
- 2022Transformers learn in-context by gradient descentcited by 732
- 2023Generating Images with Multimodal Language Modelscited by 260
- 2024Many-Shot In-Context Learningcited by 206
- 2023Large Language Models as General Pattern Machinescited by 197
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2023In-Context Learning through the Bayesian Prismcited by 83
- 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scalecited by 64
- 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learningcited by 51
- 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
- 2024VisualWebArena: Evaluating Multimodal Agents on Realistic Visual Web Taskscited by 47
- 2022HyperTuning: Toward Adapting Large Language Models without Back-propagationcited by 46
- 2023Distilling and Retrieving Generalizable Knowledge for Robot Manipulation via Language Correctionscited by 45
37 more
- 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 40
- 2023Generalization to New Sequential Decision Making Tasks with In-Context Learningcited by 39
- 2024The broader spectrum of in-context learningcited by 35
- 2024On the Out-Of-Distribution Generalization of Multimodal Large Language Modelscited by 30
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steeringcited by 29
- 2023A Closer Look at In-Context Learning under Distribution Shiftscited by 25
- 2023In-context Learning Generalizes, But Not Always Robustly: The Case of Syntaxcited by 22
- 2023Passive learning of active causal strategies in agents and language modelscited by 21
- 2024When does compositional structure yield compositional generalization? A kernel theorycited by 20
- 2024LLM Task Interference: An Initial Study on the Impact of Task-Switch in Conversational Historycited by 19
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
- 2024Dual Process Learning: Controlling Use of In-Context vs. In-Weights Strategies with Weight Forgettingcited by 15
- 2025Latent learning: episodic memory complements parametric learning by enabling flexible reuse of experiencescited by 15
- 2023Conceptual structure coheres in human cognition but not in large language modelscited by 14
- 2024A Survey to Recent Progress Towards Understanding In-Context Learningcited by 14
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformercited by 12
- 2023Ambiguity-Aware In-Context Learning with Large Language Modelscited by 11
- 2023Breaking through the learning plateaus of in-context learning in Transformercited by 8
- 2024Can foundation models actively gather information in interactive environments to test hypotheses?cited by 8
- 2023The Cost of Down-Scaling Language Models: Fact Recall Deteriorates before In-Context Learningcited by 7
- 2026Learning Next Action Predictors from Human-Computer Interactioncited by 7
- 2025Understanding Prompt Tuning and In-Context Learning via Meta-Learningcited by 6
- 2026Generative AI collective behavior needs an interactionist paradigmcited by 6
- 2024Quantifying artificial intelligence through algorithmic generalizationcited by 5
- 2022The KITMUS Test: Evaluating Knowledge Integration from Multiple Sources in Natural Language Understanding Systemscited by 4
- 2025Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worldscited by 4
- 2024Multi-modal Generation via Cross-Modal In-Context Learningcited by 2
- 2026Input Pathways Shape Few-Shot, Not Zero-Shot, Binding in Tiny Transformers: A Fully-Enumerable Studycited by 2
- 2023Accelerating Neural Self-Improvement via Bootstrappingcited by 1
- 2025Relational reasoning and inductive bias in transformers and large language modelscited by 1
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoningcited by 1
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledgecited by 1
- 2025From Text to Trajectories: GPT-2 as an ODE Solver via In-Contextcited by 0
- 2026How Context Attribution Handles What the Model Already Knowscited by 0
- 2026Does Episodic Memory Help Close the Lexical Frequency Gap in Sensitivity to Syntactic Contrasts? A Test Using Retrieval-Augmented Language Modelscited by 0
- 2026Generalized Context in Cross Attention for Transfer Learning of Disjoint Tabular Datacited by 0
- 2026LLMs Learn Better In-Context from Rules than from Examplescited by 0
- 2026LLMs Learn Better In-Context from Rules than from Examples2 Sep 2026
- 2026Generalized Context in Cross Attention for Transfer Learning of Disjoint Tabular Data28 Aug 2026
- 2026Does Episodic Memory Help Close the Lexical Frequency Gap in Sensitivity to Syntactic Contrasts? A Test Using Retrieval-Augmented Language Models24 Aug 2026
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledge12 Aug 2026
- 2026How Context Attribution Handles What the Model Already Knows26 Jul 2026
- 2026Input Pathways Shape Few-Shot, Not Zero-Shot, Binding in Tiny Transformers: A Fully-Enumerable Study6 Jul 2026
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning23 Apr 2026
- 2026Learning Next Action Predictors from Human-Computer Interaction6 Mar 2026
- 2026Generative AI collective behavior needs an interactionist paradigm15 Jan 2026
- 2025Belief Dynamics Reveal the Dual Nature of In-Context Learning and Activation Steering1 Nov 2025
- 2025Latent learning: episodic memory complements parametric learning by enabling flexible reuse of experiences19 Sep 2025
- 2025From Text to Trajectories: GPT-2 as an ODE Solver via In-Context5 Aug 2025
37 more
- 2025Relational reasoning and inductive bias in transformers and large language models4 Jun 2025
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer1 Jun 2025
- 2025Understanding Prompt Tuning and In-Context Learning via Meta-Learning22 May 2025
- 2025On the generalization of language models from in-context learning and finetuning: a controlled study1 May 2025
- 2025Towards Large-Scale In-Context Reinforcement Learning by Meta-Training in Randomized Worlds5 Feb 2025
- 2024Can foundation models actively gather information in interactive environments to test hypotheses?9 Dec 2024
- 2024The broader spectrum of in-context learning5 Dec 2024
- 2024Quantifying artificial intelligence through algorithmic generalization8 Nov 2024
- 2024Toward Understanding In-context vs. In-weight Learning30 Oct 2024
- 2024Dual Process Learning: Controlling Use of In-Context vs. In-Weights Strategies with Weight Forgetting28 May 2024
- 2024Multi-modal Generation via Cross-Modal In-Context Learning28 May 2024
- 2024When does compositional structure yield compositional generalization? A kernel theory26 May 2024
- 2024Many-Shot In-Context Learning17 Apr 2024
- 2024LLM Task Interference: An Initial Study on the Impact of Task-Switch in Conversational History28 Feb 2024
- 2024On the Out-Of-Distribution Generalization of Multimodal Large Language Models9 Feb 2024
- 2024A Survey to Recent Progress Towards Understanding In-Context Learning3 Feb 2024
- 2024VisualWebArena: Evaluating Multimodal Agents on Realistic Visual Web Tasks24 Jan 2024
- 2023Generalization to New Sequential Decision Making Tasks with In-Context Learning6 Dec 2023
- 2023Distilling and Retrieving Generalizable Knowledge for Robot Manipulation via Language Corrections17 Nov 2023
- 2023In-context Learning Generalizes, But Not Always Robustly: The Case of Syntax13 Nov 2023
- 2023The Cost of Down-Scaling Language Models: Fact Recall Deteriorates before In-Context Learning7 Oct 2023
- 2023Ambiguity-Aware In-Context Learning with Large Language Models14 Sep 2023
- 2023Breaking through the learning plateaus of in-context learning in Transformer12 Sep 2023
- 2023Uncovering mesa-optimization algorithms in Transformers11 Sep 2023
- 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learning23 Jul 2023
- 2023Large Language Models as General Pattern Machines10 Jul 2023
- 2023In-Context Learning through the Bayesian Prism8 Jun 2023
- 2023Generating Images with Multimodal Language Models26 May 2023
- 2023A Closer Look at In-Context Learning under Distribution Shifts26 May 2023
- 2023Passive learning of active causal strategies in agents and language models25 May 2023
- 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrations22 May 2023
- 2023Accelerating Neural Self-Improvement via Bootstrapping2 May 2023
- 2023Conceptual structure coheres in human cognition but not in large language models5 Apr 2023
- 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scale18 Dec 2022
- 2022The KITMUS Test: Evaluating Knowledge Integration from Multiple Sources in Natural Language Understanding Systems15 Dec 2022
- 2022Transformers learn in-context by gradient descent15 Dec 2022
- 2022HyperTuning: Toward Adapting Large Language Models without Back-propagation22 Nov 2022
- 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scalecited by 64
- 2025On the generalization of language models from in-context learning and finetuning: a controlled studycited by 40
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformercited by 12
- 2025Relational reasoning and inductive bias in transformers and large language modelscited by 1
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoningcited by 1
- 2026To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning23 Apr 2026
- 2025Relational reasoning and inductive bias in transformers and large language models4 Jun 2025
- 2025Is Random Attention Sufficient for Sequence Modeling? Disentangling Trainable Components in the Transformer1 Jun 2025
- 2025On the generalization of language models from in-context learning and finetuning: a controlled study1 May 2025
- 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scale18 Dec 2022
- 2023Accelerating Neural Self-Improvement via Bootstrappingcited by 1
- 2023Accelerating Neural Self-Improvement via Bootstrapping2 May 2023
- 2022Transformers learn in-context by gradient descentcited by 732
- 2024Many-Shot In-Context Learningcited by 206
- 2023Large Language Models as General Pattern Machinescited by 197
- 2023Uncovering mesa-optimization algorithms in Transformerscited by 100
- 2023In-Context Learning through the Bayesian Prismcited by 83
- 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learningcited by 51
- 2023Measuring Inductive Biases of In-Context Learning with Underspecified Demonstrationscited by 49
- 2022HyperTuning: Toward Adapting Large Language Models without Back-propagationcited by 46
- 2023Distilling and Retrieving Generalizable Knowledge for Robot Manipulation via Language Correctionscited by 45
- 2023Generalization to New Sequential Decision Making Tasks with In-Context Learningcited by 39
- 2024The broader spectrum of in-context learningcited by 35
- 2023A Closer Look at In-Context Learning under Distribution Shiftscited by 25
12 most cited of 36 All 36 (JSON)
- 2026LLMs Learn Better In-Context from Rules than from Examples2 Sep 2026
- 2026Generalized Context in Cross Attention for Transfer Learning of Disjoint Tabular Data28 Aug 2026
- 2026Information Abundance Paradox: Long-Context Training Undermines Parametric Knowledge12 Aug 2026
- 2026How Context Attribution Handles What the Model Already Knows26 Jul 2026
- 2026Input Pathways Shape Few-Shot, Not Zero-Shot, Binding in Tiny Transformers: A Fully-Enumerable Study6 Jul 2026
- 2026Learning Next Action Predictors from Human-Computer Interaction6 Mar 2026
- 2026Generative AI collective behavior needs an interactionist paradigm15 Jan 2026
- 2025Latent learning: episodic memory complements parametric learning by enabling flexible reuse of experiences19 Sep 2025
- 2025From Text to Trajectories: GPT-2 as an ODE Solver via In-Context5 Aug 2025
- 2025Understanding Prompt Tuning and In-Context Learning via Meta-Learning22 May 2025
- 2024Can foundation models actively gather information in interactive environments to test hypotheses?9 Dec 2024
- 2024The broader spectrum of in-context learning5 Dec 2024
12 newest of 36 All 36 (JSON)