Coupling Large Language Models with Logic Programming for Robust and General Reasoning from Text
Open accessAbstract
While large language models (LLMs), such as GPT-3, appear to be robust and general, their reasoning ability is not at a level to compete with the best models trained for specific natural language reasoning problems.In this study, we observe that a large language model can serve as a highly effective few-shot semantic parser.It can convert natural language sentences into a logical form that serves as input for answer set programs, a logic-based declarative knowledge representation formalism.The combination results in a robust and general system that can handle multiple question-answering tasks without requiring retraining for each new task.It only needs a few examples to guide the LLM's adaptation to a specific task, along with reusable ASP knowledge modules that can be applied to multiple tasks.We demonstrate that this method achieves state-of-the-art performance on several NLP benchmarks, including bAbI, StepGame, CLUTRR, and gSCAN.Additionally, it successfully tackles robot planning tasks that an LLM alone fails to solve.C is to the top right of D. C is to the right and above D at an angle of about 45 degrees.C is at a 45 degree angle to D, in the upper righthand corner.C is directly north east of D. C is above D at 2 o'clock.
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
The claims and statistics of this paper haven’t been checked yet.
Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
LLMs have demonstrated the ability to generate code in various programming languages to meet users' specific needs.
“LLMs have demonstrated the ability to generate code in various programming languages to meet users' specific needs [13].”
From ChatLogic: Integrating Logic Programming with Large Language Models for Multi-Step Reasoning (2024) · cites this paper as [13]
Section 2.1 says pretrained language models have been used to generate SQL queries, SPARQL queries, logical forms, and programs from natural language. The Conclusion also acknowledges LLMs’ code-generation capability. The paper does not establish the broader claim that LLMs generate code in various programming languages to meet users’ specific needs. (LLM, conf=0.82)
Experimental — accuracy not yet measured
Self-check
Percentages, sums and reported differences re-computed from the paper’s own numbers.
The self-check needs the paper’s full text.
Cites
Do As I Can, Not As I Say: Grounding Language in Robotic Affordances
Ahn, M., Brohan, A., Brown, N., Chebotar, Y., Cortes, O., David, B., Finn, C., Fu, C., Gopalakrishnan, K., Hausman, K., et al. (2022) · arXiv · doi:10.48550/arxiv.2204.01691 · Cited by 624 · see citing works
Socratic Models: Composing Zero-Shot Multimodal Reasoning with Language
Zeng, A., Attarian, M., Ichter, B., Choromanski, K., Wong, A., Welker, S., Tombari, F., Purohit, A., Ryoo, M., Sindhwani, V., et al. (2022) · arXiv · doi:10.48550/arxiv.2204.00598 · Cited by 205 · see citing works
Self-citationConstrained Language Models Yield Few-Shot Semantic Parsers
Shin, R., Lin, C., Thomson, S., Chen, C., Roy, S., Platanios, E. A., Pauls, A., Klein, D., Eisner, J., & Van Durme, B. (2021) · Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing · doi:10.18653/v1/2021.emnlp-main.608 · Cited by 139 · see citing works
Flagged first, then by citations
Research works printed but not linked: 54
- Monica Agrawal, Stefan Hegselmann, Hunter Lang, Yoon Kim, and David Sontag. 2022. Large language models are few-shot clinical information extractors. In Proceedings of the 2022 Conference on Empiri- cal Methods in Natural Language Processing, page 1998-2022. Association for Computational Linguis- tics.
- Joseph Babb and Joohyung Lee. 2012. Module theorem for the general theory of stable models. Theory and Practice of Logic Programming, 12(4-5):719-735.
- Chitta Baral, Juraj Dzifcak, and Hiro Takahashi. 2006. Macros, macro calls and use of ensembles in mod- ular answer set programming. In International Conference on Logic Programming, pages 376-390. Springer.
- Leon Bergen, Timothy O'Donnell, and Dzmitry Bah- danau. 2021. Systematic generalization with edge transformers. Advances in Neural Information Pro- cessing Systems, 34:1390-1402.
- Antoine Bosselut, Hannah Rashkin, Maarten Sap, Chai- tanya Malaviya, Asli Celikyilmaz, and Yejin Choi. 2019. Comet: Commonsense transformers for knowl- edge graph construction. In Association for Compu- tational Linguistics (ACL).
- Gerhard Brewka, Ilkka Niemelä, and Miroslaw Truszczynski. 2011. Answer set programming at a glance. Communications of the ACM, 54(12):92- 103.
- Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. Advances in neural information processing systems, 33:1877-1901.
- Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Ka- plan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, et al. 2021. Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. · arXiv
- Xiang Chen, Ningyu Zhang, Xin Xie, Shumin Deng, Yunzhi Yao, Chuanqi Tan, Fei Huang, Luo Si, and Huajun Chen. 2022. Knowprompt: Knowledge- aware prompt-tuning with synergistic optimization for relation extraction. In Proceedings of the ACM Web Conference 2022, pages 2778-2788.
- Xilun Chen, Asish Ghoshal, Yashar Mehdad, Luke Zettlemoyer, and Sonal Gupta. 2020a. Low-resource domain adaptation for compositional task-oriented semantic parsing. In Proceedings of the 2020 Con- ference on Empirical Methods in Natural Language Processing (EMNLP), pages 5090-5100.
- Zhenfang Chen, Jiayuan Mao, Jiajun Wu, Kwan- Yee Kenneth Wong, Joshua B Tenenbaum, and Chuang Gan. 2020b. Grounding physical concepts of objects and events through dynamic visual rea- soning. In International Conference on Learning Representations.
- Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. 2018. Universal transformers. In International Conference on Learn- ing Representations.
- Mingyu Ding, Zhenfang Chen, Tao Du, Ping Luo, Josh Tenenbaum, and Chuang Gan. 2021. Dynamic visual reasoning by learning differentiable physics models from video and language. Advances in Neural Infor- mation Processing Systems, 34.
- Li Dong and Mirella Lapata. 2016. Language to logical form with neural attention. In 54th Annual Meet- ing of the Association for Computational Linguistics, pages 33-43. Association for Computational Linguis- tics (ACL).
- Andrew Drozdov, Nathanael Schärli, Ekin Akyürek, Nathan Scales, Xinying Song, Xinyun Chen, Olivier Bousquet, and Denny Zhou. 2022. Compositional semantic parsing with large language models. arXiv preprint arXiv:2209.15003. · arXiv
- Daan Fierens, Guy Van den Broeck, Joris Renkens, Dimitar Shterionov, Bernd Gutmann, Ingo Thon, Gerda Janssens, and Luc De Raedt. 2013. Inference and learning in probabilistic logic programs using weighted boolean formulas. Theory and Practice of Logic Programming, pages 1-44.
- Michael Gelfond and Vladimir Lifschitz. 1988. The stable model semantics for logic programming. In Proceedings of International Logic Programming Conference and Symposium, pages 1070-1080. MIT Press.
- Omer Goldman, Veronica Latcinnik, Ehud Nave, Amir Globerson, and Jonathan Berant. 2018. Weakly su- pervised semantic parsing with abstract examples. In Proceedings of the 56th Annual Meeting of the As- sociation for Computational Linguistics (Volume 1: Long Papers), pages 1809-1819.
- Wenlong Huang, Fei Xia, Ted Xiao, Harris Chan, Jacky Liang, Pete Florence, Andy Zeng, Jonathan Tompson, Igor Mordatch, Yevgen Chebotar, Pierre Sermanet, Tomas Jackson, Noah Brown, Linda Luu, Sergey Levine, Karol Hausman, and brian ichter. 2022. Inner monologue: Embodied reasoning through planning with language models. In 6th Annual Conference on Robot Learning.
- Drew A Hudson and Christopher D Manning. 2018. Compositional attention networks for machine rea- soning. In International Conference on Learning Representations.
- Jena D Hwang, Chandra Bhagavatula, Ronan Le Bras, Jeff Da, Keisuke Sakaguchi, Antoine Bosselut, and Yejin Choi. 2021. (comet-) atomic 2020: On sym- bolic and neural commonsense knowledge graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 6384-6392.
- Robin Jia and Percy Liang. 2016. Data recombination for neural semantic parsing. In Proceedings of the 54th Annual Meeting of the Association for Compu- tational Linguistics (Volume 1: Long Papers), pages 12-22.
- Tomáš Kočiskỳ, Gábor Melis, Edward Grefenstette, Chris Dyer, Wang Ling, Phil Blunsom, and Karl Moritz Hermann. 2016. Semantic parsing with semi-supervised sequential autoencoders. In Pro- ceedings of the 2016 Conference on Empirical Meth- ods in Natural Language Processing, pages 1078- 1087.
- Brenden Lake and Marco Baroni. 2018. Generalization without systematicity: On the compositional skills of sequence-to-sequence recurrent networks. In In- ternational conference on machine learning, pages 2873-2882. PMLR.
- Luis C Lamb, Artur Garcez, Marco Gori, Marcelo Prates, Pedro Avelar, and Moshe Vardi. 2020. Graph neural networks meet neural-symbolic computing: A survey and perspective. In Proceedings of Inter- national Joint Conference on Artificial Intelligence (IJCAI), pages 4877-4884.
- Hung Le, Truyen Tran, and Svetha Venkatesh. 2020. Self-attentive associative memory. In International Conference on Machine Learning, pages 5682-5691.
- PMLR.
- Joohyung Lee and Yi Wang. 2018. Weight learning in a probabilistic extension of answer set programs. In Proceedings of International Conference on Prin- ciples of Knowledge Representation and Reasoning (KR), pages 22-31.
- Vladimir Lifschitz. 2008. What is answer set program- ming? In Proceedings of the AAAI Conference on Artificial Intelligence, pages 1594-1597. MIT Press.
- Vladimir Lifschitz. 2019. Answer set programming. Springer Heidelberg.
- Hugo Liu and Push Singh. 2004. Conceptnet-a practi- cal commonsense reasoning tool-kit. BT technology journal, 22(4):211-226.
- Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. 2021. Pre- train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys (CSUR).
- Gary Marcus. 2018. Deep learning: A critical appraisal. arXiv preprint arXiv:1801.00631. · arXiv
- John McCarthy. 1998. Elaboration tolerance. In Work- ing Papers of the Fourth Symposium on Logical For- malizations of Commonsense Reasoning.
- John McCarthy and Patrick Hayes. 1969. Some philo- sophical problems from the standpoint of artificial intelligence. In B. Meltzer and D. Michie, editors, Machine Intelligence, volume 4, pages 463-502. Ed- inburgh University Press, Edinburgh.
- Scott Miller, David Stallard, Robert Bobrow, and Richard Schwartz. 1996. A fully statistical approach to natural language interfaces. In 34th Annual Meet- ing of the Association for Computational Linguistics, pages 55-61.
- Pasquale Minervini, Sebastian Riedel, Pontus Stenetorp, Edward Grefenstette, and Tim Rocktäschel. 2020. Learning reasoning strategies in end-to-end differ- entiable proving. In International Conference on Machine Learning, pages 6938-6949. PMLR.
- Roshanak Mirzaee and Parisa Kordjamshidi. 2022. Transfer learning with synthetic corpora for spatial role labeling and reasoning. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, page 6148-6165. Association for Computational Linguistics.
- Erik Mueller. 2006. Commonsense reasoning. Elsevier.
- Maxwell Nye, Michael Tessler, Josh Tenenbaum, and Brenden M Lake. 2021. Improving coherence and consistency in neural sequence models with dual- system, neuro-symbolic reasoning. Advances in Neural Information Processing Systems, 34:25192- 25204.
- Emilia Oikarinen and Tomi Janhunen. 2006. Modular equivalence for normal logic programs. In 17th Eu- ropean Conference on Artificial Intelligence(ECAI), pages 412-416.
- Murray Shanahan. 1995. A circumscriptive calculus of events. Artif. Intell., 77(2):249-284.
- Koustuv Sinha, Shagun Sodhani, Jin Dong, Joelle Pineau, and William L Hamilton. 2019. Clutrr: A di- agnostic benchmark for inductive reasoning from text. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 4506-4515.
- Jidong Tian, Yitian Li, Wenqing Chen, HE Hao, and Yaohui Jin. 2021. A generative-symbolic model for logical reasoning in nlu. In Is Neuro-Symbolic SOTA still a myth for Natural Language Inference? The first workshop.
- Karthik Valmeekam, Alberto Olmo, Sarath Sreedharan, and Subbarao Kambhampati. 2022. Large language models still can't plan (a benchmark for LLMs on planning and reasoning about change). In NeurIPS 2022 Foundation Models for Decision Making Work- shop.
- Chenguang Wang, Xiao Liu, and Dawn Song. 2022. Ielm: An open information extraction benchmark for pre-trained language models. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, page 8417-8437. Association for Computational Linguistics.
- Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, brian ichter, Fei Xia, Ed H. Chi, Quoc V Le, and Denny Zhou. 2022. Chain of thought prompt- ing elicits reasoning in large language models. In Advances in Neural Information Processing Systems.
- Jason Weston, Antoine Bordes, Sumit Chopra, and Tomás Mikolov. 2016. Towards ai-complete question answering: A set of prerequisite toy tasks. In 4th In- ternational Conference on Learning Representations, ICLR 2016, San Juan, Puerto Rico, May 2-4, 2016, Conference Track Proceedings.
- Yuk Wah Wong and Raymond Mooney. 2007. Learn- ing synchronous grammars for semantic parsing with lambda calculus. In Proceedings of the 45th Annual Meeting of the Association of Computational Linguis- tics, pages 960-967.
- Kexin Yi, Chuang Gan, Yunzhu Li, Pushmeet Kohli, Jiajun Wu, Antonio Torralba, and Joshua B Tenen- baum. 2019. CLEVRER: Collision events for video representation and reasoning. In ICLR.
- John M Zelle and Raymond J Mooney. 1996. Learning to parse database queries using inductive logic pro- gramming. In Proceedings of the national conference on artificial intelligence, pages 1050-1055.
- Luke S Zettlemoyer and Michael Collins. 2005. Learn- ing to map sentences to logical form: structured clas- sification with probabilistic categorial grammars. In Proceedings of the Twenty-First Conference on Un- certainty in Artificial Intelligence, pages 658-666.
- Denny Zhou, Nathanael Schärli, Le Hou, Jason Wei, Nathan Scales, Xuezhi Wang, Dale Schuurmans, Olivier Bousquet, Quoc Le, and Ed Chi. 2022. Least-to-most prompting enables complex reason- ing in large language models. arXiv preprint arXiv:2205.10625. · arXiv
- Wenxuan Zhou and Muhao Chen. 2022. An improved baseline for sentence-level relation extraction. In Pro- ceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Lin- guistics and the 12th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 161-168, Online only. Association for Computational Linguistics.
Cited by
Sorted by citations
ChatLogic: Integrating Logic Programming with Large Language Models for Multi-Step Reasoning
Wang, Z., Liu, J., Bao, Q., Rong, H., & Zhang, J. (2024) · 2024 International Joint Conference on Neural Networks (IJCNN) · doi:10.1109/ijcnn60899.2024.10650138 · Cited by 8 · see citing works
Dagan, G., Keller, F., & Lascarides, A. (2023) · arXiv · doi:10.48550/arxiv.2308.06391 · Cited by 5 · see citing works
- Authors
- Yang, Z., Ishay, A., & Lee, J.
- Affiliations
- Arizona State University (US)
- Samsung (South Korea) (KR)
- Venue
- Findings of the Association for Computational Linguistics: ACL 2023
- Published
- 2023
- Pages
- 5186-5219
- OpenAlex
- W4385570924
- Cited by
- 38
- References
- 3
- Citations by year
- 2026: 11 · 2025: 16 · 2024: 11
- FWCI
- 6.75
- Type
- conference paper
- Language
- en
- Open access
- hybrid
- doi.org
- Licence
- cc-by
- Locations
- Findings of the Association for Computational Linguistics: ACL (Findings of ACL) (publishedVersion, cc-by)
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Funders
- National Science Foundation (2006747)
- Topics
- Physical Sciences › Computer Science › Artificial Intelligence › Logic, Reasoning, and Knowledge
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
- Keywords
- large language models, logic programming, answer set programming, semantic parsing, few-shot learning, natural language reasoning, question answering, knowledge representation, robot planning, spatial reasoning
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review