MoSE: Hierarchical Self-Distillation Enhances Early Layer Embeddings
Not on the map. Why?
Abstract (arXiv)
Deploying language models often requires navigating accuracy vs. performance trade-offs to meet latency constraints while preserving utility. Traditional model distillation reduces size but incurs substantial costs through training separate models. We introduce ModularStarEncoder (MoSE), a 1-billion-parameter multi-exit encoder for code retrieval and classification that employs a novel Self-Distillation mechanism. This approach significantly enhances lower-layer representations, enabling flexible deployment of different model portions with favorable performance trade-offs. Our architecture improves text-to-code and code-to-code search by targeting specific encoder layers as exit heads, where higher layers guide earlier ones during training, thereby improving intermediate representations at minimal additional cost. We further enhance MoSE with a repository-level contextual loss that maximizes training context window utilization. Additionally, we release a new dataset created through code translation that extends text-to-code benchmarks with cross-language code-to-code pairs. Evaluations demonstrate the effectiveness of Self-Distillation as a principled approach to trading inference cost for accuracy across various code understanding tasks.
Key facts. Cited by 2 papers in the map (data through 7 Oct 2026). Builds on 36 of its 45 references that are in the map. First posted on arXiv 4 Mar 2025.
Builds on
36 of 45 references.
References · 36
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2021Learning Transferable Visual Models From Natural Language Supervisioncited by 33,456
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2020A Simple Framework for Contrastive Learning of Visual Representationscited by 11,979
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,551
- 2018Deep contextualized word representationscited by 2,285
24 more
- 2015Learning both Weights and Connections for Efficient Neural Networkscited by 1,998
- 2017Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inferencecited by 1,548
- 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2019TinyBERT: Distilling BERT for Natural Language Understandingcited by 1,153
- 2024Qwen2.5-Coder Technical Reportcited by 1,151
- 2023StarCoder: may the source be with you!cited by 790
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 638
- 2024DeepSeek LLM: Scaling Open-Source Language Models with Longtermismcited by 621
- 2017BranchyNet: Fast Inference via Early Exiting from Deep Neural Networkscited by 591
- 2024Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inferencecited by 527
- 2024StarCoder 2 and The Stack v2: The Next Generationcited by 484
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2022One Embedder, Any Task: Instruction-Finetuned Text Embeddingscited by 329
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 327
- 2025SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Modelcited by 307
- 2024Extreme Compression of Large Language Models via Additive Quantizationcited by 223
- 2023From Words to Watts: Benchmarking the Energy Costs of Large Language Model Inferencecited by 168
- 2023The geometry of hidden representations of large transformer modelscited by 108
- 2024CoIR: A Comprehensive Benchmark for Code Information Retrieval Modelscited by 59
- 2024Code Representation Learning At Scalecited by 26
- 2023An Empirical Comparison of Pre-Trained Models of Source Codecited by 25
- 2023LEONARDO: A Pan-European Pre-Exascale Supercomputer for HPC and AI Applicationscited by 12
Built on by
Citing papers per year: 2026: 2.
2 papers.