Do Topological Characteristics Help in Knowledge Distillation?

Jungeun Kim, Junwon You, Dongjin Lee, Ha Young Kim, Jae-Hun Jung

Knowledge Distillation (KD) is a powerful technique for compressing massive "teacher" models into compact "student" models without sacrificing too much performance. However, traditional KD methods often struggle to transfer the complex, overarching geometric structure of the teacher's latent space.

To address this, researchers have introduced TopKD, a novel framework that transfers the "global shape"—or topology—of a teacher network's latent space to a smaller student network. By leveraging a specialized neural network called RipsNet to approximate complex topological descriptors in real-time, TopKD achieves state-of-the-art performance across various architectures, sometimes even allowing the student to outperform its teacher.

The Limitations of Traditional KD

Traditionally, knowledge distillation is performed by matching individual data points (point-to-point) or the distances between pairs of points (pairwise or relation-based KD).

Relation-based KD focuses on pairwise distances, often missing the global topological structure.

While effective, these methods often miss the "big picture." Imagine trying to describe a mountain range by only listing the coordinates of a few peaks; you would entirely miss the valleys, the ridges, and the overall connectivity. In deep learning, a model's latent space has a highly complex geometric structure. Existing KD methods struggle to transfer this global structure efficiently. As a result, student models might mimic individual outputs perfectly but fail to capture the underlying organizational logic and broader context learned by the teacher.

Methodology: Capturing the "Big Picture"

To capture this global structure, the authors turn to Topological Data Analysis (TDA), specifically a technique called Persistent Homology (PH).

  1. Persistent Homology & Diagrams (PD): PH analyzes data across multiple scales. It tracks when topological "features" (like clusters or loops) are born and when they die as the "connection radius" between data points increases. This lifecycle is summarized in a Persistence Diagram (PD).
  2. Persistence Images (PI): Because PDs are irregular and difficult for neural networks to process directly in a loss function, the authors convert them into Persistence Images—a vectorized, stable, and grid-based representation.
  3. RipsNet (The Efficiency Engine): Calculating exact PIs for every training batch is notoriously slow and computationally expensive. To bypass this bottleneck, the authors introduce RipsNet, a small Multi-Layer Perceptron (MLP) trained to approximate the PI of a point cloud. Once pre-trained on the teacher's features, RipsNet provides nearly instantaneous topological summaries during the student's training loop.
  4. Topology Distillation Loss ($L_{Top}$): During training, the student minimizes the $L_2$ distance between its own approximated PI and the teacher's approximated PI. This effectively forces the student's latent space to structurally mirror the teacher's.

Key Insights and Performance

The researchers evaluated TopKD on several standard benchmarks, including CIFAR-100, ImageNet-1K, MS COCO, STL-10, and Tiny-ImageNet. The results highlight several compelling advantages:

  • Topology as a "Skeleton": Global topology acts like a structural skeleton for the data. By matching this skeleton, the student learns the broader context of how classes relate to one another, rather than just memorizing local decision boundaries.
  • State-of-the-Art Performance: On CIFAR-100, TopKD consistently outperformed established methods like FitNet, RKD, and CRD. For instance, a ResNet20 student reached 71.58% accuracy with TopKD, compared to just 70.66% with vanilla KD.
  • Surpassing the Teacher: In a remarkable result on ImageNet-1K, using a ResNet34 teacher (73.31% accuracy) to train a ResNet18 student resulted in a student accuracy of 73.60%—effectively beating the teacher model.
  • Synergy with Vanilla KD: TopKD works best when combined with vanilla KD (which transfers soft logits). This proves that topological information is complementary to the standard class-probability information.
  • Better Feature Clustering: Qualitative UMAP visualizations showed that TopKD students developed much cleaner, more distinct clusters for different classes compared to students trained with standard KD.

Interestingly, the paper notes that 0-dimensional homology (which tracks connected components and clusters) was significantly more beneficial for classification tasks than 1-dimensional homology (which tracks loops and holes).

Limitations and Future Directions

While TopKD offers a massive leap forward, it does come with a few limitations. Primarily, RipsNet must be pre-trained on the teacher's embedding features before the actual student training can begin, which adds an extra step to the pipeline. Additionally, the current success relies heavily on 0-dimensional homology, suggesting that higher-dimensional topological features might require different processing techniques to be useful for standard classification.

Moving forward, the authors plan to explore other topological descriptors, such as Betti sequences and persistence landscapes, to see if they can capture even more nuanced "knowledge" from teacher networks.

(Code for TopKD is available at https://github.com/jekim5418/TopKD)

Summary updated

BibTeX
@inproceedings{kim2024do,
  author = {Jungeun Kim and Junwon You and Dongjin Lee and Ha Young Kim and Jae-Hun Jung},
  title = {{Do Topological Characteristics Help in Knowledge Distillation?}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=2dEH0u8w0b},
}
Figure