Making Grid Beam Search Less Greedy
Abstract
A common formalism for constraining the output of autoregressive text generation models involves lexical constraints, words or phrases which are required to occur in the generated text. DFA-constrained beam search and grid beam search are two widely used paradigms for decoding from autoregressive models while enforcing lexical constraints. As the former approach requires a number of forward passes exponential in the number of constraint tokens, it is often dispreferred to the latter, which requires only linearly many forward calls. However, while grid beam search achieves an exponential speedup, it does so in a manner which does not treat all of the constraints equally. In this paper, we demonstrate that grid beam search is biased to incorporate easier-to-satisfy constraints first, leaving harder constraints to the end of the sequence. This contrasts with DFA-constrained beam search, which exhibits no such bias. To address this shortcoming, we propose fair grid beam search, a modification to grid beam search which avoids this bias while still requiring only linearly many forward passes. Experimentally, we confirm grid beam search's bias on two constrained generation tasks, finding significant differences in how it orders constraint tokens as compared to DFA-constrained beam search and fair grid beam search. Furthermore, we find that fair grid beam search not only fixes grid beam search's bias, but finds higher-probability strings in the process.
Create a lesson
Metadata
- Journal
- Proceedings of the Third Conference on Language Modeling (COLM 2026)
- Comments
- Published as a conference paper at COLM 2026
Related papers
Bathys: Advancing Deep Search Agents
Shared title terminologycs.CLZixuan Chen, Shengyou Yuan, Nang Yuan et al.
Making Evaluation Explicit Is Not Enough: Supervising the Evaluation Process in Generative Reward Models
Shared title terminologycs.CLQiyuan Chen, Yuze Zhao, Jiahe Chen et al.
ToolSmith: An Automatic Tool-Generation Framework for Multimodal Search Agents
Shared title terminologycs.CLRui Sun, Junhua Huang, Luca Zancato et al.
CocoonBench: Can Multilingual Search Agents Escape Language Information Cocoons?
Shared title terminologycs.CLHongchuan Zeng, Bowen Liu, Changjiang Gao et al.
What Makes Something Hard(er)? Explaining Question Difficulty in Natural Language
Shared title terminologycs.CLPeng Cui, Qiaoyuan Zheng, Rudolf Debelak et al.
Harness Annealing: Learning to Act with Less External Control
Shared title terminologycs.CLYingxuan Yang, Huacan Chai, Ying Wen