Simple yet Effective Semi-supervised Knowledge Distillation from Vision-Language Models via Dual-Head Optimization

Seongjae Kang, Dong Bok Lee, Hyungjoon Jang, Sung Ju Hwang

TL;DR

Large vision-language models (VLMs) possess incredible zero-shot generalization, but transferring this knowledge to smaller, task-specific models via standard knowledge distillation often fails due to gradient conflicts between supervised and distillation losses. This paper introduces Dual-Head Optimization (DHO), a simple yet highly effective framework that decouples these losses into separate prediction heads during training and combines them at inference. DHO eliminates gradient conflicts, achieves state-of-the-art semi-supervised performance across 15 datasets, and enables post-training hyperparameter tuning without model retraining.

What Problem Does This Paper Address?

Foundation vision-language models (like CLIP) are excellent generalists but often lack the fine-grained discriminative power needed for specific downstream tasks. Conversely, task-specific models trained on limited labeled data capture local patterns well but generalize poorly.

Semi-supervised learning (SSL) attempts to bridge this gap by leveraging unlabeled data, but traditional SSL methods struggle to match the rich representations learned by massive foundation models. While Knowledge Distillation (KD) seems like a natural framework to transfer VLM capabilities to smaller student models, standard single-head distillation approaches are suboptimal in data-scarce settings.

The authors identify a fundamental roadblock: gradient conflicts. When a single prediction head tries to simultaneously optimize a supervised loss (from scarce labeled data) and a distillation loss (from the teacher VLM), the gradients often pull in opposite directions. The strong teacher signal can overwhelm the weak, noisy signal from limited labels, severely impairing the student's feature learning.

Methods

To resolve this conflict, the authors propose Dual-Head Optimization (DHO). Instead of forcing a single classification head to handle two distinct training signals, DHO splits the architecture after the shared feature extractor into two independent linear prediction heads:

  1. Supervised Head ($h_{CE}$): Optimized exclusively on ground-truth labels using standard cross-entropy loss.
  2. Distillation Head ($h_{KD}$): Optimized exclusively to match the teacher VLM's probabilistic outputs using Kullback-Leibler (KL) divergence.
Figure 2: Conceptual illustration on KD frameworks, Single-Head Optimization (SHO) and Dual-Head Optimization (DHO), for semi-supervised settings. As demonstrated in Fig. 3, we observe gradient conflict of SHO. In contrast, DHO mitigates such conflicts by leveraging dual-head architectures in Fig. 3.

By separating the objectives, each head learns its distinct signal without interference, which mathematically mitigates gradient conflicts in both the classification heads and the shared feature extractor.

Post-Training Dual-Head Interpolation

At inference time, DHO combines the outputs of both heads using a simple linear interpolation rule: $$\hat{p}_{DHO} = \alpha \sigma(h_{CE}(z)) + (1 - \alpha) \sigma(h_{KD}(z) / \beta)$$

Where $\alpha$ balances the supervised and KD heads, and $\beta$ is a temperature scaling factor that softens the KD logits. Crucially, because $\alpha$ and $\beta$ are applied during inference, they act as post-training hyperparameters. Engineers can dynamically tune them on a validation set to match a specific dataset's requirements without undergoing costly model retraining.

Datasets

The authors evaluated DHO across a diverse suite of 15 datasets:

  • In-Distribution Low-Shot/Few-Shot Learning: ImageNet (evaluated under 1/2/4/8/16-shot settings, as well as 1% and 10% low-shot settings).
  • Fine-Grained Visual Recognition (10 datasets): Caltech101, OxfordPets, StanfordCars, Flowers102, Food101, FGVCAircraft, SUN397, DTD, EuroSAT, and UCF101.
  • Out-of-Distribution (OOD) Generalization: Four challenging ImageNet variants experiencing distribution shifts: ImageNet-V2, ImageNet-Sketch, ImageNet-A, and ImageNet-R.

Key Insights and Ideas

  • Decoupling Restores Alignment: The core "aha!" moment is that separating the prediction heads doesn't just fix the classification layer; it propagates down. Empirically, DHO maintains a positive gradient cosine similarity in the shared feature extractor throughout the entire training process, leading to significantly better feature representations.
  • Hyperparameter Tuning Without Retraining: In standard KD, finding the right balance between the teacher and ground-truth loss requires retraining the model multiple times with different loss weights ($\lambda$). DHO shifts this balancing act to inference time ($\alpha$), saving massive amounts of computational time.
  • The Importance of Shared Training Backgrounds: When testing OOD generalization, the authors found that distillation works best when the teacher and student share a similar pre-training lineage (e.g., a CLIP-trained student learning from a larger CLIP teacher), rather than simply picking the largest available teacher model.

Key Results

  • Consistently Outperforms Baselines: DHO consistently outperformed single-head KD baselines across all 11 few-shot datasets tested.
  • Smaller Students Beat Large Teachers: Remarkably, smaller student models (like ResNet-18) trained via DHO frequently outperformed their much larger teacher models (CLIP ResNet-50) on task-specific benchmarks, demonstrating highly effective task adaptation.
  • New State-of-the-Art on ImageNet: In low-shot semi-supervised settings on ImageNet, DHO established a new state-of-the-art, outperforming previous methods by 3.0% accuracy using only 1% of labels, and by 0.1% using 10% of labels—all while utilizing significantly fewer parameters.
Figure 1: (Left): DHO consistently outperforms single-head baselines on 11 datasets under 16-shot semi- supervised setting. The improvements are evaluated in comparison to the second-best one. (Right): DHO achieves new SoTA on ImageNet in both 1% and 10% labeled data setting, with fewer parameters.

Limitations and Future Work

  • VLM-Centric Focus: While the authors believe gradient conflicts occur widely when adapting large foundation models (like instruction-tuned LLMs) to downstream tasks, this study primarily validates the approach using Vision-Language Models.
  • Bounded to Classification: The current implementation and architectural design are tailored strictly for visual recognition tasks. Extending DHO to more complex dense-prediction vision tasks, such as object detection and semantic segmentation, remains an open avenue for future research.

Summary updated

BibTeX
@inproceedings{kang2026simple,
  author = {Seongjae Kang and Dong Bok Lee and Hyungjoon Jang and Sung Ju Hwang},
  title = {{Simple yet Effective Semi-supervised Knowledge Distillation from Vision-Language Models via Dual-Head Optimization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=bA0Jhhnk8K},
}
Figure