mlsanityData to 7 Oct 2026

A Metamorphic Testing Perspective on Knowledge Distillation for Language Models of Code: Does the Student Deeply Mimic the Teacher?

arXiv 2511.05476 ↗First posted 7 Nov 2025cs.SE cs.LGcited by 1

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 62 of its 99 references that are in the map. First posted on arXiv 7 Nov 2025.

Builds on

62 of 99 references.

References · 62

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  4. 2015Distilling the Knowledge in a Neural Networkcited by 10,076
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2017On Calibration of Modern Neural Networkscited by 4,860
  7. 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
  8. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  9. 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,414
  10. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  11. 2019TinyBERT: Distilling BERT for Natural Language Understandingcited by 1,153
  12. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
38 more
  1. 2019Relational Knowledge Distillationcited by 873
  2. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  3. 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
  4. 2019Green AIcited by 620
  5. 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 600
  6. 2019Patient Knowledge Distillation for BERT Model Compressioncited by 502
  7. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
  8. 2020MobileBERT: a Compact Task-Agnostic BERT for Resource-Limited Devicescited by 476
  9. 2013Do Deep Nets Really Need to be Deep?cited by 466
  10. 2020Movement Pruning: Adaptive Sparsity by Fine-Tuningcited by 398
  11. 2023Large Language Models for Software Engineering: A Systematic Literature Reviewcited by 389
  12. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  13. 2020Knowledge Distillation and Student-Teacher Learning for Visual Intelligence: A Review and New Outlookscited by 312
  14. 2019Q8BERT: Quantized 8Bit BERTcited by 296
  15. 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 266
  16. 2023A Survey on Model Compression for Large Language Modelscited by 263
  17. 2020MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformerscited by 240
  18. 2019Machine Learning Testing: Survey, Landscapes and Horizonscited by 213
  19. 2020Compressing BERT: Studying the Effects of Weight Pruning on Transfer Learningcited by 184
  20. 2019Distilling Task-Specific Knowledge from BERT into Simple Neural Networkscited by 152
  21. 2015Compressing Neural Networks with the Hashing Trickcited by 150
  22. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 133
  23. 2019Adversarially Robust Distillationcited by 124
  24. 2020BERT-of-Theseus: Compressing BERT by Progressive Module Replacingcited by 112
  25. 2019Adversarial Robustness vs Model Compression, or Both?cited by 98
  26. 2024MT-Eval: A Multi-Turn Capabilities Evaluation Benchmark for Large Language Modelscited by 78
  27. 2021Revisiting Adversarial Robustness Distillation: Robust Soft Labels Make Student Bettercited by 77
  28. 2022Natural Attack for Pre-trained Models of Codecited by 72
  29. 2023Automatic Semantic Augmentation of Language Model Prompts (for Code Summarization)cited by 72
  30. 2020Metamorphic Testing: A New Approach for Generating Next Test Casescited by 71
  31. 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 68
  32. 2021A Survey on Green Deep Learningcited by 52
  33. 2022A Survey on Model Compression and Acceleration for Pretrained Language Modelscited by 45
  34. 2021Beyond Preserved Accuracy: Evaluating Loyalty and Robustness of BERT Compressioncited by 38
  35. 2023Lion: Adversarial Distillation of Proprietary Large Language Modelscited by 33
  36. 2025Hallucination Detection in Large Language Models with Metamorphic Relationscited by 24
  37. 2022Compressing Pre-trained Models of Code into 3 MBcited by 21
  38. 2023Greening Large Language Models of Codecited by 19

50 most cited of 62 All 62 (JSON)

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.