Large Language Models Are Neurosymbolic Reasoners
Paper · 2024 · Meng Fang, Shilong Deng, Yudi Zhang et al.
Summary
The paper asks whether general-purpose LLMs can serve as symbolic reasoners without task-specific training. It tests this in text-based games, which are modelled as POMDPs and require skills such as arithmetic, map navigation, sorting, and common-sense object placement. The authors build a zero-shot LLM agent, mainly GPT-3.5. At each step, the prompt gives the agent its role, the current observation, and a combined list of valid actions from the game environment and an external symbolic module such as a calculator, navigator, sorter, or knowledge lookup. Constrained prompts guide which action to choose.
On the four benchmark tasks from Wang et al. (2022b), the agent averages 0.88 normalized test score. It clearly beats a DRRN reinforcement learning baseline. It comes close to a T5-based Behavior Cloned Transformer with symbolic modules, which scores slightly higher but depends on gold expert trajectories. The work suggests that pairing LLMs with external tools can replace costly RL or imitation training for symbolic decision-making.
Key points
- Tasks: The four benchmarks are TWC (Text World Common Sense), Arithmetic, Sorting, and MapReader. The baselines are DRRN and a T5 Behavior Cloned Transformer, each run with and without symbolic modules.
- GPT-3.5 test scores: Arithmetic 1.00, MapReader 0.86 (about 15 steps on average), Sorting 0.71, TWC 0.94, for an average of 0.88.
- Failure modes: On MapReader, the agent forgets routes and has to re-query them. On Sorting, it loses track of the ascending order because of limited memory.
- Prompt ablation: Removing the constrained prompts lowers the average to 0.67. Sorting drops most sharply, to 0.35.
- GPT-4 comparison: GPT-4 raises the average to 0.91, with MapReader at 0.99 and Sorting at 0.93. However, TWC falls to 0.71 and takes more steps.
- Code: github.com/hyintell/LLMSymbolic.
Institutions
Fields, topics and concepts
📚 Shelves 2The field of science this work belongs to (OpenAlex fields).Computer Science · 19,503 worksArtificial Intelligence · 18,805 works
🧭 Topics 1Research subjects and languages the work is about.Language models & pretraining · 4,145 works
Cite
Cite as Meng Fang, Shilong Deng, Yudi Zhang, Zijing Shi, Ling Chen, Mykola Pechenizkiy and Jun Wang. 2024. Large Language Models Are Neurosymbolic Reasoners. arXiv:2401.09334.
@misc{fang2024large,
title = {{Large Language Models Are Neurosymbolic Reasoners}},
author = {Meng Fang, Shilong Deng, Yudi Zhang, Zijing Shi, Ling Chen, Mykola Pechenizkiy and Jun Wang},
year = {2024},
doi = {10.48550/arxiv.2401.09334},
eprint = {2401.09334},
archivePrefix = {arXiv},
url = {https://doi.org/10.48550/arxiv.2401.09334}
}References
- Discussion. Our results demonstrate that the incorporation of external symbolic modules by the LLM agent leads to enhanced average accuracy compared to other baselines. This capability is achieved by leveraging the underlying patterns present in the training data. Instead of relying on symbolic thin… find
- Ammanabrolu, P.; and Hausknecht, M. 2020. Graph constrained reinforcement learning for natural language action spaces. In International Conference on Learning Representations. find
- Ammanabrolu, P.; Urbanek, J.; Li, M.; Szlam, A.; Rocktäschel, T.; and Weston, J. 2021. How to Motivate Your Dragon: Teaching Goal-Driven Agents to Speak and Act in Fantasy Worlds. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: H… find
- Basu, K.; Murugesan, K.; Atzeni, M.; Kapanipathi, P.; Talamadupula, K.; Klinger, T.; Campbell, M.; Sachan, M.; and Gupta, G. 2022. A hybrid neuro-symbolic approach for text-based games using inductive logic programming. In Combining Learning and Reasoning: Programming Languages, Formalisms, and Repr… find
- Brooks, E.; Walls, L.; Lewis, R. L.; and Singh, S. 2022. In-context policy iteration. arXiv preprint arXiv:2210.03821. — [arXiv:2210.03821](https://arxiv.org/abs/2210.03821) find
- Brown, T.; Mann, B.; Ryder, N.; Subbiah, M.; Kaplan, J. D.; Dhariwal, P.; Neelakantan, A.; Shyam, P.; Sastry, G.; Askell, A.; et al. 2020. Language models are few-shot learners. In Advances in Neural Information Processing Systems.
- Cambria, E.; Liu, Q.; Decherchi, S.; Xing, F.; and Kwok, K. 2022. SenticNet 7: A commonsense-based neurosymbolic AI framework for explainable sentiment analysis. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, 3829–3839. find
- Chen, L.; Lu, K.; Rajeswaran, A.; Lee, K.; Grover, A.; Laskin, M.; Abbeel, P.; Srinivas, A.; and Mordatch, I. 2021. Decision transformer: Reinforcement learning via sequence modeling. In Advances in Neural Information Processing Systems. Côté, M.-A.; Kádár, A.; Yuan, X.; Kybartas, B.; Barnes, T.… find
- He, J.; Ostendorf, M.; He, X.; Chen, J.; Gao, J.; Li, L.; and Deng, L. 2016. Deep Reinforcement Learning with a Combinatorial Action Space for Predicting Popular Reddit Threads. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, 1838–1848. find
- Hendrycks, D.; Mazeika, M.; Zou, A.; Patel, S.; Zhu, C.; Navarro, J.; Song, D.; Li, B.; and Steinhardt, J. 2021. What would jiminy cricket do? Towards agents that behave morally. In Advances in Neural Information Processing Systems. find
- Huang, W.; Abbeel, P.; Pathak, D.; and Mordatch, I. 2022a. Language models as zero-shot planners: Extracting actionable knowledge for embodied agents. In International Conference on Machine Learning.
- Huang, W.; Xia, F.; Xiao, T.; Chan, H.; Liang, J.; Florence, P.; Zeng, A.; Tompson, J.; Mordatch, I.; Chebotar, Y.; et al. 2022b. Inner monologue: Embodied reasoning through planning with language models. arXiv preprint arXiv:2207.05608. find
- Jansen, P.; and Cote, M.-a. 2023. TextWorldExpress: Simulating Text Games at One Million Steps Per Second. In Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations, 169–177. find
- Kimura, D.; Chaudhury, S.; Ono, M.; Tatsubori, M.; Agravante, D. J.; Munawar, A.; Wachi, A.; Kohita, R.; and Gray, A. 2021a. LOA: Logical Optimal Actions for Text-based Interaction Games. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th Internat… find
- Kimura, D.; Ono, M.; Chaudhury, S.; Kohita, R.; Wachi, A.; Agravante, D. J.; Tatsubori, M.; Munawar, A.; and Gray, A. 2021b. Neuro-Symbolic Reinforcement Learning with First-Order Logic. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, 3505– 3511. find
- Kwon, M.; Xie, S. M.; Bullard, K.; and Sadigh, D. 2023. Reward design with language models. In International Conference on Learning Representations.
- Lample, G.; and Charton, F. 2020. Deep Learning For Symbolic Mathematics. In International Conference on Learning Representations.
- Liang, J.; Huang, W.; Xia, F.; Xu, P.; Hausman, K.; Ichter, B.; Florence, P.; and Zeng, A. 2023. Code as policies: Language model programs for embodied control. In 2023 IEEE International Conference on Robotics and Automation, 9493–9500. find
- Liu, G.; Adhikari, A.; Farahmand, A.-m.; and Poupart, P. 2021. Learning object-oriented dynamics for planning from text. In International Conference on Learning Representations. find
- Madaan, A.; Tandon, N.; Gupta, P.; Hallinan, S.; Gao, L.; Wiegreffe, S.; Alon, U.; Dziri, N.; Prabhumoye, S.; Yang, Y.; et al. 2023. Self-refine: Iterative refinement with self-feedback. arXiv preprint arXiv:2303.17651. find
- Min, S.; Lewis, M.; Zettlemoyer, L.; and Hajishirzi, H. 2022. MetaICL: Learning to Learn In Context. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, 2791–2809. find
- Mnih, V.; Kavukcuoglu, K.; Silver, D.; Graves, A.; Antonoglou, I.; Wierstra, D.; and Riedmiller, M. 2013. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602. find
- Murugesan, K.; Atzeni, M.; Kapanipathi, P.; Shukla, P.; Kumaravel, S.; Tesauro, G.; Talamadupula, K.; Sachan, M.; and Campbell, M. 2021. Text-based rl agents with commonsense knowledge: New challenges, environments and baselines. In Proceedings of the AAAI Conference on Artificial Intelligence, volu… find
- Narasimhan, K.; Kulkarni, T.; and Barzilay, R. 2015. Language Understanding for Text-based Games using Deep Reinforcement Learning. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 1–11.
- OpenAI. 2023. GPT-4 Technical Report. ArXiv, abs/2303.08774. Osborne, P.; Nõmm, H.; and Freitas, A. 2022. A survey of text games for reinforcement learning informed by natural language. Transactions of the Association for Computational Linguistics, 873–887.
- Poesia, G.; Dong, W.; and Goodman, N. 2021. Contrastive reinforcement learning of symbolic reasoning domains. In Advances in Neural Information Processing Systems. find
- Qian, J.; Wang, H.; Li, Z.; Li, S.; and Yan, X. 2023. Limitations of Language Models in Arithmetic and Symbolic Induction. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 9285–9298. find
- Raffel, C.; Shazeer, N.; Roberts, A.; Lee, K.; Narang, S.; Matena, M.; Zhou, Y.; Li, W.; and Liu, P. J. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of machine learning Research, 21(1): 5485–5551.
- Ryu, D.; Shareghi, E.; Fang, M.; Xu, Y.; Pan, S.; and Haf, R. 2022. Fire Burns, Sword Cuts: Commonsense Inductive Bias for Exploration in Text-based Games. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), 515–522. find
- Shi, Z.; Fang, M.; Xu, Y.; Chen, L.; and Du, Y. 2022. Stay moral and explore: Learn to behave morally in text-based games. In International Conference on Learning Representations. find
- Shinn, N.; Labash, B.; and Gopinath, A. 2023. Reflexion: an autonomous agent with dynamic memory and self-reflection. arXiv preprint arXiv:2303.11366.
- Singh, I.; Blukis, V.; Mousavian, A.; Goyal, A.; Xu, D.; Tremblay, J.; Fox, D.; Thomason, J.; and Garg, A. 2023. Progprompt: Generating situated robot task plans using large language models. In 2023 IEEE International Conference on Robotics and Automation, 11523–11530.
- Sutton, R. S.; and Barto, A. G. 2018. Reinforcement learning: An introduction. MIT press. find
- Vemprala, S.; Bonatti, R.; Bucker, A.; and Kapoor, A. 2023. ChatGPT for Robotics: Design Principles and Model Abilities. Technical Report MSR-TR-2023-8, Microsoft. Wang, R.; Jansen, P.; Côté, M.-A.; and Ammanabrolu, P. 2022a. ScienceWorld: Is your Agent Smarter than a 5th Grader? In Proceedings of… find
- Wei, J.; Wang, X.; Schuurmans, D.; Bosma, M.; Xia, F.; Chi, E. H.; Le, Q. V.; Zhou, D.; et al. 2022. Chain-of-Thought Prompting Elicits Reasoning in Large Language Models. In Advances in Neural Information Processing Systems.
- Xu, Y.; Fang, M.; Chen, L.; Du, Y.; and Zhang, C. 2021. Generalization in Text-based Games via Hierarchical Reinforcement Learning. In Findings of the Association for Computational Linguistics: EMNLP 2021, 1343–1353. find
- Xu, Y.; Fang, M.; Chen, L.; Du, Y.; Zhou, J.; and Zhang, C. 2022. Perceiving the World: Question-guided Reinforcement Learning for Text-based Games. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics, 538–560. find
- Xu, Y.; Fang, M.; Chen, L.; Du, Y.; Zhou, J. T.; and Zhang, C. 2020. Deep reinforcement learning with stacked hierarchical attention for text-based games. In Advances in Neural Information Processing Systems. find
- Yang, S.; Nachum, O.; Du, Y.; Wei, J.; Abbeel, P.; and Schuurmans, D. 2023. Foundation models for decision making: Problems, methods, and opportunities. arXiv preprint arXiv:2303.04129.
- Yao, S.; Rao, R.; Hausknecht, M.; and Narasimhan, K. 2020. Keep CALM and Explore: Language Models for Action Generation in Text-based Games. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing, 8736–8754.
- Yao, S.; Zhao, J.; Yu, D.; Du, N.; Shafran, I.; Narasimhan, K.; and Cao, Y. 2022. React: Synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629.
- Yin, X.; and May, J. 2019. Comprehensible context-driven text game playing. In IEEE Conference on Games, 1–8. Yuan, X.; Côté, M.-A.; Sordoni, A.; Laroche, R.; Combes, R. T. d.; Hausknecht, M.; and Trischler, A. 2018. Counting to explore and generalize in text-based games. arXiv preprint arXiv:1806… — [arXiv:1806.11525](https://arxiv.org/abs/1806.11525) find
- Zellers, R.; Holtzman, A.; Peters, M.; Mottaghi, R.; Kembhavi, A.; Farhadi, A.; and Choi, Y. 2021. PIGLeT: Language Grounding Through Neuro-Symbolic Interaction in a 3D World. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint… find
Updated
This page in Markdown → https://md.research.elamur.ai/free/en/papers/fang-2024-large-language-models-neurosymbolic/