Skip to main content
QUICK REVIEW

[Paper Review] If LLM Is the Wizard, Then Code Is the Wand: A Survey on How Code Empowers Large Language Models to Serve as Intelligent Agents

Ke Yang, Jiateng Liu|arXiv (Cornell University)|Jan 1, 2024
Topic ModelingComputer Science13 citations
TL;DR

The paper surveys how training LLMs on code and using code-based prompts enable LLMs to act as intelligent agents by improving programming skills, complex reasoning, and interaction with external tools and environments through executable code.

ABSTRACT

The prominent large language models (LLMs) of today differ from past language models not only in size, but also in the fact that they are trained on a combination of natural language and formal language (code). As a medium between humans and computers, code translates high-level goals into executable steps, featuring standard syntax, logical consistency, abstraction, and modularity. In this survey, we present an overview of the various benefits of integrating code into LLMs' training data. Specifically, beyond enhancing LLMs in code generation, we observe that these unique properties of code help (i) unlock the reasoning ability of LLMs, enabling their applications to a range of more complex natural language tasks; (ii) steer LLMs to produce structured and precise intermediate steps, which can then be connected to external execution ends through function calls; and (iii) take advantage of code compilation and execution environment, which also provides diverse feedback for model improvement. In addition, we trace how these profound capabilities of LLMs, brought by code, have led to their emergence as intelligent agents (IAs) in situations where the ability to understand instructions, decompose goals, plan and execute actions, and refine from feedback are crucial to their success on downstream tasks. Finally, we present several key challenges and future directions of empowering LLMs with code.

Motivation & Objective

  • Define code in the context of LLM training and its benefits.
  • Explain how code pre-training and code-based prompting improve reasoning and tool use in LLMs.
  • Survey how LLMs connected to execution environments become intelligent agents (IAs).
  • Identify challenges and future directions for integrating code with LLMs and IAs.

Proposed method

  • Propose a definition of code as a formal, machine-executable and human-interpretable language.
  • Describe code training methods: code pre-training vs. code fine-tuning, and their objective functions.
  • Present a taxonomy of code-enabled benefits: programming skill boost, complex reasoning (CoT and PoT), and structured knowledge capture.
  • Introduce a code-centric paradigm for connecting LLMs to diverse tool ends via generated code or predefined functions.
  • Summarize how code execution environments provide automated, faithful feedback for self-improvement.

Experimental results

Research questions

  • RQ1How does pre-training LLMs on code affect their programming and reasoning abilities?
  • RQ2How does code-based prompting enable LLMs to generate executable steps and interface with external tools?
  • RQ3What roles do code execution environments and feedback play in improving LLM and IA performance?
  • RQ4What are the key challenges and future directions for code-enabled LLMs and intelligent agents?

Key findings

  • Code pre-training on code enhances LLMs’ programming and code-evaluation skills.
  • Code pre-training improves complex reasoning, with program-like thought (PoT) often outperforming chain-of-thought (CoT).
  • Code enables LLMs to capture structured knowledge from graphs, tables, and multimodal data more effectively.
  • A code-centric paradigm facilitates scalable, flexible tool invocation across digital and physical ends via generated code or predefined functions.
  • LLMs in code-enabled environments can receive automated feedback from code execution for self-improvement and better alignment with tasks.
  • The survey highlights challenges and promising directions in making LLMs with code-based IAs more capable and robust.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.