Abstract
Standard knowledge distillation from Vision-Language Models (VLMs) like CLIP often fails because signals from labeled data and the teacher model conflict during training. We propose Dual-Head Optimization (DHO), a simple solution that uses two separate prediction heads to decouple these signals. This approach resolves gradient conflicts and achieves new state-of-the-art results on ImageNet and 14 other datasets with minimal computational cost.
Introduction
Vision-Language Models (VLMs) have become essential for modern AI due to their exceptional zero-shot generalization. However, their massive size often precludes deployment on edge devices. Knowledge Distillation (KD) is typically used to create smaller "student" models by having them mimic a large "teacher" VLM while learning from limited labeled data.
The authors identify a fundamental flaw in standard Single-Head Optimization: gradient conflict. When a single classification head attempts to satisfy both ground-truth labels and teacher predictions, the resulting gradients often point in opposite directions. This "tug-of-war" leads to sub-optimal feature representations, particularly in low-data regimes.
Dual-Head Optimization (DHO)
The proposed DHO method addresses gradient conflict through an elegantly simple architectural change.
Architecture and Training
Instead of a single head, DHO attaches two independent linear heads to a shared feature extractor:
- Supervised Head: Trained exclusively on labeled data using standard cross-entropy loss.
- KD Head: Trained to match the teacher VLM's probabilistic outputs using both labeled and unlabeled data.
By separating the heads, the model allows each to learn its distinct signal without interference. Analysis of gradient cosine similarity confirms that in DHO, gradients remain positively aligned, facilitating better feature learning in the shared backbone.
Inference and Tuning
At test time, the model combines outputs from both heads via weighted linear interpolation. This allows for post-training tuning of the balance between "supervised" and "generalist" knowledge without retraining the model.
Experimental Evaluation
DHO was validated across 15 datasets, including ImageNet-1K (1% and 10% labels), 10 fine-grained datasets, and various out-of-distribution (OOD) benchmarks.
Key Results
- State-of-the-Art Performance: On ImageNet with 1% labels, DHO improved accuracy by 3.0% over previous methods while using significantly fewer parameters (e.g., 76M vs. 304M for comparable accuracy).
- Efficiency: The method adds negligible overhead. For a ResNet-50, DHO increases FLOPs by only 0.2% and parameters by 8.0%.
- Robustness: DHO outperformed single-head baselines on 11 out of 11 datasets in 16-shot settings and showed strong performance on OOD benchmarks like ImageNet-Sketch and ImageNet-R.
- Beating the Teacher: In several few-shot scenarios, a smaller student model (e.g., ResNet-18) distilled via DHO outperformed its larger teacher (ResNet-50 VLM), demonstrating effective combination of teacher breadth and student task-specificity.
Conclusion
Dual-Head Optimization provides a robust and efficient framework for semi-supervised knowledge distillation from VLMs. By resolving the gradient conflict inherent in single-head approaches, DHO enables the creation of high-performance, compact models. Future work includes extending DHO to complex tasks like object detection and exploring its applicability to other foundation models like Large Language Models (LLMs).
Summary updated