Skip to main content
QUICK REVIEW

[Paper Review] Contrastive Representation Distillation

Yonglong Tian, Dilip Krishnan|arXiv (Cornell University)|Oct 23, 2019
Domain Adaptation and Few-Shot LearningComputer Science36 references64 citations
TL;DR

CRD uses a contrastive objective to transfer representations from teacher to student, outperforming standard knowledge distillation across model compression, cross-modal transfer, and ensemble distillation tasks.

ABSTRACT

Often we wish to transfer representational knowledge from one neural network to another. Examples include distilling a large network into a smaller one, transferring knowledge from one sensory modality to a second, or ensembling a collection of models into a single estimator. Knowledge distillation, the standard approach to these problems, minimizes the KL divergence between the probabilistic outputs of a teacher and student network. We demonstrate that this objective ignores important structural knowledge of the teacher network. This motivates an alternative objective by which we train a student to capture significantly more information in the teacher's representation of the data. We formulate this objective as contrastive learning. Experiments demonstrate that our resulting new objective outperforms knowledge distillation and other cutting-edge distillers on a variety of knowledge transfer tasks, including single model compression, ensemble distillation, and cross-modal transfer. Our method sets a new state-of-the-art in many transfer tasks, and sometimes even outperforms the teacher network when combined with knowledge distillation. Code: http://github.com/HobbitLong/RepDistiller.

Motivation & Objective

  • Motivate transferring representational knowledge rather than only output probabilities.
  • Address the limitation of KL-based KD which treats output dimensions independently.
  • Propose a contrastive objective that captures correlations and higher-order dependencies in representations.
  • Demonstrate CRD's effectiveness across model compression, cross-modal transfer, and ensemble distillation.

Proposed method

  • Define teacher and student representations at the penultimate layer.
  • Construct a contrastive loss that brings together matching (x) teacher-student pairs and pushes apart non-matching pairs.
  • Formulate a mutual-information bound via a critic h that estimates P(C=1|T,S) and use it to maximize a log-likelihood related objective.
  • Derive a practical objective akin to InfoNCE with a memory bank of negative samples to stabilize training.
  • Incorporate a KD term or cross-modal/ensemble extensions as needed, yielding CRD and CRD+KD variants.

Experimental results

Research questions

  • RQ1Does a contrastive representation objective improve transfer of knowledge from a teacher to a student beyond traditional KD?
  • RQ2How does CRD perform on model compression, cross-modal transfer, and ensemble distillation compared to KD and other distillers?
  • RQ3What is the role of negative sampling and mutual-information bounds in guiding representation transfer?

Key findings

  • CRD consistently outperforms KD across CIFAR-100 and ImageNet in various teacher-student pairs, with an average relative improvement of 57% over KD on CIFAR-100 in Table 1.
  • CRD also improves cross-architecture transfers (different teacher/student architectures) over KD and other methods as shown in Table 2.
  • The CRD method can be combined with KD (CRD+KD) to further improve performance in some settings.
  • Across model compression, cross-modal transfer, and ensemble distillation, CRD sets state-of-the-art results in several configurations.
  • The approach emphasizes transferring information from the teacher’s representation rather than only conditional class probabilities, sometimes even surpassing the teacher when combined with KD.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.