Change Partners at Every Layer: Balanced Random Regrouping for Model Merging
Organizations: University of Connecticut · NEC Laboratories America
Abstract
Model merging combines fine-tuned experts into one model that serves many tasks without retraining, but merging many experts this way substantially reduces accuracy. Grouping offers a middle ground: at every layer or weight matrix, the experts are divided into groups, the experts in a group are merged into one shared module, and a task uses the module merged from its expert's group. Natural choices are to keep the same partners across layers or to group similar experts. Surprisingly, we find that randomly changing partners at every layer outperforms both. We call this Balanced Random Regrouping (BRR): it independently partitions the experts into equal-sized random groups at each layer (BRR-layer) or weight matrix (BRR-matrix) and merges each group with an existing method. With validation-selected merge scales, both BRR variants outperform reusing one grouping across layers in all 24 CLIP settings, by 1.0-6.8 points, and BRR-matrix also outperforms the similarity-based FlexMerge in every setting. A first-order analysis explains this gain. At each layer, merging a task's expert with its partners shifts the task's output features; when the partners are the same at every layer, these shifts tend to point in similar directions and add up, whereas with new partners at every layer they vary independently and add up less on average. A series of experiments supports this analysis, which further guides a grouping search that can outperform BRR.
Figures & tables
| ViT-B/32 | ViT-L/14 | ||||||||
| Method | TA | TSV-M | Iso-CTS | ACE | TA | TSV-M | Iso-CTS | ACE | |
| Zero-shot | 42.05 | 48.11 | |||||||
| Experts | 85.68 | 89.79 | |||||||
| 1 | One model | 43.26 | 53.90 | 54.58 | 57.22 | 48.81 | 64.74 | 66.74 | 68.36 |
| Channel Merging | |||||||||
| FlexMerge | 51.18 | 66.90 | 66.13 | 70.36 | 60.46 | 76.13 | 77.41 | 79.36 | |
| ViT-B/32 | ViT-L/14 | |||
|---|---|---|---|---|
| Method | TA | TSV-M | TA | TSV-M |
| Channel Merging | 80.57 | – | 88.61 | – |
| FlexMerge | 81.50 | 86.84 | 89.67 | 92.71 |
| Shared | 80.78 | 87.89 | 89.15 | 92.43 |
| BRR-layer | 82.59 | 88.97 | 90.13 | 92.91 |
| BRR-matrix | 83.12 | 89.24 | 90.27 | 93.00 |
| InternVL2.5-1B | Qwen2-VL-7B | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Method | TA | TSV-M | Iso-CTS | ACE | TA | TSV-M | Iso-CTS | ACE | |
| Experts | 81.06 | 86.98 | |||||||
| 1 | One model | 66.68 | 74.57 | 75.75 | 76.69 | 79.36 | 85.08 | 84.27 | 86.66 |
| Channel Merging | |||||||||
| FlexMerge | |||||||||
| 2 | Shared | ||||||||
| (a) Balance and independence (TSV-M) | ||||
|---|---|---|---|---|
| Groups | Shared | Per matrix | ||
| Unbalanced | 72.38 | 76.90 | ||
| Balanced | 73.79 | 78.38 | ||
| (b) Random versus similarity-based partners (balanced) | ||||
| Shared | Per matrix | |||
| Merging | Random | Similarity | Random | Similarity |
| Grouping | Partner-repeat rate |
|---|---|
| Shared | 1.00 |
| FlexMerge | 0.30 |
| Similarity, per matrix | 0.27 |
| BRR-layer | 0.15 |
| BRR-matrix | 0.09 |
Appendix figures & tables30 assets
Supplementary material from the paper’s appendix.
Appendix
| Group (count) | Tasks |
|---|---|
| FusionBench (TALL20) (20) | sun397 (397), stanford cars (196), resisc45 (45), eurosat (10), svhn (10), gtsrb (43), mnist (10), dtd (47), oxford flowers102 (102), pcam (2), fer2013 (7), oxford pets (37), stl10 (10), cifar100 (100), cifar10 (10), food101 (101), fashion mnist (10), emnist letters (26), kmnist (10), rendered sst2 (2) |
| VTAB / ELEVATER (12) | caltech101 (102), fgvc aircraft (100), country211 (211), clevr count (8), clevr distance (6), dmlab (6), dsprites orientation (40), dsprites location (32), smallnorb azimuth (18), smallnorb elevation (9), diabetic retinopathy (5), kitti distance (4) |
| Fine-grained and food (12) | cub200 (200), stanford dogs (120), birds525 (525), butterflies100 (34), fruits360 (113), pokemon (150), inat wildflowers25 (25), ip102 insects (102), vietnamese food (30), indian food (20), food11 (11), sports100 (100) |
| Objects and scenes (5) | mit indoor67 (67), imagewoof (10), tiny imagenet (200), caltech256 (257), intel scenes (6) |
| DomainNet (6) | domainnet clipart (345), domainnet infograph (345), domainnet painting (345), domainnet quickdraw (345), domainnet real (345), domainnet sketch (345) |
| Remote sensing (4) | whu rs19 (19), rsscn7 (7), patternnet (38), uc merced (21) |
| ViT-B/32 | ViT-L/14 | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Method | TA | TSV-M | Iso-CTS | ACE | TA | TSV-M | Iso-CTS | ACE | ||
| 5 | FlexMerge | 49.74 | 66.90 | 66.13 | 70.36 | 56.86 | 75.49 | 76.43 | 78.99 | |
| Shared | 48.73 | 68.32 | 67.27 | 72.65 | 57.55 | 77.66 | 77.64 | 81.95 | ||
| BRR-layer | 49.05 | 70.54 | 69.08 | 75.73 | 57.65 | 79.28 | 78.53 | 83.54 | ||
| BRR-matrix | 49.02 | 71.19 | 69.49 | 76.25 | 57.69 | 79.36 | 78.62 | 83.74 | ||
| 10 | FlexMerge | 57.67 | 71.58 | 66.29 | 76.04 | 65.39 | 79.95 | 76.62 | 83.40 | |
| Condition | 95% CI | Tasks improved |
|---|---|---|
| Independent minus shared | ||
| Balanced | [3.71, 5.56] | 95/100 |
| Unbalanced | [3.53, 5.54] | 92/100 |
| Balanced minus unbalanced | ||
| Shared | [0.58, 2.18] | 73/100 |
| Independent | [1.14, 1.87] | 91/100 |
| Unbalanced sizes | Balanced sizes | |||||
|---|---|---|---|---|---|---|
| Backbone | Merging | shared | independent | shared | independent | |
| ViT-B/32 | TA | 10 | 56.18 | 61.51 | 57.40 | 61.87 |
| ViT-B/32 | Iso-CTS | 10 | 69.92 | 75.05 | 73.07 | 77.58 |
| ViT-B/32 | ACE-Merging | 10 | 76.07 | 79.80 | 77.81 | 80.83 |
| ViT-B/32 | TSV-M | 5 | 65.57 | 70.16 | 68.32 | 72.35 |
| ViT-B/32 | TSV-M | 20 | 76.89 | 81.18 | 78.02 | 81.99 |
| Scope | Members | TA | TSV-M | Iso-CTS | ACE |
|---|---|---|---|---|---|
| Shared | Random | 57.40 | 73.79 | 73.07 | 77.81 |
| Similarity | 57.73 | 71.22 | 69.67 | 75.37 | |
| Per matrix | Random | 61.87 | 78.38 | 77.58 | 80.83 |
| Similarity | 60.37 | 75.26 | 73.69 | 78.54 |
| Method | Members | Shared | Per matrix | |
|---|---|---|---|---|
| TSV-M | 5 | Random | 68.32 | 72.35 |
| Similarity | 67.08 | 70.27 | ||
| 20 | Random | 78.02 | 81.99 | |
| Similarity | 75.00 | 78.53 | ||
| TA | 5 | Random | 50.31 | 51.50 |
| Similarity | 50.92 | 51.78 |
| Selected | |||||
| Merge operator | Shared | BRR-layer | BRR-matrix | gain [95% CI], tasks improved | gain |
| Task Arithmetic | 57.40 | 61.10 | 61.87 | +4.47 [3.61, 5.30], 99/100 | +1.06 |
| TSV-M | 73.79 | 77.53 | 78.38 | +4.59 [3.71, 5.56], 95/100 | +2.61 |
| Iso-CTS | 73.07 | 76.31 | 77.58 | +4.51 [3.62, 5.51], 93/100 | +1.34 |
| ACE-Merging | 77.81 | 80.40 | 80.83 | +3.02 [2.45, 3.68], 94/100 | +3.03 |
| EMR-Merging | 81.87 | 82.47 | 82.58 | +0.72 [0.42, 1.00], 77/100 | +0.61 |
| Backbone | Operator | shared grouping | BRR-matrix | gain [95% CI] | tasks improved | ||
| ViT-L/14 | TA | 100 | 10 | 70.12 | 74.54 | +4.42 [3.47, 5.36] | 95/100 |
| ViT-L/14 | TSV-M | 100 | 10 | 82.03 | 84.96 | +2.93 | – |
| ViT-L/14 | Iso-CTS | 100 | 10 | 83.85 | 86.13 | +2.28 [1.58, 3.14] | 88/100 |
| ViT-L/14 | ACE-Merging | 100 | 10 | 85.12 | 86.84 | +1.72 [1.00, 2.57] | 83/100 |
| ViT-B/32 | TSV-M | 100 | 2 | 59.71 | 61.71 | +2.00 [1.54, 2.46] | 88/100 |
| ViT-B/32 | TSV-M | 100 | 5 | 68.32 | 72.35 | +4.03 [3.01, 5.05] | 87/100 |
| Method | Shared | BRR-layer | BRR-matrix | |
|---|---|---|---|---|
| 25 | TSV-M | |||
| TA | ||||
| 50 | TSV-M | |||
| TA † |
| ViT-B/32 | ViT-L/14 | |||||
| Method | TA | TSV-M | TA | TSV-M | ||
| 8 | – | Experts | 92.93 | 95.87 | ||
| – | Zero-shot | 48.02 | 65.32 | |||
| 1 | One model | 70.64 | 85.62 | 84.84 | 92.96 | |
| 2 | Channel Merging | 84.25 0.15 | – | 92.09 0.08 | – | |
| FlexMerge | 83.28 | 89.48 | 91.65 | 94.42 | ||
| Output signal | ViT-B/32 | ViT-L/14 |
|---|---|---|
| Real training signal | 0.535 | 0.582 |
| Shared random | ||
| Independent random |
| Layer-pair setting | Observed local interaction |
|---|---|
| Same partner, same batch | Positive in 132/132 task–layer-pair cases (reference). |
| Different partners, cyclic shifts | Positive in 2% of shift cases. |
| Same partner, different batches | Retains 89% of the reference interaction; positive in 132/132 cases. |
| Method | Grouping | |||
|---|---|---|---|---|
| TA | Shared | 0.37 [0.27, 0.47] | 0.67 [0.51, 0.80] | 1.08 [0.91, 1.28] |
| TA | BRR-layer | 0.37 [0.26, 0.46] | 0.67 [0.50, 0.80] | 1.07 [0.89, 1.27] |
| TA | BRR-matrix | 0.37 [0.26, 0.46] | 0.67 [0.50, 0.80] | 1.07 [0.88, 1.27] |
| TSV-M | Shared | 0.30 [0.26, 0.38] | 0.56 [0.48, 0.68] | 0.95 [0.85, 1.11] |
| TSV-M | BRR-layer | 0.28 [0.24, 0.36] | 0.52 [0.45, 0.65] | 0.91 [0.79, 1.06] |
| TSV-M | BRR-matrix | 0.28 [0.23, 0.36] | 0.52 [0.44, 0.64] | 0.90 [0.77, 1.05] |
| Units | Relative error (%) | Sum gap | Max. | |
|---|---|---|---|---|
| Mean | Max. | (%) | ||
| Layer | 0.23 | 0.32 | 0.03 | 1.26 |
| Matrix | 0.30 | 0.43 | 0.02 | 1.17 |
| Family | Arms | Covariance | Uniform | Adjacent |
|---|---|---|---|---|
| Cycling / copy-refresh | 9 | 0.17 | 0.68 | 0.61 |
| Blocks of layers | 6 | 0.17 | 0.95 | 0.85 |
| Placement of changes | 6 | 0.13 | 1.02 | 0.71 |
| Ties within a layer | 6 | 0.17 | 0.33 | 2.44 |
| All | 27 | 0.16 | 0.74 | 1.09 |
| Arrangement | Measured [95% CI] | Covariance | Uniform | Adjacent |
|---|---|---|---|---|
| 6+6 switch | +0.59 [0.35, 0.84] | +0.45 | +1.13 | +0.19 |
| 3+3 | +1.04 [0.79, 1.28] | +0.94 | +1.13 | +0.56 |
| segments of 4 | +0.86 [0.50, 1.19] | +0.78 | +1.51 | +0.38 |
| ABAB | +1.42 [1.13, 1.70] | +1.49 | +1.13 | +2.07 |
| ABC cycle | +1.85 [1.48, 2.22] | +1.86 | +1.51 | +2.07 |
| ABCD cycle | +1.98 [1.60, 2.37] | +1.98 | +1.69 | +2.07 |
| Arrangement | Measured [95% CI] | Covariance | Uniform | Adjacent |
|---|---|---|---|---|
| 6+6 switch | +0.96 [0.68, 1.27] | +0.81 | +2.04 | +0.34 |
| 3+3 | +1.60 [1.24, 1.96] | +1.71 | +2.04 | +1.02 |
| segments of 4 | +1.38 [0.95, 1.85] | +1.40 | +2.72 | +0.68 |
| ABAB | +2.37 [1.75, 3.10] | +2.70 | +2.04 | +3.75 |
| ABC cycle | +3.20 [2.42, 4.10] | +3.36 | +2.72 | +3.75 |
| ABCD cycle | +3.40 [2.64, 4.27] | +3.59 | +3.06 | +3.75 |
| Operator | Scale | Covariance | Uniform | Adjacent |
|---|---|---|---|---|
| ACE-Merging | 0.16 | 0.40 | 0.52 | |
| ACE-Merging | selected | 0.15 | 0.40 | 0.51 |
| Iso-CTS | 0.16 | 0.16 | 0.28 | |
| Iso-CTS | selected | 0.32 | 0.53 | 0.64 |
| Method | Layers/block | Measured | Covariance | Uniform | Adjacent |
|---|---|---|---|---|---|
| TSV-M | 6 | 74.60 | 75.83 | 74.13 | |
| 3 | 75.62 | 76.85 | 74.81 | ||
| 2 | 76.34 | 77.19 | 75.49 | ||
| TA | 6 | 58.20 | 59.42 | 57.74 | |
| 3 | 59.19 | 60.43 | 58.41 | ||
| 2 | 59.97 | 60.76 | 59.08 |
| Layers per segment | Measured | Covariance | Uniform | Adjacent |
|---|---|---|---|---|
| TSV-M | ||||
| Best (4, 2, 2, 4) | 75.71 | 76.74 | 74.81 | |
| Even (3, 3, 3, 3) | 75.62 | 76.85 | 74.81 | |
| Worst (1, 9, 1, 1) | 74.57 | 75.49 | 74.81 | |
| TA | ||||
| Best (4, 2, 3, 3) | 59.23 | 60.37 | 58.41 | |
| Tied sets | Measured | Covariance | Uniform | Adjacent |
|---|---|---|---|---|
| TSV-M | ||||
| Best (fc2 alone) | 78.04 | 78.16 | 75.28 | |
| Worst (query alone) | 77.28 | 78.16 | 75.28 | |
| Two sets | 77.70 | 78.23 | 75.28 | |
| Three sets | 77.72 | 78.32 | 76.05 | |
| TA | ||||
| prediction | MAE, error ratio | MAE, accuracy (pp) |
|---|---|---|
| covariance (fixed in advance) | 0.029 | 0.113 |
| uniform rule (fixed in advance) | 0.268 | 0.504 |
| adjacent rule (fixed in advance) | 0.076 | 0.239 |
| adjacent pair, -weighted (post hoc) | 0.065 | 0.214 |
| fixed in advance | post hoc | |||||||
|---|---|---|---|---|---|---|---|---|
| Family | Cov. | Unif. | Adj. | Avg. | Dist. | Type+dist. | Geom. | |
| Nine arrangements (TSV-M) | 9 | 0.17 | 0.68 | 0.61 | 0.19 | 0.19 | 0.19 | 0.15 |
| Blocks, TSV-M | 3 | 0.17 | 0.94 | 0.88 | 0.15 | 0.25 | 0.25 | 0.19 |
| Blocks, TA | 3 | 0.17 | 0.97 | 0.83 | 0.23 | 0.22 | 0.22 | 0.17 |
| Placement, TSV-M | 3 | 0.09 | 1.15 | 0.66 | 0.37 | 0.23 | 0.23 | 0.33 |
| Placement, TA | 3 | 0.18 | 0.89 | 0.75 | 0.24 | 0.30 | 0.30 | 0.19 |
| Granularity | Selection | Actual held-out feature error | Linearized held-out feature error | Test accuracy (%) |
|---|---|---|---|---|
| Layer | Random BRR | |||
| Single-unit objective | ||||
| Linearized objective | ||||
| Actual objective | ||||
| Matrix | Random BRR | |||
| Single-unit objective |
| Test accuracy (points) | Actual held-out feature error | ||||
|---|---|---|---|---|---|
| Granularity | Comparison | Difference | Higher in | Difference | Lower in |
| Layer | Linearized random | 5/5 | 5/5 | ||
| Single-unit random | 2/5 | 5/5 | |||
| Linearized single-unit | 5/5 | 4/5 | |||
| Actual random | 5/5 | 5/5 | |||
| Actual linearized | 3/5 | 5/5 | |||
| Units | Objective | Search time | Total cost (GPU-hours) |
|---|---|---|---|
| Layer | Linearized | 3–10 s | |
| Actual | 0.5–1.1 h | 2.22 | |
| Matrix | Linearized | 14–69 s | |
| Actual | 3.7–5.4 h | 6.33 |
| Deployment | Merged weights (backbones) | routing | total |
|---|---|---|---|
| grouping-only operator, any grouping, merged units | KB | ||
| FlexMerge official, / budget | 9.95 / 4.96 | 5.2 KB | 9.95 / 4.96 |
| EMR or TALL masks, | 10 (+1 base) | KB | 14.13 |
| 100 experts | 100 | – | 100 |
| Batch | Method | Median (ms) | vs. dense |
|---|---|---|---|
| 16 | Channel Merging | 28.6 | 3.55 |
| 16 | FlexMerge | 18.9 | 2.34 |
| 16 | shared | 14.8 | 1.83 |
| 16 | BRR-layer | 18.0 | 2.23 |
| 16 | BRR-matrix | 26.9 | 3.34 |
| 64 | Channel Merging | 91.9 | 3.10 |
| InternVL2.5-1B | Qwen2-VL-7B | |||||||
|---|---|---|---|---|---|---|---|---|
| Method | TA | TSV-M | Iso-CTS | ACE | TA | TSV-M | Iso-CTS | ACE |
| Channel Merging | ||||||||
| FlexMerge | ||||||||
| Shared | ||||||||
| BRR-layer | ||||||||
| BRR-matrix | ||||||||
| InternVL2.5-1B | Qwen2-VL-7B | InternVL2.5-1B | Qwen2-VL-7B | ||||||
| Merging | Grouping | VQA | MC | VQA | MC | VQA | MC | VQA | MC |
| TA | FlexMerge | 62.37 | 76.74 | 71.74 | 89.94 | 68.20 | 79.05 | 79.47 | 94.03 |
| Shared | 65.25 | 80.12 | 74.06 | 92.11 | 74.68 | 86.16 | 81.16 | 95.03 | |
| BRR-layer | 66.47 | 80.15 | 76.14 | 93.66 | 75.46 | 86.49 | 81.70 | 95.08 | |
| BRR-matrix | 66.60 | 80.21 | 76.27 | 93.63 | 75.87 | 86.60 | 81.74 | 95.06 | |
Model Merging
Model merging combines trained model weights or adapters to reuse capabilities while reducing the cost of joint training or ensembles.
See all 226 papers