Transformer-based language models of code have achieved state-of-the-art performance across a wide range of software analytics tasks, but their practical deployment remains limited due to high computational costs, slow inference speeds, and significant environmental impact. To address these challenges, recent research has increasingly explored knowledge distillation as a method for compressing a large language model of code (the teacher) into a smaller model (the student) while maintaining performance. However, the degree to which a student model deeply mimics the predictive behavior and internal representations of its teacher remains largely unexplored, as current accuracy-based evaluation provides only a surface-level view of model quality and often fails to capture more profound discrepancies in behavioral fidelity between the teacher and student models. To address this gap, we empirically show that the student model often fails to deeply mimic the teacher model, resulting in up to 285% greater performance drop under adversarial attacks, which is not captured by traditional accuracy-based evaluation. Therefore, we propose MetaCompress, a metamorphic testing framework that systematically evaluates behavioral fidelity by comparing the outputs of teacher and student models under a set of behavior-preserving metamorphic relations. We evaluate MetaCompress on two widely studied tasks, using compressed versions of popular language models of code, obtained via three different knowledge distillation techniques: Compressor, AVATAR, and MORPH. The results show that MetaCompress identifies up to 62% behavioral discrepancies in student models, underscoring the need for behavioral fidelity evaluation within the knowledge distillation pipeline and establishing MetaCompress as a practical framework for testing compressed language models of code derived through knowledge distillation.


翻译:基于Transformer的代码语言模型在各类软件分析任务中均取得了最先进的性能,但其实际部署仍因高计算成本、缓慢推理速度和显著环境影响而受限。为应对这些挑战,近年来研究逐渐探索将知识蒸馏作为压缩大型代码语言模型(教师模型)为小型模型(学生模型)的方法,同时保持模型性能。然而,学生模型在多大程度上深度模仿了教师模型的预测行为和内部表征仍鲜有探讨——当前基于准确率的评估仅提供模型质量的表层视角,往往无法捕捉教师与学生模型间行为保真度的深层差异。为弥补这一空白,我们通过实验证明:学生模型常未能深度模仿教师模型,在对抗性攻击下其性能下降幅度高达285%,但传统准确率评估无法捕捉这一现象。为此,我们提出MetaCompress——一个通过比较教师与学生模型在行为保留蜕变关系下的输出来系统性评估行为保真度的蜕变测试框架。我们基于两种广泛研究的任务,采用三种不同知识蒸馏技术(Compressor、AVATAR和MORPH)获得的压缩版流行代码语言模型来评估MetaCompress。结果表明,MetaCompress能识别出学生模型中高达62%的行为差异,这凸显了在知识蒸馏流程中纳入行为保真度评估的必要性,并使MetaCompress成为测试由知识蒸馏生成的压缩代码语言模型的实用框架。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
大语言模型同策略蒸馏研究综述
专知会员服务
20+阅读 · 4月5日
基于大语言模型的时序知识图谱推理模型蒸馏方法
专知会员服务
38+阅读 · 2025年1月10日
大型语言模型的知识蒸馏综述:方法、评估与应用
专知会员服务
79+阅读 · 2024年7月4日
《大型语言模型代码生成》综述
专知会员服务
70+阅读 · 2024年6月4日
大型语言模型的模型压缩与高效推理:综述
专知会员服务
94+阅读 · 2024年2月17日
【Tutorial】计算机视觉中的Transformer,98页ppt
专知
21+阅读 · 2021年10月25日
模型压缩 | 知识蒸馏经典解读
AINLP
11+阅读 · 2020年5月31日
绝对干货!NLP预训练模型:从transformer到albert
新智元
13+阅读 · 2019年11月10日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
VIP会员
最新内容
综述 | 3D场景图:开放挑战与未来方向
专知会员服务
1+阅读 · 今天15:00
21世纪的无人机战争
专知会员服务
2+阅读 · 今天14:05
《量子技术的军事任务技术适配与利用》
专知会员服务
2+阅读 · 今天13:51
美国从乌克兰无人机战争中学习经验
专知会员服务
7+阅读 · 6月21日
ICML 2026 | 面向视觉语言模型的语义鲁棒性认证
专知会员服务
5+阅读 · 6月21日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
3+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员