mlsanityData to 14 Oct 2026

Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insight

arXiv 2509.24169 ↗First posted 29 Sep 2025cs.CLcited by 3

Not on the map. Why?

Abstract (arXiv)

Large Language Models (LLMs) can perform new tasks from in-context demonstrations, a phenomenon known as in-context learning (ICL). Recent work suggests that these demonstrations are compressed into task vectors (TVs), compact task representations that LLMs exploit for predictions. However, prior studies typically extract TVs from model outputs or hidden states using cumbersome and opaque methods, and they rarely elucidate the mechanisms by which TVs influence computation. In this work, we address both limitations. First, we propose directly training Learned Task Vectors (LTVs), which surpass extracted TVs in accuracy and exhibit superior flexibility-acting effectively at arbitrary layers, positions, and even with ICL prompts. Second, through systematic analysis, we investigate the mechanistic role of TVs, showing that at the low level they steer predictions primarily through attention-head OV circuits, with a small subset of "key heads" most decisive. At a higher level, we find that despite Transformer nonlinearities, TV propagation is largely linear: early TVs are rotated toward task-relevant subspaces to improve logits of relevant labels, while later TVs are predominantly scaled in magnitude. Taken together, LTVs not only provide a practical approach for obtaining effective TVs but also offer a principled lens into the mechanistic foundations of ICL.

Key facts. Cited by 3 papers in the map (data through 14 Oct 2026). Builds on 49 of its 61 references that are in the map. First posted on arXiv 29 Sep 2025.

Builds on

49 of 61 references.

References · 49

  1. 2015Deep Residual Learning for Image Recognitioncited by 52,096
  2. 2020Language Models are Few-Shot Learnerscited by 32,419
  3. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
  4. 2013Efficient Estimation of Word Representations in Vector Spacecited by 4,375
  5. 2021Pre-train, Prompt, and Predict: A Systematic Survey of Prompting Methods in Natural Language Processingcited by 2,234
  6. 2023Efficient Streaming Language Models with Attention Sinkscited by 2,186
  7. 2016Understanding deep learning requires rethinking generalizationcited by 1,674
  8. 2023Inference-Time Intervention: Eliciting Truthful Answers from a Language Modelcited by 1,302
  9. 2023Steering Llama 2 via Contrastive Activation Additioncited by 1,085
  10. 2023Steering Language Models With Activation Engineeringcited by 922
  11. 2019Are Sixteen Heads Really Better than One?cited by 816
  12. 2024Yi: Open Foundation Models by 01.AIcited by 719
37 more
  1. 2023The Linear Representation Hypothesis and the Geometry of Large Language Modelscited by 716
  2. 2023The Geometry of Truth: Emergent Linear Structure in Large Language Model Representations of True/False Datasetscited by 712
  3. 2023In-Context Learning Creates Task Vectorscited by 312
  4. 2025Layer by Layer: Uncovering Hidden Representations in Language Modelscited by 311
  5. 2024Massive Activations in Large Language Modelscited by 294
  6. 2019A Multiscale Visualization of Attention in the Transformer Modelcited by 292
  7. 2019Analyzing the Structure of Attention in a Transformer Language Modelcited by 243
  8. 2022Extracting Latent Steering Vectors from Pretrained Language Modelscited by 225
  9. 2024A Mechanistic Understanding of Alignment Algorithms: A Case Study on DPO and Toxicitycited by 185
  10. 2024Personalized Steering of Large Language Models: Versatile Steering Vectors Through Bi-directional Preference Optimizationcited by 118
  11. 2023Language Models Implement Simple Word2Vec-style Vector Arithmeticcited by 98
  12. 2024Cutting Off the Head Ends the Conflict: A Mechanism for Interpreting and Mitigating Knowledge Conflicts in Language Modelscited by 91
  13. 2023Agent Attention: On the Integration of Softmax and Linear Attentioncited by 90
  14. 2023Copy Suppression: Comprehensively Understanding an Attention Headcited by 76
  15. 2024Attention Heads of Large Language Models: A Surveycited by 67
  16. 2022Rethinking the Role of Scale for In-Context Learning: An Interpretability-based Case Study at 66 Billion Scalecited by 64
  17. 2025Which Attention Heads Matter for In-Context Learning?cited by 61
  18. 2025Steering Large Language Model Activations in Sparse Spacescited by 58
  19. 2025Do Language Models Use Their Depth Efficiently?cited by 50
  20. 2024Identifying Semantic Induction Heads to Understand In-Context Learningcited by 47
  21. 2025One-shot Optimized Steering Vectors Mediate Safety-relevant Behaviors in LLMscited by 29
  22. 2024Out-of-distribution generalization via composition: a lens through induction heads in Transformerscited by 28
  23. 2024Beyond Single Concept Vector: Modeling Concept Subspace in LLMs with Gaussian Distributioncited by 27
  24. 2024Your Transformer is Secretly Linearcited by 23
  25. 2020Linear Attention Mechanism: An Efficient Attention for Semantic Segmentationcited by 21
  26. 2025Task Vectors in In-Context Learning: Emergence, Formation, and Benefitcited by 20
  27. 2025The Geometry of Prompting: Unveiling Distinct Mechanisms of Task Adaptation in Language Modelscited by 18
  28. 2024Revisiting In-context Learning Inference Circuit in Large Language Modelscited by 17
  29. 2025Unlocking the Power of Function Vectors for Characterizing and Mitigating Catastrophic Forgetting in Continual Instruction Tuningcited by 16
  30. 2025The Atlas of In-Context Learning: How Attention Heads Shape In-Context Retrieval Augmentationcited by 11
  31. 2025Unifying Attention Heads and Task Vectors via Hidden State Geometry in In-Context Learningcited by 10
  32. 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
  33. 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitationscited by 9
  34. 2025Provable In-Context Vector Arithmetic via Retrieving Task Conceptscited by 8
  35. 2025From Compression to Expression: A Layerwise Analysis of In-Context Learningcited by 6
  36. 2025Beyond Demonstrations: Dynamic Vector Construction from Latent Representationscited by 4
  37. 2025REAL: Reading Out Transformer Activations for Precise Localization in Language Model Steeringcited by 3

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 3.

3 papers.