ChatPaper.aiChatPaper

크레인: 제약 조건이 있는 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

PDF182February 18, 2025