Natural Language Embedded Programs for Hybrid Language Symbolic Reasoning

Tianhua Zhang, Jiaxin Ge, Hongyin Luo, Yung-Sung Chuang, Mingye Gao +5 more
9/19/2023
27 citations
cs.CL

Official code: luohongyin/LangCode (51 stars, Python, MIT, last commit 2023-09-22).

Abstract

How can we perform computations over natural language representations to solve tasks that require symbolic and numeric reasoning? We propose natural language embedded programs (NLEP) as a unifying framework for addressing math/symbolic reasoning, natural language understanding, and instruction following tasks.

Show full abstract

Our approach prompts a language model to generate full Python programs that define functions over data structures which contain natural language representations of structured knowledge. A Python interpreter then executes the generated code and prints the output. Despite using a task-general prompt, we find that this approach can improve upon strong baselines across a range of different tasks including math and symbolic reasoning, text classification, question answering, and instruction following. We found that the generated programs are interpretable since they outline the exact reasoning process followed by the program interpreter.

View on arXivView PDF

Code Implementations(1)

MIT

LangCode - Improving alignment and reasoning of large language models (LLMs) with natural language embedded program (NLEP).

517PythonSep 19, 20233 years agoMIT
colabgpt4jupyter-notebookllmnlep+1 more

Similar Papers

Cite this paper

@article{zhang2023natural,
  title  = {Natural Language Embedded Programs for Hybrid Language Symbolic Reasoning},
  author = {Tianhua Zhang and Jiaxin Ge and Hongyin Luo and Yung-Sung Chuang and Mingye Gao and Yuan Gong and Xixin Wu and Yoon Kim and Helen Meng and James Glass},
  year   = {2023},
  eprint = {2309.10814},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2309.10814v2}
}

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/2309.10814.svg)](https://codeofpaper.com/paper/2309.10814)

Discussion