Saved in:
Bibliographic Details
Main Authors: Dong, Jianbing, Chang, Jianbin
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2511.17599
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914167024254976
author Dong, Jianbing
Chang, Jianbin
author_facet Dong, Jianbing
Chang, Jianbin
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2511_17599
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle From Projection to Prediction: Beyond Logits for Scalable Language Models
Dong, Jianbing
Chang, Jianbin
Machine Learning
Artificial Intelligence
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.
title From Projection to Prediction: Beyond Logits for Scalable Language Models
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2511.17599