用卡尔曼滤波优化大模型微调,更省资源、收敛更快。
LoKO: Low-Rank Kalman Optimizer for Online Fine-Tuning of Large Models
- 将参数高效微调建模为状态估计问题,用卡尔曼滤波在线更新参数。
- 相比传统优化器,迭代次数减少,图像分类与语言任务性能更优。
- 适用于视觉与语言大模型,尤其适合实时在线微调场景。
从零训练包含数百万甚至数十亿参数的大模型计算成本极高。参数高效微调(PEFT)方法,尤其是低秩适配(LoRA),通过仅调整少量参数来应对特定任务,结合基于梯度的优化器实现。本文将PEFT视为最优滤波/状态估计问题,提出低秩卡尔曼优化器(LoKO),实现参数的在线估计。利用LoRA中的低秩分解显著缩小卡尔曼迭代中的矩阵规模,并通过协方差矩阵的对角近似,将计算复杂度从二次降至线性。我们发现卡尔曼算法中协方差矩阵的初始化和观测噪声协方差的准确估计是关键,提出了在多种主流视觉与语言模型上表现稳定的鲁棒方法。实验表明,LoKO在图像分类与语言任务中均以更少迭代次数收敛,生成的模型性能优于常用优化器搭配LoRA的结果。本研究揭示了卡尔曼滤波作为大模型在线微调有效优化器的潜力。
原文摘要 · Abstract (English)
Training large models with millions or even billions of parameters from scratch incurs substantial computational costs. Parameter Efficient Fine-Tuning (PEFT) methods, particularly Low-Rank Adaptation (LoRA), address this challenge by adapting only a reduced number of parameters to specific tasks with gradient-based optimizers. In this paper, we cast PEFT as an optimal filtering/state estimation problem and present Low-Rank Kalman Optimizer (LoKO) to estimate the optimal trainable parameters in an online manner. We leverage the low-rank decomposition in LoRA to significantly reduce matrix sizes in Kalman iterations and further capitalize on a diagonal approximation of the covariance matrix to effectively decrease computational complexity from quadratic to linear in the number of trainable parameters. Moreover, we discovered that the initialization of the covariance matrix within the Kalman algorithm and the accurate estimation of the observation noise covariance are the keys in this formulation, and we propose robust approaches that work well across a vast range of well-established computer vision and language models. Our results show that LoKO converges with fewer iterations and yields better performance models compared to commonly used optimizers with LoRA in both image classifications and language tasks. Our study opens up the possibility of leveraging the Kalman filter as an effective optimizer for the online fine-tuning of large models.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。