CrossMean: Model Merging by Pairing Merged and Expert Activations
Organizations: Faculty of Computer and Information Science, Ben-Gurion University of the Negev
Abstract
Model merging combines fine-tuned experts into one network without retraining, and closed-form methods compute each merged layer from statistics of its input activations. However, these statistics are measured on a single expert, while in the merged model, each layer receives activations from the merged layers that precede it. Recent work re-measures these statistics in the merged model but still forms them from a single network. We formulate closed-form methods as a linear system and show that they use the same matrix on both sides. We then introduce CrossMean, which replaces this matrix on one side with a bilinear statistic that pairs merged and expert activations. From the same statistics, we also derive a label-free criterion that indicates the task sets in which accounting for the merged activations improves the merge more. Empirically, task sets with a lower criterion value show a larger improvement. On the eight-task benchmark of each vision backbone that we tested and on BERT encoders, CrossMean improves on merging with statistics measured on the experts, and with all linear layers merged, it also improves on re-measuring these statistics in the merged model. These results suggest that merging benefits from pairing merged and expert activations.
Figures & tables
| Method | Measured on | ||
|---|---|---|---|
| Weight averaging | none | ||
| Task Arithmetic | none | ||
| TIES | none | ||
| Fisher merging | expert | ||
| RegMean | expert | ||
| LOT | expert |
| Method | B/32 | B/16 | L/14 | L/14-336 | H/14 |
|---|---|---|---|---|---|
| Data-free baselines | |||||
| Weight averaging | |||||
| Task Arithmetic | |||||
| DARE | |||||
| TIES | |||||
| Model Stock | |||||
| Method | B/32 | B/16 | L/14 |
|---|---|---|---|
| Activation-based baselines | |||
| RegMean | |||
| RegMean++ | 89.8 | ||
| Progressive RegMean | 89.8 | ||
| LOT | |||
| LOT + Progressive RegMean | 82.6 | 85.3 | |
| Low- task set | High- task set | |||||
|---|---|---|---|---|---|---|
| Backbone | Prog. RegMean | CrossMean | Prog. RegMean | CrossMean | ||
| B/32 | ||||||
| B/16 | ||||||
| L/14 | ||||||
| L/14-336 | ||||||
| H/14 | ||||||
| Task set | RegMean | Progressive RegMean | CrossMean | ||
|---|---|---|---|---|---|
| GLUE-4 | 66.9 | 64.0 | 72.0 | ||
| GLUE-4 | 67.0 | 64.0 | 72.0 | ||
| GLUE-4 | 67.0 | 64.1 | 73.3 | ||
| GLUE-6 | 66.2 | 64.4 | 73.4 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Progressive RegMean margin | CrossMean margin | |||||
|---|---|---|---|---|---|---|
| Backbone | G | Q | G | Q | G | Q |
| B/32 | ||||||
| B/16 | ||||||
| L/14 | ||||||
| B/32 | B/16 | L/14 | L/14-336 | H/14 | |||||||||||
| Method | 8 | 14 | 20 | 8 | 14 | 20 | 8 | 14 | 20 | 8 | 14 | 20 | 8 | 14 | 20 |
| Data-free baselines | |||||||||||||||
| Weight averaging | |||||||||||||||
| Task Arithmetic | |||||||||||||||
| DARE | |||||||||||||||
| TIES | |||||||||||||||
| Backbone | Parameters | |||
|---|---|---|---|---|
| ViT-B/32 | 88M | |||
| ViT-B/16 | 86M | |||
| ViT-L/14 | 304M | |||
| ViT-L/14-336 | 304M | |||
| ViT-H/14 | 632M |
| Method | SUN397 | Cars | RESISC45 | EuroSAT | SVHN | GTSRB | MNIST | DTD | Avg. |
|---|---|---|---|---|---|---|---|---|---|
| ViT-B/32 | |||||||||
| Data-free baselines | |||||||||
| Weight averaging | 61.2 | ||||||||
| Task Arithmetic | |||||||||
| DARE | |||||||||
| TIES | |||||||||
| Method | SUN397 | Cars | RESISC45 | EuroSAT | SVHN | GTSRB | MNIST | DTD | Avg. |
|---|---|---|---|---|---|---|---|---|---|
| ViT-L/14-336 | |||||||||
| Data-free baselines | |||||||||
| Weight averaging | |||||||||
| Task Arithmetic | 97.6 | ||||||||
| DARE | 97.6 | ||||||||
| TIES | 74.8 | 81.9 | 88.0 | 68.8 | |||||
| ViT-B/32 | ViT-B/16 | ViT-L/14 | |
| Baselines | |||
| LOT | 80.32 | 85.01 | 89.64 |
| Applied to LOT | |||
| LOT + Progressive RegMean | 82.61 | 85.26 | 89.60 |
| LOT + CrossMean | 84.07 | 87.12 | 90.14 |
| Improvement over LOT (%) | |||
| Task set | Progressive RegMean | CrossMean | |
|---|---|---|---|
| ViT-B/32, low- task set | |||
| ViT-B/32, | |||
| ViT-B/32, | |||
| ViT-B/16, low- task set | |||
| ViT-B/32, | |||
| ViT-B/16, |
| Quantity | Est. | CI [ ] | |
|---|---|---|---|
| vs. margin of CrossMean , all 25 measured task sets | 25 | [ ] | |
| vs. margin of CrossMean , shared-protocol grid | 15 | [ ] | |
| vs. margin of CrossMean over Progressive RegMean, shared-protocol grid | 15 | [ ] | |
| vs. margin of Progressive RegMean, all 25 measured task sets | 25 | [ ] | |
| vs. margin, ViT-B/32 confound study | 12 | [ ] | |
| Difficulty vs. margin, ViT-B/32 confound study | 12 | [ ] |
| Change to CrossMean | ViT-B/32 | ViT-L/14 |
|---|---|---|
| None, the unmodified method | ||
| Statistic | ||
| Time relative to RegMean | Peak memory (GiB) | ||||
|---|---|---|---|---|---|
| Method | B/32, | B/32, | H/14, | B/32, | H/14, |
| Iso-C | |||||
| RegMean | |||||
| Progressive RegMean | |||||
| CrossMean | |||||
Model Merging
Model merging combines trained model weights or adapters to reuse capabilities while reducing the cost of joint training or ensembles.
See all 191 papers