GRAM: Group-wise Rank-Aware Modal Merging via Subspace Alignment

Di Wu, Shuaidong PanNeurIPS 2026

TL;DR

Forcing a dozen specialized fine-tuned models into a single merged model often destroys performance on outlier tasks because their learned parameter directions clash. GRAM fixes this without needing any training data: instead of forcing one universal model, it reads the geometric "angles" between task weights, groups compatible tasks into $K$ friendly coalitions, and merges within those groups. Just allowing two merged models instead of one eliminates most of the interference and sets a new bar across vision, language, and medical benchmarks.

What Problem Does This Paper Address?

Imagine several hospitals each fine-tuning the same base LLM on local patient records. Due to strict privacy laws, they cannot share data—only model weights. Model merging promises to combine these task-specific updates ("task vectors," or the difference between fine-tuned and base weights) into a single multi-task model without retraining.

The catch? Almost all existing methods perform a uniform global merge, squishing every task into one shared parameter space. When tasks learn misaligned weight directions, projecting them onto a single low-rank basis throws away vital, task-specific information—a failure mode the authors call subspace interference. Worse, many methods that try to fix this require calibration data or activations at merge time, which violates strict data-privacy rules.

Figure 1: How tasks are grouped on the Grassmannian governs merging quality. Insets: three partitions of the per-task low-rank subspaces visualised on the Grassmannian—all tasks merged into a single global coalition (top, low intra-coalition similarity), three groups (middle), and the two- group GRAM partition (bottom, high intra-coalition similarity). Curve: as intra-coalition similarity increases, merged-model accuracy rises (left axis, solid) and the within-group subspace projection error P

Methods

Instead of compressing $T$ models into $1$, GRAM (Group-wise Rank-Aware Model Merging) compresses $T$ models into a tiny budget of $K \ll T$ models (typically $K=2$), operating exclusively on frozen weights. The pipeline has three stages:

  1. Measuring Subspace Geometry (New): For each layer, GRAM decomposes each task's weight update via Singular Value Decomposition (SVD) to extract its output subspace. It measures compatibility between tasks using squared chordal distance—a metric based on the principal angles between subspaces that directly governs how much information is lost when two tasks share a basis.
  2. Grassmannian $k$-Means++ Clustering (New): Treating each task's subspace projector as a point on a geometric manifold (the Grassmannian), GRAM runs $k$-means++ on the layer-averaged chordal distances to partition tasks into $K$ geometrically coherent coalitions, backed by an $O(\log K)$ optimality guarantee.
  3. Adaptive Per-Coalition Merge (New + Standard): Within each group, rather than splitting the rank budget $r$ equally, a greedy adaptive rank allocator pools singular values across member tasks and hands more rank capacity to complex tasks with heavy spectral tails. Finally, it combines the selected singular components using a standard orthogonal polar-factor merge (following TSV-Merge).
Figure 2: The GRAM pipeline. Each task vector ∆Wi is decomposed via SVD to extract its top-r left- and right-singular subspaces (Ui, Vi) (left). The collection of Ui’s is fed into a subspace clustering step that partitions the T tasks into K coalitions by chordal distance (middle). Within each coalition, the selected top-ki singular components from member tasks are concatenated and re-orthonormalized via thin SVD to yield a single rank-r merged update (right).

Datasets

GRAM is evaluated post-hoc on pre-existing fine-tuned checkpoints across three benchmarks (no new datasets are introduced, though the authors assemble a 4-expert medical evaluation):

  • Language Understanding (GLUE): 8 tasks (CoLA, MNLI, MRPC, QNLI, QQP, RTE, SST-2, STS-B) using LoRA-tuned Flan-T5-Base and Flan-T5-Large.
  • Computer Vision: An 8-task benchmark (MNIST, SVHN, GTSRB, DTD, Cars, RESISC45, EuroSAT, SUN397) using fully fine-tuned CLIP ViT-B/32 and ViT-L/14.
  • Medical Instruction Tuning: Four public LoRA experts on Qwen2-7B-Instruct spanning English and Chinese multiple-choice QA and doctor-patient dialogues (MedQA, CMExam, HealthcareMagic, cMedQA2).

Key Insights and Ideas

  • The $K=2$ "Sharp Knee": You don't need many models to stop interference. Moving from $K=1$ to $K=2$ captures 87% (Flan-T5-Base) and 73% (Flan-T5-Large) of the accuracy gap to the unmerged individual oracle, costing just one extra rank-16 LoRA adapter (~0.7% of backbone parameters). Going from $K=2$ to $K=7$ adds almost nothing (+0.1% to +0.6%).
  • Outliers Win Big: Global merges quietly sacrifice geometric outliers to satisfy the majority cluster. On GLUE, MNLI and STS-B sit at large angles from the bulk tasks; isolating them into a second coalition recovers massive accuracy drops (+8.1 points on MNLI for Flan-T5-Base over TSV-Merge).
  • You Don't Actually Need Task Labels at Test Time: While GRAM assumes you know which task is being queried, a lightweight Mahalanobis distance router (using 5 training samples per class and zero gradient updates) routes 100% of GLUE validation queries to the right $K=2$ group—because the tasks a router might confuse (like QQP and MRPC) are geometrically similar and already merged into the same coalition!

Key Results

With $K=2$ and zero calibration data, GRAM consistently beats single-model baselines:

  • GLUE: Achieves 83.8% (Flan-T5-Base) and 88.7% (Flan-T5-Large) average score, beating the strongest baseline (TSV-Merge) by +2.1 and +0.9 points.
  • Vision: Hits 88.7% (ViT-B/32) and 94.0% (ViT-L/14) average test accuracy, outperforming Iso-CTS (85.8% / 93.9%) and TSV-Merge (85.0% / 92.8%).
  • Medical: Achieves the best overall rank (2.40) and highest average relative improvement (+75.54% over pretrained), beating even data-dependent methods like RegMean (+71.48%) and Fisher-Merge (+27.18%) that use 64 calibration samples per task.
  • Speed: Grouping 8 tasks takes ~1 second on a single RTX 3080, and scaling to 1,024 synthetic adapters finishes in under ~2.5 minutes.

Limitations and Future Work

  • Single-seed & Model Scope: Results use single-seed reporting (making tight margins on Flan-T5-Large warrant caution) and test one model family per modality.
  • Simulated Privacy Setting: The medical benchmark uses public checkpoints rather than a live, multi-hospital federated deployment.
  • Theory vs. Practice Gap: The theoretical bounds analyze idealized optimal group bases rather than GRAM's exact column-stacked, adaptively allocated SVD merge.
  • Future Directions: The authors plan to scale task-agnostic routing to massive adapter collections and test GRAM in real multi-site federated healthcare setups.

Summary updated

Abstract

Merging different models into a single model is highly desirable for multi-task deployment, particularly in regulated domains like healthcare. In such settings, models are often locally fine-tuned due to strict data privacy policies, necessitating that aggregation operates exclusively on the fine-tuned weights. Existing meth- ods apply a uniform merge across all tasks, ignoring the geometric relationships among their learned subspaces. When task updates occupy misaligned subspaces, projecting them onto a shared low-rank basis discards task-relevant directions, a failure mode named subspace interference. Through this study, we show that the per-task projection error of a merged model is governed by the principal-angle alignment between each task and the shared subspace, so that grouping geometri- cally compatible tasks provably reduce this error within each group. Motivated by this observation, we propose Group-wise Rank-Aware Model Merging (GRAM), which uses the principal-angle geometry of task vectors to decide which tasks should be merged and then performs a standard SVD-based merge within each coalition; the pipeline requires only the fine-tuned weights at merge time. With only one additional model (K=2), GRAM significantly mitigates subspace in- terference and consistently outperforms prior merging methods across language understanding (GLUE with Flan-T5), 8-task CLIP vision, and medical instruction tuning (Qwen2-7B-Instruct with four English/Chinese medical LoRAs).
BibTeX
@inproceedings{wu2026gram,
  author = {Di Wu and Shuaidong Pan},
  title = {{GRAM: Group-wise Rank-Aware Modal Merging via Subspace Alignment}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=MOnKup7VWM},
}
Figure