Abstract
Learning robust vision models that perform well in out-of-distribution (OOD) situations is critical for real-world deployment. While large pretrained models like CLIP provide a strong foundation, naive fine-tuning can impair OOD robustness by "forgetting" general-purpose knowledge. We introduce Mixture-of-Adapters (MoA), a parameter-efficient fine-tuning (PEFT) strategy that dynamically routes data through specialized adapter experts. Our approach achieves state-of-the-art performance on domain generalization benchmarks while training less than 2% of the model's total parameters, effectively balancing task adaptation with robust generalization.
Introduction: The Fine-tuning Paradox
In machine learning, Domain Generalization (DG) aims to create models that succeed in unseen environments—for example, recognizing a dog in a charcoal drawing after only seeing photos. Standard fine-tuning of large models often leads to a "Fine-tuning Paradox": updating all parameters helps the model learn the specific training task but often makes it brittle to domain shifts. The challenge lies in finding a regularization method that adapts the model without sacrificing its pretrained robustness.
Methodology: Mixture-of-Adapters (MoA)
To address this, we propose a two-fold solution centered on Parameter-Efficient Fine-Tuning (PEFT). Instead of updating the entire backbone, we freeze the original weights ($W_0$) and introduce small, trainable modules.
Mixture-of-Experts Architecture
The core of our method is the Mixture-of-Adapters (MoA). Rather than a single adapter, each layer contains multiple adapters with varying capacities (inner ranks). A learnable Cosine Router analyzes incoming tokens and uses cosine similarity to decide which adapter "expert" should process them. This allows the model to dynamically adjust its complexity: simple, domain-invariant features can be handled by low-capacity adapters, while complex, domain-specific shifts are routed to higher-capacity ones.
Analysis: Why MoA Generalizes Better
Loss Landscape Flatness
A key insight of this work is the relationship between the "flatness" of the loss landscape and OOD robustness. A flatter minimum indicates that small shifts in data distribution (domain shifts) will not lead to drastic increases in loss. Our analysis shows that full fine-tuning results in a "jagged" surface, whereas MoA and other PEFT methods like LoRA and KAdaptation maintain a significantly flatter surface.
Semantic Routing
Qualitative analysis of the router's behavior reveals that it does not select experts randomly. Instead, it learns to cluster tokens based on semantic content. For instance, it may route foreground object tokens to one expert and background tokens to another, effectively separating "what" an object is from the "where" or "how" of its domain-specific appearance.
Experimental Results
We evaluated MoA on the DomainBed benchmark, which includes diverse datasets such as PACS, VLCS, OfficeHome, TerraIncognita, and DomainNet. Using a ViT-B/16 backbone pretrained on CLIP, our results demonstrate:
- State-of-the-Art Performance: Our KAdaptation-MoA method achieved an average accuracy of 77.3%, outperforming more computationally expensive baselines.
- Extreme Efficiency: While full fine-tuning requires updating 85.8 million parameters, MoA achieves superior results by training only 1.5 million parameters.
- Scalability: Increasing the number of experts (e.g., from 2 to 6) consistently improves performance, suggesting that the model benefits from a wider pool of specialized knowledge.
Conclusion
Mixture-of-Adapters provides a powerful framework for adapting large pretrained models to new tasks without losing their inherent robustness. By combining the regularization benefits of PEFT with the dynamic capacity of Mixture-of-Experts, MoA sets a new standard for domain generalization. Future work will explore scaling these experts further and applying the architecture to multi-modal and cross-architecture settings.
Summary updated