Code Prompting: a Neural Symbolic Method for Complex Reasoning in Large Language Models

Yi Hu, Haotong Yang, Zhouchen Lin, Muhan Zhang
5/29/2023
cs.CLcs.AI

No confident code implementation found for this paper. 8 possible matches can be shown below.

Abstract

Large language models (LLMs) have scaled up to unlock a wide range of complex reasoning tasks with the aid of various prompting methods. However, current prompting methods generate natural language intermediate steps to help reasoning, which can cause imperfect task reduction and confusion. To mitigate such limitations, we explore code prompting, a neural symbolic prompting method with both zero-shot and few-shot versions which triggers code as intermediate steps. We conduct experiments on 7 widely-used benchmarks involving symbolic reasoning and arithmetic reasoning. Code prompting generally outperforms chain-of-thought (CoT) prompting. To further understand the performance and limitations of code prompting, we perform extensive ablation studies and error analyses, and identify several exclusive advantages of using symbolic promptings compared to natural language. We also consider the ensemble of code prompting and CoT prompting to combine the strengths of both. Finally, we show through experiments how code annotations and their locations affect code prompting.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 8 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{hu2023code,
  title  = {Code Prompting: a Neural Symbolic Method for Complex Reasoning in Large Language Models},
  author = {Yi Hu and Haotong Yang and Zhouchen Lin and Muhan Zhang},
  year   = {2023},
  eprint = {2305.18507},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.18507v2}
}

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

Discussion