Proceedings

Markov Constraint as Large Language Model Surrogate

Download BibTeX Cite

Proceedings of the Thirty-Third International Joint Conference on Artificial Intelligence. Main Track. Pages 1844-1852.

https://doi.org/10.24963/ijcai.2024/204

Abstract

This paper presents NgramMarkov, a variant of the Markov constraints. It is dedicated to text generation in constraint programming (CP).

It involves a set of n-grams (i.e., sequence of n words) associated with probabilities given by a large language model (LLM). It limits the product of the probabilities of the n-gram of a sentence.

The propagator of this constraint can be seen as an extension of the ElementaryMarkov constraint propagator, incorporating the LLM distribution instead of the maximum likelihood estimation of n-grams. It uses a gliding threshold, i.e., it rejects n-grams whose local probabilities are too low, to guarantee balanced solutions.

It can also be combined with a "look-ahead" approach to remove n-grams that are very unlikely to lead to acceptable sentences for a fixed-length horizon. This idea is based on the MDDMarkovProcess constraint propagator, but without explicitly using an MDD (Multi-Valued Decision Diagram).

The experimental results show that the generated text is valued in a similar way to the LLM perplexity function.

Using this new constraint dramatically reduces the number of candidate sentences produced, improves computation times, and allows larger corpora or smaller n-grams to be used. A real-world problem has been solved for the first time using 4-grams instead of 5-grams.

  1. [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, Proceed- ings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI-23, pages 1893-1901. In- ternational Joint Conferences on Artificial Intelligence Or- ganization, 8 2023. Main Track. IJCAI
  2. [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.
  3. [Demassey et al., 2006] Sophie Demassey, Gilles Pesant, and Louis-Martin Rousseau. A cost-regular based hybrid column generation approach. Constraints, 11(4):315-333, 2006.
  4. [Gehrmann et al., 2019] Sebastian Gehrmann, Hendrik Stro- belt, and Alexander Rush. GLTR: Statistical detection and visualization of generated text. In Proceedings of the 57th Annual Meeting of the Association for Compu- tational Linguistics: System Demonstrations, pages 111- 116, Florence, Italy, July 2019. Association for Computa- tional Linguistics.
  5. [Hochreiter and Schmidhuber, 1997] Sepp Hochreiter and Jürgen Schmidhuber. Long Short-Term Memory. Neural Computation, 9(8):1735-1780, 11 1997.
  6. [Jacob et al., 2018] Benoit Jacob, Skirmantas Kligys, Bo Chen, Menglong Zhu, Matthew Tang, Andrew Howard, Hartwig Adam, and Dmitry Kalenichenko. Quantization and training of neural networks for efficient integer-arithmetic-only inference. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
  7. [Jurafsky and Martin, 2009] Dan Jurafsky and James H. Martin. Speech and language processing : an introduction to natural language processing, computational linguistics, and speech recognition. Pearson Prentice Hall, Upper Sad- dle River, N.J., 2009.
  8. [Liu et al., 2021] Yixian Liu, Liwen Zhang, Wenjuan Han, Yue Zhang, and Kewei Tu. Constrained text generation with global guidance -case study on commongen. CoRR, abs/2103.07170, 2021.
  9. [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.
  10. [Morin and Quimper, 2014] Michael Morin and Claude-Guy Quimper. The markov transition constraint. In Integra- tion of AI and OR Techniques in Constraint Programming: 11th International Conference, CPAIOR 2014, Cork, Ire- land, May 19-23, 2014. Proceedings 11, pages 405-421. Springer, 2014. [OpenAI, 2023] OpenAI. Gpt-4 technical report, 2023.
  11. [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.
  12. [Pachet et al., 2011] Francois Pachet, Pierre Roy, and Gabriele Barbieri. Finite-length markov processes with constraints. In Proceedings of the Twenty-Second Inter- national Joint Conference on Artificial Intelligence, IJ- CAI'11, pages 635-642. AAAI Press, 2011. IJCAI
  13. [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.
  14. [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
  15. [Perez and Régin, 2017] Guillaume Perez and Jean-Charles Régin. MDDs: Sampling and probability constraints. In Proceedings of the International Conference on Principles and Practice of Constraint Programming, page 226-242, 2017.
  16. [Perez and Régin, 2017] Guillaume Perez and Jean-Charles Régin. Soft and cost MDD propagators. In Proceedings of the AAAI Conference on Artificial Intelligence, 2017.
  17. [Pesant and Régin, 2005] Gilles Pesant and Jean-Charles Régin. Spread: A balancing constraint based on statistics. In Peter van Beek, editor, Principles and Practice of Con- straint Programming -CP 2005, pages 460-474, Berlin, Heidelberg, 2005. Springer Berlin Heidelberg.
  18. [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.
  19. [Roy and Pachet, 2013] Pierre Roy and Francois Pachet. En- forcing meter in finite-length markov sequences. Pro- ceedings of the AAAI Conference on Artificial Intelligence, 27(1):854-861, Jun. 2013.
  20. [Schaus et al., 2007] Pierre Schaus, Yves Deville, Pierre Dupont, and Jean-Charles Régin. The deviation con- straint. In Pascal Van Hentenryck and Laurence Wolsey, editors, Integration of AI and OR Techniques in Constraint Programming for Combinatorial Optimization Problems, pages 260-274, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg.
  21. [Shannon, 1951] C. E. Shannon. Prediction and entropy of printed english. The Bell System Technical Journal, 30(1):50-64, 1951.
  22. [Simoulin and Crabbé, 2021] Antoine Simoulin and Benoit Crabbé. Un modèle Transformer Génératif Pré-entrainé pour le franc ¸ais. In Pascal Denis, Natalia Grabar, Amel Fraisse, Rémi Cardon, Bernard Jacquemin, Eric Kergosien, and Antonio Balvet, editors, Traitement Au- tomatique des Langues Naturelles, pages 246-255, Lille, France, 2021. ATALA.
  23. [Suresh et al., 2021] Ananda Theertha Suresh, Brian Roark, Michael Riley, and Vlad Schogol. Approximating prob- abilistic models as weighted finite automata. Computa- tional Linguistics, 47(2):221-254, 2021.
  24. [Touvron et al., 2023] Hugo Touvron, Thibaut Lavril, Gau- tier Izacard, Xavier Martinet, Marie-Anne Lachaux, Tim- othée Lacroix, Baptiste Rozière, Naman Goyal, Eric Ham- bro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models, 2023.
  25. [Vaswani et al., 2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Sys- tems, pages 5998-6008, 2017.
  26. [Wolf et al., 2020] Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Fun- towicz, Joe Davison, Sam Shleifer, Patrick von Platen, Clara Ma, Yacine Jernite, Julien Plu, Canwen Xu, Teven Le Scao, Sylvain Gugger, Mariama Drame, Quentin Lhoest, and Alexander M. Rush. Transformers: State-of- the-art natural language processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Lan- guage Processing: System Demonstrations, Online, Octo- ber 2020. Association for Computational Linguistics.

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

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