Contrastive Distillation on Intermediate Representations for Language Model Compression
Siqi Sun, Zhe Gan, Yuwei Fang, Yu Cheng, Shuohang Wang, Jingjing Liu
Abstract
Existing language model compression methods mostly use a simple L 2 loss to distill knowledge in the intermediate representations of a large BERT model to a smaller one. Although widely used, this objective by design assumes that all the dimensions of hidden representations are independent, failing to capture important structural knowledge in the intermediate layers of the teacher network. To achieve better distillation efficacy, we propose Contrastive Distillation on Intermediate Representations (CODIR), a principled knowledge distillation framework where the student is trained to distill knowledge through intermediate layers of the teacher via a contrastive objective. By learning to distinguish positive sample from a large set of negative samples, CoDIR facilitates the student's exploitation of rich information in teacher's hidden layers. CoDIR can be readily applied to compress large-scale language models in both pretraining and finetuning stages, and achieves superb performance on the GLUE benchmark, outperforming state-of-the-art compression methods. 1
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
29 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- TinyBERT: Distilling BERT for Natural Language Understanding cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- Compression of Generative Pre-trained Language Models via Quantization cites TinyBERT: Distilling BERT for Natural Language Understanding
- Compression of Generative Pre-trained Language Models via Quantization cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- Compression of Generative Pre-trained Language Models via Quantization cites A Simple Framework for Contrastive Learning of Visual Representations
- Supervised Contrastive Learning cites A Simple Framework for Contrastive Learning of Visual Representations
- Less is More: Task-aware Layer-wise Distillation for Language Model Compression cites TinyBERT: Distilling BERT for Natural Language Understanding
- LLM-Pruner: On the Structural Pruning of Large Language Models cites TinyBERT: Distilling BERT for Natural Language Understanding
- LLM-Pruner: On the Structural Pruning of Large Language Models cites ALBERT: A Lite BERT for Self-supervised Learning of Language Representations
- Compressing Visual-linguistic Model via Knowledge Distillation cites TinyBERT: Distilling BERT for Natural Language Understanding
Cited by top-tier papers29
- LLM-Pruner: On the Structural Pruning of Large Language ModelsXinyin Ma, Gongfan Fang, Xinchao WangNeurIPS 2023 · 994 citations
- LoSparse: Structured Compression of Large Language Models based on Low-Rank and Sparse ApproximationYixiao Li, Yifan Yu, Qingru Zhang, Chen Liang et al.ICML 2023 · 125 citations
- Compressing Visual-linguistic Model via Knowledge DistillationZhiyuan Fang, Jianfeng Wang, Xiaowei Hu, Lijuan Wang et al.ICCV 2021 · 121 citations
- Compression of Generative Pre-trained Language Models via QuantizationChaofan Tao, Lu Hou, Wei Zhang, Lifeng Shang et al.ACL 2022 · 119 citations
- Less is More: Task-aware Layer-wise Distillation for Language Model CompressionChen Liang, Simiao Zuo, Qingru Zhang, Pengcheng He et al.ICML 2023 · 119 citations
Builds on13
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- ALBERT: A Lite BERT for Self-supervised Learning of Language RepresentationsZhenzhong Lan, Mingda Chen, Sebastian Goodman, Kevin Gimpel et al.ICLR 2020 · 7,418 citations
- Supervised Contrastive LearningPrannay Khosla, Piotr Teterwak, Chen Wang, Aaron Sarna et al.NeurIPS 2020 · 7,049 citations
- Reformer: The Efficient TransformerNikita Kitaev, Lukasz Kaiser, Anselm LevskayaICLR 2020 · 2,878 citations
- TinyBERT: Distilling BERT for Natural Language UnderstandingXiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang et al.EMNLP Findings 2020 · 1,787 citations
Related papers
- Intermediate Layer Distillation with the Reused Teacher Classifier: A Study on the Importance of the Classifier of Attention-based ModelsHang Zhang, Seyyed Hasan Mozafari, James J. Clark, Brett H. Meyer et al.EMNLP Findings 2024
- Adaptive Contrastive Knowledge Distillation for BERT CompressionJinyang Guo, Jiaheng Liu, Zining Wang, Yuqing Ma et al.ACL Findings 2023 · 11 citations
- Maximizing the Effectiveness of Larger BERT Models for CompressionWen-Shu Fan, Su Lu, Shangyu Xing, Xin-Chun Li et al.ACL 2025
- Contrastive Representation DistillationYonglong Tian, Dilip Krishnan, Phillip IsolaICLR 2020 · 1,305 citations
- One Teacher is Enough? Pre-trained Language Model Distillation from Multiple TeachersChuhan Wu, Fangzhao Wu, Yongfeng HuangACL Findings 2021 · 47 citations
