Paper Info
arXiv: 2607.20469
Title: DecodeShare: Tracing the Shared Subspace of LLM Decode-Time Decisions
Authors: Zishan Shao, Lixun Zhang, Kangning Cui, Yixiao Wang, Ting Jiang, Hancheng Ye, Qinsi Wang, Zhixu Du, Yuzhe Fu, Fan Yang, Danyang Zhuo, Yiran Chen, Hai Helen Li
Venue: ICML 2026
Code: Zishan-Shao/decodeshare
Prior Knowledge
Autoregressive LLM inference with a KV cache has two stages. The prefill pass processes the entire prompt and stores attention keys and values; each subsequent decode step processes the current token while reusing that cache. A hidden state at the final prompt position and a hidden state during decoding therefore come from different inference stages, even at the same layer. A representation estimated from one stage need not describe the states encountered at the other.
Activation steering modifies a model's hidden states during inference. A steering vector selects one direction; a subspace contains multiple directions, and principal component analysis (PCA) provides an orthogonal basis from variation across collected states. Subtracting a hidden state's projection onto a subspace removes its component along those directions. Because different subspaces can contain different amounts of activation energy, an ablation effect alone does not establish that the chosen directions are uniquely important or shared across tasks.
Main Question
Do different tasks use a common, compact set of hidden-state directions during KV-cached decoding, and are those directions causally involved in the model's decisions? If so, can directions estimated from prefill states substitute for directions estimated at decode time?
Key Claims
- A small set of pooled PCA directions carries measurable variance across several tasks' decode-time states, above the paper's permutation and orthogonal-scramble nulls.
- Removing this set only during decoding generally harms decisions more than matched non-shared interventions; restoring the removed component can rescue many changed decisions.
- A subspace estimated at the final prefill position often fails to reproduce the effect of a decode-estimated subspace when both are applied at the decode stage.
- Decode-time measurements can be more informative than prefill measurements when selecting activation-steering vectors, although suppressing a steering vector's shared component has task-dependent effects.
Method
Finding directions shared across tasks
At a chosen layer, the authors collect current-token hidden states over KV-cached decode steps, balance the number of states across tasks, and center each task's states. They then run PCA on the pooled matrix and retain directions explaining most of its variance.
Sharedness requires a further check: within the retained space, what fraction of each task's variance lies along a given direction? A direction is selected only if this fraction exceeds a threshold for enough tasks. The main test requires it to pass for all eight tasks. Permutation and orthogonal-scramble nulls test whether the resulting shared set is larger than expected under those controls.
Testing its role in decisions
With the selected orthonormal directions forming a basis , the intervention removes a scaled projection from hidden state at layer and decode step :
Here controls removal strength, and the prefill pass is left untouched. Controls match dimension and removed projection energy to check whether the effect exceeds generic disruption. A leave-one-task-out (LOTO) analysis estimates the basis without the evaluated task. Alongside native generation, forced-choice scoring from teacher-forced conditional log probabilities helps distinguish changes in decisions from failures of answer formatting or termination.
For patchback, the authors record the shared projection from an unmodified run, remove it in another run, and restore it during selected decode steps. They measure rescue on examples answered correctly at baseline but incorrectly after ablation. A separate matched-rank comparison estimates bases from either decode states or last-position prefill states and applies them at the same decode intervention point.
Steering analysis
The authors measure how much a steering vector overlaps the decode-shared basis and test a projected version,
They also compare how well prefill- and decode-stage proxy scores rank steering vectors by held-out utility during decoding.
Result
A compact shared set, conditional on the task pool
The strict eight-task test identifies a shared set occupying roughly 2–3% of hidden dimensions at layer 10 across four tested models, exceeding both nulls (Table 11).
Expanding to 13 tasks leaves Llama-2-7B-Chat with no directions passing the all-task rule, although a majority rule still finds sharing above the nulls (Table 16). Changing the sampling policy also rotates the estimated basis substantially (Table 37). Sharedness is therefore a property of the task pool, threshold, and decoding conditions used to estimate it.
Removal and patchback
Removing the shared component can substantially impair performance on tasks excluded from its estimation. For Llama-2-7B-Chat at layer 10, the eight-task LOTO generation average falls from 27.4% to 15.1%, while the matched random control remains at 27.1% (Table 31). The generation and forced-choice panels each show significant drops on seven of their eight listed tasks; AQuA is the exception.
Shared removal also destabilizes generation, affecting answer extraction, stopping, and output length (Table 32). The forced-choice results matter because they show that formatting and termination problems alone cannot account for the observed decision changes.
Patchback strengthens this connection: in the representative Llama-2-7B-Chat layer-10 setting, restoring the recorded component at the first decode step rescues about 86% of baseline-correct answers made incorrect by ablation, far more than the controls (Table 1). The separation varies by model, with substantially higher random-control rescue for Qwen2.5-7B-Instruct.
Prefill mismatch and steering
Estimating a basis at the stage where it will be used makes a large difference. In a seven-task Llama-2-7B-Chat comparison at layer 10, full removal of a decode-estimated basis lowers mean forced-choice accuracy by 19.5 percentage points. Applying a matched-rank prefill-estimated basis at the same decode intervention point leaves the mean near baseline, as does the random control (Table 7). StratQA improves under decode-estimated removal, so the average drop does not describe every task.
This stage mismatch also matters when choosing steering vectors: decode-stage proxy scores track held-out decode utility better than prefill scores in all four tested vector pools (Table 4). Projecting vectors away from the shared subspace has mixed effects, however. It can improve or worsen steering across tasks and templates, and aggressive projection can remove the desired signal. These results favor evaluating candidate vectors under the conditions where they will operate, with projection treated as a task-specific choice.
Thoughts
This work particularly interests me because of its implications for actionability. The mixed effects of projection make me wonder whether the shared-subspace geometry could offer a useful hint on a new prompt: when might removing the overlap help, and when might it weaken the behavior we want? I find the possibility of using this information to narrow down which projection settings to try appealing. Even a partial understanding could be useful if it makes experimentation less arbitrary. I would be curious to see how far that guidance carries across prompts, and how much trial and error it could save.