arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2501.06625cs.AI
收藏

大语言模型引导式代码生成:面向复杂代码任务的多智能体框架

Guided Code Generation with LLMs: A Multi-Agent Framework for Complex Code Tasks

Egypt-Japan University of Science and Technology(埃及-日本科学技术大学);Alexandria University(亚历山大大学)

Amr Almorsi, Mohanned Ahmed, Walid Gomaa

AI总结:

针对大语言模型在复杂长上下文编程任务中组合推理能力不足的问题,提出一种结构化细粒度的多智能体引导式代码生成框架,结合HumanEval基准的实验验证其较单轮生成准确率提升23.79%,提升了大模型在软件开发中的实用价值。

摘要:

大语言模型(LLMs)在代码生成任务中展现出卓越能力,但在处理复杂的长上下文编程挑战、展现复杂组合推理能力方面仍存在显著局限。本文提出一种用于“引导式代码生成”的新型智能体框架,通过针对代码生成任务的精心结构化、细粒度方法来解决上述局限。该框架发挥了LLMs作为模糊搜索器和近似信息检索器的优势,同时弥补了其在长序列推理与长上下文理解上的短板。使用OpenAI的HumanEval基准、Meta的Llama 3.1 8B模型(int4精度)开展的实证评估显示,与直接单轮生成相比,该方法的求解准确率提升了23.79%。研究结果表明,结构化的引导式代码生成方法可显著提升LLMs在软件开发中的实用价值,同时克服其在组合推理和上下文处理方面的固有局限。

英文摘要:

Large Language Models (LLMs) have shown remarkable capabilities in code generation tasks, yet they face significant limitations in handling complex, long-context programming challenges and demonstrating complex compositional reasoning abilities. This paper introduces a novel agentic framework for ``guided code generation'' that tries to address these limitations through a deliberately structured, fine-grained approach to code generation tasks. Our framework leverages LLMs' strengths as fuzzy searchers and approximate information retrievers while mitigating their weaknesses in long sequential reasoning and long-context understanding. Empirical evaluation using OpenAI's HumanEval benchmark with Meta's Llama 3.1 8B model (int4 precision) demonstrates a 23.79\% improvement in solution accuracy compared to direct one-shot generation. Our results indicate that structured, guided approaches to code generation can significantly enhance the practical utility of LLMs in software development while overcoming their inherent limitations in compositional reasoning and context handling.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑