Tell Your Model Where to Attend: Post-hoc Attention Steering for LLMs
Qingru Zhang, Chandan Singh, Liyuan Liu, Xiaodong Liu, Bin Yu, Jianfeng Gao, Tuo Zhao
Abstract
In human-written articles, we often leverage the subtleties of text style, such as bold and italics, to guide the attention of readers. These textual emphases are vital for the readers to grasp the conveyed information. When interacting with large language models (LLMs), we have a similar need -steering the model to pay closer attention to user-specified information, e.g., an instruction. Existing methods, however, are constrained to process plain text and do not support such a mechanism. This motivates us to introduce PASTA -Post-hoc Attention STeering Approach, a method that allows LLMs to read text with user-specified emphasis marks. To this end, PASTA identifies a small subset of attention heads and applies precise attention reweighting on them, directing the model attention to user-specified parts. Like prompting, PASTA is applied at inference time and does not require changing any model parameters. Experiments demonstrate that PASTA can substantially enhance an LLM's ability to follow user instructions or integrate new knowledge from user inputs, leading to a significant performance improvement on a variety of tasks, e.g., an average accuracy improvement of 22% for LLAMA-7B. Our code is publicly available at https://github.com/QingruZhang/PASTA .
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
41 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- LoRA: Low-Rank Adaptation of Large Language Models cites Language Models are Few-Shot Learners
- LoFiT: Localized Fine-tuning on LLM Representations cites LoRA: Low-Rank Adaptation of Large Language Models
- LoFiT: Localized Fine-tuning on LLM Representations cites Language Models are Few-Shot Learners
- QLoRA: Efficient Finetuning of Quantized LLMs cites LoRA: Low-Rank Adaptation of Large Language Models
- QLoRA: Efficient Finetuning of Quantized LLMs cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- QLoRA: Efficient Finetuning of Quantized LLMs cites Training language models to follow instructions with human feedback
- Unveiling and Harnessing Hidden Attention Sinks: Enhancing Large Language Models without Training through Attention Calibration cites Language Models are Few-Shot Learners
- Unveiling and Harnessing Hidden Attention Sinks: Enhancing Large Language Models without Training through Attention Calibration cites Training language models to follow instructions with human feedback
- Data Formulator 2: Iterative Creation of Data Visualizations, with AI Transforming Data Along the Way cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Training cites LoRA: Low-Rank Adaptation of Large Language Models
- ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Training cites QLoRA: Efficient Finetuning of Quantized LLMs
- ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Training cites Unveiling and Harnessing Hidden Attention Sinks: Enhancing Large Language Models without Training through Attention Calibration
- ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Training cites Language Models are Few-Shot Learners
- ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without Training cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
- Chain-of-Thought Prompting Elicits Reasoning in Large Language Models cites Training language models to follow instructions with human feedback
- Training language models to follow instructions with human feedback cites Language Models are Few-Shot Learners
Cited by top-tier papers41
- LoFiT: Localized Fine-tuning on LLM RepresentationsFangcong Yin, Xi Ye, Greg DurrettNeurIPS 2024 · 74 citations
- Unveiling and Harnessing Hidden Attention Sinks: Enhancing Large Language Models without Training through Attention CalibrationZhongzhi Yu, Zheng Wang, Yonggan Fu, Huihong Shi et al.ICML 2024 · 63 citations
- Mixture of In-Context Experts Enhance LLMs' Long Context AwarenessHongzhan Lin, Ang Lv, Yuhan Chen, Chen Zhu et al.NeurIPS 2024 · 25 citations
- Data Formulator 2: Iterative Creation of Data Visualizations, with AI Transforming Data Along the WayChenglong Wang, Bongshin Lee, Steven Mark Drucker, Dan Marshall et al.CHI 2025 · 17 citations
- ZeroTuning: Unlocking the Initial Token's Power to Enhance Large Language Models Without TrainingFeijiang Han, Xiaodong Yu, Jianheng Tang, Delip Rao et al.ICLR 2026 · 17 citations
Builds on18
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
- Training language models to follow instructions with human feedbackLong Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida et al.NeurIPS 2022 · 24,707 citations
- Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
- LoRA: Low-Rank Adaptation of Large Language ModelsEdward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu et al.ICLR 2022 · 18,833 citations
- QLoRA: Efficient Finetuning of Quantized LLMsTim Dettmers, Artidoro Pagnoni, Ari Holtzman, Luke ZettlemoyerNeurIPS 2023 · 5,863 citations
Related papers
- Learning to Keep a Promise: Scaling Language Model Decoding Parallelism with Learned Asynchronous DecodingTian Jin, Ellie Y. Cheng, Zachary Ankner, Nikunj Saunshi et al.ICML 2025
- Answer is All You Need: Instruction-following Text Embedding via Answering the QuestionLetian Peng, Yuwei Zhang, Zilong Wang, Jayanth Srinivasa et al.ACL 2024
- Instruction Position Matters in Sequence Generation with Large Language ModelsYijin Liu, Xianfeng Zeng, Chenze Shao, Fandong Meng et al.ACL Findings 2024 · 6 citations
- MAPO: Boosting Large Language Model Performance with Model-Adaptive Prompt OptimizationYuyan Chen, Zhihao Wen, Ge Fan, Zhengyu Chen et al.EMNLP Findings 2023 · 18 citations
- Selective Prompt Anchoring for Code GenerationYuan Tian, Tianyi ZhangICML 2025
