Closed-Form Merging of Parameter-Efficient Modules for Federated Continual Learning

Riccardo Salami, Pietro Buzzega, Matteo Mosconi, Jacopo Bonato, Luigi Sabetta, Simone Calderara

In the rapidly evolving landscape of decentralized AI, two major challenges often collide: Federated Learning (FL), where data stays on local devices, and Continual Learning (CL), where models must learn new tasks without forgetting old ones. When you combine them into Federated Class-Incremental Learning (FCIL), you get a "boss level" challenge involving data privacy, limited communication bandwidth, and the dreaded "catastrophic forgetting."

A new paper accepted to ICLR 2025, titled "Closed-Form Merging of Parameter-Efficient Modules for Federated Continual Learning," introduces a clever way to navigate this minefield using LoRM (Low-rank Regression Mean).

TL;DR

The authors propose LoRM, a method to merge LoRA (Low-Rank Adaptation) modules by mathematically aligning their outputs rather than just averaging their weights. By using an alternating optimization strategy to solve an otherwise "unsolvable" indeterminate system, they achieve state-of-the-art performance in federated environments while keeping communication costs low and data private.

What Problem Does This Paper Address?

The standard way to combine models in Federated Learning is FedAvg—simply averaging the weights. While this works for basic tasks, it struggles with "client drift" (where local models diverge too much) and "catastrophic forgetting" (where the model loses old skills as it learns new ones).

Recently, researchers have turned to Parameter-Efficient Fine-Tuning (PEFT), specifically LoRA, which adds small, low-rank matrices ($A$ and $B$) to a frozen pre-trained model. While you can average these LoRA modules, simple averaging doesn't guarantee that the merged model will actually behave like the individual ones.

The authors ask: Can we merge these modules so the global model's output matches the sum of the local models' responses?

Methods: The LoRM Approach

The researchers build on a technique called RegMean, which merges linear layers by solving a least-squares problem to minimize the difference between the merged model's output and the original models' outputs.

However, applying RegMean to LoRA is tricky. Because a LoRA update is a product of two matrices ($BA$), trying to solve for both $A$ and $B$ simultaneously results in an indeterminate system—there are infinitely many solutions, and the math essentially "breaks" ($0 = 0$).

The "Aha!" Moment: Alternating Optimization

To fix this, the authors introduce LoRM. Instead of trying to solve for $A$ and $B$ at once, they alternate:

  1. Round J: Freeze matrix $A$, train only $B$ on the clients. The server then merges the $B$ matrices using a unique closed-form solution.
  2. Round J+1: Freeze the newly merged $B$, train only $A$. The server merges the $A$ matrices.
LoRM Alternating Optimization Strategy

By alternating, they turn an indeterminate problem into two solvable ones.

Privacy and Efficiency

To align the model responses, the server needs to know something about the data distribution. Instead of sending raw data (a privacy nightmare), clients send the diagonal of the Gram matrix of their inputs. This provides enough statistical context to align the model responses without exposing the actual data.

Datasets

The authors put LoRM through a rigorous gauntlet across multiple domains:

  • In-domain Vision: CIFAR-100, ImageNet-R, and ImageNet-A.
  • Specialization: Cars-196 and CUB-200 (birds).
  • Out-of-domain: EuroSAT (satellite imagery).
  • Language: Out-Of-Scope (OOS) intent classification.

They tested these under varying degrees of data heterogeneity (using a Dirichlet distribution parameter $\beta$), simulating real-world scenarios where some clients have very different data than others.

Key Insights and Ideas

  • Response Matching > Weight Averaging: The core philosophy is that behavior matters more than values. Aligning how a model reacts to data leads to much more robust merging than simply averaging numbers in a matrix.
  • The Power of Alternating: The discovery that the LoRA merging system is indeterminate is a significant theoretical contribution. The alternating strategy isn't just a heuristic; it's a mathematical necessity to find a unique solution.
  • Communication Efficiency: Because LoRM only transmits one low-rank matrix ($A$ or $B$) per round, it is significantly more bandwidth-efficient than full-parameter fine-tuning or even standard LoRA merging.

Key Results

LoRM consistently outperformed 10 competing methods, including current state-of-the-art approaches like PILoRA.

Performance comparison on CIFAR-100, ImageNet-R, and ImageNet-A
  • Superior Accuracy: On CIFAR-100 with high data imbalance ($\beta=0.05$), LoRM achieved 82.76% accuracy, significantly higher than the next best competitor (PILoRA at 74.80%).
  • Faster Convergence: LoRM reaches high accuracy in fewer communication rounds compared to other federated methods because the closed-form solution is mathematically "optimal" for the given round.
  • Robustness: It showed remarkable stability across both vision and language tasks, proving the method isn't just a "vision trick."

Limitations and Future Work

While LoRM is powerful, the authors note a few areas for growth:

  • LoRA Specificity: The current derivation is grounded in the original LoRA framework. While they provide hints for other PEFT methods like VeRA or $(IA)^3$ in the appendix, those weren't the primary focus of the experimental results.
  • Gram Matrix Overhead: Although they only send the diagonal, calculating the Gram matrix requires an extra forward pass over the data at the end of each round.
  • Future Directions: The authors suggest exploring the robustness of these closed-form equations in even more diverse model-merging scenarios beyond the federated/continual learning niche.

Check out the code: The authors have made their implementation available as part of the Mammoth library.

Summary updated

BibTeX
@inproceedings{salami2025closed,
  author = {Riccardo Salami and Pietro Buzzega and Matteo Mosconi and Jacopo Bonato and Luigi Sabetta and Simone Calderara},
  title = {{Closed-Form Merging of Parameter-Efficient Modules for Federated Continual Learning}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=ROpY0qRUXL},
}
Figure