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

基于基础目标的链式:连接面向过程与面向目标的代码生成提示

Chain of Grounded Objectives: Bridging Process and Goal-oriented Prompting for Code Generation

Electronics and Telecommunications Research Institute(电子电信研究院);Department of Computer Science and Engineering, Seoul National University(计算机科学与工程系,首尔国立大学)

Sangyeop Yeo, Seung-won Hwang, Yu-Seung Ma

AI总结:

本文提出基础目标链(CGO)方法,通过将功能目标嵌入输入提示并避免显式顺序过程,有效适应编程任务的结构化特性,从而提升LLM代码生成质量并克服现有顺序推理策略的局限。

摘要:

近年来,将大型语言模型(LLMs)用于代码生成引起了广泛关注。现有方法通常通过在输入提示中引入额外的上下文信息或指导来提升生成代码的质量。许多此类方法采用顺序推理策略,模仿人类逐步思考的方式。然而,这种策略可能会限制灵活性,因为它们并不总是与编程语言的结构化特征相一致。本文提出了基础目标链(CGO)方法,该方法将功能目标嵌入输入提示中以增强代码生成。通过利用适当结构化的目标作为输入并避免显式的顺序过程,CGO能够有效适应编程任务的结构化特性。实证评估表明,CGO有效提升了代码生成质量,解决了现有方法的局限性。

英文摘要:

The use of Large Language Models (LLMs) for code generation has gained significant attention in recent years. Existing methods often aim to improve the quality of generated code by incorporating additional contextual information or guidance into input prompts. Many of these approaches adopt sequential reasoning strategies, mimicking human-like step-by-step thinking. However, such strategies may constrain flexibility, as they do not always align with the structured characteristics of programming languages. This paper introduces the Chain of Grounded Objectives (CGO), a method that embeds functional objectives into input prompts to enhance code generation. By leveraging appropriately structured objectives as input and avoiding explicit sequential procedures, CGO adapts effectively to the structured nature of programming tasks. Empirical evaluations demonstrate that CGO effectively enhances code generation, addressing limitations of existing approaches.

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

↑