paperbot · PL 论文追踪

全部论文 待读 收藏

P2 The EarlyBIRD Catches the Bug: On Exploiting Early Layers of Encoder Models for More Efficient Code Classification

早起的鸟儿有虫吃:利用编码器模型早期层实现更高效的代码分类
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 2/10 · 该论文关注利用预训练编码器早期层提升代码分类(如缺陷检测)的效率,属于 ML4Code/NLP for SE,而非用户核心关注的静态分析在 ML/Agent 程序中的应用、LLM/Agent 改进静态分析与形式化验证、浮点程序分析或贝叶斯程序分析。其方法与目标均不直接匹配研究画像。引用 17 inbox
Anastasiia Grishina, Max Hort, Leon Moonen
crossref: 2026-09-12dblp: 2026-09-12arxiv: 2026-09-12

AI 速览

一句话:提出 EarlyBIRD,用预训练 Transformer 早期层构建代码复合表示,在不增加资源下提升缺陷检测效率与精度。

深度 NLP 模型在漏洞检测、类型推断等软件工程任务上效果显著,但训练和微调开销大。本文提出通用方法 EarlyBIRD,从预训练 Transformer(以 CodeBERT 为例)的早期层提取表示,并组合成代码的复合表示,从而更充分地利用已有资源与信息。作者系统比较了 12 种复合表示构建策略与仅使用最后一层编码器的标准做法,在四个数据集上评估缺陷检测与多分类性能。结果显示,多种早期层组合在缺陷检测上优于基线,部分组合也提升多分类表现:仅用 CodeBERT 12 层中的 3 层,Devign 上的检测准确率平均提升 2 个百分点,微调速度提升 3.3 倍。这表明早期层可在同等资源下取得更好结果,也可显著降低微调与推理开销。

问题
预训练语言模型用于代码分类任务时资源开销大,而标准做法只用最后一层编码器,可能浪费了早期层中蕴含的有用信息。
方法
提出 EarlyBIRD,从预训练 Transformer(CodeBERT)的早期层提取特征并构建复合表示,比较 12 种组合策略与仅用最后一层的基线。
评估
在四个数据集上评估缺陷检测与多分类任务,报告准确率变化与微调加速比,如 Devign 上用 3/12 层取得 +2 准确率与 3.3 倍微调加速。
原文摘要(Abstract)

The use of modern Natural Language Processing (NLP) techniques has shown to be beneficial for software engineering tasks, such as vulnerability detection and type inference. However, training deep NLP models requires significant computational resources. This paper explores techniques that aim at achieving the best usage of resources and available information in these models. We propose a generic approach, EarlyBIRD, to build composite representations of code from the early layers of a pre-trained transformer model. We empirically investigate the viability of this approach on the CodeBERT model by comparing the performance of 12 strategies for creating composite representations with the standard practice of only using the last encoder layer. Our evaluation on four datasets shows that several early layer combinations yield better performance on defect detection, and some combinations improve multi-class classification. More specifically, we obtain a +2 average improvement of detection accuracy on Devign with only 3 out of 12 layers of CodeBERT and a 3.3x speed-up of fine-tuning. These findings show that early layers can be used to obtain better results using the same resources, as well as to reduce resource usage during fine-tuning and inference.

链接与引用

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

BibTeX
@inproceedings{abs-2305-04940,
  title = {The EarlyBIRD Catches the Bug: On Exploiting Early Layers of Encoder Models for More Efficient Code Classification},
  author = {Anastasiia Grishina and Max Hort and Leon Moonen},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3616304}
}