mlsanityData to 7 Oct 2026

Capturing In-Context Learning Dynamics with Task Operators

arXiv 2610.01054 ↗First posted 1 Oct 2026cs.CL cs.AI cs.LGcited by 0

Not on the map. Why?

Abstract (arXiv)

In-context learning (ICL) enables language models to perform new tasks from demonstrations without weight updates. However, every ICL inference requires processing the full set of examples, resulting in inefficient deployments, and how ICL works mechanistically is not fully understood. Prior work compresses ICL into fixed activation vectors extracted from specific layers or positions, but these input-independent interventions fail on complex tasks where the output depends on fine-grained interactions with the input. By analyzing the ICL forward pass, we show that each attention head's output is an affine transformation of its context-masked counterpart, and that the parameters of this transformation are empirically stable across samples for a given task. Building on this, we introduce Task Operator (TO), which replays this transformation as an analytically derived update to the attention output projection. Across lexical, algorithmic, and reasoning tasks, TO achieves the best overall performance among prior methods and substantially narrows the gap between zero-shot inference and ICL. We further show that the extracted knowledge concentrates in a task-specific sparse circuit across layers and positions, and that averaging operators from disjoint demonstration batches enables effective many-shot scaling without expanding the context window. Our code is available at https://github.com/gzxiong/task_operator.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 26 of its 36 references that are in the map. First posted on arXiv 1 Oct 2026.

Builds on

26 of 36 references.

References · 26

  1. 2020Language Models are Few-Shot Learnerscited by 32,199
  2. 2021Training Verifiers to Solve Math Word Problemscited by 9,743
  3. 2021Measuring Mathematical Problem Solving With the MATH Datasetcited by 5,203
  4. 2023Let's Verify Step by Stepcited by 3,598
  5. 2023GPQA: A Graduate-Level Google-Proof Q&A Benchmarkcited by 2,748
  6. 2022Locating and Editing Factual Associations in GPTcited by 2,609
  7. 2022Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 smallcited by 1,130
  8. 2022Editing Models with Task Arithmeticcited by 1,076
  9. 2021An Explanation of In-context Learning as Implicit Bayesian Inferencecited by 915
  10. 2022Efficiently Scaling Transformer Inferencecited by 529
  11. 2023Dissecting Recall of Factual Associations in Auto-Regressive Language Modelscited by 512
  12. 2023In-Context Learning Creates Task Vectorscited by 302
14 more
  1. 2023Function Vectors in Large Language Modelscited by 292
  2. 2023In-context Vectors: Making In Context Learning More Effective and Controllable Through Latent Space Steeringcited by 240
  3. 2023Localizing Model Behavior with Path Patchingcited by 182
  4. 2024Multimodal Task Vectors Enable Many-Shot Multimodal In-Context Learningcited by 49
  5. 2024Representation Surgery: Theory and Practice of Affine Steeringcited by 47
  6. 2024Activation Scaling for Steering and Interpreting Language Modelscited by 33
  7. 2024Steering Large Language Models using Conceptors: Improving Addition-Based Activation Engineeringcited by 33
  8. 2024Refusal in LLMs is an Affine Functioncited by 26
  9. 2024In-Context Learning State Vector with Inner and Momentum Optimizationcited by 15
  10. 2025Learning Task Representations from In-Context Learningcited by 11
  11. 2024Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspectivecited by 9
  12. 2025Understanding Task Vectors in In-Context Learning: Emergence, Functionality, and Limitationscited by 8
  13. 2025Beyond Demonstrations: Dynamic Vector Construction from Latent Representationscited by 4
  14. 2025Adaptive Task Vectors for Large Language Modelscited by 4

Built on by

Not cited yet.