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.
Clone What You Can't Steal: Black-Box LLM Replication via Logit Leakage and Distillation
Department of Electrical Engineering and Computer Science(电气工程与计算机科学系);Embry-Riddle Aeronautical University(埃姆布里-里德尔航空大学);Department of Mathematics(数学系)
School of Artificial Intelligence, Wuhan University(武汉大学人工智能学院);School of Computer Science, Wuhan University(武汉大学计算机学院);School of Information Management, Wuhan University(武汉大学信息管理学院);School of Computer Science, Shanghai Jiao Tong University(上海交通大学计算机学院)
Scalable Heterogeneous Graph Learning via Heterogeneous-aware Orthogonal Prototype Experts
National Engineering Research Center for Big Data Technology;System Lab, Cluster;Grid Computing Lab, School of Computer Science;Technology, Huazhong University of Science;DIRO, Université de Montréal \& Mila \& Canada CIFAR AI Chair, Canada
Adversarial Training with Fast Gradient Projection Method against Synonym Substitution based Text Attacks
School of Computer Science and Technology, Huazhong University of Science and Technology(华中科技大学计算机科学与技术学院);Computer Science Department, University of California, Los Angeles(加州大学洛杉矶分校计算机科学系)
Scalable Adaptive Stochastic Optimization Using Random Projections
Institute for Machine Learning, Department of Computer Science, ETH Zürich(苏黎世联邦理工学院计算机科学系机器学习研究所);Seminar for Statistics, Department of Mathematics, ETH Zürich(苏黎世联邦理工学院数学系统计研讨班);Disney Research, Zürich(迪士尼研究院苏黎世分院)
Differentiable Zero-One Loss via Hypersimplex Projections
School of Data, Mathematical, and Statistical Sciences, University of Central Florida, Orlando, USA(数据、数学与统计科学学院,中央佛罗里达大学,奥兰多,美国);Department of CIS, University of Macau, Macao, China(信息与系统系,澳门大学,澳门,中国)
Merging Models on the Fly Without Retraining: A Sequential Approach to Scalable Continual Model Merging
Wuhan University(武汉大学);Northeastern University(东北大学);Sun Yat-sen University(中山大学);Beijing Institute of Technology(北京理工大学);Nanyang Technological University(南洋理工大学)
Simple, Scalable and Effective Clustering via One-Dimensional Projections
Institute of Science and Technology Austria (ISTA)(奥地利科学技术学院);University of Vienna(维也纳大学);University of Pennsylvania(宾夕法尼亚大学);Stanford University(斯坦福大学)