paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Exploring and evaluating personalized models for code generation

探索与评估面向代码生成的个性化模型
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 2/10 · 该论文研究面向代码生成(Java 单元测试)的个性化微调策略(全参数、轻量、前缀微调)及成本权衡,属于提升 LLM 本身能力的模型微调工作,与用户关注的静态分析、Agentic 程序分析、浮点/贝叶斯程序分析及其与 LLM 的交叉均无直接关联。仅在“程序语言+机器学习”的大方向上略有重叠。引用 12 inbox
Andrei Zlotchevski, Dawn Drain, Alexey Svyatkovskiy, Colin B. Clement, Neel Sundaresan, Michele Tufano
crossref: 2026-09-12

AI 速览

一句话:比较全参数、轻量与前缀微调三种个性化策略,在 Java 单元测试生成上权衡性能与计算成本。

大型 Transformer 模型在代码建模中已成为主流,但预训练后微调仍面临泛化挑战。本文探索面向代码生成的模型个性化,在 Java 方法生成单元测试的任务上评估三种个性化微调技术:(i) 全参数自定义微调;(ii) 轻量微调,冻结大部分参数,仅调整 token 嵌入与 softmax 层或仅最后一层;(iii) 前缀微调,保持模型参数冻结,仅优化项目特定的小前缀向量。作者用代码与任务特定指标、训练时间和总计算量比较各策略,分析其在性能与计算成本间的权衡,并讨论不同部署场景下各自的泛化与成本收益。

问题
预训练 Transformer 模型在代码任务上微调后跨项目泛化仍难,需要为特定软件项目定制模型。
方法
在 Java 方法生成单元测试任务上,比较全参数微调、轻量微调(仅 token embedding/softmax 或最后一层)与前缀微调三种个性化技术。
评估
以代码与任务特定指标、训练时间和总计算量评估各策略的性能与成本权衡。
原文摘要(Abstract)

Large Transformer models achieved the state-of-the-art status for Natural Language Understanding tasks and are increasingly becoming the baseline model architecture for modeling source code. Transformers are usually pre-trained on large unsupervised corpora, learning token representations and transformations relevant to modeling generally available text, and are then fine-tuned on a particular downstream task of interest. While fine-tuning is a tried-and-true method for adapting a model to a new domain -- for example, question-answering on a given topic -- generalization remains an on-going challenge. In this paper, we explore and evaluate transformer model fine-tuning for personalization. In the context of generating unit tests for Java methods, we evaluate learning to personalize to a specific software project using several personalization techniques. We consider three key approaches: (i) custom fine-tuning, which allows all the model parameters to be tuned; (ii) lightweight fine-tuning, which freezes most of the model's parameters, allowing tuning of the token embeddings and softmax layer only or the final layer alone; (iii) prefix tuning, which keeps model parameters frozen, but optimizes a small project-specific prefix vector. Each of these techniques offers a trade-off in total compute cost and predictive performance, which we evaluate by code and task-specific metrics, training time, and total computational operations. We compare these fine-tuning strategies for code generation and discuss the potential generalization and cost benefits of each in various deployment scenarios.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@inproceedings{paperbot7039,
  title = {Exploring and evaluating personalized models for code generation},
  author = {Andrei Zlotchevski and Dawn Drain and Alexey Svyatkovskiy and Colin B. Clement and Neel Sundaresan and Michele Tufano},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3558959}
}