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

BitsAI-Fix:基于大语言模型的自动化Lint错误修复方法及其工业实践

BitsAI-Fix: LLM-Driven Approach for Automated Lint Error Resolution in Practice

ByteDance(字节跳动);Carnegie Mellon University(卡内基梅隆大学);Zhejiang University(浙江大学)

Yuanpeng Li, Qi Long, Zhiyuan Yao, Jian Xu, Lintao Xie, Xu He, Lu Geng, Xin Han, Yueyan Chen, Wenbo Duan

AI总结:

针对企业代码库lint错误堆积问题,提出基于大语言模型的自动化修复工作流BitsAI-Fix,采用渐进式强化学习与规则奖励机制,在字节跳动部署中服务超5000名工程师,修复准确率约85%。

摘要:

随着企业代码库规模和复杂性的持续增长,lint错误的数量远远超出工程师手动修复的能力,导致技术债务不断累积并阻碍开发效率。本文提出了BitsAI-Fix,一种基于大语言模型(LLM)的自动化lint错误修复工作流,旨在解决工业规模环境中的这一关键挑战。BitsAI-Fix采用tree-sitter进行上下文扩展,并通过专门训练的LLM生成搜索-替换格式的补丁,随后通过lint扫描重新验证以输出最终修复结果。此外,我们的方法引入了一种创新的渐进式强化学习(RL)训练策略,该策略能够在项目冷启动阶段自动获取可验证的训练数据,并通过系统部署后的反馈收集在线样本来持续迭代模型。进一步地,我们设计了一种针对性的基于规则的奖励机制,该机制结合了格式奖励和正确性奖励,同时惩罚冗余修改。我们还提出了一种“代码差异匹配”方法,以持续跟踪在线效果。在字节跳动的生产部署中,我们的解决方案已支持超过5,000名工程师,解决了超过12,000个静态分析问题,实现了约85%的修复准确率,每周约有1,000名活跃使用者。这项工作证明了基于LLM的代码修复解决方案在企业环境中的实际可行性,并为大规模工业场景中的自动化代码修复提供了参考。

英文摘要:

As enterprise codebases continue to grow in scale and complexity, the volume of lint errors far exceeds engineers' manual remediation capacity, leading to continuous accumulation of technical debt and hindered development efficiency. This paper presents BitsAI-Fix, an automated lint error remediation workflow based on Large Language Models (LLMs), designed to address this critical challenge in industrial-scale environments. BitsAI-Fix employs tree-sitter for context expansion and generates search-and-replace format patches through specially trained LLMs, followed by lint scan re-verification to output final remediation results. Additionally, our approach introduces an innovative progressive reinforcement learning (RL) training strategy that can automatically acquire verifiable training data during the project cold-start phase and continuously iterate the model by collecting online samples through feedback after system deployment. Furthermore, we designed a targeted rule-based reward mechanism that combines format rewards and correctness rewards while penalizing redundant modifications. We also propose a "code diff matching" methodology to continuously track online effectiveness. In production deployment at ByteDance, our solution has supported over 5,000 engineers, resolved more than 12,000 static analysis issues, achieved approximately 85% remediation accuracy, with around 1,000 weekly active adopters. This work demonstrates the practical feasibility of LLM-based code remediation solutions in enterprise environments and serves as a reference for automated code fix in large-scale industrial scenarios.

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

↑