Are Intermediate Layers and Labels Really Necessary? A General Language Model Distillation Method

Shicheng Tan, Weng Lam Tam, Yuanchun Wang, Wenwen Gong, Shu Zhao, Peng Zhang, Jie Tang

Abstract

As Large Language Models (LLMs) continue to scale, the computational costs associated with their deployment on edge devices have become a significant barrier. Knowledge Distillation (KD) offers a path toward model compression, yet traditional methods are often hampered by structural constraints, heavy reliance on labeled data, and vocabulary-induced parameter bloat. This paper presents GLMD (General Language Model Distillation), a novel approach that simplifies the distillation process by focusing on two-stage word prediction and vocabulary compression. By prioritizing output logit matching over complex intermediate layer alignment, GLMD achieves state-of-the-art results on the SuperGLUE benchmark, demonstrating that effective distillation can be both architecture-agnostic and label-free.

Introduction

The rapid evolution of LLMs has revolutionized natural language processing, but their massive parameter counts make real-time inference on resource-constrained hardware nearly impossible. Knowledge Distillation—a technique where a smaller "student" model is trained to mimic a larger "teacher"—has emerged as a primary solution. However, the current landscape of KD is fraught with three primary challenges:

  1. Structural Constraints: Many methods require the student and teacher to share identical hidden dimensions or layer counts to facilitate intermediate feature matching.
  2. Data Dependency: High-quality "hard labels" (ground truth) are often required, making distillation expensive and dependent on curated datasets.
  3. Vocabulary Bloat: While many methods compress hidden layers, they often ignore the vocabulary embedding matrix, which can constitute a disproportionate share of the total model size.

GLMD addresses these issues by introducing a "less is more" philosophy, proving that neither intermediate layer matching nor labeled datasets are strictly necessary for high-performance compression.

Methodology

GLMD is built upon two core innovations: a simplified two-stage distillation objective and a strategic vocabulary compression mechanism.

Two-Stage Word Prediction Distillation

Unlike conventional KD methods that force the student to replicate the teacher's internal hidden states, GLMD focuses exclusively on the output distribution. This makes the process entirely architecture-agnostic.

  • Pre-training Stage: The student is trained to match the teacher’s word prediction logits across a massive corpus. A key differentiator here is the distillation of both masked and unmasked tokens. While standard training focuses on predicting missing words, GLMD leverages the teacher's predictions for unmasked tokens to provide a richer, more consistent signal of the teacher's internal knowledge.
  • Fine-tuning Stage: During task-specific training, the student continues to distill word prediction logits while simultaneously learning from the teacher's "soft labels" (the probability distribution over classes). This eliminates the need for traditional intermediate loss ($L_{inter}$) and hard label loss ($L_{hard}$).

Vocabulary Compression via Semantic Mapping

Rather than reducing the dimensionality of embeddings (which often requires complex projection layers), GLMD reduces the number of tokens in the vocabulary. Recognizing that word frequency follows a long-tail distribution, the authors map low-frequency, rare tokens to their most semantically similar high-frequency counterparts using the teacher’s embedding weights. This strategy exploits natural linguistic redundancy to reduce parameter counts with minimal impact on performance.

Experimental Setup

The researchers evaluated GLMD using the following framework:

  • Data: Pre-training was conducted on BooksCorpus and English Wikipedia (19GB total).
  • Evaluation: The SuperGLUE benchmark served as the primary testing ground, encompassing eight diverse tasks including ReCoRD, COPA, and BoolQ.
  • Baselines: GLMD was compared against 25 state-of-the-art methods, including TinyBERT, DistilBERT, MobileBERT, and MiniLM.

Key Insights and Results

Spontaneous Feature Alignment

One of the most significant findings of this research is that explicit intermediate layer matching is redundant. The authors observed that by simply matching output logits, the student spontaneously learns internal representations that correlate highly with the teacher's states. Spearman correlation analysis confirmed that the student's internal "thought process" aligns with the teacher's even without direct supervision of those layers.

Performance and Scaling

GLMD consistently outperformed existing baselines. On the SuperGLUE benchmark, it achieved the highest average scores across multiple model scales, surpassing TinyBERT by up to 3%. More impressively, the method demonstrated exceptional scalability: the authors successfully distilled a 10B-parameter teacher into a 2B-parameter student. This 2B student achieved an 84.76% average score on SuperGLUE, a massive improvement over the 65.09% achieved by TinyBERT at the same scale.

Efficiency

The vocabulary compression strategy proved more efficient than traditional dimensionality reduction. By mapping rare tokens rather than shrinking the entire embedding space, GLMD maintained higher accuracy than specialized models like ALBERT or MobileBERT while significantly reducing the model's memory footprint.

Conclusion and Future Work

GLMD demonstrates that the complexity of modern distillation—specifically the reliance on intermediate layers and labeled data—can be significantly reduced without sacrificing performance. By focusing on output consistency and smart vocabulary management, GLMD provides a robust, architecture-agnostic framework for LLM compression.

While the current study focused on the GLM architecture, future work will involve validating the method on other popular architectures such as Llama and Mistral. Additionally, the researchers aim to scale the distillation process to models exceeding 100B parameters, further pushing the boundaries of what is possible for edge-device AI.

Summary updated

BibTeX
@inproceedings{tan2023are,
  author = {Shicheng Tan and Weng Lam Tam and Yuanchun Wang and Wenwen Gong and Shu Zhao and Peng Zhang and Jie Tang},
  title = {{Are Intermediate Layers and Labels Really Necessary? A General Language Model Distillation Method}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.614},
}
Figure