In-Context Learning State Vector with Inner and Momentum Optimization
Not on the map. Why?
Abstract (arXiv)
Large Language Models (LLMs) have exhibited an impressive ability to perform In-Context Learning (ICL) from only a few examples. Recent works have indicated that the functions learned by ICL can be represented through compressed vectors derived from the transformer. However, the working mechanisms and optimization of these vectors are yet to be thoroughly explored. In this paper, we address this gap by presenting a comprehensive analysis of these compressed vectors, drawing parallels to the parameters trained with gradient descent, and introduce the concept of state vector. Inspired by the works on model soup and momentum-based gradient descent, we propose inner and momentum optimization methods that are applied to refine the state vector progressively as test-time adaptation. Moreover, we simulate state vector aggregation in the multiple example setting, where demonstrations comprising numerous examples are usually too lengthy for regular ICL, and further propose a divide-and-conquer aggregation method to address this challenge. We conduct extensive experiments using Llama-2 and GPT-J in both zero-shot setting and few-shot setting. The experimental results show that our optimization method effectively enhances the state vector and achieves the state-of-the-art performance on diverse tasks. Code is available at https://github.com/HITsz-TMG/ICL-State-Vector
Key facts. Cited by 15 papers in the map (data through 14 Oct 2026). Builds on 32 of its 44 references that are in the map. First posted on arXiv 17 Apr 2024.
Builds on
32 of 44 references.
References · 32
- 2020Language Models are Few-Shot Learnerscited by 32,419
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2022Emergent Abilities of Large Language Modelscited by 2,512
- 2015Character-level Convolutional Networks for Text Classificationcited by 2,330
- 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
- 2022Model soups: averaging weights of multiple fine-tuned models improves accuracy without increasing inference timecited by 1,396
- 2022Editing Models with Task Arithmeticcited by 1,120
- 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 938
- 2022Transformers learn in-context by gradient descentcited by 732
- 2022What Can Transformers Learn In-Context? A Case Study of Simple Function Classescited by 715
20 more
- 2023Language Models are Super Mario: Absorbing Abilities from Homologous Models as a Free Lunchcited by 694
- 2022What learning algorithm is in-context learning? Investigations with linear modelscited by 684
- 2013Generating Sequences With Recurrent Neural Networkscited by 554
- 2017Word Translation Without Parallel Datacited by 487
- 2023Learning to Compress Prompts with Gist Tokenscited by 390
- 2023A Comprehensive Survey on Test-Time Adaptation under Distribution Shiftscited by 359
- 2023In-Context Learning Creates Task Vectorscited by 312
- 2022Data Distributional Properties Drive Emergent In-Context Learning in Transformerscited by 309
- 2023Function Vectors in Large Language Modelscited by 308
- 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 245
- 2023Label Words are Anchors: An Information Flow Perspective for Understanding In-Context Learningcited by 236
- 2023Linearity of Relation Decoding in Transformer Language Modelscited by 200
- 2019The Bottom-up Evolution of Representations in the Transformer: A Study with Machine Translation and Language Modeling Objectivescited by 139
- 2023Task-Specific Skill Localization in Fine-tuned Language Modelscited by 105
- 2023Language Models Implement Simple Word2Vec-style Vector Arithmeticcited by 98
- 2023AdapterSoup: Weight Averaging to Improve Generalization of Pretrained Language Modelscited by 84
- 2023Separate the Wheat from the Chaff: Model Deficiency Unlearning via Parameter-Efficient Module Operationcited by 33
- 2023In-context Learning and Gradient Descent Revisitedcited by 20
- 2017Distinguishing Antonyms and Synonyms in a Pattern-based Neural Networkcited by 19
- 2023Iterative Forward Tuning Boosts In-Context Learning in Language Modelscited by 15
Built on by
Citing papers per year: 2024: 2; 2025: 10; 2026: 3.
15 papers.
Sort:
By area:
- 2025CODI: Compressing Chain-of-Thought into Continuous Space via Self-Distillationcited by 225
- 2025Learning Task Representations from In-Context Learningcited by 11
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitationscited by 9
- 2024ELICIT: LLM Augmentation via External In-Context Capabilitycited by 7
- 2025From Compression to Expression: A Layerwise Analysis of In-Context Learningcited by 6
- 2024Label Words as Local Task Vectors in In-Context Learningcited by 3
- 2025Optimization-Inspired Few-Shot Adaptation for Large Language Modelscited by 3
- 2026Context Learning for Multi-Agent Discussioncited by 3
- 2025Take Off the Training Wheels Progressive In-Context Learning for Effective Alignmentcited by 2
- 2025Task-driven Layerwise Additive Activation Interventioncited by 1
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectivenesscited by 1
- 2025Unleashing Hierarchical Reasoning: An LLM-Driven Framework for Training-Free Referring Video Object Segmentationcited by 0
3 more
- 2026Capturing In-Context Learning Dynamics with Task Operators1 Oct 2026
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning20 May 2026
- 2026Context Learning for Multi-Agent Discussion2 Feb 2026
- 2025Hyperbolic Optimization20 Sep 2025
- 2025Unleashing Hierarchical Reasoning: An LLM-Driven Framework for Training-Free Referring Video Object Segmentation6 Sep 2025
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectiveness1 Aug 2025
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitations10 Jun 2025
- 2025Optimization-Inspired Few-Shot Adaptation for Large Language Models25 May 2025
- 2025From Compression to Expression: A Layerwise Analysis of In-Context Learning22 May 2025
- 2025Take Off the Training Wheels Progressive In-Context Learning for Effective Alignment13 Mar 2025
- 2025CODI: Compressing Chain-of-Thought into Continuous Space via Self-Distillation28 Feb 2025
- 2025Task-driven Layerwise Additive Activation Intervention10 Feb 2025
3 more
- 2025Learning Task Representations from In-Context Learning8 Feb 2025
- 2024ELICIT: LLM Augmentation via External In-Context Capability12 Oct 2024
- 2024Label Words as Local Task Vectors in In-Context Learning23 Jun 2024
- 2026Context Learning for Multi-Agent Discussioncited by 3
- 2026Context Learning for Multi-Agent Discussion2 Feb 2026
- 2025Learning Task Representations from In-Context Learningcited by 11
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitationscited by 9
- 2024ELICIT: LLM Augmentation via External In-Context Capabilitycited by 7
- 2024Label Words as Local Task Vectors in In-Context Learningcited by 3
- 2025Optimization-Inspired Few-Shot Adaptation for Large Language Modelscited by 3
- 2025Take Off the Training Wheels Progressive In-Context Learning for Effective Alignmentcited by 2
- 2025Task-driven Layerwise Additive Activation Interventioncited by 1
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectivenesscited by 1
- 2025Hyperbolic Optimizationcited by 0
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learningcited by 0
- 2026Capturing In-Context Learning Dynamics with Task Operatorscited by 0
- 2026Capturing In-Context Learning Dynamics with Task Operators1 Oct 2026
- 2026Distributional Alignment as a Criterion for Designing Task Vectors in In-Context Learning20 May 2026
- 2025Hyperbolic Optimization20 Sep 2025
- 2025Multi-Layer Attention is the Amplifier of Demonstration Effectiveness1 Aug 2025
- 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitations10 Jun 2025
- 2025Optimization-Inspired Few-Shot Adaptation for Large Language Models25 May 2025
- 2025Take Off the Training Wheels Progressive In-Context Learning for Effective Alignment13 Mar 2025
- 2025Task-driven Layerwise Additive Activation Intervention10 Feb 2025
- 2025Learning Task Representations from In-Context Learning8 Feb 2025
- 2024ELICIT: LLM Augmentation via External In-Context Capability12 Oct 2024
- 2024Label Words as Local Task Vectors in In-Context Learning23 Jun 2024