System 2 Attention (is something you might need too)

Jason Weston, Sainbayar SukhbaatararXiv 2023 · DOI

Abstract

Transformer-based Large Language Models (LLMs) often struggle with "sycophancy"—the tendency to be distracted by irrelevant information or user bias within a prompt. This paper introduces System 2 Attention (S2A), a mechanism that leverages the LLM's own reasoning capabilities to deliberately rewrite input context. By stripping out noise and biased opinions before final generation, S2A significantly improves factuality and objectivity, bringing model performance close to "oracle" levels.

The Problem: Distraction and Sycophancy

Standard LLMs utilize "soft attention," which assigns mathematical weights to every token in a prompt. While efficient, this "System 1" approach is fast and automatic but prone to error. It often fails to distinguish between essential facts and "spurious correlations," such as a user’s incorrect stated opinion or irrelevant sentences. For instance, if a user suggests a wrong answer, a model might agree simply to be "helpful," a phenomenon known as sycophancy.

Methodology: System 2 Attention (S2A)

To move toward more deliberate "System 2" thinking, the authors propose S2A, a two-step prompting strategy:

  1. Context Regeneration: The LLM is prompted to extract only the relevant and unbiased portions of the input context $x$, producing a cleaned version $x'$.
  2. Final Response: The LLM generates the final answer $y$ based solely on the regenerated context $x'$.

This process effectively implements "hard attention" through natural language. By physically removing irrelevant or biased tokens, the soft attention mechanism in the final step is never exposed to the distractors.

S2A effectively removes user bias from the prompt, allowing the model to provide the correct factual answer.

Experimental Setup and Datasets

S2A was evaluated using LLaMA-2-70B-chat across three challenging benchmarks:

  • Modified TriviaQA: Factual questions with appended "suggested" answers to test sycophancy.
  • Longform Argument Generation: Tasks requiring objective commentary despite user-stated preferences.
  • GSM-IC: A math benchmark (GSM8K) modified with "in-topic" distractors—irrelevant sentences containing similar keywords or numbers.

Key Results and Insights

The implementation of S2A yielded substantial performance gains:

  • Factuality: Accuracy on TriviaQA rose from 62.8% to 80.3%, nearly matching the 82.0% "Oracle" score (performance on clean data).
  • Mathematical Reasoning: On GSM-IC, S2A improved accuracy from 51.7% to 61.3% by filtering out numerical distractors.
  • Objectivity: Objectivity scores in longform generation (rated by GPT-4) improved from 2.23 to 3.82 out of 5.
In math problems with distractors, S2A (right) cleans the context to prevent the model from incorporating irrelevant numbers into its calculation, unlike the baseline (left).

A critical insight from the study is that "attention must be hard, not soft." Appending cleaned context to the original (S2A-KeepOrig) actually performed worse than replacing it entirely. This suggests that once bias enters the context window, soft attention is largely unable to ignore it; physical deletion is necessary.

Limitations and Future Directions

While effective, S2A increases computational cost due to the dual-pass requirement. Future work may explore "speedup tricks," such as generating only the delta between original and cleaned contexts. Additionally, the method's zero-shot nature makes it sensitive to the quality of the "System 2" prompt. One promising avenue is using S2A to generate high-quality synthetic data for distilling these capabilities into smaller, more efficient models.

Summary updated

Abstract

Soft attention in Transformer-based Large Language Models (LLMs) is susceptible to incorporating irrelevant information from the context into its latent representations, which adversely affects next token generations. To help rectify these issues, we introduce System 2 Attention (S2A), which leverages the ability of LLMs to reason in natural language and follow instructions in order to decide what to attend to. S2A regenerates the input context to only include the relevant portions, before attending to the regenerated context to elicit the final response. In experiments, S2A outperforms standard attention-based LLMs on three tasks containing opinion or irrelevant information, QA, math word problems and longform generation, where S2A increases factuality and objectivity, and decreases sycophancy.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
TriviaQA · Modified TriviaQA with opinion-containing promptsSystem 2 Attention (S2A; LLaMA-2-70B-chat)Accuracy (questions correct)80.3%+17.5 vs baselineparams=70B · backbone=LLaMA-2-70B-chat · prompt-condition=opinion-containing
Source quote
L223: System 2 Attention gives a large improvement over the original input prompts, with an accuracy of 80.3% -- close to oracle prompt performance.
GSM-IC · in-topic irrelevant sentencesSystem 2 Attention (S2A; LLaMA-2-70B-chat)Accuracy61.3%+9.6 vs baseline0-shot · params=70B · subset=in-topic irrelevant sentences · backbone=LLaMA-2-70B-chat
Source quote
L40: Finally, on math word problems from GSM-IC~\citep{shi2023large} with in-topic irrelevant sentences, S2A improves accuracy from 51.7% to 61.3%.
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
TriviaQA · Modified TriviaQA with opinion-containing promptsInput prompts (baseline; LLaMA-2-70B-chat) baselineAccuracy (questions correct)62.8%params=70B · backbone=LLaMA-2-70B-chat · prompt-condition=opinion-containing
Source quote
L222: Input prompts, due to the opinions contained within their contexts, lose accuracy in their answers, yielding 62.8% of questions correct. In contrast, the oracle (unopinionated) prompts achieve 82.0%.
GSM-IC · in-topic irrelevant sentencesBaseline (LLaMA-2-70B-chat) baselineAccuracy51.7%0-shot · params=70B · subset=in-topic irrelevant sentences · backbone=LLaMA-2-70B-chat
Source quote
L40: Finally, on math word problems from GSM-IC~\citep{shi2023large} with in-topic irrelevant sentences, S2A improves accuracy from 51.7% to 61.3%.
BibTeX
@misc{weston2023system,
  author = {Jason Weston and Sainbayar Sukhbaatar},
  title = {{System 2 Attention (is something you might need too)}},
  year = {2023},
  eprint = {2311.11829},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2311.11829},
}
Figure