Reconciling In-Context and In-Weight Learning via Dual Representation Space Encoding
Not on the map. Why?
Abstract (arXiv)
In-context learning (ICL) is a valuable capability exhibited by Transformers pretrained on diverse sequence tasks. However, previous studies have observed that ICL often conflicts with the model's inherent in-weight learning (IWL) ability. By examining the representation space learned by a toy model in synthetic experiments, we identify the shared encoding space for context and samples in Transformers as a potential source of this conflict. To address this, we modify the model architecture to separately encode the context and samples into two distinct spaces: a task representation space and a sample representation space. We model these two spaces under a simple yet principled framework, assuming a linear representational structure and treating them as a pair of dual spaces. Both theoretical analysis and empirical results demonstrate the effectiveness of our proposed architecture, CoQE, in the single-value answer setting. It not only enhances ICL performance through improved representation learning, but also successfully reconciles ICL and IWL capabilities across synthetic few-shot classification and a newly designed pseudo-arithmetic task. Code: https://github.com/McGuinnessChen/dual-representation-space-encoding
Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 52 of its 62 references that are in the map. First posted on arXiv 13 Mar 2026.
Builds on
52 of 62 references.
References · 52
- 2017Attention Is All You Needcited by 59,932
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023RT-2: Vision-Language-Action Models Transfer Web Knowledge to Robotic Controlcited by 2,993
- 2023PaLM-E: An Embodied Multimodal Language Modelcited by 2,037
- 2023Sparse Autoencoders Find Highly Interpretable Features in Language Modelscited by 1,359
- 2022Planning-oriented Autonomous Drivingcited by 1,068
- 2023Video-ChatGPT: Towards Detailed Video Understanding via Large Vision and Language Modelscited by 1,047
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 700
- 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 679
- 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 673
38 more
- 2023Trained Transformers Learn Linear Models In-Contextcited by 331
- 2023Emergent Linear Representations in World Models of Self-Supervised Sequence Modelscited by 313
- 2023Language Models Represent Space and Timecited by 306
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 303
- 2023In-Context Learning Creates Task Vectorscited by 302
- 2023Function Vectors in Large Language Modelscited by 292
- 2023What In-Context Learning "Learns" In-Context: Disentangling Task Recognition and Task Learningcited by 149
- 2023The mechanistic basis of data dependence and abrupt learning in an in-context classification taskcited by 115
- 2024How Transformers Learn Causal Structure with Gradient Descentcited by 114
- 2023What and How does In-Context Learning Learn? Bayesian Model Averaging, Parameterization, and Generalizationcited by 112
- 2024Physics of Language Models: Part 2.1, Grade-School Math and the Hidden Reasoning Processcited by 107
- 2023Scan and Snap: Understanding Training Dynamics and Token Composition in 1-layer Transformercited by 101
- 2023Language Models Implement Simple Word2Vec-style Vector Arithmeticcited by 97
- 2023How Many Pretraining Tasks Are Needed for In-Context Learning of Linear Regression?cited by 93
- 2023How Do Transformers Learn Topic Structure: Towards a Mechanistic Understandingcited by 85
- 2023In-Context Learning through the Bayesian Prismcited by 78
- 2023How Do Transformers Learn In-Context Beyond Simple Functions? A Case Study on Learning with Representationscited by 72
- 2023The Transient Nature of Emergent In-Context Learning in Transformerscited by 72
- 2022Discovering Latent Concepts Learned in BERTcited by 56
- 2024Competition Dynamics Shape Algorithmic Phases of In-Context Learningcited by 52
- 2023In-Context Learning Learns Label Relationships but Is Not Conventional Learningcited by 48
- 2024Unveiling Induction Heads: Provable Training Dynamics and Feature Learning in Transformerscited by 46
- 2023Pretraining Data Mixtures Enable Narrow Model Selection Capabilities in Transformer Modelscited by 45
- 2024Why Larger Language Models Do In-context Learning Differently?cited by 44
- 2024Transformers Learn Nonlinear Features In Context: Nonconvex Mean-field Dynamics on the Attention Landscapecited by 43
- 2024Pretrained transformer efficiently learns low-dimensional target functions in-contextcited by 29
- 2023A Closer Look at In-Context Learning under Distribution Shiftscited by 25
- 2025Task Vectors in In-Context Learning: Emergence, Formation, and Benefitcited by 20
- 2024Toward Understanding In-context vs. In-weight Learningcited by 19
- 2024Differential learning kinetics govern the transition from memorization to generalization during in-context learningcited by 19
- 2025Strategy Coopetition Explains the Emergence and Transience of In-Context Learningcited by 17
- 2024Dual Process Learning: Controlling Use of In-Context vs. In-Weights Strategies with Weight Forgettingcited by 15
- 2024Everything Everywhere All at Once: LLMs can In-Context Learn Multiple Tasks in Superpositioncited by 13
- 2024Does learning the right latent variables necessarily improve in-context learning?cited by 12
- 2024Feature contamination: Neural networks learn uncorrelated features and fail to generalizecited by 11
- 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
- 2024Transformers Handle Endogeneity in In-Context Linear Regressioncited by 8
- 2025When Do Neural Networks Learn World Models?cited by 8
50 most cited of 52 All 52 (JSON)
Built on by
Not cited yet.