一句话:提出基于LLM的自动化lint修复工作流,结合渐进式强化学习与规则奖励,在字节跳动大规模落地并达到约85%修复准确率。
随着企业代码库规模与复杂度增长,lint错误数量远超工程师手工修复能力,导致技术债累积与开发效率下降。本文提出BitsAI-Fix,一个面向工业级环境的基于大语言模型(LLM)的自动化lint错误修复工作流。该方法使用tree-sitter进行上下文扩展,由专门训练的LLM生成search-and-replace格式补丁,并通过lint扫描重验证输出最终修复结果。训练方面,作者提出渐进式强化学习策略:在项目冷启动阶段自动获取可验证训练数据,系统部署后通过反馈收集在线样本持续迭代模型;同时设计规则化奖励机制,结合格式奖励与正确性奖励,并对冗余修改进行惩罚。此外提出“代码差异匹配”方法持续追踪线上效果。在字节跳动的生产部署中,该方案支持超过5000名工程师,修复超过12000个静态分析问题,修复准确率约85%,每周约1000名活跃使用者,验证了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.
DOI 原文 ·
@inproceedings{paperbot9467,
title = {BitsAI-Fix: LLM-Driven Approach for Automated Lint Error Resolution in Practice},
author = {Yuanpeng Li and Qi Long and Zhiyuan Yao and Jian Xu and Lintao Xie and Xu He and Lu Geng and Xin Han and Yueyan Chen and Wenbo Duan},
booktitle = {ASE},
year = {2025},
doi = {10.1109/ase63991.2025.00288}
}