Chip Foundry Services Request Assessment

Similarity-Preserving Distillation

Similarity-Preserving Distillation is a knowledge distillation method that trains the student to produce the same pairwise similarity matrix as the teacher — ensuring that if two inputs are similar according to the teacher, they remain similar according to the student.

How Does It Work?

  • Similarity Matrix: For a batch of $N$ inputs, compute the $N\times N$ similarity matrix $S_{ij} = f_i^T f_j / (\lVert{f_i}\rVert \cdot \lVert{f_j}\rVert)$.
  • Loss: Minimize the difference between teacher's and student's similarity matrices: $\lVert{S^T - S^S}\rVert_F^2$.
  • Batch-Level: Operates on the full batch similarity structure, not individual samples.

Why It Matters

  • Manifold Preservation: Ensures the student's feature space preserves the same neighborhood structure as the teacher.
  • Architecture Agnostic: Works regardless of dimension mismatch between teacher and student (similarity is always $N\times N$).
  • Complementary: Can be combined with standard KD loss for improved performance.

Similarity-Preserving Distillation is transferring the social network of features — teaching the student which inputs should be friends (similar) and which should be strangers (dissimilar).