arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.15729cs.SEcs.CLcs.LG
收藏

面向 OpenAPI 代码补全的大型语言模型优化

Optimizing Large Language Models for OpenAPI Code Completion

Faculty of Informatics, Kaunas University of Technology(考纳斯理工大学信息学学院)

Bohdan Petryshyn, Mantas Lukoševičius

AI总结:

本文针对 OpenAPI 代码补全任务,利用 Code Llama 开源模型结合提示工程与微调优化,在参数量少 25 倍的情况下比 GitHub Copilot 提升 55.2% 正确率,并改进了代码填充训练技术。

摘要:

大型语言模型(LLMs)的最新进展及其在代码生成任务中的应用,已显著重塑了软件开发领域。尽管代码补全解决方案在主流编程语言中表现出显著效果,但在应用于 OpenAPI 定义等不那么普遍的格式时,其性能有所滞后。本研究评估了流行的商业代码补全工具 GitHub Copilot 的 OpenAPI 补全性能,并提出了一组利用 Meta 开源模型 Code Llama 的针对特定任务的优化方法。本研究提出的语义感知 OpenAPI 补全基准被用于开展一系列实验,通过这些实验分析了各种提示工程和微调技术对 Code Llama 模型性能的影响。经过微调的 Code Llama 模型相较于 GitHub Copilot 达到了最高 55.2% 的正确率提升,尽管其使用的参数量比该商业解决方案底层 Codex 模型少 25 倍。此外,本研究对一种广泛使用的代码填充训练技术提出了改进,解决了当模型接收到的上下文大小小于训练时所用上下文大小时性能不佳的问题。数据集、基准和模型微调代码均已公开提供。

英文摘要:

Recent advancements in Large Language Models (LLMs) and their utilization in code generation tasks have significantly reshaped the field of software development. Despite the remarkable efficacy of code completion solutions in mainstream programming languages, their performance lags when applied to less ubiquitous formats such as OpenAPI definitions. This study evaluates the OpenAPI completion performance of GitHub Copilot, a prevalent commercial code completion tool, and proposes a set of task-specific optimizations leveraging Meta's open-source model Code Llama. A semantics-aware OpenAPI completion benchmark proposed in this research is used to perform a series of experiments through which the impact of various prompt-engineering and fine-tuning techniques on the Code Llama model's performance is analyzed. The fine-tuned Code Llama model reaches a peak correctness improvement of 55.2% over GitHub Copilot despite utilizing 25 times fewer parameters than the commercial solution's underlying Codex model. Additionally, this research proposes an enhancement to a widely used code infilling training technique, addressing the issue of underperformance when the model is prompted with context sizes smaller than those used during training. The dataset, the benchmark, and the model fine-tuning code are made publicly available.

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

↑