Mixture-of-Experts (MoE) architectures have emerged as a promising approach for scaling deep learning models while maintaining computational efficiency. However, existing MoE adaptations for Contrastive Language-Image Pre-training (CLIP) models suffer from significant computational overhead during sequential training and degradation of zero-shot capabilities. To address these limitations, we propose CLIP-FMoE, a novel approach that integrates MoE architecture into CLIP fine-tuning. Our method uses Isolated Constrained Contrastive Learning, a pipeline that trains specialized experts on cluster-based data partitions to accelerate expert specialization. Additionally, we introduce a Fusion Gate mechanism to mitigate catastrophic forgetting of pre-trained knowledge. Extensive experiments across multiple benchmarks demonstrate that our approach achieves consistent improvements on downstream tasks while preserving zero-shot capabilities. Furthermore, our method demonstrates robust performance across varying context lengths, making it particularly suitable for diverse real-world applications.
Figures & tables
Figure 1: Illustration of our main training pipeline. Stage 1 performs semantic clustering to group original data into distinct clusters ( C0 , C1 , C2 , …, CN ) (left). Data from each cluster trains a corresponding MLP layer, with all MLPs training concurrently (middle). In Stage 2, the trained MLP weights from Stage 1 serve as initialization for the MoE experts. During this stage, only the router network is trained while the expert weights remain frozen (right).
Figure 2: Mixture-of-experts architecture pipeline. Vanilla Transformer Block (left) is initialized from the pretrained model. Each Expert and Fusion Gate in N models (middle) is fine-tuned. N experts are aggregated in a unified block (right) while the Router and Fusion Gate are fine-tuned. Layers with solid borders are trainable, while layers with dashed borders remain frozen.
Model
Cars
Coun
FGVC
Food
Sun
Cal
Euro
Flow
Pets
IN-1K
IN-v2
Avg.
OpenAI CLIP
77.93
31.88
31.77
93.07
67.56
83.27
62.59
79.20
93.21
75.54
69.84
69.62
Fine-tuning
69.12
25.43
25.83
91.34
71.17
79.67
65.20
69.56
90.24
72.89
66.39
66.08
Up-cycling
68.98
25.36
27.66
90.78
70.82
81.22
69.98
68.52
91.11
72.92
66.27
66.69
CLIP-MoE
71.20
25.31
27.81
91.27
71.01
79.19
65.13
69.90
90.35
73.19
66.86
66.47
CLIP-FMoE
74.62
28.02
29.58
92.32
71.86
81.79
68.31
73.54
91.58
74.87
68.66
68.65
Table 1: Zero-shot classification results across common datasets. All methods use CLIP ViT-L/14, trained on CC3M (LLaVA-ReCap) dataset. The reported metric is top-1 accuracy. Bold denotes the best performance among CLIP-finetuning methods.
MS COCO
Flickr 8K
Flickr 30K
Model
IR
TR
IR
TR
IR
TR
Avg.
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
OpenAI CLIP
36.51
61.01
56.38
79.36
61.60
86.36
77.40
94.00
65.22
87.26
85.10
97.30
73.96
Fine-tuning
49.04
73.36
63.76
83.94
73.24
93.14
83.20
96.80
78.16
94.85
90.90
99.00
81.62
Up-cycling
48.83
73.19
63.12
84.36
73.10
93.48
83.50
97.00
77.98
94.66
91.20
98.90
81.61
CLIP-MoE
49.46
73.80
65.30
85.44
73.28
93.48
85.70
96.90
78.22
94.94
92.00
99.00
82.29
Table 2: Standard image-text retrieval results (R@1, R@5) on MS COCO, Flickr8K, and Flickr30K benchmarks. All methods use CLIP ViT-L/14 architecture with 77-token context length, trained on CC3M with LLaVA-generated captions. Bold denotes the best performance.
Model
MS COCO
Flickr 8K
Flickr 30K
DOCCI-Long
IIW-Long
Urban
DCI
Avg.
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
OpenAI CLIP
36.5
56.4
61.6
77.4
65.2
85.1
63.3
66.0
90.5
90.2
55.8
68.3
33.9
36.0
63.3
Fine-tuning
46.6
64.3
72.1
84.6
74.8
90.8
77.7
77.6
97.5
96.8
88.9
89.8
54.4
57.6
76.7
LongCLIP
47.0
63.3
72.5
83.4
76.1
89.3
78.8
66.7
97.2
94.5
86.1
82.4
52.7
45.3
73.9
TULIP
45.7
61.2
70.6
81.5
74.6
88.0
79.6
78.0
97.2
96.2
91.2
90.2
54.7
54.3
75.9
CLIP-FMoE
47.7
65.6
72.4
84.9
75.9
91.6
79.2
78.4
97.3
98.0
88.2
90.7
54.7
55.9
77.2
Table 3: Retrieval performance on long-context scenarios. All methods use CLIP ViT-L/14 with 248-token context (except OpenAI CLIP), trained on ShareGPT4V. Bold indicates best performance, underline indicates second best.
Figure 6
Model
# Parameters (M)
Cluster (min)
Total Training (min)
Inference (GFLOPs)
CLIP (Base)
427.62 / 64.53
-
24.59
84.38
Up-Cycling
685.78 / 322.69
-
40.41
112.44
CLIP-MoE
685.78 / 64.53 / 0.04
60.32
193.51
112.44
CLIP-FMoE
693.83 / 72.59 / 8.09
14.54
53.24
128.22
Table 5: Efficiency comparison of CLIP (Fine-tuning), Up-Cycling, CLIP-MoE, and our CLIP-FMoE. Parameters are reported as either (base / trainable) or (base / trainable in Stage 1 / trainable in Stage 2), in millions (M). FLOPs are measured per sample (forward pass only) in GFLOPs. Training times are wall-clock measurements under identical hardware and training settings (total training time including clustering time).
Appendix figures & tables14 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Generated image samples from Stable-Diffusion-XL, conditioned on the output of the text encoder. Highlighted texts indicate the aspects that our method successfully captures compared to the baselines.
Model
Cars
Coun
FGVC
Food
Sun
Cal
C10
C100
Euro
Flow
Pets
IN-a
IN-o
IN-r
IN-1K
IN-Ske
IN-v2
Avg.
CLIP OpenAI
77.93
31.88
31.77
93.07
67.56
83.27
95.59
75.85
62.59
79.20
93.21
70.75
32.25
87.82
75.54
59.58
69.84
69.86
Fine-tuning
69.12
25.43
25.83
91.34
71.17
79.67
96.63
77.93
65.20
69.56
90.24
61.92
35.30
85.62
72.89
56.37
66.39
67.09
Up-cycling
68.98
25.36
27.66
90.78
70.82
81.22
95.72
77.92
69.98
68.52
91.11
61.43
35.55
85.73
72.92
56.62
66.27
67.45
CLIP-MoE
71.20
25.31
27.81
91.27
71.01
79.19
95.82
77.70
65.13
69.90
90.35
62.33
34.75
86.23
73.19
56.89
66.86
67.35
CLIP-FMoE
74.62
28.02
29.58
92.32
71.86
81.79
95.74
78.75
68.31
73.54
91.58
66.13
35.80
87.46
74.87
58.71
68.66
69.28
Appendix
Table 6: Top-1 accuracy across 17 benchmark datasets (extended version of Table 1 ). Models trained on LLaVA-Recap CC3M with ViT-L/14 backbone (77-token context). Bold denotes the best method out of reported fine-tuning methods
Model
Cars
Coun
FGVC
Food
Sun
Cal
C10
C100
Euro
Flow
Pets
IN-a
IN-o
IN-r
IN-1K
IN-Ske
IN-v2
Avg.
OpenAI CLIP
77.93
31.88
31.77
93.07
67.56
83.27
95.59
75.85
62.59
79.20
93.21
70.75
32.25
87.82
75.54
59.58
69.84
69.86
Fine-tune
74.36
28.68
28.18
91.00
70.27
85.00
94.74
76.18
61.28
72.82
91.17
59.41
35.60
85.56
71.69
57.74
65.53
67.60
LongCLIP
72.37
28.14
30.78
91.47
72.54
82.58
96.10
79.82
69.09
72.39
91.03
64.13
37.00
86.44
72.82
57.95
66.88
68.91
TULIP
63.25
21.75
19.95
83.46
67.24
83.06
92.96
71.91
55.43
61.64
87.03
55.28
33.90
81.42
63.48
52.51
57.56
61.87
CLIP-FMoE
75.58
30.17
29.07
92.32
71.54
84.63
95.26
78.02
67.11
76.06
93.08
65.24
35.90
87.27
73.90
58.84
67.72
69.51
Appendix
Table 7: Top-1 accuracy across 17 common benchmark datasets. Results are obtained using models trained on ShareGPT4V dataset with ViT-L/14 architecture and a standard 248-token context length.
Model
DOCCI
IIW
Urban
DCI
Avg.
IR
TR
IR
TR
IR
TR
IR
TR
OpenAI CLIP
17.1
48.5
35.0
84.3
55.8
68.3
33.9
36.0
47.4
Vanilla Fine-tuning
23.9
53.6
46.8
88.5
87.3
85.9
51.1
49.2
60.8
CLIP Up-cycling
23.9
52.9
46.6
89.0
87.6
85.4
53.1
51.3
61.2
CLIP-MoE
24.1
56.1
47.2
89.8
86.1
86.0
53.5
52.0
61.8
CLIP-FMoE
23.7
58.2
45.4
92.5
85.5
85.7
53.9
53.0
62.2
Appendix
Table 8: R@1 retrieval results on fine-grained (DOCCI, IIW) and long-caption (Urban-1k and DCI) datasets.
Table 12
MS COCO
Flickr 8K
Flickr 30K
Cluster Type
Image Retrieval
Text Retrieval
Image Retrieval
Text Retrieval
Image Retrieval
Text Retrieval
Avg.
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
Random
40.8
66.0
58.8
81.8
64.9
88.4
80.1
95.0
69.8
89.3
86.6
97.9
76.6
Text
41.8
66.9
59.8
82.4
65.6
88.6
80.5
95.3
70.8
90.3
87.5
98.2
77.3
Image + Text
41.1
66.5
59.6
82.3
65.4
88.3
80.6
95.3
70.7
89.9
89.2
98.6
77.3
Image (level 1)
41.3
66.6
59.8
82.8
65.9
88.4
80.7
95.3
70.6
90.3
87.5
98.5
77.3
Appendix
Table 11: Standard text-image retrieval results for clustering method ablation study of CLIP-FMoE. All experiments were conducted with a 248-token context length and ViT-B/16 architecture on ShareGPT4V dataset.
Fine-grained Text-Image Retrieval
Long Text-Image Retrieval
DOCCI-FG
IIW-FG
Urban 1K
DCI
Cluster Type
IR
TR
IR
TR
IR
TR
IR
TR
Avg.
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
R@1
R@5
Random
15.7
29.8
47.1
72.9
32.2
52.9
88.0
98.0
84.5
96.7
87.0
97.0
50.4
69.2
52.2
71.0
65.3
Text
16.0
30.4
47.8
74.8
32.6
52.9
87.5
98.5
86.1
97.7
89.9
98.6
51.5
70.5
53.3
71.8
66.2
Image + Text
15.9
30.0
48.0
73.8
32.3
52.0
89.8
98.3
85.5
96.9
88.1
98.3
50.9
69.6
53.4
71.9
65.9
Appendix
Table 12: Fine-grained and long-context retrieval results for clustering method ablation study of CLIP-FMoE. All experiments were conducted with a 248-token context length and ViT-B/16 architecture on ShareGPT4V dataset.
Data type
MS COCO
Flickr 8K
Flickr 30K
DOCCI-Long
IIW-Long
Urban
DCI
Avg.
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
400M OpenAI
36.51
56.38
61.60
77.40
65.22
85.10
63.25
66.04
90.50
90.25
55.80
68.30
33.94
36.04
63.31
+ 1.2M ShareGPT4V
47.57
65.48
72.08
84.90
75.98
91.10
78.83
77.61
97.50
98.25
88.00
90.50
54.50
55.43
76.98
+ 2.8M LLaVA-Recap
49.50
67.00
74.02
85.20
78.54
93.10
84.92
81.90
97.75
96.75
93.40
94.00
59.88
58.07
79.57
Appendix
Table 13: Ablation study of CLIP-FMoE on standard text-image retrieval tasks with varying fine-tuning dataset sizes. Results are obtained using the ViT-L/14 architecture with a context length of 248.
Data type
Cars
Coun
FGVC
Food
Sun
Cal
C10
C100
Euro
Flow
Pets
IN-a
IN-o
IN-r
IN-1K
IN-Ske
IN-v2
Avg.
400M OpenAI
77.9
31.9
31.8
93.1
67.6
83.3
95.6
75.9
62.6
79.2
93.2
70.8
32.3
87.8
75.5
59.6
69.8
69.9
+ 1.2M ShareGPT4V
75.8
30.1
29.8
92.4
65.1
84.4
95.4
78.3
67.2
76.0
93.0
65.1
35.6
87.2
73.9
58.9
67.8
69.2
+ 2.8M LLaVA-Recap
74.6
28.0
29.7
92.8
71.9
82.3
95.7
79.0
68.0
74.2
92.2
66.1
35.8
87.4
74.7
59.0
68.7
69.4
Appendix
Table 14: Ablation study of CLIP-FMoE Top-1 zero-shot classification accuracy across 17 benchmark tasks with varying fine-tuning dataset sizes. Results are reported using the ViT-L/14 architecture with a context length of 248.
M
N
MS COCO
Flickr 8K
Flickr 30K
Urban
DCI
Avg.
IR
TR
IR
TR
IR
TR
IR
TR
IR
TR
8
4
41.6
60.2
65.4
80.5
70.9
88.4
87
88
52.2
54.3
68.9
8
40.6
59.4
64.8
79.7
70.1
86.9
83.5
86.3
50.8
53.2
67.5
16
4
42.2
60.3
66
80.9
70.7
88.6
87.2
88.2
52
54.6
69.1
8
40.6
58.8
64.8
79.7
69.8
87.1
82.7
86.5
50.5
52.8
67.3
32
4
41.9
60.4
66
80.8
70.8
87.8
87.2
89.6
52.1
54.4
69.1
Appendix
Table 15: Hyperparameter analysis on the number of clusters/experts ( N ) and the number of sub-clusters ( M ). The setting is CLIP-FMoE on standard text-image retrieval tasks. Results are obtained using the ViT-B/16 architecture with a context length of 248.
M
N
Cars
Coun
FGVC
Food
Sun
Cal
C10
C100
Euro
Flow
Pets
IN-a
IN-o
IN-r
IN-1K
IN-Ske
IN-v2
Avg.
8
4
61.5
22
21.9
87.4
67.8
82.7
90.8
67.2
55.6
69.5
89.9
40.4
42.7
76.2
66.1
47.6
59.1
61.7
8
61.5
22.2
22.5
88
67.6
82.7
90.8
68.4
57.9
68.8
89.3
41.8
44.3
76.4
66.5
47.6
59.7
62.1
16
4
61.2
22
22.2
87.2
67.9
82.8
90.6
66.6
55.7
69.5
89.6
40.2
42.6
76
66
47.5
58.9
61.6
8
62.2
22
22.4
88.2
67.6
83
90.4
68.3
58.4
68.3
89.3
41.6
43.9
76.2
66.4
47.5
59.5
62.1
32
4
61.3
22
22.6
87.2
67.8
83.2
91.1
67.4
54.4
69.2
89.5
40.8
43.2
76.3
66.1
47.5
58.9
61.7
8
61.9
21.9
22.3
88
67.4
82.8
90.8
67.7
59.4
67.8
88.9
41.32
44.2
76.4
66.2
47.4
59.3
62.0
Appendix
Table 16: Hyperparameter analysis on the number of clusters/experts ( N ) and the number of sub-clusters ( M ). The setting is CLIP-FMoE on zero-shot image classification task. Results are obtained using the ViT-B/16 architecture with a context length of 248.
Attribute
Expert 0
Expert 1
Expert 2
Expert 3
Orientation and Direction
13.33
20
0
6.67
Presence of Specific Features
6.67
20
13.33
6.67
State and Condition
40
40
40
46.67
Quantity and Count
20
13.33
13.33
13.33
Positional and Relational Context
0
0
20
6.67
Color and Appearance
53.33
66.67
73.33
66.67
Appendix
Table 17: Attribute distribution across experts for different characteristics.
Dataset
Cars
Food
Sun
Eurosat
Cal
IN-a
IN-o
IN-r
IN-s
IN-1K
IN-v2
FLow
Avg.
Worst among experts
65.69
88.49
64.71
48.83
75.22
54.88
32.2
84.72
55.3
67.34
60.77
65.95
63.68
Best among experts
71.33
91.71
69.44
64.57
82.5
61.55
33.2
86.6
56.91
70.38
64.47
72.03
68.72
MoE-Top-2
73.22
91.66
71.19
66.61
81.45
64.11
34.7
87.22
58.61
72.98
66.52
72.63
70.08
MoE-Top-4
73.48
91.85
71.36
67.33
81.74
64.52
35.05
87.33
58.78
73.31
66.95
73.07
70.40
Appendix
Table 18: Zero-shot classification performance on the 13.6M dataset.
Dataset
COCO IR
COCO TR
Urban IR
Urban TR
DCI IR
DCI TR
Flickr 8K IR
Flickr 8K TR
Flickr 30K IR
Flickr 30K TR
Avg.
Worst among experts
42.83
54.58
85.8
86.6
54.38
41.82
66.98
78.0
70.94
85.3
66.72
Best among experts
46.87
59.72
92.3
92.8
59.49
53.62
71.76
82.1
76.48
89.8
72.49
MoE-Top-2
48.17
62.84
93.4
93.4
59.54
53.98
72.72
83.8
76.86
91.3
73.6
MoE-Top-4
48.28
63.02
93.6
93.4
59.67
54.17
72.70
84.6
76.96
91.6
73.8
Appendix
Table 19: Zero-shot retrieval performance on the 13.6M dataset.
Mixture-of-Experts (MoE) scales language models efficiently through sparse expert activation, and its dynamic variant further reduces computation by adjusting the activated experts in an input-dependent manner. Existing dynamic MoE methods usually rely on pre-training from scratch or task-specific adaptation, leaving the practical conversion of fully trained MoE underexplored. Enabling such adaptation would directly alleviate the inference costs by allowing easy tokens to bypass unnecessary expert during serving. This paper introduces Zero-Expert Self-Distillation Adaptation (ZEDA), a low-cost framework that transforms post-trained static MoE models into efficient dynamic ones. To stabilize this architectural conversion, ZEDA injects parameter-free zero-output experts into each MoE layer and adapts the augmented model through two-stage self-distillation, utilizing the original MoE as a frozen teacher and applying a group-level balancing loss. On Qwen3-30B-A3B and GLM-4.7-Flash across 11 benchmarks spanning math, code, and instruction following, ZEDA eliminates over 50% of expert FLOPs at marginal accuracy loss. It outperforms the strongest dynamic MoE baseline by 6.1 and 4.0 points on the two models, and delivers ~1.20× end-to-end inference speedup.
Xingtai Lv, Li Sheng, Kaiyan Zhang +12
Tsinghua University · Shanghai AI Lab · WeChat AI +1
Sparse Upcycling provides an efficient way to initialize a Mixture-of-Experts (MoE) model from pretrained dense weights instead of training from scratch. However, since all experts start from identical weights and the router is randomly initialized, the model suffers from expert symmetry and limited early specialization. We propose Cluster-aware Upcycling, a strategy that incorporates semantic structure into MoE initialization. Our method first partitions the dense model's input activations into semantic clusters. Each expert is then initialized using the subspace representations of its corresponding cluster via truncated SVD, while setting the router's initial weights to the cluster centroids. This cluster-aware initialization breaks expert symmetry and encourages early specialization aligned with the data distribution. Furthermore, we introduce an expert-ensemble self-distillation loss that stabilizes training by providing reliable routing guidance using an ensemble teacher. When evaluated on CLIP ViT-B/32 and ViT-B/16, Cluster-aware Upcycling consistently outperforms existing methods across both zero-shot and few-shot benchmarks. The proposed method also produces more diverse and disentangled expert representations, reduces inter-expert similarity, and leads to more confident routing behavior. Project page: https://sanghyeokchu.github.io/cluster-aware-upcycling/
Sanghyeok Chu, Pyunghwan Ahn, Gwangmo Song +3
ECE, Seoul National University · LG AI Research · University of Michigan +1
The CLIP model's outstanding generalization has driven recent success in Zero-Shot Anomaly Detection (ZSAD) for detecting anomalies in unseen categories. The core challenge in ZSAD is to specialize the model for anomaly detection tasks while preserving CLIP's powerful generalization capability. Existing approaches attempting to solve this challenge share the fundamental limitation of a patch-agnostic design that processes all patches monolithically without regard for their unique characteristics. To address this limitation, we propose MoECLIP, a Mixture-of-Experts (MoE) architecture for the ZSAD task, which achieves patch-level adaptation by dynamically routing each image patch to a specialized Low-Rank Adaptation (LoRA) expert based on its unique characteristics. Furthermore, to prevent functional redundancy among the LoRA experts, we introduce (1) Frozen Orthogonal Feature Separation (FOFS), which orthogonally separates the input feature space to force experts to focus on distinct information, and (2) a simplex equiangular tight frame (ETF) loss to regulate the expert outputs to form maximally equiangular representations. Comprehensive experimental results across 14 benchmark datasets spanning industrial and medical domains demonstrate that MoECLIP outperforms existing state-of-the-art methods. The code is available at https://github.com/CoCoRessa/MoECLIP.