Abstract
Large-scale pre-trained language models (PLMs) have set new benchmarks in natural language processing but remain computationally prohibitive for deployment on resource-constrained devices. This paper presents Multi-Granularity Structural Knowledge Distillation (MGSKD), a framework designed to compress these models by transferring complex structural relationships from a teacher to a student. By capturing interactions across tokens, spans, and samples, MGSKD enables a 14-million parameter model to achieve performance parity with BERT-base while delivering a 9.4x speedup.
Introduction
The success of models like BERT and ELECTRA comes at the cost of massive parameter counts, making them impractical for edge computing. Knowledge Distillation (KD) typically addresses this by training a smaller "student" model to mimic a "teacher." However, conventional KD often suffers from two limitations: it focuses on a single granularity (usually tokens or full samples) and relies on rigid feature alignment, which forces the student to mimic exact vector values rather than the underlying logic.
MGSKD overcomes these hurdles by shifting the focus from raw values to the geometry of the feature space across multiple linguistic levels.
Methods
The MGSKD framework is built upon three core components designed to capture the rich hierarchical nature of language.
1. Multi-Granularity Representations
Language conveys meaning at different scales. MGSKD extracts representations at three levels:
- Tokens: Sub-word units for fine-grained syntax.
- Spans: Meaningful phrases or chunks, identified via linguistic chunking, to capture intermediate semantics.
- Samples: The entire input sequence, representing global context.
2. Structural Knowledge Extraction
Instead of direct vector matching, MGSKD teaches the student the relationships between these units:
- Pair-wise Interactions: Modeled via scaled dot products to capture how any two units relate.
- Triplet-wise Geometric Angles: High-order relations that look at the angles formed by triplets of vectors. This provides a more robust geometric map of the semantic space than simple pairs. To maintain efficiency, a selection strategy identifies the most salient triplets for calculation.
3. Hierarchical Distillation
The framework aligns with linguistic intuition: lower layers of the model typically handle structural/syntactic information, while upper layers manage semantic meaning. MGSKD distills token and span-level knowledge into the student's lower layers and sample-level knowledge into its upper layers.
Key Results
The researchers evaluated MGSKD on the GLUE benchmark using ELECTRA-base as the teacher and a 4-layer TinyBERT-style architecture as the student.
As shown in the results table, the MGSKD student (14M parameters) achieves a 9.4x speedup over BERT-base. Remarkably, it outperforms the 109M parameter BERT-base on several tasks, including SST-2, MRPC, and RTE. Compared to other state-of-the-art distillation methods like MiniLMv2 and CKD, MGSKD consistently provides superior performance across nearly all benchmarks.
Discussion and Insights
The primary contribution of MGSKD is the demonstration that structural relationships are more portable than raw values. By teaching the student how the teacher relates concepts (the "geometry" of knowledge), the student gains a more flexible and robust understanding.
Ablation studies highlighted that sample-level structural knowledge—how different sentences in a batch relate—is the most critical factor for overall performance. While the model showed a slight performance dip on the CoLA task (likely due to its heavy reliance on low-level syntax versus the model's semantic focus), the overall gains in efficiency and accuracy mark a significant step forward for model compression.
Summary updated