CRANE: 制約付きLLM生成による推論
CRANE: Reasoning with constrained LLM generation
February 13, 2025
著者: Debangshu Banerjee, Tarun Suresh, Shubham Ugare, Sasa Misailovic, Gagandeep Singh
cs.AI
要旨
コード生成、記号的数学推論、およびその他のタスクでは、LLMは構文的にも意味的にも正しい出力を生成する必要があります。制約付きLLM生成は、形式的文法への遵守を強制するための有望な方向性ですが、これまでの研究では、形式的制約の厳格な遵守がしばしばLLMの推論能力を低下させることが経験的に観察されてきました。本研究では、まず、LLMの出力を構文的に有効な最終回答のみを許可する非常に制限的な文法に制約することが、モデルの推論能力を低下させる理論的説明を提供します。第二に、出力文法に注意深く設計された追加ルールを組み込むことで、常にLLMの推論能力を維持しつつ、出力の構文的および意味的な正確さを確保できることを実証します。これらの理論的洞察を基に、推論を強化した制約付きデコーディングアルゴリズムであるCRANEを提案し、制約のある生成の正確性と制約のない生成の柔軟性を効果的にバランスさせます。複数のオープンソースLLMおよびベンチマークでの実験結果は、CRANEが最先端の制約付きデコーディング戦略および標準の制約のないデコーディングよりも優れており、難解な記号的推論ベンチマークGSM-symbolicおよびFOLIOにおいて、ベースラインに対して最大10%ポイントの精度向上を示しています。
English
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.Summary
AI-Generated Summary