Improving Chain-of-Thought for Logical Reasoning via Attention-Aware Intervention
Nguyen Minh Phuong, Dang Huu Tien, Naoya Inoue
TL;DR
This work tackles non-interactive, end-to-end logical reasoning with LLMs by embedding symbolic structure directly into prompts and guiding the model’s inference through attention-level interventions. It first analyzes how Symbolic-Aided CoT prompts induce specialized attention-head patterns, identifying anchor, aggregation, and copy heads aligned with reasoning operators. It then introduces Attention-Aware Intervention (AAI), a lightweight, model-agnostic masking-based reweighting mechanism that grounds rule references in their semantic content via tailored masks and head selection, incurring negligible computational overhead. Across multiple benchmarks (ProofWriter, PrOntoQA, Logical Deduction, FOLIO, GSM8k) and model scales (1.7B–32B), AAI yields consistent accuracy gains and demonstrates robustness to hyperparameters, with greater gains as model size increases and broad compatibility with different prompting strategies. These results advance scalable, interpretable reasoning in LLMs by enabling internal symbolic reasoning without external solvers or multi-step interactions, offering practical impact for robust reasoning in real-world tasks.
Abstract
Modern logical reasoning with LLMs primarily relies on employing complex interactive frameworks that decompose the reasoning process into subtasks solved through carefully designed prompts or requiring external resources (e.g., symbolic solvers) to exploit their strong logical structures. While interactive approaches introduce additional overhead, hybrid approaches depend on external components, which limit their scalability. A non-interactive, end-to-end framework enables reasoning to emerge within the model itself -- improving generalization while preserving analyzability without any external resources. In this work, we introduce a non-interactive, end-to-end framework for reasoning tasks. We show that introducing structural information into the few-shot prompt activates a subset of attention heads that patterns aligned with logical reasoning operators. Building on this insight, we propose Attention-Aware Intervention (AAI), an inference-time intervention method that reweights attention scores across selected heads identified by their logical patterns. AAI offers an efficient way to steer the model's reasoning toward leveraging prior knowledge through attention modulation. Extensive experiments show that AAI enhances logical reasoning performance across diverse benchmarks and model architectures, while incurring negligible additional computational overhead. Code is available at https://github.com/phuongnm94/aai_for_logical_reasoning.
