Compressing Pre-trained Models of Code into 3 MB
Jieke Shi, Zhou Yang, Bowen Xu, Hong Jin Kang, David Lo

TL;DR
This paper introduces Compressor, a novel method that compresses large pre-trained code models into extremely small 3 MB models with minimal performance loss, enabling efficient deployment on personal devices.
Contribution
The paper presents a genetic algorithm-based approach combined with knowledge distillation to significantly reduce model size while maintaining performance.
Findings
Compressed models are over 160 times smaller than original models.
Compressed models are over 4 times faster at inference.
Performance degradation is negligible after compression.
Abstract
Although large pre-trained models of code have delivered significant advancements in various code processing tasks, there is an impediment to the wide and fluent adoption of these powerful models in software developers' daily workflow: these large models consume hundreds of megabytes of memory and run slowly on personal devices, which causes problems in model deployment and greatly degrades the user experience. It motivates us to propose Compressor, a novel approach that can compress the pre-trained models of code into extremely small models with negligible performance sacrifice. Our proposed method formulates the design of tiny models as simplifying the pre-trained model architecture: searching for a significantly smaller model that follows an architectural design similar to the original pre-trained model. Compressor proposes a genetic algorithm (GA)-based strategy to guide the…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
- 🤗jiekeshi/CodeBERT-3MB-Vulnerability-Predictionmodel
- 🤗jiekeshi/CodeBERT-3MB-Clone-Detectionmodel
- 🤗jiekeshi/CodeBERT-25MB-Vulnerability-Predictionmodel· ♡ 1♡ 1
- 🤗jiekeshi/CodeBERT-50MB-Vulnerability-Predictionmodel· ♡ 2♡ 2
- 🤗jiekeshi/CodeBERT-25MB-Clone-Detectionmodel
- 🤗jiekeshi/CodeBERT-50MB-Clone-Detectionmodel
- 🤗jiekeshi/GraphCodeBERT-3MB-Clone-Detectionmodel
- 🤗jiekeshi/GraphCodeBERT-25MB-Clone-Detectionmodel
- 🤗jiekeshi/GraphCodeBERT-50MB-Clone-Detectionmodel
- 🤗jiekeshi/GraphCodeBERT-50MB-Vulnerability-Predictionmodel
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software System Performance and Reliability · Software Testing and Debugging Techniques
