arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.17410cs.LG
收藏

COSMOS:一种用于LLM内存高效训练的混合自适应优化器

COSMOS: A Hybrid Adaptive Optimizer for Memory-Efficient Training of LLMs

Georgia Tech(佐治亚理工学院);Microsoft(微软公司)

Liming Liu, Zhenghao Xu, Zixuan Zhang, Hao Kang, Zichong Li, Chen Liang, Weizhu Chen, Tuo Zhao

AI总结:

针对LLM训练中自适应优化器内存消耗高或近似误差大的问题,提出混合优化器COSMOS,对主导特征子空间应用SOAP、对其余应用MUON,在保持优化性能的同时显著降低内存消耗。

摘要:

大型语言模型(LLMs)在各个领域取得了显著成功,但由于其处于复杂且高维的损失景观中,优化仍是一项重大挑战。尽管像AdamW这样的自适应优化器被广泛使用,但它们存在关键局限性,包括无法捕捉坐标间的相互依赖关系以及高内存消耗。后续以SOAP为代表的研究试图更好地捕捉坐标间的相互依赖性,却产生了更大的内存开销,限制了对大规模LLMs的可扩展性。另一种方法旨在通过低维投影降低内存消耗,但这会导致严重的近似误差,使得优化效果变差(例如,在每token效率方面)。在本文中,我们提出了COSMOS,一种新型混合优化器,它利用梯度矩阵中特征子空间的不同重要性来实现内存效率,同时不妥协优化性能。COSMOS的设计动机源于我们的经验性洞察和实际考量。具体而言,COSMOS将SOAP应用于主导特征子空间,该子空间捕捉了主要的优化动态;并将MUON应用于剩余特征子空间,该子空间不太关键但用SOAP处理计算成本高昂。这种混合策略在保持稳健优化性能的同时显著降低了内存消耗,使其特别适合大规模LLMs。我们在各种数据集和transformer架构上进行了数值实验,以证明COSMOS的有效性。我们的代码可在 https://github.com/lliu606/COSMOS 获取。

英文摘要:

Large Language Models (LLMs) have demonstrated remarkable success across various domains, yet their optimization remains a significant challenge due to the complex and high-dimensional loss landscapes they inhabit. While adaptive optimizers such as AdamW are widely used, they suffer from critical limitations, including an inability to capture interdependencies between coordinates and high memory consumption. Subsequent research, exemplified by SOAP, attempts to better capture coordinate interdependence but incurs greater memory overhead, limiting scalability for massive LLMs. An alternative approach aims to reduce memory consumption through low-dimensional projection, but this leads to substantial approximation errors, resulting in less effective optimization (e.g., in terms of per-token efficiency). In this paper, we propose COSMOS, a novel hybrid optimizer that leverages the varying importance of eigensubspaces in the gradient matrix to achieve memory efficiency without compromising optimization performance. The design of COSMOS is motivated by our empirical insights and practical considerations. Specifically, COSMOS applies SOAP to the leading eigensubspace, which captures the primary optimization dynamics, and MUON to the remaining eigensubspace, which is less critical but computationally expensive to handle with SOAP. This hybrid strategy significantly reduces memory consumption while maintaining robust optimization performance, making it particularly suitable for massive LLMs. Numerical experiments on various datasets and transformer architectures are provided to demonstrate the effectiveness of COSMOS. Our code is available at https://github.com/lliu606/COSMOS.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑