Large Language Model Meets Constraint Propagation

Alexandre Bonlarron, Florian Régin, Elisabetta De Maria, Jean-Charles Régin
5/29/2025
cs.CLcs.AI

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Large Language Models (LLMs) excel at generating fluent text but struggle to enforce external constraints because they generate tokens sequentially without explicit control mechanisms. GenCP addresses this limitation by combining LLM predictions with Constraint Programming (CP) reasoning, formulating text generation as a Constraint Satisfaction Problem (CSP). In this paper, we improve GenCP by integrating Masked Language Models (MLMs) for domain generation, which allows bidirectional constraint propagation that leverages both past and future tokens. This integration bridges the gap between token-level prediction and structured constraint enforcement, leading to more reliable and constraint-aware text generation. Our evaluation on COLLIE benchmarks demonstrates that incorporating domain preview via MLM calls significantly improves GenCP's performance. Although this approach incurs additional MLM calls and, in some cases, increased backtracking, the overall effect is a more efficient use of LLM inferences and an enhanced ability to generate feasible and meaningful solutions, particularly in tasks with strict content constraints.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Cite this paper

@article{bonlarron2025large,
  title  = {Large Language Model Meets Constraint Propagation},
  author = {Alexandre Bonlarron and Florian Régin and Elisabetta De Maria and Jean-Charles Régin},
  year   = {2025},
  eprint = {2505.24012},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.24012v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.24012.svg)](https://codeofpaper.com/paper/2505.24012)

Discussion