Instruction Following by Principled Attention Boosting of Large Language Models

Vitoria Guardieiro, Avishree Khare, Adam Stein, Eric Wong

TL;DR

Existing attention steering techniques can force large language models (LLMs) to follow instructions, but often at the cost of catastrophic context loss or severe degradation in generation quality. Grounded in a formal theory of rule-based competition, this paper introduces InstaBoost (Instruction Attention Boosting)—a training-free intervention that applies a uniform additive bias to instruction-key attention logits across all layers and heads, achieving strong instruction adherence while preserving task relevance and fluency.

What Problem Does This Paper Address?

Large language models often struggle to adhere strictly to instructions (e.g., system prompts, safety refusals, formatting constraints) when competing context in the user prompt pulls the model in another direction.

Inference-time attention steering methods attempt to fix this by tilting attention toward instruction tokens:

  • PASTA selects a subset of attention heads via costly profiling and downweights non-instruction tokens.
  • Spotlight enforces a minimum attention mass across all heads using state-dependent, dynamic boosting.

However, existing approaches lack a unified theoretical foundation explaining how boosting instruction attention affects downstream task details. In practice, aggressive or rigid attention steering often leads to instruction over-focus, where the model ignores critical details in the user prompt and generates repetitive, irrelevant outputs.

Methods

The authors frame instruction-following through the lens of the Logicbreaks framework, modeling transformer decoding as sparse, rule-based inference:

  1. Rule Competition: The prompt is split into instruction rules $\Gamma$ (directives that must hold) and competing rules $\Delta_t$ (user query, context, and prior generation steps).
  2. Attention as an Arbiter: Softmax attention acts as an arbiter determining the influence of each rule on the latent proof state update.
  3. InstaBoost Intervention: Guided by proofs showing that additive logit bias amplifies instruction influence by an exponential factor $e^B$, InstaBoost modifies pre-softmax attention scores $S_{ij}$ for instruction key positions $0 \le j < K$: $$T_B(S_{ij}) = \begin{cases} S_{ij} + B & \text{if } 0 \le j < K \\ S_{ij} & \text{if } K \le j < N \end{cases}$$ Equivalently, it scales the softmax numerators of instruction tokens by a constant multiplier $M = e^B$ uniformly across all layers and heads. Unlike PASTA, it requires no expensive head selection; unlike Spotlight, it avoids state-dependent dynamic bias that forcefully chokes user context.

Datasets

The authors evaluate steering across 15 tasks on Meta-Llama-3-8B-Instruct and gemma-7b-it:

  • Emotion Steering: 6 emotions (anger, disgust, fear, joy, sadness, surprise) evaluated using prompts tested with the GoEmotions dataset and classified via a RoBERTa judge.
  • AI Persona: Power-seeking and wealth-seeking evaluations (both MCQ and open-ended QA) sampled from Anthropic’s Model-Written Evaluations.
  • Safety & Jailbreaking: Evaluated on AdvBench (harmful vs. harmless Alpaca prompts) and JailbreakBench, judged via Llama Guard 3-8B.
  • Toxicity Reduction: Prompts from RealToxicityPrompts, measured using Google’s Perspective API.
  • Factuality & Truthfulness: TruthfulQA (MCQ truthfulness) and TriviaQA (open-domain factual QA).

No new datasets were introduced; established benchmarks were adapted to standard steering protocols.

Key Insights and Ideas

  • Exponential Subversion Budget: The authors prove that an additive boost $B$ inflates the magnitude budget required for competing prompt context to override instruction rules by a factor scaling up to $e^B$. Overriding instruction rules becomes exponentially harder for context-based adversaries or distractions.
  • Mechanistic Cause of Context Loss: The theory reveals a formal suppression regime (Theorem 2 & 7): when the effective weight on competing rules ($\rho_{\Delta, t}$) drops too low, benign task details fail to clear the activation threshold. This mathematically explains why Spotlight’s state-dependent target frequently collapses task relevance.
  • Uniform Application is Sufficient: PASTA assumed only specific attention heads handle instructions. The authors show that heads with negligible baseline instruction attention remain essentially unaffected by a uniform constant shift, rendering complex head-search profiling unnecessary.

Key Results

  • Balanced Adherence and Quality: While latent steering baselines (e.g., DiffMean, Linear probing) suffer severe fluency collapse at higher strengths, and Spotlight causes steep drops in relevance, InstaBoost reliably maintains high fluency ($\approx 1.5 - 2.0 / 2.0$) and high relevance.
  • Emotion & Persona Steering: On Llama-3-8B-Instruct, InstaBoost achieves near-saturated steering success across emotions (e.g., 0.98 on disgust, 0.92 on fear, 1.00 on surprise) and persona tasks (0.80 on Power MCQ, 1.00 on Power QA, 0.94 on Wealth MCQ, 0.96 on Wealth QA), matching or outperforming both PASTA and latent methods.
  • Robustness in System Following: On safety/jailbreaking evaluations, InstaBoost proved far more effective at enforcing system directives than standard prompt repetition or prior attention steering, achieving 0.64 on AdvBench and 0.52 on JailbreakBench where baseline instruction following achieved 0.00.

Limitations and Future Work

  • Trade-off Tuning: The boost multiplier $M$ (or bias $B$) remains a hyperparameter that must be balanced. If chosen too large, it still risks under-activating benign context (over-focus failure).
  • Rollout Length Vulnerability: The theoretical bounds show that as rollout length $t$ grows, proof-state history can inflate the competing pool size ($k_t \ge t + 1$), gradually diluting the relative advantage factor $\text{Infl}_t(B) \to 1$.
  • Architectural Scope: The empirical validation focuses primarily on standard 7B–8B autoregressive transformer models (Llama-3-8B and Gemma-7B); scaling behavior to mixture-of-experts (MoE) architectures or much larger models was not explicitly evaluated.

Summary updated

BibTeX
@inproceedings{guardieiro2026instruction,
  author = {Vitoria Guardieiro and Avishree Khare and Adam Stein and Eric Wong},
  title = {{Instruction Following by Principled Attention Boosting of Large Language Models}},
  booktitle = {Sci4DL @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=EEPjCeAMYM},
}
Figure