Scaling In Context Task Representations to Complex Reasoning

29 concepts27 papers1 proposal

When you provide a Large Language Model (LLM) with a few examples of a task in a prompt, it undergoes a remarkable internal shift. Without updating its weights, the model figures out the underlying rule and applies it to a new query. This ability, known as In-Context Learning (ICL), has traditionally been treated as a black box.

However, a growing body of interpretability research has begun to map out the internal mechanics of ICL. The core discovery is elegant: models compress the demonstrations in a prompt into compact, low-dimensional internal representations—often called task vectors—and use highly localized circuits to execute them. Yet, as the field pushes toward more advanced applications, it faces a fundamental tension: while these clean, linear mechanisms perfectly explain simple, single-token mapping tasks, it remains an open question whether they can scale to support complex, multi-step reasoning.

The Anatomy of a Task Vector

How does an LLM transition from reading examples to executing a task? The prevailing mechanistic explanation is that the model acts as an encoder-decoder system during ICL.

Mor Geva et al. demonstrated this phenomenon in In-Context Learning Creates Task Vectors. They discovered that intermediate layers compress the context of few-shot demonstrations into a single, localized "task vector." To prove this vector causally drives behavior, the authors extracted it from the intermediate layers of a multi-shot forward pass and "patched" (surgically injected) it into a query-only forward pass. Even without seeing any examples, the model executed the intended task with high accuracy.

[Prompt: Paris -> France, Tokyo -> Japan, Berlin -> ...] 
                           │
                           ▼ (Intermediate Layers)
                 [ Compressed Task Vector ]
                           │
                           ▼ (Surgical Injection)
[Prompt: Rome -> ...] ───► (Model Execution) ───► "Italy"

This compression mechanism is surprisingly robust and abstract. Seungwook Han et al. formalized this in Emergence and Effectiveness of Task Vectors in In-Context Learning: An Encoder Decoder Perspective, showing that models concurrently learn to encode tasks into distinct, separable vectors and decode them via task-specific algorithms.

Furthermore, these representations transcend the specific format or modality of the prompt. Guy Davidson et al. investigated this invariance in Do different prompting methods yield a common task representation in language models?, exploring whether direct instructions and few-shot examples converge on the same internal "mental" representation. In the multimodal domain, Grace Luo et al. showed in Task Vectors are Cross-Modal and Vision-Language Models Create Cross-Modal Task Representations that Vision-Language Models compress text instructions, text examples, and image examples into a shared, cross-modal latent space. Patching a task vector derived from image examples can trigger the correct text-based behavior, revealing a universal latent language for task execution.

The Geometry and Circuits of Simple Tasks

When we look closer at the geometry of these representations, the internal mechanics appear remarkably linear and localized. For atomic, relational tasks—such as translating a word or finding a country's capital—Carsten Eickhoff et al. found in Language Models Implement Simple Word2Vec-style Vector Arithmetic that feed-forward networks (FFNs) operate via simple additive vector updates, reminiscent of early Word2Vec arithmetic.

Even arithmetic tasks exhibit structured geometric properties. In Understanding In-context Learning of Addition via Activation Subspaces, Xinyan Hu et al. localized the ICL mechanism for integer addition to a few specific attention heads. They discovered that models represent numbers using low-dimensional "activation subspaces" structured with trigonometric functions for units and magnitude components for tens.

To understand how these representations are causally processed across layers, researchers have begun mapping them to discrete functional circuits:

The Complexity Wall

While these linear, low-dimensional, and localized mechanisms explain how an LLM handles atomic transformations, they hit a conceptual wall when tasks scale in complexity. A single task vector works perfectly when the output is a single token or a simple classification label. But what happens when a task requires multi-step logic, long-form generation, or sequential planning?

The core limitation is that a static task vector or a simple additive update assumes a fixed, one-step mapping function. In contrast, complex reasoning—such as chain-of-thought problem solving or code generation—requires a dynamic sequence of dependent operations where the internal "state" must be updated at every step.

This limitation is explicitly acknowledged across the frontier of interpretability research:

Why Engineering Interventions Hit a Limit

The tension between simple representations and complex tasks becomes highly visible when trying to engineer or steer model behavior without full fine-tuning.

For instance, instead of extracting task vectors from prompts, Haolin Yang et al. (Task Vectors, Learned Not Extracted: Performance Gains and Mechanistic Insights) proposed directly training Learned Task Vectors (LTVs) via gradient descent. Similarly, Jungwon Park et al. developed a method in Soft Injection of Task Embeddings Outperforms Prompt-Based In-Context Learning to inject task embeddings directly into model activations, bypassing the prompt space entirely. While both approaches drastically outperform standard prompting on atomic, single-step mappings, their effectiveness remains unproven for open-ended generation or multi-stage problem solving.

The same pattern holds for inference-time optimizations. The authors of Batch-ICL: Effective, Efficient, and Order-Agnostic In-Context Learning designed an algorithm that processes few-shot examples in parallel and aggregates their "meta-gradients" to eliminate order sensitivity. While highly effective for classification and translation, independent parallel processing cannot inherently support tasks where inter-example relationships or sequential chain-of-thought dependencies are required.

Tracking the Frontier of Internal Adaptations

To understand how models might overcome this complexity wall, researchers are studying how internal mechanisms adapt under more demanding conditions—such as architectural hybrids, multimodal inputs, and cognitive conflicts.

In architectural scaling, frameworks like PiFi (Plug-in and Fine-tuning), proposed by Kyeonghyun Kim et al. in Plug-in and Fine-tuning: Bridging the Gap between Small Language Models and Large Language Models, attempt to inject a single frozen layer from a massive LLM into a Small Language Model (SLM). While this improves standard generation and domain generalization, it remains an open question whether a single injected layer possesses the representational capacity required for long-context windows or sophisticated logical deduction.

Meanwhile, training-free frameworks are pushing the boundaries of what can be fed into a context window. Tianle Zhang et al. introduced In-Context Representation Learning (ICRL) in Can LLMs Reason Over Non-Text Modalities in a Training-Free Manner? A Case Study with In-Context Representation Learning, plugging specialized embeddings (like molecular or image data) directly into an LLM's context. While highly successful for cross-modal classification and regression, its efficacy in multi-stage scientific discovery is still unknown.

Finally, complex tasks often introduce internal conflict. When a model is presented with a counterfactual prompt (e.g., "the iPhone was developed by Google"), it triggers an internal competition. Francesco Ortu et al. traced this in Competition of Mechanisms: Tracing How Language Models Handle Facts and Counterfactuals, identifying specific "gatekeeper" attention heads that mediate between pre-trained factual recall and in-context instructions.

[Counterfactual Prompt] ──► [Gatekeeper Attention Heads] ──► Balance Fact vs. Context
                                     │
                                     ▼
                        Does this mechanism persist 
                        during multi-step reasoning?

Understanding how these gatekeepers, circuits, and task vectors behave over long-range dependencies is the next major frontier. To truly understand task complexity scaling, interpretability research must transition from analyzing how a model represents a static rule to uncovering how it dynamically coordinates sequences of representations across a long-form logical journey.

Key Foundational Work

In-Context Learning Creates Task Vectors (2023) — contributed 2 concept elements to this direction.
TAFE-Net: Task-Aware Feature Embeddings for Low Shot Learning (2019) — contributed 1 concept elements to this direction.
Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Task (2023) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_task_complexity_scaling_76c4eca1,
  title = {task complexity scaling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/task-complexity-scaling/rdr_76c4eca1b1f64e848036f4281ac5054f},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-20},
}

This exact version (version 1, frozen text):

@misc{lacuna_task_complexity_scaling_76c4eca1_v1,
  title = {task complexity scaling},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/task-complexity-scaling/rdr_76c4eca1b1f64e848036f4281ac5054f/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-20},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake