arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2511.17599cs.LGcs.AI
收藏

从投影到预测:超越logits的可扩展语言模型

From Projection to Prediction: Beyond Logits for Scalable Language Models

NVIDIA

Jianbing Dong, Jianbin Chang

AI总结:

本文提出了一种将输出投影与损失预测整合的方法,通过直接计算损失减少内存和带宽消耗,提升大型语言模型的训练效率和可扩展性。

摘要:

训练大型语言模型(LLMs)通常在输出层涉及一个两阶段的流程:隐藏状态通过线性变换(lm_head)投影到词汇logits,随后计算与目标标记的交叉熵损失。尽管概念上简单,这种设计带来了显著的开销。中间logits张量的维度与批量大小、序列长度和词汇大小成正比,必须在GPU内存中完全显式化,尽管最终每个位置只使用一个目标标记。这导致了显著的内存占用和带宽消耗,限制了可扩展性和训练吞吐量。在本文中,我们提出了一种新的方法,将输出投影和损失预测整合到单个操作中。通过直接从隐藏状态和目标标记计算损失,我们的方法绕过了显式的logits显式化。这种设计减少了内存使用并缓解了带宽压力。在LLM训练实验中,我们的方法在内存使用和速度提升方面相比标准的两阶段流程实现了显著的节省和可测量的加速,使得大批量和更长的序列在不牺牲准确性的情况下成为可能。我们的工作强调了重新思考投影与预测之间的边界的好处,为高效LLM训练提供了一种实用的系统优化。

英文摘要:

Training Large Language Models (LLMs) typically involves a two-stage pipeline at the output layer: hidden states are projected into vocabulary logits via a linear transformation (lm_head), followed by cross-entropy loss computation against target tokens. While conceptually simple, this design incurs substantial overhead. The intermediate logits tensor, with dimensions proportional to batch size, sequence length, and vocabulary size, must be fully materialized in GPU memory, even though only one target token per position is ultimately used. This leads to significant memory footprint and bandwidth comsumption, limiting scalability and slowing training throughput. In this work, we introduce a novel approach to integrates the output projection and loss prediction into a single operation. By directly computing the loss from hidden states and target tokens, our approach bypasses explicit logits materialization. This design reduces memory usage and alleviates bandwidth pressure. Experiments on LLM training demonstrate that our method achieves substantial memory savings and measurable speedups compared to the standard two-stage pipeline, enabling large batch sizes and longer sequences without sacrificing accuracy. Our work highlights the benefits of rethinking the boundary between projection and prediction, offering a practical systems optimization for efficient LLM training.

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

↑