Shorter Sequences, Faster Models: Sequence Length Compression as a Stackable Primitive for LLM Training and Inference
Abstract
The efficiency of decoder-only LLMs is routinely improved by making attention cheaper per token: reducing KV-cache size, restricting the receptive field, or replacing the attention operator. All of these leave the number of tokens flowing through the network unchanged, so the FFNs and the token-wise projections continue to scale with full sequence length, and in most cases the attention cost does as well. Existing approaches that do shorten the sequence pay for it elsewhere, through restructured generation, separate decoders, or compression applied post hoc to a frozen model. We show that neither is necessary: a single normalization-projection module between the embedding layer and an otherwise unchanged transformer trunk suffices to pretrain a decoder-only LLM that operates natively on a compressed sequence, including the tokens it generates. A training construction that covers every autoregressive decoding state exactly once eliminates train-inference mismatch and requires no hyperparameters beyond the compression factor . In controlled experiments at 79M--537M scale, with throughput measured up to 7B parameters, quality approaches parity with the uncompressed baseline as models grow (near parity at compression and 537M parameters), while sequence length compression accelerates prefill, decode, and training simultaneously, and stacks multiplicatively with GQA, with prefill speedups approaching at 1M context, all without requiring new inference kernels. Sequence length is therefore a trainable property of the model: compressing it shortens every part of the network and composes with existing efficiency methods.
Create a lesson
Metadata
- Categories
- cs.LG, cs.CL
- Comments
- 31 pages, 7 figures
Related papers
SealKV: Accurate Low-Bit KV Compression for Faster LLM Inference
Shared title terminologycs.LGLijie Yang, Tri Dao, Ravi Netravali et al.
Refresh or Reweight? Two Kinds of Training-Inference Mismatch in LLM Reinforcement Learning
Shared title terminologycs.LGRunguo Li, Dezhen Lu, Lingxiang Gao
DIAL: Diffusion Post-Training for Inference-Time Adjustable Alignment by Reward Importance and Strength
Shared title terminologycs.LGMasato Ishii, Akio Hayakawa, Takashi Shibuya et al.
Sequence-Level Score Centering Stabilizes Off-Policy LLM Reinforcement Learning
Shared title terminologycs.LGRuixiang Zhang
A PAC Theory of Post-Training: Feasibility, Compounding, and Internalization
Shared title terminologycs.LGNam H. Le
Compressing Gated DeltaNet States with a Shared Value Basis and an Adaptive Residual
Shared title terminologycs.LGIvan Krivorotov, Egor Maximov, Aleksei Merkelov et al.