SED: Self-Evaluation Decoding Enhances Large Language Models for Better Generation

Ziqin Luo, Haixia Han, Haokun Zhao, Guochao Jiang, Chengyu Du, Tingyun Li, Jiaqing Liang, Deqing Yang, Yanghua XiaoarXiv 2024 · DOI

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities in text generation, yet they remain prone to logical inconsistencies and hallucinations. This often stems from the nature of autoregressive decoding, where models generate text one token at a time. Standard strategies, such as greedy search or beam search, prioritize immediate token probability, which can lead the model into "chaotic points"—moments of high uncertainty where a single suboptimal choice triggers a cascade of errors. To address this, researchers have introduced Self-Evaluation Decoding (SED), a framework that enables models to evaluate the long-term consequences of their choices before committing to a specific token.

The Problem: Chaotic Points and Error Propagation

In standard decoding, the model typically selects the most likely next token based on its current hidden state. However, the authors identify a critical flaw: the most probable token is not always the most logically sound in the long run. At "chaotic points," the probability distribution is flat, meaning several tokens appear equally plausible. Choosing the wrong path at these junctures leads to error propagation, where the model attempts to justify an initial mistake, resulting in a failed reasoning chain. Standard methods are essentially "short-sighted," lacking the ability to look ahead and assess the quality of the final output resulting from a specific token choice.

The Self-Evaluation Decoding (SED) Framework

SED addresses these limitations by implementing a "slow thinking" process (analogous to human System 2 reasoning). Instead of immediate selection, the model enters a speculation-and-evaluation loop at detected chaotic points. The framework consists of four primary modules:

  1. Chaotic Point Detection: The model monitors its internal uncertainty using entropy-based or ratio-based metrics. If the top candidates have similar probabilities, the point is flagged as chaotic.
  2. Speculation: Rather than picking one token, the model takes the top-$k$ candidates and generates a complete potential response (a "speculation") for each.
  3. Self-Evaluation: The model evaluates these speculations, acting as its own judge to determine the likelihood of correctness ($p_{se}$).
  4. Feedback Backpropagation: A final propensity score is calculated by fusing the original token probability with the self-evaluation score. The token that maximizes this combined score is selected to continue the generation.
The four-stage pipeline of the Self-Evaluation Decoding (SED) framework, illustrating the transition from chaotic point detection to final token selection.

To ensure effective evaluation, the authors utilized a multi-model data synthesis strategy. By training models on a mix of correct and incorrect answers generated by various LLMs, they enhanced the model's ability to distinguish between high-quality and low-quality reasoning paths.

Experimental Evaluation

The SED framework was tested across three diverse benchmarks designed to challenge different LLM capabilities:

  • XieZhi: A multiple-choice suite for holistic domain knowledge.
  • HotpotQA: A multi-hop question-answering dataset requiring complex reading comprehension.
  • GSM8K: A benchmark of elementary school math word problems used to evaluate mathematical reasoning.

Results and Analysis

Empirical results demonstrate that SED consistently outperforms standard decoding baselines across multiple model families, including Falcon, Llama 2, and Gemma.

Comparative accuracy of SED versus baseline decoding strategies across XieZhi, HotpotQA, and GSM8K benchmarks.

Key findings include:

  • Reasoning Improvements: On the GSM8K benchmark, Llama2-7b-chat's accuracy rose from 37.2% with greedy search to 42.1% with SED.
  • Knowledge Retrieval: On the XieZhi benchmark, the same model saw a significant jump from 31.2% to 41.5%.
  • Superiority over Baselines: SED outperformed not only greedy and beam search but also specialized methods like DoLa (contrastive decoding), suggesting that "looking ahead" via speculation is more effective than internal layer-based contrasts.

Discussion and Future Work

The primary challenge of SED is the "slow thinking tax"—the increased computational cost associated with generating multiple speculations at every chaotic point. While this leads to higher accuracy, it significantly slows down inference speeds.

Future research will focus on optimizing this overhead through techniques such as computation reuse and dynamic thresholds to ensure the model only engages in "slow thinking" when necessary. Additionally, moving from binary evaluations to more nuanced Chain-of-Thought (CoT) self-corrections could further refine the model's decision-making process at critical junctures.

Summary updated

BibTeX
@misc{luo2024sed,
  author = {Ziqin Luo and Haixia Han and Haokun Zhao and Guochao Jiang and Chengyu Du and Tingyun Li and Jiaqing Liang and Deqing Yang and Yanghua Xiao},
  title = {{SED: Self-Evaluation Decoding Enhances Large Language Models for Better Generation}},
  year = {2024},
  eprint = {2405.16552},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2405.16552},
}
Figure