Proceedings

Large Language Model Meets Constraint Propagation

Download BibTeX Cite

Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence. AI, Arts & Creativity. Pages 10036-10044.

https://doi.org/10.24963/ijcai.2025/1115

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.

  1. [Baptiste et al., 2001] Philippe Baptiste, Claude Le Pape, and Wim Nuijten. Constraint-based scheduling: apply- ing constraint programming to scheduling problems, vol- ume 39. Springer Science & Business Media, 2001.
  2. [Barbieri et al., 2012] Gabriele Barbieri, Franc ¸ois Pachet, Pierre Roy, and Mirko Degli Esposti. Markov constraints for generating lyrics with style. In Proceedings of the 20th European Conference on Artificial Intelligence, ECAI'12, page 115-120, NLD, 2012. IOS Press.
  3. [Bessiere, 2006] Christian Bessiere. Constraint propagation. In Foundations of Artificial Intelligence, volume 2, pages 29-83. Elsevier, 2006.
  4. [Bonlarron and Régin, 2024a] Alexandre Bonlarron and Jean-Charles Régin. Intertwining cp and nlp: The generation of unreasonably constrained sentences. In Kate Larson, editor, Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence, IJCAI-24, pages 7600-7608. International Joint Confer- ences on Artificial Intelligence Organization, 8 2024. AI, Arts & Creativity. IJCAI
  5. [Bonlarron and Régin, 2024b] Alexandre Bonlarron and Jean-Charles Régin. Markov constraint as large language model surrogate. In Kate Larson, editor, Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence, IJCAI-24, pages 1844-1852. International Joint Conferences on Artificial Intelligence Organization, 8 2024. Main Track.
  6. [Bonlarron et al., 2023] Alexandre Bonlarron, Aurélie Cal- abrèse, Pierre Kornprobst, and Jean-Charles Régin. Con- straints first: A new mdd-based model to generate sen- tences under constraints. In Edith Elkind, editor, Pro- ceedings of the Thirty-Second International Joint Con- ference on Artificial Intelligence, IJCAI-23, pages 1893- 1901, 2023. IJCAI
  7. [Booch et al., 2021] Grady Booch, Francesco Fabiano, Lior Horesh, Kiran Kate, Jonathan Lenchner, Nick Linck, An- dreas Loreggia, Keerthiram Murgesan, Nicholas Mattei, Francesca Rossi, and Biplav Srivastava. Thinking fast and slow in ai. Proceedings of the AAAI Conference on Artifi- cial Intelligence, 35(17):15042-15046, May 2021.
  8. [Cardei et al., 2025] Michael Cardei, Jacob K Christo- pher, Thomas Hartvigsen, Brian R. Bartoldson, Bhavya Kailkhura, and Ferdinando Fioretto. Constrained discrete diffusion, 2025.
  9. [Dao et al., 2022] Tri Dao, Dan Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. Flashattention: Fast and memory-efficient exact attention with io-awareness. Advances in Neural Information Processing Systems, 35:16344-16359, 2022.
  10. [Devlin et al., 2019] Jacob Devlin, Ming-Wei Chang, Ken- ton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understand- ing. In Jill Burstein, Christy Doran, and Thamar Solorio, editors, Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, NAACL-HLT 2019, Minneapolis, MN, USA, June 2-7, 2019, Volume 1 (Long and Short Papers), pages 4171-4186. Association for Computational Linguistics, 2019.
  11. [Garbacea and Mei, 2022] Cristina Garbacea and Qiaozhu Mei. Why is constrained neural language generation par- ticularly challenging? arXiv preprint arXiv:2206.05395, 2022.
  12. [Geh et al., 2024] Renato Geh, Honghua Zhang, Kareem Ahmed, Benjie Wang, and Guy Van Den Broeck. Where is the signal in tokenization space? In Proceedings of the 2024 Conference on Empirical Methods in Natural Lan- guage Processing, pages 3966-3979, 2024.
  13. [Geh et al., 2025] Renato Lui Geh, Zilei Shao, and Guy Van den Broeck. Adversarial tokenization, 2025.
  14. [Gholami et al., 2021] Amir Gholami, Sehoon Kim, Zhen Dong, Zhewei Yao, Michael W. Mahoney, and Kurt Keutzer. A survey of quantization methods for efficient neural network inference. CoRR, abs/2103.13630, 2021.
  15. [Hokamp and Liu, 2017] Chris Hokamp and Qun Liu. Lex- ically constrained decoding for sequence generation us- ing grid beam search. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 1535-1546, Vancouver, Canada, July 2017. Association for Computational Lin- guistics. [Holtzman et al., 2020] Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. The curious case of neural text degeneration. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020.
  16. [Kahneman, 2011] Daniel Kahneman. Thinking, fast and slow. Farrar, Straus and Giroux, New York, 2011.
  17. [Lu et al., 2021] Ximing Lu, Peter West, Rowan Zellers, Ro- nan Le Bras, Chandra Bhagavatula, and Yejin Choi. Neu- roLogic decoding: (un)supervised neural text generation with predicate logic constraints. In Kristina Toutanova, Anna Rumshisky, Luke Zettlemoyer, Dilek Hakkani-Tur, Iz Beltagy, Steven Bethard, Ryan Cotterell, Tanmoy Chakraborty, and Yichao Zhou, editors, Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Lan- guage Technologies, pages 4288-4299, Online, June 2021. Association for Computational Linguistics.
  18. [Lu et al., 2022] Ximing Lu, Sean Welleck, Peter West, Li- wei Jiang, Jungo Kasai, Daniel Khashabi, Ronan Le Bras, Lianhui Qin, Youngjae Yu, Rowan Zellers, Noah A. Smith, and Yejin Choi. NeuroLogic A*esque decoding: Con- strained text generation with lookahead heuristics. In Pro- ceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pages 780-799, Seattle, United States, July 2022. Association for Computational Linguistics.
  19. [Pachet and Roy, 2011] Franc ¸ois Pachet and Pierre Roy. Markov constraints: Steerable generation of markov se- quences. Constraints, 16(2):148-172, apr 2011.
  20. [Papadopoulos et al., 2014] Alexandre Papadopoulos, Pierre Roy, and Franc ¸ois Pachet. Avoiding plagiarism in markov sequence generation. In Proceedings of the Twenty-Eighth AAAI Conference on Artificial Intelligence, AAAI'14, page 2731-2737. AAAI Press, 2014.
  21. [Papadopoulos et al., 2015] Alexandre Papadopoulos, Pierre Roy, Jean-Charles Régin, and Franc ¸ois Pachet. Generating all possible palindromes from ngram corpora. In Proceed- ings of the 24th International Conference on Artificial In- telligence, IJCAI'15, page 2489-2495. AAAI Press, 2015. IJCAI
  22. [Papadopoulos et al., 2016] Alexandre Papadopoulos, Pierre Roy, and Franc ¸ois Pachet. Assisted lead sheet composition using flowcomposer. In Michel Rueher, editor, Principles and Practice of Constraint Programming, pages 769-785, Cham, 2016. Springer International Publishing.
  23. [Post and Vilar, 2018] Matt Post and David Vilar. Fast lexi- cally constrained decoding with dynamic beam allocation for neural machine translation. In Proceedings of the 2018 Conference of the North American Chapter of the Asso- ciation for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pages 1314-1324, New Orleans, Louisiana, June 2018. Association for Com- putational Linguistics.
  24. [Régin, 2024] Florian Régin. Generative constraint pro- gramming. Theses, Université Côte d'Azur, December 2024.
  25. [Régin and De Maria, 2023] Florian Régin and Elisabetta De Maria. Using on-the-fly model checking to improve constraint programming for dynamic problems. In 2023 IEEE 35th International Conference on Tools with Artifi- cial Intelligence (ICTAI), pages 393-398, 2023.
  26. [Régin et al., 2024] Florian Régin, Elisabetta De Maria, and Alexandre Bonlarron. Combining Constraint Program- ming Reasoning with Large Language Model Predictions. In 30th International Conference on Principles and Prac- tice of Constraint Programming (CP 2024), 2024.
  27. [Schiex et al., 1996] Thomas Schiex, Jean-Charles Régin, Christine Gaspin, and Gerard Verfaillie. Lazy arc consis- tency. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 1, pages 216-221, 1996.
  28. [Sprockeels and Van Roy, 2024] Damien Sprockeels and Pe- ter Van Roy. Expressing musical ideas with constraint programming using a model of tonal harmony. In Kate Larson, editor, Proceedings of the Thirty-Third Interna- tional Joint Conference on Artificial Intelligence, IJCAI- 24, pages 7753-7761. International Joint Conferences on Artificial Intelligence Organization, 8 2024. AI, Arts & Creativity. [Trick, 2003]
  29. Michael Trick. A dynamic programming ap- proach for consistency and propagation for knapsack con- straints. Annals of Operations Research, 118:73-84, 2003.
  30. [Wei et al., 2022] Jason Wei, Xuezhi Wang, Dale Schuur- mans, Maarten Bosma, Brian Ichter, Fei Xia, Ed H. Chi, Quoc V. Le, and Denny Zhou. Chain-of-thought prompt- ing elicits reasoning in large language models. In Sanmi Koyejo, S. Mohamed, A. Agarwal, Danielle Belgrave, K. Cho, and A. Oh, editors, Advances in Neural Informa- tion Processing Systems 35: Annual Conference on Neu- ral Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 -December 9, 2022, 2022.
  31. [Yao et al., 2023] Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Thomas L. Griffiths, Yuan Cao, and Karthik Narasimhan. Tree of thoughts: deliberate problem solving with large language models. In Proceedings of the 37th International Conference on Neural Information Process- ing Systems, NIPS '23, Red Hook, NY, USA, 2023.
  32. [Curran Associates Inc. Yao et al., 2024] Shunyu Yao, Howard Chen, Austin W. Hanjie, Runzhe Yang, and Karthik R Narasimhan. COL- LIE: Systematic construction of constrained text genera- tion tasks. In The Twelfth International Conference on Learning Representations, 2024.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards