arXiv:2503.01843cs.LGcond-mat.dis-nn2025-03被引 5

提出轻量版Adam优化器,节省98%内存且性能不变

When Can You Get Away with Low Memory Adam?

  • 通过信噪比分析判断何时可压缩梯度方差信息
  • 在多种模型上实现与Adam相当的性能,最高省98%内存
  • 适合大模型训练中内存受限的场景

Adam是现代机器学习模型训练的主流优化器,但需额外内存存储梯度及其平方的移动平均。尽管已有多种低内存优化器,其可靠性不足导致仍以Adam为默认选择。本文通过分层信噪比(SNR)分析,量化了在不同维度上用均值替代二阶矩的可行性。SNR分析揭示了模型结构、训练超参数和数据集特性对压缩性的影响,自然导出轻量版优化器SlimAdam。该方法在信噪比高时沿维度压缩二阶矩,在压缩有害时保持原样。在多种架构和训练场景下,SlimAdam在保持与Adam相当性能和稳定性的同时,最多节省98%的二阶矩内存。代码已公开于https://github.com/dayal-kalra/low-memory-adam。

原文摘要 · Abstract (English)

Adam is the go-to optimizer for training modern machine learning models, but it requires additional memory to maintain the moving averages of the gradients and their squares. While various low-memory optimizers have been proposed that sometimes match the performance of Adam, their lack of reliability has left Adam as the default choice. In this work, we apply a simple layer-wise Signal-to-Noise Ratio (SNR) analysis to quantify when second-moment tensors can be effectively replaced by their means across different dimensions. Our SNR analysis reveals how architecture, training hyperparameters, and dataset properties impact compressibility along Adam's trajectory, naturally leading to $\textit{SlimAdam}$, a memory-efficient Adam variant. $\textit{SlimAdam}$ compresses the second moments along dimensions with high SNR when feasible, and leaves when compression would be detrimental. Through experiments across a diverse set of architectures and training scenarios, we show that $\textit{SlimAdam}$ matches Adam's performance and stability while saving up to $98\%$ of total second moments. Code for $\textit{SlimAdam}$ is available at https://github.com/dayal-kalra/low-memory-adam.

优化器内存优化深度学习

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。