PortGPT:利用大型语言模型实现自动化补丁回溯移植
PortGPT: Towards Automated Backporting Using Large Language Models
AI总结:
本文提出PORTGPT,一个基于大型语言模型的智能体,通过工具增强实现端到端自动化补丁回溯移植,在现有及复杂数据集上取得领先成功率,并向Linux内核贡献了9个已合并的补丁。
摘要:
补丁回溯移植,即将主线安全补丁迁移到旧版本分支的过程,是维护流行开源项目(如Linux内核)中的一项基本任务。然而,手动回溯移植可能耗费大量人力,而现有的自动化方法严重依赖预定义的语法或语义规则,往往难以灵活应对复杂补丁。在本文中,我们介绍了PORTGPT,一个用于在真实场景中端到端自动化补丁回溯移植的LLM智能体。PORTGPT通过工具增强LLM,使其能够按需访问代码、总结Git历史,并根据反馈(例如来自编译器的反馈)自主修订补丁,从而模拟类似人类的推理和验证过程。PORTGPT在现有数据集(1815个案例)上达到了89.15%的成功率,在我们自有的146个复杂案例数据集上达到了62.33%的成功率,均优于最先进的回溯移植工具。我们向Linux内核社区贡献了9个由PORTGPT生成的回溯移植补丁,所有补丁现已合并。
英文摘要:
Patch backporting, the process of migrating mainline security patches to older branches, is an essential task in maintaining popular open-source projects (e.g., Linux kernel). However, manual backporting can be labor-intensive, while existing automated methods, which heavily rely on predefined syntax or semantic rules, often lack agility for complex patches. In this paper, we introduce PORTGPT, an LLM-agent for end-to-end automation of patch backporting in real-world scenarios. PORTGPT enhances an LLM with tools to access code on-demand, summarize Git history, and revise patches autonomously based on feedback (e.g., from compilers), hence, simulating human-like reasoning and verification. PORTGPT achieved an 89.15% success rate on existing datasets (1815 cases), and 62.33% on our own dataset of 146 complex cases, both outperforms state-of-the-art of backporting tools. We contributed 9 backported patches from PORTGPT to the Linux kernel community and all patches are now merged.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。