Learning Task-Agnostic Representations through Multi-Teacher Distillation

Philippe Formont, Maxime Darrin, Banafsheh Karimian, Eric Granger, Jackie Ck Cheung, Ismail Ben Ayed, Mohammadhadi Shateri, Pablo Piantanida

TL;DR

This paper introduces a novel framework for distilling knowledge from multiple diverse "teacher" models into a single, efficient "student" model without requiring task-specific labels. By framing distillation as a "majority vote" problem and leveraging information theory, the authors produce compact embedding models across text, vision, and chemistry that punch significantly above their weight class.

The Challenge of Combining Embedders

The current AI landscape features a proliferation of "embedders"—models that turn complex data like text, images, or molecules into numerical vectors. Because these models are trained on different datasets with different architectures (e.g., contrastive vs. masked language modeling), they each capture unique "views" of the data.

To achieve the best performance, one might want to combine these models, but running an ensemble of large models is computationally expensive. Standard Knowledge Distillation (KD) usually tries to compress one large teacher into a smaller student for a specific task (like sentiment analysis). However, if the goal is a general-purpose student that works for any future task (task-agnostic), existing methods like Mean Squared Error (MSE) often struggle with stability in high-dimensional spaces or fail to capture the full richness of the teachers' collective knowledge.

A Task-Agnostic Distillation Framework

The authors propose a "task-enabling" setting. Instead of matching raw vectors, they aim for the student to learn a representation that would allow a hypothetical classifier to agree with the "majority vote" of the teachers across any possible task.

Multi-Teacher Distillation Framework

The Secret Sauce: Information Theory

The researchers prove that the probability of a student disagreeing with its teachers is mathematically bounded by the conditional entropy of the teachers' embeddings given the student's output. To minimize this disagreement, they maximize the Mutual Information (MI) between the student and all teachers.

Implementation Details

  • Gaussian Kernels: They use a differentiable Gaussian-Mixture based estimator to model the conditional distribution of teachers given the student.
  • NLL Loss: Instead of MSE, they minimize the Negative Log-Likelihood (NLL) of the teachers' embeddings. This is more expressive than MSE because it allows the model to learn not just the "mean" position of a teacher's embedding, but also the uncertainty (covariance) around it.
  • End-to-End Training: The student and the Gaussian kernels are trained together, effectively "packing" the most useful information from all teachers into the student’s smaller vector space.

Key Insights and Ideas

  • NLL > MSE: The authors show that standard MSE distillation is actually just a restricted version of their NLL approach (where the covariance is fixed to an identity matrix). By allowing the model to learn the covariance, the student becomes much more robust and informative.
  • The "Diversity" Bonus: In molecular modeling and text, adding more teachers—even if some are "weaker" than the best one—actually improves the student. The diversity of perspectives helps the student build a more holistic representation.
  • Information Density: Their medium-sized text model (109M parameters) outperformed models three times its size, suggesting that multi-teacher distillation is a highly effective way to increase "information density" in small models.
  • Invariance is a Double-Edged Sword: Because MI is invariant under invertible transformations, the student doesn't necessarily "look" like the teachers in terms of vector geometry (like cosine similarity). While this is great for classification, it means the student might need a small extra step to perform as well on tasks that rely purely on raw dot-products.

Datasets and Key Results

The authors validated their approach across three distinct domains, achieving state-of-the-art (SOTA) results for compact models:

Performance vs. Size and NLP Task Rankings
  • Natural Language Processing (NLP): Evaluated on the Massive Text Embedding Benchmark (MTEB). Their 23M parameter "xs" model set a new SOTA for its size category, gaining 2 points on average over previous leaders. Their 109M model achieved competitive results against models with 500M+ parameters.
  • Molecular Modeling: Evaluated on the Therapeutic Data Commons (TDC) ADMET tasks. The distilled student (Student-2M) achieved the best average rank across 32 different chemical property tasks, outperforming all individual teachers and other distillation baselines like CompRess.
  • Computer Vision: Evaluated on fine-grained classification datasets (CIFAR10, DTD, SVHN, etc.). A tiny 3.7M parameter student distilled from 87M parameter teachers sat firmly on the Pareto frontier, offering a superior trade-off between accuracy and model size.

Limitations and Future Work

While highly effective, the approach has limitations. Generating embeddings from multiple large teachers during training is resource-intensive. The authors mitigated this by pre-computing and storing embeddings (requiring ~100GB for text), but this remains a computational barrier.

Additionally, the current loss doesn't explicitly enforce a specific structure (like a hypersphere) on the embedding space, leading to slightly more modest gains in clustering and sentence similarity compared to massive gains in classification. Looking ahead, the authors suggest that the next frontier is cross-modal distillation—using a vision teacher and a text teacher to train a single student that understands both, leveraging the same task-agnostic framework.

Summary updated

BibTeX
@inproceedings{formont2025learning,
  author = {Philippe Formont and Maxime DARRIN and Banafsheh Karimian and Eric Granger and Jackie CK Cheung and Ismail Ben Ayed and Mohammadhadi Shateri and Pablo Piantanida},
  title = {{Learning Task-Agnostic Representations through Multi-Teacher Distillation}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=wmkd9qYty4},
}
Figure