Skip to main content
QUICK REVIEW

[论文解读] Lemur: Harmonizing Natural Language and Code for Language Agents

Yiheng Xu, Hongjin Su|arXiv (Cornell University)|Oct 10, 2023
Topic Modeling被引用 6
一句话总结

Lemur 和 Lemur-Chat 是在代码密集型语料上预训练并微调以遵循指令的开源语言模型,在自然语言和代码生成方面均实现了最先进的均衡性能。它们在 13 个智能体基准测试中超越了现有开源模型,通过协调语言与代码能力,显著缩小了与专有模型在智能体推理、工具使用和环境定位方面的差距。

ABSTRACT

We introduce Lemur and Lemur-Chat, openly accessible language models optimized for both natural language and coding capabilities to serve as the backbone of versatile language agents. The evolution from language chat models to functional language agents demands that models not only master human interaction, reasoning, and planning but also ensure grounding in the relevant environments. This calls for a harmonious blend of language and coding capabilities in the models. Lemur and Lemur-Chat are proposed to address this necessity, demonstrating balanced proficiencies in both domains, unlike existing open-source models that tend to specialize in either. Through meticulous pre-training using a code-intensive corpus and instruction fine-tuning on text and code data, our models achieve state-of-the-art averaged performance across diverse text and coding benchmarks among open-source models. Comprehensive experiments demonstrate Lemur's superiority over existing open-source models and its proficiency across various agent tasks involving human communication, tool usage, and interaction under fully- and partially- observable environments. The harmonization between natural and programming languages enables Lemur-Chat to significantly narrow the gap with proprietary models on agent abilities, providing key insights into developing advanced open-source agents adept at reasoning, planning, and operating seamlessly across environments. https://github.com/OpenLemur/Lemur

研究动机与目标

  • 为解决现有开源大语言模型在自然语言或代码方面专精但能力失衡的问题,开发一种具备协调能力的模型。
  • 通过整合语言与代码能力,使语言智能体能够在复杂、部分可观测的环境中有效推理、规划并执行任务。
  • 缩小开源模型与专有模型在涉及工具使用、环境反馈和多步规划的智能体任务中的性能差距。
  • 开发一个在文本和代码基准测试中均表现出色的基础模型,同时支持交互式、基于环境的智能体行为。
  • 提供一个公开可用、功能多样的语言模型,支持在网页交互、机器人技术和数据科学等现实世界智能体应用中使用。

提出的方法

  • 在包含 900 亿 token 的代码导向语料上进行预训练,该语料来自 The Stack,文本与代码比例为 10:1,以增强代码生成能力,同时保持自然语言质量。
  • 使用约 30 万条多样化示例(结合文本与代码任务)进行指令微调,构建指令遵循模型,最终形成 Lemur-Chat。
  • 设计一个全面的智能体评估套件,涵盖完全可观测与部分可观测环境下的推理、代码生成、工具使用和环境交互。
  • 在 8 个标准基准测试(如 HumanEval、GSM8K、MMLU、Spider、DS-1000)和 13 个智能体专用基准测试(包括 WebArena、ALFWorld 和 InterCode)上评估模型。
  • 采用与官方基准一致的零样本和少样本提示协议,确保比较的公平性与可复现性。
  • 在智能体评估中整合环境反馈与人类反馈,以评估模型在真实场景中的鲁棒性与适应能力。

实验结果

研究问题

  • RQ1单一开源语言模型能否在自然语言和代码生成基准测试中均实现最先进性能?
  • RQ2语言与代码能力的协调如何提升智能体在复杂交互环境中的表现?
  • RQ3开源模型在智能体推理、工具使用和环境定位方面,能在多大程度上匹配 GPT-4 等专有模型?
  • RQ4代码密集型预训练对大语言模型在文本与代码能力之间实现平衡有何影响?
  • RQ5具备均衡能力的模型在需要迭代信息收集与计划调整的部分可观测环境中,表现如何?

主要发现

  • Lemur-Chat 在 13 个智能体基准测试中的 12 个上超越所有其他开源模型,证明其在真实场景中具备卓越的智能体能力。
  • 在开源模型中,Lemur-Chat 在 8 个标准文本与代码基准测试的平均性能达到最先进水平,证实其能力的均衡性。
  • 在涉及工具使用(如网页浏览和操作系统交互)的智能体任务中,Lemur-Chat 显著优于 Llama-2-70B-Chat 等模型,尤其在复杂、高动作空间环境中表现更优。
  • 自然语言与代码能力的整合使 Lemur-Chat 能够生成有效且可执行的动作,并通过反馈实现错误恢复,表现优于编码能力较弱的模型。
  • Lemur-Chat 显著缩小了与 GPT-4 等专有模型在智能体能力方面的差距,尤其在推理、规划和环境定位方面。
  • 在 CTF 和机器人推理等多步任务中,模型展现出强大的泛化能力,这些任务对模块化规划与错误回溯能力要求较高。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。