一句话:提出ABC框架,用模型合并实现基础与组合代码风格转换,并发布BCC Style数据集和CS4BLEU指标。
现有基于代码语言模型的代码风格转换通常只处理目标风格遵循单一准则的基础风格,难以应对涉及多重准则的组合风格,限制了其在实际风格指南中的应用。本文提出ABC(Absent-Basis-Combination)框架,通过模型合并提升组合风格转换并克服已有方法局限;实现0.5B、1.3B、1.5B和3B四种规模变体。在基础与组合风格转换上,各规模均持续优于已有方法,性能提升最高达86.70%,即使基线参数量为其三倍仍保持优势。为缓解高质量数据集和评估指标缺乏,作者构建并发布BCC Style数据集,并提出CS4BLEU代码相似度指标,在准确性与一致性上超越现有指标。
Code style transformation models built on code Language Models (code LMs) have achieved remarkable success. However, they typically focus on basis style transformations, where the target style follows a single criterion, and often struggle with combination styles, where the target style involves multiple criteria. In practice, style guides encompass multiple criteria, making the lack of effective combination style transformation a major limitation to their real-world applicability. In this paper, we propose Absent-Basis-Combination (abbreviated as ABC), a novel framework for code style transformation that significantly improves combination style transformation and overcomes the limitations of existing approaches. We implement four variants of ABC with parameter sizes of 0.5B, 1.3B, 1.5B, and 3B, demonstrating consistent superiority over existing approaches across all model sizes in both basis and combination style transformations. Specifically, ABC achieves performance gains of up to 86.70%, and remains superior even when baseline approaches use three times the parameters. Furthermore, to address the lack of high-quality datasets and evaluation metrics, we construct and release a new style transformation dataset, Basis & Combination Code Style (abbreviated as BCC Style ), and introduce Code Sequence, Syntactic, Semantic and Stylistic BLEU (abbreviated as CS4BLEU), a novel code similarity metric that surpasses existing metrics in accuracy and consistency.
@article{paperbot2998,
title = {ABC: Towards a Universal Code Styler through Model Merging},
author = {Yitong Chen and Zhiqiang Gao and Chuanqi Shi and Baixuan Li and Miao Gao},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {OOPSLA2},
year = {2025},
doi = {10.1145/3763104}
}