Re-Reading Improves Reasoning in Large Language Models

Xiaohan Xu, Chongyang Tao, Tao Shen, Can Xu, Hongbo Xu, Guodong Long, Jian-Guang Lou, Shuai Ma

Abstract

Large Language Models (LLMs) based on decoder-only architectures often struggle with complex reasoning due to their unidirectional attention mechanism, which prevents early tokens from attending to subsequent context. This paper discusses RE2 (Re-Reading), a simple yet effective prompting strategy that repeats the input question to simulate bidirectional attention. Experimental results across 14 datasets demonstrate that RE2 consistently enhances reasoning performance in arithmetic, commonsense, and symbolic tasks by providing models with a more comprehensive initial representation of the problem.

Introduction

Modern state-of-the-art LLMs, such as GPT-4 and Llama-3, primarily utilize decoder-only architectures. These models employ causal or unidirectional attention, meaning each token can only attend to preceding tokens. In complex reasoning tasks, critical constraints often appear at the end of a prompt. Consequently, the initial representation of the problem is formed without knowledge of these later constraints, leading to a fundamental bottleneck in comprehension. While techniques like Chain-of-Thought (CoT) focus on improving the model's output reasoning steps, they do not address this input-side limitation.

Methodology: The RE2 Prompting Strategy

The implementation of RE2 is remarkably straightforward: the input question is repeated twice within the prompt. A typical template follows:

Q: {Question}
Read the question again: {Question}
A: Let’s think step by step.

Figure 1: Comparison between standard Chain-of-Thought (CoT) and the RE2 augmented version (CoT+RE2), illustrating the two-pass mechanism.

By repeating the question, the model performs a "second pass." During this pass, the attention mechanism allows tokens in the second instance of the question to attend to the entire first instance. This effectively provides the model with a "global" view of the problem before it begins generating reasoning steps, simulating the bidirectional encoding found in encoder-decoder models.

The Bidirectional Attention Effect

Analysis of attention heatmaps confirms this hypothesis. In a standard single-pass prompt, tokens are restricted by the causal mask. However, in the RE2 framework, tokens in the second pass show significant attention weights toward later tokens from the first pass. This "horizontal" depth boost forces the model to allocate more computational resources to encoding the problem before starting generation.

Figure 2: Attention heatmap illustrating how tokens in the second pass attend to the full context of the first pass, simulating bidirectional encoding within a unidirectional model.

Experimental Evaluation

The authors evaluated RE2 across 14 datasets spanning arithmetic (e.g., GSM8K, SVAMP), commonsense (e.g., StrategyQA, ARC), and symbolic reasoning (e.g., Date Understanding). Tests were conducted on various models, including text-davinci-003, GPT-3.5-turbo, and the Llama-2 family.

Key Findings

  • Consistent Performance Gains: On davinci-003, RE2 improved vanilla prompting by 3.81% in arithmetic and 2.51% in commonsense tasks. When combined with CoT, it yielded average gains of 2.22% in arithmetic and 5.25% in symbolic reasoning.
  • Optimal Frequency: Experiments with multiple repetitions (1 to 5 times) revealed that reading the question twice is the optimal "sweet spot." Performance tends to plateau or decline beyond three repetitions as the model may become prone to repetitive outputs.
  • Complexity Handling: RE2 is particularly effective for problems of medium complexity (4-5 reasoning steps), where maintaining focus on all constraints is crucial for success.
  • Efficiency: Despite doubling the input length, the computational overhead is minimal. Due to optimizations like Grouped-Query Attention (GQA) and KV caching, inference time and memory usage typically increase by less than 20% in practical settings.

Conclusion

RE2 is a "plug-and-play" prompting module that addresses the unidirectional attention bottleneck in decoder-only LLMs. By simply repeating the input, models achieve better problem representation, leading to more accurate reasoning. Its simplicity and orthogonality to existing methods like CoT make it a highly practical tool for improving LLM performance in real-world applications.

Summary updated

BibTeX
@inproceedings{xu2024re,
  author = {Xiaohan Xu and Chongyang Tao and Tao Shen and Can Xu and Hongbo Xu and Guodong Long and Jian-Guang Lou and Shuai Ma},
  title = {{Re-Reading Improves Reasoning in Large Language Models}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.emnlp-main.871},
}
Figure