Table of Contents
Fetching ...

Hard Constraints Meet Soft Generation: Guaranteed Feasibility for LLM-based Combinatorial Optimization

Yang Liu, Chuan Zhou, Yancheng Chen, Shuai Zhang, Xixun Lin, Xiaoqing Wang

TL;DR

This work tackles the lack of feasibility guarantees in LLM-based combinatorial optimization by introducing FALCON, a framework that guarantees 100% feasibility through a three-layer architecture: grammar-constrained decoding for syntactic validity, a semantic feasibility repair layer, and adaptive Best-of-$N$ sampling to allocate inference effort. It advances training with Best-anchored Objective-guided Preference Optimization (BOPO), proving convergence $O(1/\sqrt{T})$ and bounding repair-induced quality loss. The approach is evaluated across seven NP-hard CO problems, where FALCON achieves perfect feasibility while maintaining competitive or superior solution quality compared with state-of-the-art neural and LLM-based solvers, and with substantial efficiency gains from adaptive sampling. The combination of formal feasibility guarantees and practical performance suggests strong potential for deploying LLM-based CO solvers in safety-critical or high-stakes applications, providing reliable and scalable decision support across domains.

Abstract

Large language models (LLMs) have emerged as promising general-purpose solvers for combinatorial optimization (CO), yet they fundamentally lack mechanisms to guarantee solution feasibility which is critical for real-world deployment. In this work, we introduce FALCON, a framework that ensures 100\% feasibility through three key innovations: (i) \emph{grammar-constrained decoding} enforces syntactic validity, (ii) a \emph{feasibility repair layer} corrects semantic constraint violations, and (iii) \emph{adaptive Best-of-$N$ sampling} allocates inference compute efficiently. To train the underlying LLM, we introduce the Best-anchored Objective-guided Preference Optimization (BOPO) in LLM training, which weights preference pairs by their objective gap, providing dense supervision without human labels. Theoretically, we prove convergence for BOPO and provide bounds on repair-induced quality loss. Empirically, across seven NP-hard CO problems, FALCON achieves perfect feasibility while matching or exceeding the solution quality of state-of-the-art neural and LLM-based solvers.

Hard Constraints Meet Soft Generation: Guaranteed Feasibility for LLM-based Combinatorial Optimization

TL;DR

This work tackles the lack of feasibility guarantees in LLM-based combinatorial optimization by introducing FALCON, a framework that guarantees 100% feasibility through a three-layer architecture: grammar-constrained decoding for syntactic validity, a semantic feasibility repair layer, and adaptive Best-of- sampling to allocate inference effort. It advances training with Best-anchored Objective-guided Preference Optimization (BOPO), proving convergence and bounding repair-induced quality loss. The approach is evaluated across seven NP-hard CO problems, where FALCON achieves perfect feasibility while maintaining competitive or superior solution quality compared with state-of-the-art neural and LLM-based solvers, and with substantial efficiency gains from adaptive sampling. The combination of formal feasibility guarantees and practical performance suggests strong potential for deploying LLM-based CO solvers in safety-critical or high-stakes applications, providing reliable and scalable decision support across domains.

Abstract

Large language models (LLMs) have emerged as promising general-purpose solvers for combinatorial optimization (CO), yet they fundamentally lack mechanisms to guarantee solution feasibility which is critical for real-world deployment. In this work, we introduce FALCON, a framework that ensures 100\% feasibility through three key innovations: (i) \emph{grammar-constrained decoding} enforces syntactic validity, (ii) a \emph{feasibility repair layer} corrects semantic constraint violations, and (iii) \emph{adaptive Best-of- sampling} allocates inference compute efficiently. To train the underlying LLM, we introduce the Best-anchored Objective-guided Preference Optimization (BOPO) in LLM training, which weights preference pairs by their objective gap, providing dense supervision without human labels. Theoretically, we prove convergence for BOPO and provide bounds on repair-induced quality loss. Empirically, across seven NP-hard CO problems, FALCON achieves perfect feasibility while matching or exceeding the solution quality of state-of-the-art neural and LLM-based solvers.
Paper Structure (94 sections, 17 theorems, 88 equations, 2 figures, 9 tables, 9 algorithms)

This paper contains 94 sections, 17 theorems, 88 equations, 2 figures, 9 tables, 9 algorithms.

Key Result

Theorem 3.3

For any output $y$ generated by Algorithm alg:gcd upon termination with grammar $G$, we have $y \in \mathcal{L}(G)$ where $\mathcal{L}(G)$ is the language defined by $G$.

Figures (2)

  • Figure 1: Repair layer statistics across seven CO problems. (a) Feasibility rates. (b) Optimality gap. (c) Repair frequency and cost for each problem. (d) Strong correlation ($r=0.912$) between repair frequency and cost.
  • Figure 2: Comparison of BOPO and GRPO starting from the same SFT checkpoint and with an identical training budget. (a) BOPO consistently achieves lower optimality gaps across all problems. (b,c) BOPO improves both optimality gap and feasibility rates. (d) Relative gap improvement.

Theorems & Definitions (44)

  • Definition 2.1: Feasible Solution
  • Definition 3.1: CO Output Grammar
  • Definition 3.2: Input-Dependent Grammar
  • Theorem 3.3: Format Validity Guarantee
  • Remark 3.4: Computational Overhead
  • Definition 3.5: Repair Operator
  • Theorem 3.6: 100% Feasibility Guarantee
  • Theorem 3.7: Repair Quality Bound
  • Corollary 3.8: Sample Efficiency of Repair
  • Definition 3.9: Solution Consistency
  • ...and 34 more