Sequence Compression
An LLM efficiency optimization method that inserts a normalized projection module between the embedding layer and the Transformer backbone to natively compress sequence length during pretraining. This reduces the computational cost of attention, FFN, and projection simultaneously and can be combined with techniques such as GQA.
Timeline (last 90 days)
A new study proposes inserting a normalization projection module between the embedding layer and the Transformer backbone, enabling pretraining of a decoder-only LLM that natively supports compressed sequences (including generated tokens).
Sequence compression directly reduces the number of tokens, causing the computation of the FFN and per-token projections to drop proportionally, a benefit that the "cheaper per token" approach cannot achieve.
The study designs a training construction that ensures each autoregressive decoding state is covered exactly once, thereby eliminating the mismatch between training and inference, and requires only the compression factor X as a hyperparameter with no additional tuning.
In controlled experiments from 79M to 537M parameters, the quality of the sequence-compressed model approaches the uncompressed baseline as scale grows, nearly matching at 2× compression and 537M parameters.
Sequence compression accelerates prefill, decoding, and training, and multiplies with GQA; at a 1M context, the prefill speedup approaches X², with no need for a new inference kernel.
Sequence compression acts on the token dimension, while GQA acts on the head dimension inside attention; the two act on different dimensions, so their speedups can multiply, with total computation reduced to roughly 1/X (sequence compression) × the GQA reduction ratio.
The prefill stage processes the entire prompt sequence in parallel; after compression the length drops to 1/X, giving a theoretical speedup close to X; but the attention part can achieve a higher speedup due to its quadratic length relationship, with the combined effect approaching X² at a 1M context.
The study verifies the speedup of sequence compression in throughput measurements up to 7B parameters.
The study's experiments cover quality evaluation up to 537M parameters at most (throughput measured up to 7B), and quality performance at larger scales still needs further verification.
Sequence compression occurs immediately after the embedding layer, so the sequence length seen by the Transformer backbone is already shortened to 1/X of the original.
All Facts (10)
A new study proposes inserting a normalization projection module between the embedding layer and the Transformer backbone, enabling pretraining of a decoder-only LLM that natively supports compressed sequences (including generated tokens).
50%UnverifiedSequence compression directly reduces the number of tokens, causing the computation of the FFN and per-token projections to drop proportionally, a benefit that the "cheaper per token" approach cannot achieve.
50%UnverifiedThe study designs a training construction that ensures each autoregressive decoding state is covered exactly once, thereby eliminating the mismatch between training and inference, and requires only the compression factor X as a hyperparameter with no additional tuning.
50%UnverifiedIn controlled experiments from 79M to 537M parameters, the quality of the sequence-compressed model approaches the uncompressed baseline as scale grows, nearly matching at 2× compression and 537M parameters.
50%UnverifiedSequence compression accelerates prefill, decoding, and training, and multiplies with GQA; at a 1M context, the prefill speedup approaches X², with no need for a new inference kernel.
50%UnverifiedSequence compression acts on the token dimension, while GQA acts on the head dimension inside attention; the two act on different dimensions, so their speedups can multiply, with total computation reduced to roughly 1/X (sequence compression) × the GQA reduction ratio.
50%UnverifiedThe prefill stage processes the entire prompt sequence in parallel; after compression the length drops to 1/X, giving a theoretical speedup close to X; but the attention part can achieve a higher speedup due to its quadratic length relationship, with the combined effect approaching X² at a 1M context.
50%UnverifiedThe study verifies the speedup of sequence compression in throughput measurements up to 7B parameters.
50%UnverifiedThe study's experiments cover quality evaluation up to 537M parameters at most (throughput measured up to 7B), and quality performance at larger scales still needs further verification.
50%UnverifiedSequence compression occurs immediately after the embedding layer, so the sequence length seen by the Transformer backbone is already shortened to 1/X of the original.
50%