arXiv:2508.20577cs.LGcs.AI2025-08ICML

提出MERIT优化器,解决大批次训练中注意力过热问题

MERIT: Maximum-normalized Element-wise Ratio for Language Model Large-batch Training

  • 用最大范数计算信任比,直接控制注意力最大值
  • 在GPT-2 Medium上实现6000大批次训练无性能下降
  • 适合需要高速迭代大模型的研究者和工业应用

大批次训练是加速深度神经网络训练的核心方法,但在语言模型中常面临优化与泛化挑战。现有优化器如AdamW因注意力层中最大注意力logit急剧上升导致信息瓶颈,性能下降;尽管LAMB部分缓解此问题,但其基于l2范数的信任比对查询/键权重最大值影响有限,且逐权重信任比易出错,忽略行或列内权重关系。为此,本文提出新型优化器MERIT,利用最大范数计算信任比,更有效地约束最大注意力logit;并构建逐元素信任比,通过关注局部权重结构实现更鲁棒的更新缩放。在多种规模的GPT-2模型上进行的大批次训练实验表明,MERIT表现优异。特别地,在训练GPT-2 Medium时,使用480标准批次(480)对比6000大批次,仅需480亿训练标记即保持性能无损。该工作强调了最大注意力logit与细粒度信任比在大批次训练中的重要性,显著提升训练稳定性,推动更大批次使用,加速大语言模型研发。代码已公开于https://github.com/NUS-HPC-AI-Lab/MERIT。

原文摘要 · Abstract (English)

Large-batch training has become a cornerstone in accelerating the training of deep neural networks, yet it poses challenges in optimization and generalization. Existing optimizers like AdamW present performance degradation during language models' large-batch training, due to the information bottleneck in attention layers caused by the sharp increase of max attention logit. While the LAMB optimizer partially addresses this issue, some attention layers still face this issue. The reason is that $l_2$-norm-based trust ratios in LAMB are less effective in directly influencing the max value of query/key weights. Furthermore, the weight-wise trust ratio in LAMB is error-prone as it overlooks relationships of weight values within rows or columns. Building on these observations, we propose a novel optimizer, MERIT, which leverages the max-norm to calculate the trust ratio to constrain the max attention logit more effectively. Moreover, we further construct element-wise trust ratios to provide more robust update scaling by focusing on local weight structures. Extensive experiments of large-batch training across various sizes of GPT-2 models demonstrate the superior performance of MERIT. Notably, during the training of GPT-2 Medium, MERIT enables a 6k batch size without any performance degradation compared to the standard batch size (480) with 48B training tokens. This work highlights the importance of considering the max attention logit and finer-granularity trust ratio in large-batch training. It successfully improves the training stability and paves the way for larger batch usage, enabling faster development and iteration of large language models. Code is available at https://github.com/NUS-HPC-AI-Lab/MERIT.

优化器大批次训练语言模型注意力机制

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