Reflection-Window Decoding: Text Generation with Selective Refinement

Zeyu Tang, Zhenhao Chen, Xiangchen Song, Loka Li, Yunlong Deng +4 more
2/5/2025
cs.CLcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

The autoregressive decoding for text generation in large language models (LLMs), while widely used, is inherently suboptimal due to the lack of a built-in mechanism to perform refinement and/or correction of the generated content. In this paper, we consider optimality in terms of the joint probability over the generated response, when jointly considering all tokens at the same time. We theoretically characterize the potential deviation of the autoregressively generated response from its globally optimal counterpart that is of the same length. Our analysis suggests that we need to be cautious when noticeable uncertainty arises during text generation, which may signal the sub-optimality of the generation history. To address the pitfall of autoregressive decoding for text generation, we propose an approach that incorporates a sliding reflection window and a pausing criterion, such that refinement and generation can be carried out interchangeably as the decoding proceeds. Our selective refinement framework strikes a balance between efficiency and optimality, and our extensive experimental results demonstrate the effectiveness of our approach.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{tang2025reflectionwindow,
  title  = {Reflection-Window Decoding: Text Generation with Selective Refinement},
  author = {Zeyu Tang and Zhenhao Chen and Xiangchen Song and Loka Li and Yunlong Deng and Yifan Shen and Guangyi Chen and Peter Spirtes and Kun Zhang},
  year   = {2025},
  eprint = {2502.03678},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.03678v3},
  journal = {ICML 2025 2025}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.03678.svg)](https://codeofpaper.com/paper/2502.03678)

Discussion