Introduction
Large-scale pre-trained language models (PLMs) like BERT have revolutionized Natural Language Processing (NLP), yet their immense computational requirements often preclude deployment on resource-constrained edge devices. Knowledge Distillation (KD) serves as a primary solution, where a compact "student" model is trained to replicate the behavior of a larger "teacher." However, conventional KD assumes access to the original training data. In practice, this data is frequently unavailable due to privacy regulations (e.g., medical records), proprietary restrictions, or prohibitive storage costs.
While "data-free" distillation has matured in Computer Vision through the generation of pseudo-images, it faces a fundamental hurdle in NLP: the discrete nature of text. Standard gradient-based generation techniques cannot easily backpropagate through a sequence of discrete tokens to create meaningful training sentences.
Methodology
To overcome the discrete text bottleneck, the proposed Adversarial self-Supervised Data-Free Distillation (AS-DFD) framework shifts the focus from generating readable words to synthesizing continuous pseudo-embeddings that capture the teacher's latent knowledge.
Two-Stage Adversarial Framework
The AS-DFD process operates in two alternating stages:
- Embedding Guessing: The framework "inverts" the fixed teacher model to discover continuous pseudo-embeddings. Starting from random Gaussian noise, vectors are iteratively updated via CrossEntropy loss to ensure the teacher classifies them into specific target categories with high confidence. Alignment constraints—such as the inclusion of [CLS] and [SEP] tokens and sequence length variations—are applied to keep these synthetic embeddings within a range the model can process effectively.
- Adversarial Self-Supervision: To optimize the student's learning, the framework introduces a "Measurement of Student Ability" module. This module performs a masking task similar to BERT’s masked language modeling. In an adversarial loop, Stage 1 updates the pseudo-embeddings to make this masking task harder for the student. In Stage 2, the student learns from the teacher using these difficult, high-value samples.
Implementation Details
A critical finding in the implementation is that initialization significantly impacts performance. Sharing the teacher's bottom-layer weights with the student stabilizes the data-free learning process, providing a more robust starting point for distillation.
Experiments and Results
AS-DFD was evaluated on three standard text classification benchmarks: AG News (topic classification), DBPedia (ontology classification), and IMDb (sentiment analysis). The framework was compared against random-text baselines and adaptations of computer vision data-free methods, such as Modified-ZSKD.
Key Performance Metrics
As shown in the experimental results, AS-DFD consistently outperformed all baselines:
- Accuracy: On AG News, AS-DFD achieved 90.4% accuracy for a 6-layer BERT student. On DBPedia, distilling a 12-layer teacher into a 4-layer student reached 94.1% accuracy, a substantial improvement over the 83.0% achieved by previous state-of-the-art adaptations.
- Efficiency: The resulting 4-layer student model is approximately 2.1x smaller and 2.8x faster than the original BERT-base teacher, making it highly suitable for mobile and edge deployment.
Discussion and Conclusion
The success of AS-DFD demonstrates that readable text is not a prerequisite for effective knowledge distillation. High-quality synthetic embeddings that capture the "latent knowledge" of the teacher are sufficient to train a high-performing student. By using the student's own performance on a self-supervised task to guide data generation, the system automatically identifies the "learning frontier."
While effective, the current approach has limitations regarding interpretability, as the pseudo-samples are unreadable to humans. Future research will focus on ensuring greater diversity in synthetic data and extending these data-free techniques to complex generative tasks like summarization and translation.
Summary updated