CRANE: Reasoning with constrained LLM generation
🤗 Upvotes: 17 | cs.PL, cs.LG
Authors:
Debangshu Banerjee, Tarun Suresh, Shubham Ugare, Sasa Misailovic, Gagandeep Singh
Title:
CRANE: Reasoning with constrained LLM generation
Arxiv:
http://arxiv.org/abs/2502.09061v1
Abstract:
Code generation, symbolic math reasoning, and other tasks require LLMs to produce outputs that are both syntactically and semantically correct. Constrained LLM generation is a promising direction to enforce adherence to formal grammar, but prior works have empirically observed that strict enforcement of formal constraints often diminishes the reasoning capabilities of LLMs. In this work, we first provide a theoretical explanation for why constraining LLM outputs to very restrictive grammars that only allow syntactically valid final answers reduces the reasoning capabilities of the model. Second, we demonstrate that by augmenting the output grammar with carefully designed additional rules, it is always possible to preserve the reasoning capabilities of the LLM while ensuring syntactic and semantic correctness in its outputs. Building on these theoretical insights, we propose a reasoning-augmented constrained decoding algorithm, CRANE, which effectively balances the correctness of constrained generation with the flexibility of unconstrained generation. Experiments on multiple open-source LLMs and benchmarks show that CRANE significantly outperforms both state-of-the-art constrained decoding strategies and standard unconstrained decoding, showing up to 10% points accuracy improvement over baselines on challenging symbolic reasoning benchmarks GSM-symbolic and FOLIO.
You May Also Like

Real Ghost Stories Online
Real Ghost Stories Online | Paranormal, Supernatural & Horror Radio

Stuff To Blow Your Mind
iHeartPodcasts
The Quanta Podcast
Quanta Magazine

That UFO Podcast
That UFO Podcast

The Best of Coast to Coast AM
iHeartPodcasts and Coast to Coast AM
Climate Connections
Yale Center for Environmental Communication

Eye On The Sky
Vermont Public

New Books in Political Science
New Books Network

New Books in Communications
Marshall Poe

Something You Should Know
Mike Carruthers | OmniCast Media
Community discussion