TL;DR
Prompting changes the behavior of large language and vision-language models without updating their weights, but how this happens geometrically inside the network has been a black box. This paper introduces a nested geometric framework to show that while simple vector translations explain most of the activation variance, affine transformations (cross-dimensional linear feature mixing) are required to actually restructure internal geometry and causally steer downstream behavior.
What Problem Does This Paper Address?
When you change a prompt from "Is there a person in this image?" to "How many people are in this image?", the model completely shifts its behavior from binary classification to counting. Because this happens entirely during inference without weight updates, the prompt must be steering the model by reshaping its internal activation space (representational geometry).
Prior work has shown that prompts alter internal representations, but usually relies on simple scalar metrics or basic activation steering (like adding a single "steering vector"). We still lack a rigorous understanding of the exact mathematical class of transformations that natural prompts induce. Does a prompt simply shift the data cloud, rotate it, scale it, or perform complex feature mixing? This paper fills that gap by systematically decomposing prompt-induced changes into a hierarchy of interpretable geometric operations.
Methods
The authors propose a nested geometric decomposition framework. For any pair of prompts (Prompt A and Prompt B) acting on the same set of stimuli, they fit a sequence of increasingly expressive, stimulus-invariant mathematical maps to align the model's hidden states from Prompt A to Prompt B:
- Translation ($F_T$): A simple mean-shift (adding a constant vector).
- Rigid + Uniform Scaling ($F_{Ou}$): Global rotation/reflection plus uniform scaling (Procrustes alignment).
- Rigid + Axis-wise Scaling ($F_{Oa}$): Procrustes alignment followed by independent scaling of each aligned axis (gain modulation).
- Affine ($F_L$): Full linear feature mixing plus translation (shearing and stretching).
- Nonlinear ($F_N$): A multi-layer perceptron (MLP) to capture non-linear warping.
To prove these maps aren't just fitting noise, the authors perform causal interventions: they feed a new stimulus using Prompt A, stop the model at a specific layer $\ell$, apply the fitted transformation to the hidden state, and let the model finish its forward pass. They then evaluate whether the model's internal geometry and final text outputs successfully match what Prompt B would have produced.
Datasets
The framework was evaluated across three LLMs (OPT-2.7B, Llama3-8B, Qwen3-8B) and three VLMs (BLIP-2, LLaVA-OneVision, Qwen3-VL) using six datasets structured factorially with two main attributes:
- Text Datasets (for LLMs): EmotionalStory (topic vs. emotion), WritingStyle (topic vs. style), and Number (numerical properties vs. cognitive operations).
- Image Datasets (for VLMs): EmoSet (image content vs. evoked emotion), StyleTransfer (scene content vs. artistic style), and COCO (person detection vs. person counting).
Key Insights and Ideas
- Prompts Actively Reorganize Task Geometry: Representational Similarity Analysis (RSA) reveals that prompts warp the representation space to cluster stimuli based on the instructed task. Under a counting prompt, the internal representations arrange themselves in an ordinal, count-graded block structure that is completely absent under a detection prompt.
- The "Affine" Threshold for Behavior: While pure translation ($F_T$) accounts for the largest absolute share of variance in activation changes, it is insufficient for behavioral steering. The affine tier ($F_L$) is the critical threshold: it is the first class of transformation that nearly fully recovers the target prompt's task geometry and unlocks massive gains in behavioral accuracy. This implies that cross-dimensional linear feature mixing is the primary mechanism for task routing.
- Model-Specific Routing Strategies: Different model families use different internal routing mechanisms. Modern instruction-tuned models (like Llama3 and Qwen3) rely heavily on translation in early layers, suggesting they use a low-dimensional "instruction code." Conversely, older base models like OPT-2.7B rely more on distributed, higher-dimensional rotational and affine adjustments spread across intermediate layers.
Key Results
- Monotonic Growth with Depth: The magnitude of prompt-induced representational change is tiny in early layers but grows monotonically with depth, peaking in the final layers of the models.
- Variance Explained: Across almost all models and datasets, the hierarchy of incremental variance explained follows the strict order of $F_T > F_L > F_{Ou} > F_{Oa} \approx F_N$.
- Causal Recovery: In causal text generation tests, moving from a translation map to an affine map consistently shifts the model's output format to match the target task (e.g., successfully forcing a model primed on an irrelevant factual prompt to output image-dependent counts). Adding non-linear capabilities ($F_N$) yields negligible improvements over the affine map, proving that the population-level effect of prompting is fundamentally affine.
Limitations and Future Work
The authors note several boundaries to the current study:
- Scope of Prompting: The analysis is strictly limited to zero-shot instruction prompts. It does not yet cover few-shot demonstrations, soft prompts, or long-context chain-of-thought conditioning.
- Intervention Granularity: The causal interventions replace the residual stream at a single layer and only at the final input-prompt token.
Future work will explore multi-layer and multi-token interventions, as well as testing how robustly these geometric maps generalize under severe input-distribution shifts.
Summary updated