Lune

ICLR2025Top-tier venue

Don't Take Things Out of Context: Attention Intervention for Enhancing Chain-of-Thought Reasoning in Large Language Models

Shaotian Yan, Chen Shen, Wenxiao Wang, Liang Xie, Junjie Liu, Jieping Ye

Abstract

Few-shot Chain-of-Thought (CoT) significantly enhances the reasoning capabilities of large language models (LLMs), functioning as a whole to guide these models in generating reasoning steps toward final answers. However, we observe that isolated segments, words, or tokens within CoT demonstrations can unexpectedly disrupt the generation process of LLMs. The model may overly concentrate on certain local information present in the demonstration, introducing irrelevant noise into the reasoning process and potentially leading to incorrect answers. In this paper, we investigate the underlying mechanism of CoT through dynamically tracing and manipulating the inner workings of LLMs at each output step, which demonstrates that tokens exhibiting specific attention characteristics are more likely to induce the model to take things out of context; these tokens directly attend to the hidden states tied with prediction, without substantial integration of non-local information. Building upon these insights, we propose a Few-shot Attention Intervention method (FAI) that dynamically analyzes the attention patterns of demonstrations to accurately identify these tokens and subsequently make targeted adjustments to the attention weights to effectively suppress their distracting effect on LLMs. Comprehensive experiments across multiple benchmarks demonstrate consistent improvements over baseline methods, with a remarkable 5.91% improvement on the AQuA dataset, further highlighting the effectiveness of FAI.

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.

4 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Efficient Streaming Language Models with Attention Sinks cites Language Models are Few-Shot Learners
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Language Models are Few-Shot Learners
  • Tree of Thoughts: Deliberate Problem Solving with Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • Scaling Reasoning Hop Exposes Weaknesses: Demystifying and Improving Hop Generalization in Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • VisCRA: A Visual Chain Reasoning Attack for Jailbreaking Multimodal Large Language Models cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Tree of Thoughts: Deliberate Problem Solving with Large Language Models
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Language Models are Few-Shot Learners
  • Graph of Thoughts: Solving Elaborate Problems with Large Language Models cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
  • CoT is Not the Chain of Truth: An Empirical Internal Analysis of Reasoning LLMs for Fake News Generation cites Chain-of-Thought Prompting Elicits Reasoning in Large Language Models
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers4

  1. VisCRA: A Visual Chain Reasoning Attack for Jailbreaking Multimodal Large Language ModelsBingrui Sima, Linhua Cong, Wenxuan Wang, Kun HeEMNLP 2025 · 11 citations
  2. Reasoning Fails Where Step Flow BreaksXiaoyu Xu, Yulan Pan, Xiaosong Yuan, Zhihong Shen et al.ACL 2026 · 1 citation
  3. Scaling Reasoning Hop Exposes Weaknesses: Demystifying and Improving Hop Generalization in Large Language ModelsZhaoyi Li, Jiatong Li, Gangwei Jiang, Linqi Song et al.ICLR 2026 · 1 citation
  4. CoT is Not the Chain of Truth: An Empirical Internal Analysis of Reasoning LLMs for Fake News GenerationZhao Tong, Chunlin Gong, Yiping Zhang, Haichao Shi et al.ICML 2026

Builds on21

  1. Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah et al.NeurIPS 2020 · 64,255 citations
  2. Chain-of-Thought Prompting Elicits Reasoning in Large Language ModelsJason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma et al.NeurIPS 2022 · 22,562 citations
  3. Tree of Thoughts: Deliberate Problem Solving with Large Language ModelsShunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran et al.NeurIPS 2023 · 5,068 citations
  4. Efficient Streaming Language Models with Attention SinksGuangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han et al.ICLR 2024 · 1,714 citations
  5. Graph of Thoughts: Solving Elaborate Problems with Large Language ModelsMaciej Besta, Nils Blach, Ales Kubicek, Robert Gerstenberger et al.AAAI 2024 · 1,292 citations

Related papers

  1. Enhancing Chain of Thought Prompting in Large Language Models via Reasoning PatternsYufeng Zhang, Xuepeng Wang, Lingxiang Wu, Jinqiao WangAAAI 2025 · 27 citations
  2. "Well, Keep Thinking": Enhancing LLM Reasoning with Adaptive Injection DecodingHyunbin Jin, Je Won Yeom, Seunghyun Bae, Taesup KimACL Findings 2025 · 1 citation
  3. Stepwise Perplexity-Guided Refinement for Efficient Chain-of-Thought Reasoning in Large Language ModelsYingqian Cui, Pengfei He, Jingying Zeng, Hui Liu et al.ACL Findings 2025 · 4 citations
  4. Towards Understanding Chain-of-Thought Prompting: An Empirical Study of What MattersBoshi Wang, Sewon Min, Xiang Deng, Jiaming Shen et al.ACL 2023 · 100 citations
  5. How Many Demonstrations Do You Need for In-context Learning?Jiuhai Chen, Lichang Chen, Chen Zhu, Tianyi ZhouEMNLP Findings 2023 · 12 citations
Dusk over the sea between two cliffs drawn in fine vertical lines