Abstract
We propose a new approach, Knowledge Distillation using Optimal Transport (KNOT), to distill the natural language semantic knowledge from multiple teacher networks to a student network. KNOT aims to train a (global) student model by learning to minimize the optimal transport cost of its assigned probability distribution over the labels to the weighted sum of probabilities predicted by the (local) teacher models, under the constraints that the student model does not have access to teacher models’ parameters or training data. To evaluate the quality of knowledge transfer, we introduce a new metric, Semantic Distance (SD), that measures semantic closeness between the predicted and ground truth label distributions. The proposed method shows improvements in the global model’s SD performance over the baseline across three NLP tasks while performing on par with Entropy-based distillation on standard accuracy and F1 metrics.
Introduction
In Federated Learning (FL), the goal is to train a central model using decentralized data without compromising privacy. Federated Distillation (FD) facilitates this by sharing model predictions (logits) rather than complex parameters. However, standard FD relies on Kullback–Leibler (KL) divergence, which is "label-blind." It treats all misclassifications equally, ignoring the inherent semantic relationships between classes—for instance, that a "4-star" review is semantically closer to "5-stars" than to "1-star." This paper introduces KNOT to bridge this gap by incorporating the geometry of the label space into the distillation process.
The KNOT Framework
KNOT enables a global student model to learn from multiple local teacher models by minimizing the Optimal Transport (OT) cost between predicted probability distributions. This approach ensures that the student model respects the semantic distance between different categories.
Optimal Transport and Sinkhorn Distance
Unlike standard entropy-based losses, OT allows researchers to define a "cost matrix." This matrix informs the model that moving probability mass between semantically similar labels (e.g., "Happy" to "Surprised") is less costly than moving it between opposites (e.g., "Happy" to "Sad"). By using the Sinkhorn Distance—an efficient approximation of OT—the student model is forced to learn the latent metric structure of the labels.
Weighted Distillation
Local teacher models are often biased because they are trained on small, non-IID (Independent and Identically Distributed) slices of user data. KNOT addresses this with a novel $L^2$-based confidence score. By calculating a model's "intrinsic bias" (its response to random noise), the framework assigns higher weights to teachers that demonstrate greater confidence on real data, preventing local biases from corrupting the global model.
Leveraging Label Geometry
The core innovation of KNOT lies in treating labels as coordinates in a metric space. This allows the model to capture the nuances of human language more effectively than traditional categorical approaches.
As illustrated in the figure above, different NLP tasks are mapped to specific geometries:
- Sentiment Analysis: Labels are placed along a 1D axis (1 to 5).
- Emotion Recognition: Emotions are mapped onto a 2D Valence-Arousal plane.
- Natural Language Inference (NLI): Labels (neutral, entailment, contradiction) are represented as axes in a 3D space.
Evaluation: Semantic Distance (SD)
To measure the success of this semantic transfer, the authors introduce Semantic Distance (SD). This metric calculates the Euclidean distance between the expected value of the model's prediction and the ground truth label. While standard metrics like Accuracy and F1 measure binary "correctness," SD measures "closeness," providing a more granular view of model performance in semantically rich tasks.
Key Results
The researchers evaluated KNOT across Sentiment Analysis (Amazon reviews), Emotion Recognition (MELD, IEMOCAP), and NLI (SNLI, MNLI) datasets.
- Better Semantic Alignment: KNOT consistently outperformed entropy-based baselines on the SD metric. In sentiment analysis, it showed a ~2% improvement in SD while maintaining or slightly improving standard Accuracy and F1 scores.
- Robustness to Non-IID Data: The weighted distillation scheme successfully mitigated the risk of transferring local biases to the global model.
- Performance Parity: While the primary goal was improving semantic understanding, KNOT remained competitive on traditional metrics, proving that semantic depth does not require sacrificing raw accuracy.
Conclusion
KNOT demonstrates that the geometry of labels matters in NLP. By moving beyond label-blind entropy losses to Optimal Transport, we can train models that better understand the spectrum of human meaning. Future work will focus on automating the discovery of semantic coordinates and exploring applications in sensitive domains like cyberbullying detection, where the severity of a misclassification is critical.
Summary updated