ExpertDiff: Head-less Model Reprogramming with Diffusion Classifiers for Out-of-Distribution Generalization

Jee Seok Yoon, Junghyo Sohn, Wootaek Jeong, Heung-Il SukIJCAI 2025 · DOI

Abstract

Adapting large-scale foundation models to specialized domains often requires extensive fine-tuning or the addition of task-specific output layers ("heads"), which can compromise the model's original capabilities. We present ExpertDiff, a "head-less" model reprogramming framework that repurposes pre-trained text-to-image diffusion models as high-performance classifiers for expert domains such as medical imaging and satellite photography. By optimizing learnable prompts and utilizing a novel Triplet Log-Sum-Exp (TLSE) loss, ExpertDiff achieves state-of-the-art out-of-distribution generalization and superior few-shot performance without modifying the underlying model weights or adding traditional classification layers.

Introduction

Vision-language models (VLMs) like CLIP have demonstrated remarkable general-purpose capabilities. However, they often struggle with "expert-level" tasks requiring fine-grained domain knowledge, such as diagnosing tumors in histopathological slides or identifying specific land-use types in satellite imagery. Traditional adaptation methods like fine-tuning are computationally expensive, while model reprogramming typically involves adding a linear probe or "head." These additional layers can lead to feature distortion and the loss of the model's generative properties.

Comparison of adaptation paradigms: Model Fine-tuning, Model Reprogramming, and the proposed Head-less Reprogramming.

ExpertDiff addresses these challenges by treating a frozen diffusion model as a "diffusion classifier," eliminating the need for an external head and preserving the model's internal representations.

Methods

ExpertDiff introduces three primary innovations to enable head-less reprogramming:

  1. Learnable Prompts: Instead of altering model weights, ExpertDiff optimizes text prompts to guide the foundation model. This includes Additive Prompts (integrated into input embeddings) and Suffix Prompts (concatenated to the text), which serve as domain-specific instructions.
  2. Triplet Log-Sum-Exp (TLSE) Loss: To avoid the high computational cost of exact likelihood calculation, the authors derived the TLSE loss as an upper bound. This loss functions similarly to a triplet loss, minimizing noise prediction error for the ground-truth class while maximizing it for incorrect classes.
  3. Optimal Timestep Search: Rather than evaluating all diffusion timesteps, ExpertDiff identifies a specific "Goldilocks" timestep where class discriminability is maximized, significantly accelerating inference.
Schematics of prompt tuning and the Triplet Log-sum-exp Loss (TLSE) within the ExpertDiff framework.

Results and Key Insights

The framework was evaluated across four expert domains: Breast Ultrasound, Chest X-ray, Camelyon17-WILDS (histopathology), and EuroSAT (satellite imagery).

Key findings include:

  • Few-Shot Dominance: On the Camelyon17 dataset, ExpertDiff achieved 83.7% accuracy in a 1-shot setting, significantly outperforming MaPLe (62.3%) and CLIP-LP (61.2%).
  • State-of-the-Art Accuracy: In supervised settings, it reached 93.7% on Camelyon17, surpassing even specialized discriminative models.
  • Robustness and Zero-Shot Capability: ExpertDiff maintains high performance with minimal noise samples and competes with domain-specific models (like MedCLIP) even in zero-shot scenarios.

Discussion and Conclusion

ExpertDiff demonstrates that a model's ability to denoise an image serves as a powerful proxy for its understanding. By avoiding an output mapping layer, the model prevents feature distortion and retains its generative power, which is crucial for medical explainability. While the current approach faces trade-offs in counterfactual editing and higher computational costs compared to simple CNNs, it represents a significant step toward efficient, modular, and robust domain adaptation for foundation models.

Summary updated

BibTeX
@inproceedings{yoon2025expertdiff,
  author = {Jee Seok Yoon and Junghyo Sohn and Wootaek Jeong and Heung-Il Suk},
  title = {{ExpertDiff: Head-less Model Reprogramming with Diffusion Classifiers for Out-of-Distribution Generalization}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2025},
  doi = {10.24963/ijcai.2025/764},
}
Figure