NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Task Vectors for Steering Large Language Models

This direction is split into other directions: activation-based task representation. Its last version stays readable and citable here.

Version 1 of 142 papers53 conceptsfrozen 2026-10-04

When we provide a few examples to a Large Language Model (LLM)—a process known as In-Context Learning (ICL)—the model doesn't just "read" the text. It performs a form of internal compilation. Recent research reveals that the model compresses these demonstrations into a single, compact representation in its latent space: a task vector.

By understanding and manipulating these vectors, we can trigger complex behaviors zero-shot, bypass the computational costs of long prompts, and even transfer skills across different languages and modalities.

The Internal Program of In-Context Learning

Traditionally, ICL is viewed as the model attending to previous examples to predict the next token. However, Mor Geva and colleagues in In-Context Learning Creates Task Vectors demonstrated a more modular reality. They found that as a model processes a few-shot prompt, it distills the intended task into a unified internal representation.

This vector acts like a "soft instruction." Once formed, the model no longer needs to look back at the original examples; the vector itself carries the necessary logic to transform a new input into the desired output. This suggests that ICL is less about "retrieval" from the prompt and more about "configuring" the model's internal state to execute a specific function.

Extracting the Essence of a Function

If tasks are stored as vectors, can we isolate them? Eric Todd and Millicent Li explored this in Function Vectors in Large Language Models. They discovered that specific "function vectors" (FVs) reside within the outputs of specialized attention heads in the model's intermediate layers.

To extract a task's essence, researchers typically:

  1. Run several examples of a task (e.g., translating English to French).
  2. Identify the attention heads most active during these transformations.
  3. Average the activations of these heads at the final token position.

The resulting vector is a "neural fingerprint" of the task. Remarkably, these vectors are portable. You can extract a "translation vector" from one prompt and "paste" it into the activations of a completely different, zero-shot query to trigger the same behavior.

Bypassing the Training Wheels

One of the biggest bottlenecks in LLMs is the "context tax." Every example added to a prompt increases the computational cost quadratically due to the nature of self-attention. Zhuowei Li and others proposed a solution called Implicit In-context Learning (I2CL). Instead of feeding the model 10 examples every time, we can condense those examples into a single "context vector" and inject it directly into the model's residual stream.

This "training wheels" analogy is taken further by Zhenyu Liu in Take Off the Training Wheels! Progressive In-Context Learning for Effective Alignment. Their method, PICA, uses demonstrations only to "kick off" the generation. Once the task vector is extracted from the initial tokens, the demonstrations are discarded mid-generation, resulting in massive speedups without losing accuracy.

The Geometry of Task Recognition

Why does this work? Haolin Yang and Naoya Inoue provide a geometric perspective in Localizing Task Recognition and Task Learning in In-Context Learning via Attention Head Analysis. They argue that ICL is a two-stage process:

  1. Task Recognition (TR): Early layers identify the "label subspace" (e.g., "I am doing sentiment analysis").
  2. Task Learning (TL): Later layers rotate the hidden states toward the specific correct prediction.

Task vectors work because they provide the "directional nudge" needed to align the model's internal representations with the correct output space, effectively fixing the alignment issues that usually cause zero-shot failures.

Scaling to Many Shots and Multiple Modalities

The power of task vectors becomes even more apparent when dealing with data-heavy inputs like images. In Multimodal Task Vectors Enable Many-Shot Multimodal In-Context Learning, Brandon Huang and colleagues show that images are "token-expensive," making 100-shot multimodal learning impossible for most models. By compressing those 100 images into a single multimodal task vector, they enable "many-shot" learning that fits within standard context limits.

This suggests that the "task vector" is a universal currency within the model. Whether the task is defined by text instructions, few-shot examples, or even images, the model eventually translates these diverse inputs into a shared latent direction to execute the work.

Papers in this version

History & citationVersion 1 · 2026-10-04

Split into other directions · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_task_vectors_for_steering_large_language_f879cc5d,
  title = {Task Vectors for Steering Large Language Models},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/task-vectors-for-steering-large-language-models/rdr_f879cc5d622d4546b1b32a39db9ce9b5},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-30},
}

This exact version (version 1, frozen text):

@misc{lacuna_task_vectors_for_steering_large_language_f879cc5d_v1,
  title = {Task Vectors for Steering Large Language Models},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/task-vectors-for-steering-large-language-models/rdr_f879cc5d622d4546b1b32a39db9ce9b5/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-30},
}