联邦学习调LoRA的朋友看这篇,它告诉你A和B该共享哪个,还给了个训练前就能算的指标,省得瞎试。
联邦学习中的LoRA微调通常将更新矩阵分解为A和B两个因子。本文通过最小二乘代理模型分析发现,共享A保留本地B(Share-A/Local-B)要求客户端更新矩阵共享输入侧秩r空间,而共享B保留本地A(Share-B/Local-A)则要求共享输出侧秩r空间,两种策略投影残差不同。据此提出FedAS-LoRA,在训练前用Rank-Aware Shared-Subspace Sufficiency(RSS)指标评估共享子空间充分性,自动选择共享侧。实验覆盖不同任务、数据分布、LoRA秩和参与率设置,验证了RSS有效性和FedAS-LoRA的优越性能。
Rethinking Factor Sharing in Federated LoRA: A Rank-Aware Adaptive Approach
Low-rank adaptation (LoRA) represents large language model (LLM) updates with two compact matrix factors, i.e., $A$ and $B$, providing an efficient way to fine-tune large models in federated learning paradigm. Inspired by the asymmetric roles of the LoRA factors, we study whether $A$ should be shared across clients while $B$ remains client-specific (Share-A/Local-B), or whether $B$ should instead be shared while $A$ remains client-specific (Share-B/Local-A). With a least-squares surrogate, we reveal that Share-A/Local-B requires the client-specific LoRA update matrices to use a common rank-$r$ input-side space, whereas Share-B/Local-A requires a common rank-$r$ output-side space. The two strategies therefore incur different projection residuals, indicating that the preferred strategy is the one with the smaller aggregate residual across clients. With this insight, we propose Federated Adaptive Factor Sharing Low-Rank Adaptation (FedAS-LoRA), which selects the sharing side before training to enhance fine-tuning performance. To enable adaptive factor selection before training, we design a Rank-Aware Shared-Subspace Sufficiency (RSS) metric, which effectively assesses whether a shared rank-$r$ input subspace is sufficient for the local data distributions using representations extracted from a frozen LLM backbone. Experiments across different tasks, data distributions, LoRA ranks, and participation settings confirm the effectiveness of RSS and the superior performance of FedAS-LoRA.