Skip to main content
QUICK 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 Science被引用 13
一句话总结

本文综述了在代码上训练LLMs并使用基于代码的提示,如何通过可执行代码改进编程技能、复杂推理以及与外部工具和环境的交互,使LLMs能够充当智能代理的方式。

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.

研究动机与目标

  • 在LLM训练的语境下定义代码及其收益。
  • 解释代码预训练和基于代码的提示如何提升LLMs的推理能力和工具使用。
  • 综述连接到执行环境的LLMs如何成为智能代理(IAs)。
  • 明确将代码与LLMs和IAs集成时的挑战与未来方向。

提出的方法

  • 提出将代码定义为正式、机器可执行且人类可解释的语言。
  • 描述代码训练方法:代码预训练与代码微调及其目标函数。
  • 给出代码驱动的收益分类:编程技能提升、复杂推理(CoT 与 PoT)以及结构化知识捕获。
  • 引入以代码为核心的范式,通过生成的代码或预定义函数将LLMs与多样化工具端连接。
  • 总结代码执行环境如何提供自动化、可靠的反馈以实现自我改进。

实验结果

研究问题

  • RQ1在代码上对LLMs进行预训练如何影响其编程和推理能力?
  • RQ2基于代码的提示如何使LLMs生成可执行步骤并与外部工具接口?
  • RQ3代码执行环境和反馈在提升LLM与IA性能方面扮演什么角色?
  • RQ4面向代码使能的LLM与智能代理的关键挑战与未来方向是什么?

主要发现

  • 在代码上的代码预训练提升了LLMs的编程能力和代码评估技能。
  • 代码预训练提升了复杂推理,程序化思维(PoT)常常优于分步思考(CoT)。
  • 代码使LLMs能够更有效地从图、表和多模态数据中捕获结构化知识。
  • 以代码为中心的范式通过生成的代码或预定义函数实现跨数字及物理端的可扩展、灵活的工具调用。
  • 在代码使能环境中的LLMs可以从代码执行中获得自动反馈,以实现自我改进并更好地与任务对齐。
  • 该综述强调在使LLMs具备基于代码的智能代理方面提高能力与鲁棒性的挑战与有前景的方向。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。