ArXiv: 2307.14995
🎯 Pitch
The first linear attention LLM to actually beat softmax attention in both speed and accuracy—not through one trick, but by jointly redesigning position encoding, gating, and training algorithms. Their Lightning Attention delivers a 2× speedup and 4× memory cut during training, solving the quadratic bottleneck while finally matching Transformer benchmark scores.
1. Executive Summary
This paper introduces TransNormerLLM, the first linear attention-based large language model that surpasses conventional softmax attention-based models in both accuracy and efficiency. The authors validate their architecture on a self-collected 6TB corpus with over 2 trillion tokens, training models at 385M, 1B, and 7B parameters and benchmarking against Transformer-based LLMs on commonsense reasoning tasks, MMLU, CMMLU, and C-Eval. The model evolves from the prior TransNormer architecture through five named innovations—LRPE with exponential decay (replacing DiagAttention to restore global token interactions while avoiding attention dilution), Lightning Attention (an IO-aware block-wise algorithm achieving more than 2× faster runtime and 4× lower memory footprint during training), Simple Gated Linear Units (removing the activation function from GLU with no performance loss and yielding a 20% speedup), SimpleRMSNorm (a streamlined normalization that matches RMSNorm accuracy with faster computation), and a robust inference algorithm (ensuring numerical stability and constant inference speed regardless of sequence length)—which collectively enable TransNormerLLM to outperform Transformer by 5% at 385M and 9% at 1B in perplexity under identical configurations while delivering faster inference, establishing that linear attention can achieve parity with or exceed softmax attention on LLM-scale training only when positional encoding, gating, normalization, and inference stability are jointly redesigned for the linear attention regime.
2. Context and Motivation
The Quadratic Complexity Bottleneck
The fundamental problem this paper addresses is the quadratic time and memory complexity of standard softmax attention with respect to sequence length. In a vanilla Transformer, the self-attention operation computes:
where , with being the sequence length and the feature dimension. The product produces an attention matrix, requiring computation and memory. During autoregressive generation, this cost compounds: for each new token, the model must attend to all previous tokens, making the total inference cost quadratic in sequence length even without considering training overhead.
This quadratic scaling is not merely a theoretical inconvenience. The paper highlights concrete practical consequences visible in their own benchmark data. Table 14 shows that a Transformer-7B model can only train on a maximum context length of 37K tokens on 64 A100 80GB GPUs with a batch size of 1, while a Transformer-175B model drops to just 10K tokens. When training LLMs on corpora with billions of tokens, the inability to process long sequences in a single forward pass forces truncation strategies that can fragment documents, break discourse coherence, and prevent the model from learning long-range dependencies that matter for tasks like document summarization, multi-turn dialogue, and code understanding.
The Gap: No Linear Attention Model That Actually Works at LLM Scale
The paper identifies a specific, well-defined gap in the literature: despite years of work on linear-complexity attention alternatives, no linear attention-based architecture had been demonstrated to match or exceed standard softmax attention on LLM-scale training benchmarks. The authors frame this gap explicitly in the Introduction:
"However, there are two reasons that prohibit them to be applied to LLMs: 1) their performance in language modeling is often unsatisfactory; 2) they do not demonstrate speed advantages in real-world scenarios."
These two failures are linked. Many prior linear attention methods achieve theoretical complexity by replacing the softmax operation with a kernelized dot product, exploiting the associative property of matrix multiplication to compute first (an by reduction to ) before multiplying by . However, as the paper notes in the Related Work, there is a critical difference between theoretical and practical complexity:
"Although its theoretical complexity is , the actual computational efficiency of Linear Attention becomes quite low when used in causal attention due to the need for cumsum operations"
This cumsum bottleneck arises because causal (autoregressive) attention requires that each position attend only to positions . The straightforward "right-multiplication trick" () produces non-causal attention that leaks future information. Restoring causality requires either expensive cumulative-sum operations that destroy parallelism on modern GPU hardware, or reverting to left-multiplication (), which defeats the purpose of linear attention by constructing the full matrix.
The result is that linear attention models have existed in a no-man's-land: theoretically appealing but practically slower than optimized softmax attention implementations like FlashAttention, and with consistently worse language modeling perplexity that makes them unacceptable for production LLMs.
Four Families of Alternatives and Their LLM-Relevant Shortcomings
The paper situates its work against four main lines of research on efficient sequence modeling, each with specific limitations that prevent LLM-scale deployment:
Linear Transformers. Predecessors like Katharopoulos et al. (2020) (using activation), CosFormer (Qin et al., 2022b, using cosine re-weighting), and randomized attention approximators (Zheng et al., 2022; 2023) all decompose softmax into kernelized inner products to enable the right-product trick. However, the paper identifies a persistent performance gap: "most Linear Transformers still exhibit a certain performance gap compared to traditional Transformers." More critically, the cumsum problem means that even when the asymptotic complexity is favorable, the constant factors and implementation overhead on real GPU hardware erase the claimed speed advantages during both training and autoregressive inference.
State Space Models (SSMs). Models like S4 (Gu et al., 2022b) and its diagonal variants (Gupta et al., 2022) use continuous-time state space equations parameterized with special initializations (HiPPO) to achieve long-range memory. While SSMs have shown competitive performance on certain long-sequence benchmarks and support constant-complexity inference (a genuine advantage for deployment), the paper does not cite any SSM-based LLM that matches Transformer performance at the 1B+ parameter scale on standard language modeling and reasoning benchmarks. The absence of such a result in the literature as of the paper's writing (late 2023/early 2024) is itself part of the motivation: the field lacks evidence that the SSM approach scales to LLM training regimes.
Long Convolutions. Methods like TNN (Qin et al., 2023a) and H3 (Fu et al., 2023) use kernel sizes equal to the input sequence length, trained via FFT. The paper identifies two LLM-deployment barriers: (1) causal inference requires caching all historical computations analogously to the Transformer's KV cache, eliminating the constant-memory advantage that makes RNN-like models attractive for long-sequence generation, and (2) "higher inference complexity compared to RNNs" makes them less suitable for the autoregressive generation that dominates LLM serving workloads.
Linear RNNs. The paper specifically highlights RWKV (Peng et al., 2023b), calling it "a linear RNN-based LLM that has shown competitive performance against similarly scaled GPT models." This is a crucial reference point: RWKV represents the closest prior success to what TransNormerLLM attempts, demonstrating that a non-Transformer architecture can approach Transformer performance at scale. However, the paper implicitly positions TransNormerLLM as a different architectural family (linear attention rather than linear recurrence) with distinct design choices, implying that the linear attention route—if properly engineered—can achieve competitive or better results.
The Specific Failures of the Original TransNormer
Since TransNormerLLM is explicitly an evolution of the authors' prior TransNormer architecture (Qin et al., 2022a), understanding the baseline's limitations is essential context. The original TransNormer used DiagAttention at lower layers to avoid what the authors call the "dilution" problem—the tendency of linear attention to distribute attention weights too uniformly across long sequences, blurring the distinction between relevant and irrelevant tokens. However, DiagAttention restricted each token to attend only within a local diagonal band, sacrificing global interaction capability. This tradeoff was unacceptable for LLM-scale language modeling, where long-range dependencies (coreference, discourse structure, document-level reasoning) are critical.
The paper's ablation (Table 2) quantifies this: the original TransNormer variants (T1 and T2) achieve higher perplexities than TransNormerLLM under identical training budgets (4.910 and 4.858 vs. 4.770 PPL at 385M parameters), confirming that the architectural changes collectively address real performance gaps rather than being incremental refinements.
Why This Problem Matters Now
The paper's contribution is timely because the LLM field is at an inflection point where sequence length constraints directly limit model capabilities. Several converging trends make quadratic attention untenable:
Longer contexts are becoming a core requirement. Production LLMs are increasingly expected to process entire documents, multi-turn conversations, code repositories, or scientific papers in a single forward pass. The Transformer architecture's quadratic cost means that doubling context length quadruples attention cost, creating an exponential barrier to further scaling.
Inference costs dominate deployment economics. While training is a one-time capital expense, inference is a per-query operating cost that scales with the number of users. In high-throughput serving scenarios, the quadratic attention bottleneck becomes the dominant cost driver, especially for applications requiring long contexts (document QA, chat with history, code completion with repository context).
The open-source ecosystem needs efficient alternatives. The paper's explicit commitment to open-sourcing TransNormerLLM reflects the broader community dynamic where efficient architectures that reduce hardware requirements can democratize LLM access. If linear attention LLMs can match Transformer performance, they enable longer-context training and faster inference on consumer-grade hardware, lowering the barrier to entry for research and deployment.
How This Paper Positions Itself
The paper positions TransNormerLLM not as a single architectural innovation but as a systems-level engineering effort that addresses the multiple interacting failure modes preventing linear attention from scaling to LLMs. The argument is that prior work attacked pieces of the problem in isolation—better positional encoding, better normalization, faster implementations—but no one put them all together with the specific modifications needed for the linear attention regime:
- Position encoding must be redesigned because standard positional encodings (absolute, RoPE) don't address the dilution problem unique to linear attention.
- Gating mechanisms must be added because linear attention lacks the implicit selective capability that softmax attention's sharp normalization provides.
- Normalization must be rethought because the
NormAttentionoperator introduced in TransNormer (Equation 6) replaces softmax with an RMSNorm-style operation, and the specific normalization function affects both accuracy and speed. - Inference algorithms must be made numerically stable because the exponential decay factors () cause divergent scaling of queries and keys over long sequences (Equation 17), a problem that doesn't exist in standard softmax attention.
- Training implementations must be IO-aware because the
cumsumbottleneck means naive right-multiplication implementations are slower than optimized softmax attention on modern GPUs, erasing the theoretical complexity advantage.
The paper's key positioning claim is that only when all of these are jointly addressed does linear attention leapfrog softmax attention on the combined metric of accuracy and efficiency. The ablation studies in Section 4.1 demonstrate this additively: each modification contributes small improvements (Table 3: LRPE-d saves 0.049 PPL vs. LRPE; Table 5: gating saves 0.05 PPL; Figures 2-3: SRMSNorm and Lightning Attention add speed), but the cumulative effect—the full TransNormerLLM architecture—is what enables the 5% and 9% Transformer performance gaps in Table 1. This positions the work as an existence proof: linear attention can work for LLMs, but only with careful, holistic engineering that prior work did not attempt.
3. Technical Approach
3.1 Reader Orientation
This is primarily a systems and architecture paper whose core idea is that linear attention can match or exceed the performance of softmax attention at large language model scale, but only when a specific set of five architectural modifications—spanning positional encoding, gating, normalization, IO-aware training algorithms, and numerically stable inference—are jointly engineered to address the failure modes unique to the linear attention regime. The authors do not propose a single algorithmic breakthrough; rather, they diagnose and fix the interacting bottlenecks that prevented prior linear attention architectures from being viable LLM backbones, delivering a complete model family (385M to 175B parameters) that achieves better perplexity than equivalently-sized Transformers while being faster at both training and inference.
3.2 Big-Picture Architecture
The TransNormerLLM block processes an input representation through two sequential sub-layers, each preceded by a SimpleRMSNorm normalization and wrapped in a residual connection:
-
Gated Linear Attention (GLA) — the token mixing sub-layer. It receives normalized input, projects it into , , , and matrices, computes linear attention scores with position-dependent decay, applies a gate via element-wise multiplication with , and returns a mixed token representation.
-
Simple Gated Linear Unit (SGLU) — the channel mixing sub-layer. It receives normalized output from GLA, projects it into two linear transformations and , multiplies them element-wise (without any activation function in between), and projects the result back to the hidden dimension.
Information flows left-to-right through a stack of identical such blocks (24 to 88 layers, depending on model size), with positional encoding injected at the attention computation step via learnable relative position biases and exponential decay factors that vary per-head and per-layer.
3.3 Roadmap for the Deep Dive
-
First, the Linear Attention foundation and the NormAttention operator inherited from the original TransNormer—since all subsequent innovations build on this base operation, and understanding why it is not trivially deployable explains the motivation for every modification that follows.
-
Second, the LRPE with exponential decay positional encoding, because position information is injected directly into the attention computation and the choice of encoding fundamentally determines whether linear attention suffers from attention dilution or maintains meaningful global interactions.
-
Third, the Gated Linear Attention mechanism, since gating is the primary mechanism for restoring the selective capability that linear attention loses when it replaces the sharp softmax normalization with a simple dot product, and the choice of activation function materially affects training stability.
-
Fourth, the Simple Gated Linear Unit and SimpleRMSNorm, because these are the speed-enabling simplifications (removing unnecessary activation functions and streamlining normalization) that collectively contribute a ~20% training speedup without accuracy degradation.
-
Fifth, the Lightning Attention training algorithm, which is the IO-aware implementation that makes the theoretical complexity translate to actual wall-clock speedups—this is where the paper's most concrete efficiency claims (2× faster, 4× less memory) are realized and where the
cumsumbottleneck from prior linear attention implementations is circumvented. -
Sixth, the robust inference algorithm, which addresses a subtle but critical numerical stability problem arising from the exponential decay in positional encoding—this is what enables the model to maintain constant inference time and memory regardless of sequence length.
-
Seventh, the model parallelism scheme, because scaling to 175B parameters requires distributing both the GLA and SGLU components across GPUs, and the linear attention structure permits a parallelism strategy that differs from standard Megatron-LM in important ways.
3.4 Detailed, Sentence-Based Technical Breakdown
We begin by understanding the core linear attention operation, since every design choice in the rest of the architecture is motivated by the strengths and failure modes of this operation. We then build up the complete system component by component, explaining at each step what problem is being solved and why the chosen solution works.
The Linear Attention Foundation and NormAttention
The fundamental operation that TransNormerLLM inherits from its predecessor is NormAttention, introduced in Qin et al. (2022a) and defined as:
where are the standard query, key, and value matrices obtained by linear projection of the input, is the sequence length, is the per-head feature dimension, and is a normalization operator.
What this computes: The term produces an matrix of unnormalized attention scores—each entry is the dot product similarity between the query at position and the key at position . Multiplying by then produces the output as a weighted sum of value vectors: each output position is a mixture of the value vectors weighted by how much attention position pays to each position . The operator (originally RMSNorm in TransNormer, replaced by SRMSNorm in TransNormerLLM) normalizes the result per token.
Why this form: Standard softmax attention computes . The softmax serves two purposes: (1) it normalizes attention weights to sum to 1, creating a probability distribution over keys for each query, and (2) the exponentiation and normalization together create a sharp, selective weighting—positions with high dot products get exponentially more weight than positions with slightly lower dot products. NormAttention removes the softmax entirely and replaces it with a post-hoc normalization on the output, which is conceptually simpler and computationally cheaper. However, this removal has a critical consequence: without the softmax's sharp normalization, attention weights can become diluted—spread too uniformly across many positions—especially for long sequences, since the raw dot product scores do not naturally concentrate probability mass on the most relevant positions.
The right-multiplication trick for linear complexity:
The key property that makes NormAttention efficient is that the normalization is applied after the attention-weighted sum, not inside the attention computation itself. This means the matrix multiplication can be re-associated:
Instead of computing the attention matrix first (cost ), we compute first—a product that reduces to a matrix at cost , then multiply by (another step). When (which holds for practical LLM configurations where is typically 64–128 per head and can be thousands or tens of thousands), is substantially smaller than . This re-association is the defining mathematical property of linear attention: the cost scales linearly with sequence length rather than quadratically.
The causal attention problem (cumsum bottleneck):
The above description omits a critical detail for autoregressive language models: causal masking. In a decoder-only LLM, each position may only attend to positions . The naive right-multiplication computes non-causal attention—position can attend to future positions —because is computed globally across all positions.
The mathematically correct causal form computes a prefix sum over keys and values:
where is the cumulative key-value outer product from positions 1 through . Each output is computed by multiplying the query by the cumulative state .
Why this is a practical bottleneck: This prefix sum (cumsum) operation is inherently sequential—computing requires knowing —which prevents the parallel computation that GPUs excel at. During training, where we have the full sequence available, the cumsum formulation forces the computation to proceed token-by-token, erasing the parallelism advantage that makes Transformers fast to train despite their quadratic complexity. During autoregressive inference, the cumsum is natural (each new token updates the state), but training throughput suffers dramatically.
The paper's solution: TransNormerLLM uses left-multiplication during training (computing but making it fast via Lightning Attention's IO-aware block-wise algorithm) and right-multiplication with cumsum during inference (where it is naturally efficient). This hybrid approach—left-multiplication for parallelism during training, right-multiplication for inference—is the core insight that reconciles training efficiency with inference efficiency.
LRPE with Exponential Decay: Positional Encoding for Linear Attention
The positional encoding in TransNormerLLM addresses a specific problem unique to linear attention: attention dilution. In standard softmax attention, the softmax operation naturally concentrates probability mass on a small number of high-similarity positions, so even without explicit positional biases, attention is selective. In linear attention without softmax, the unnormalized dot products can distribute weight more uniformly, causing information from distant (potentially irrelevant) tokens to dilute the signal from nearby (potentially relevant) tokens.
The positional encoding takes the form:
where is the query vector at position , is the key vector at position , is a per-head per-layer decay factor, is a complex exponential encoding relative position via learnable frequency parameters , and is the resulting attention score (a complex number whose real and imaginary parts are handled as separate dimensions, following the LRPE framework).
What this computes: The product is the standard content-based attention score (how relevant is token to token based on their content?). The decay factor multiplies this by an exponentially decreasing weight as the distance grows—when (past tokens), the decay penalises distant tokens. The complex exponential encodes relative position as a rotation in a complex vector space, where the rotation angle is proportional to the distance . The full score thus combines content similarity, distance-based decay, and positional rotation into a single scalar.
Why this form: Standard absolute positional encodings (adding a position-dependent vector to token embeddings before attention) do not address dilution because they cannot explicitly increase the relative weight of nearby tokens over distant ones. RoPE (Rotary Position Embedding), which multiplies queries and keys by rotation matrices based on absolute position, encodes relative position implicitly through dot products of rotated vectors, but still relies on the softmax to create sharp selectivity. The exponential decay factor directly addresses dilution by introducing an explicit, multiplicative bias toward closer positions—tokens that are farther apart have their attention scores scaled down by , making it harder for them to dominate the attention output.
The per-head per-layer decay schedule:
The decay factor is not learnable and varies systematically across attention heads and layers:
where is the head index (out of total heads), is the layer index (out of total layers), and the factor 8 determines the maximum decay rate.
What this schedule computes: The term produces a decay rate for head that ranges from approximately (for , very mild decay) to 8 (for , aggressive decay). The term scales this decay by the layer's position in the stack—lower layers get stronger decay (shorter effective attention spans), higher layers get weaker decay (longer effective attention spans), and the top layer () gets (no decay, full global attention).
Why this schedule: This design implements a hierarchical receptive field strategy. Lower layers attend primarily to local context (small Theoretical Receptive Field), which is appropriate for low-level syntactic and morphological patterns. Middle layers attend to broader spans. The final layer attends globally, allowing top-level semantic integration across the full sequence. This hierarchical scheme mirrors the original TransNormer's motivation (which used DiagAttention at lower layers for the same reason) but achieves it through continuous exponential decay rather than hard diagonal truncation, preserving the ability to attend globally when content similarity is strong enough to overcome the decay penalty.
The "Mix" positional encoding (used in the final model):
The paper empirically finds that applying the full LRPE-d (LRPE with exponential decay) to every layer is computationally expensive but that applying it only to the first layer and using pure exponential decay (without the complex rotation ) for all subsequent layers speeds up training by "approximately 15-20% but only with a subtle effect on the performance" (Section 3.1.1). This Mix variant is the configuration used for the benchmark models.
Compatibility with linear attention:
A critical property of this positional encoding is that it is decomposable with respect to and :
This factorization means that positional information can be absorbed into the query and key representations before the attention computation: redefine and , then returns to the standard linear attention form. This is what enables the right-multiplication trick in the first place—if the positional encoding were not decomposable, the attention computation could not be re-associated.
Why is non-learnable:
The paper reports: "we choose to be non-learnable since we empirically found that gradients become unstable when is learnable, leading to NaN values." This is a practical but important constraint: the exponential form with learnable creates extremely steep gradients when approaches 0, because small changes in produce exponentially large changes in the attention score for distant token pairs. Fixing via the deterministic schedule above avoids this instability entirely.
Gated Linear Attention (GLA): Restoring Selectivity
The gating mechanism in TransNormerLLM addresses a second consequence of removing softmax: the loss of input-dependent selectivity. In softmax attention, the sharpness of the attention distribution adapts automatically to the input—when one key is much more similar to the query than others, softmax produces a near-one-hot attention vector; when all keys are similar, softmax produces a more uniform distribution. Linear attention with a simple dot product cannot modulate its selectivity based on input content—the attention distribution is determined solely by the raw dot product magnitudes, with no mechanism to amplify large differences or suppress small differences.
The GLA structure is defined as:
where the query, key, value, and gate projections are:
and is an activation function (swish, in the final model), are learnable projection matrices, and denotes element-wise multiplication.
What this computes: The term produces the linear attention output as described above—a mixture of value vectors weighted by content similarity and positional decay. The gate is a separate linear projection of the input that does not participate in the attention computation. The element-wise product modulates each dimension of the attention output independently: dimensions where has a large magnitude are amplified, dimensions where has a near-zero magnitude are suppressed or gated out. This provides input-dependent selectivity—the model can learn to produce large gate values for important token positions and small gate values for less relevant ones, effectively choosing how much attention output to pass through at each dimension.
Why this form: Gating is not unique to TransNormerLLM—the GLA structure follows Flash (Hua et al., 2022) and is conceptually similar to the gating in Mamba and other recent architectures. However, it serves a specific purpose in linear attention that is more critical than in softmax attention. Softmax attention already has input-dependent selectivity built into the softmax normalization: the attention weights themselves are a nonlinear function of the input, so the model can decide which tokens to attend to through the softmax. In linear attention, the attention weights are linear functions of the query-key dot products (modulated only by the fixed exponential decay), providing no mechanism to say "this token is important, amplify it" or "this token is noise, suppress it" based on content. The gate provides this mechanism post-hoc—after computing the mixed representation, the model can selectively amplify or suppress dimensions based on the same input.
Activation function choice:
The paper tests three options for : Swish, No Activation, and 1+elu. Results in Table 6 show that "using Swish and 1+elu leads to similar performance," with both substantially outperforming No Activation (2.248 vs. 2.283 loss at 385M parameters). However:
"in our experiments, using 1+elu in our 7B model may encounter a NaN problem, so we use Swish in our model."
The 1+elu activation () is a popular choice in linear attention (Katharopoulos et al., 2020) because it guarantees strictly positive outputs (elu outputs are , so adding 1 produces non-negative values), which is theoretically convenient for kernel-based attention formulations. The NaN problem at 7B scale suggests that this activation interacts poorly with large-scale training dynamics (likely due to gradient magnitudes becoming very large when the elu input is very negative, before the +1 shift).
Why Swish works without the NaN problem: Swish (, where is the sigmoid function) has the property that its gradient is bounded for large negative inputs (, Swish , gradient ) and grows approximately linearly for large positive inputs. This avoids the exploding-gradient regime that can occur with elu-based activations on large models.
Simple Gated Linear Unit (SGLU): Removing Unnecessary Nonlinearity
The channel mixing sub-layer uses a simplified version of the Gated Linear Unit that removes the activation function entirely:
where project the input into two intermediate representations, projects back to the model dimension, and is element-wise multiplication.
What this computes: The standard GLU formulation (used in LLaMA and many other Transformer variants) computes , where is a nonlinear activation (typically Swish or GELU). SGLU removes , computing the element-wise product of the two linear projections directly. The intuition is that the multiplication itself is nonlinear—it is a bilinear function of the input—so an additional activation function on one branch is redundant.
Why this matters for speed: An activation function (especially Swish, which involves a sigmoid evaluation) adds non-trivial computational cost. For the forward pass of a -dimensional GLU layer, computing Swish on a tensor of size requires an exponential, a division, and a multiplication per element. Removing this saves a measurable fraction of the per-block computation. The paper reports that this simplification, combined with the SRMSNorm optimization, contributes to the overall ~20% acceleration over the original TransNormer.
Empirical justification: Table 7 shows that No Activation (SGLU) achieves 2.248 loss vs. 2.254 loss for Swish at the same training budget—the difference is "negligible" (0.006 loss, less than 0.3%). The activation function is therefore justified only if it provides a meaningful accuracy improvement, which it does not in this architecture. This is surprising given the widespread use of Swish/GELU in GLU-based Transformers and suggests that the gating in the GLA sub-layer (which does use Swish activation on and ) already provides sufficient nonlinear capacity, making the additional nonlinearity in the channel mixer unnecessary.
SimpleRMSNorm (SRMSNorm): Streamlining Normalization
The normalization function used throughout TransNormerLLM is a simplification of RMSNorm:
where is the input vector to normalize, is the L2 norm, and is the feature dimension.
What this computes: Standard RMSNorm computes , where and is a learnable per-dimension scale parameter. SRMSNorm replaces with . Mathematically, these are identical: . The difference is purely in the implementation—the numerator can be precomputed as a constant for each layer, reducing the normalization computation to: compute squared norm, divide by pre-computed constant, square root, divide. No division by is needed at runtime.
Why this matters for speed: The performance advantage comes from a custom Triton kernel implementation of SRMSNorm. As shown in Figure 2, the Triton implementation is faster than PyTorch's built-in normalization "when operating with larger dimensions"—the speedup is visible for feature dimensions above ~1024 and becomes more pronounced as dimensions increase to 16384. For a 7B model with , the Triton SRMSNorm kernel computes both the forward and backward passes faster than the equivalent PyTorch RMSNorm or LayerNorm implementation.
Empirical justification: Table 8 shows that SRMSNorm, RMSNorm, and LayerNorm produce nearly identical results (2.248, 2.247, and 2.247 loss respectively at 385M parameters). The paper states: "there is almost no difference among these methods when applied to TransNormerLLM." The choice of SRMSNorm is therefore a pure systems optimization: identical accuracy, faster implementation.
Lightning Attention: IO-Aware Training Algorithm for Linear Attention
This is the most important implementation innovation in the paper—the algorithm that translates the theoretical complexity of linear attention into actual wall-clock speedups during training. The problem it solves is that naive left-multiplication of the full attention matrix is (no better than standard attention), while naive right-multiplication requires cumsum operations that are not parallelizable.
The computation being optimized:
Lightning Attention computes the attention output as:
where are the query, key, and value matrices, is the attention mask (encoding both causal masking and the positional decay factors ), is element-wise multiplication, and is the output.
What this computes: This is the standard left-multiplication form that explicitly constructs the attention matrix , then multiplies by to produce the output. The mask encodes two pieces of information: (1) causal masking— for (future positions), for (past positions), and (2) the complex exponential rotation from LRPE. The advantage of this left-multiplication formulation is that it is parallelizable—the attention matrix can be computed with one large matrix multiplication, which GPUs execute very efficiently.
Why a naive implementation is inefficient: The product is an times multiplication, producing an matrix that must be stored in GPU memory. For sequence length , this is a million element matrix. In single precision (4 bytes per element), this single matrix requires ~268 MB of memory per attention head, per layer, per batch element. For a model with 32 heads, 30 layers, and batch size 8, the total attention matrix memory would be tens of gigabytes—far exceeding GPU memory capacity. The naive computation must materialize this matrix in slow HBM (High Bandwidth Memory, i.e., GPU DRAM), compute the mask, then multiply by . The HBM bandwidth becomes the bottleneck.
The Lightning Attention algorithm (Algorithm 3—Forward Pass, Algorithm 4—Backward Pass):
The key insight, inspired by FlashAttention (Dao et al., 2022a; Dao, 2023), is to tile the computation—split , , into smaller blocks that fit in fast on-chip SRAM, compute partial attention outputs for each block combination, and accumulate the results, without ever materializing the full attention matrix in HBM.
Forward pass (Algorithm 3):
-
Blocking: Split the sequence dimension into blocks for queries/ outputs (row blocks of size ) and blocks for keys/values (column blocks of size ). The attention mask is similarly split into blocks of size . The block sizes and are chosen to fit within the GPU's SRAM capacity (typically ~100–200 KB per streaming multiprocessor on an A100).
-
Outer loop over query blocks: For each query block (size ) loaded from HBM to SRAM, initialize an output accumulator also in SRAM.
-
Inner loop over key-value blocks: For each key-value block pair (size each) loaded to SRAM, and the corresponding mask block (size ):
- Compute the partial attention . This is a small (at most ) matrix that fits in SRAM.
- Accumulate: .
-
Write back: After processing all key-value blocks, write the accumulated from SRAM to HBM as the -th block of the output.
What makes this IO-aware: The critical metric for GPU performance is the number of reads/writes between HBM and SRAM. A standard implementation that materializes the full performs:
- Read once from HBM:
- Write to HBM and read it back:
- Write to HBM:
The dominant term is reads/writes from HBM, which is slow. Lightning Attention performs:
- For each of the block pairs, read , , , from HBM once: (approximately, depending on block size choices)
- Write once:
By never writing the full attention matrix to HBM, the algorithm reduces HBM traffic by a factor proportional to the block size. This is exactly the same principle that makes FlashAttention fast for softmax attention—the difference is that Lightning Attention applies this principle to linear attention, which has a simpler per-block computation (no softmax, just a dot product with mask and accumulation).
Backward pass (Algorithm 4):
The backward pass follows the same block-wise strategy but in reverse: for each key-value block , it computes gradients , by iterating over all query-output blocks, accumulating contributions without materializing the full gradient of the attention matrix. The mathematical derivation follows from the chain rule applied to the block-decomposed forward computation. Specific formulas:
- (gradient through the value multiplication)
- (gradient through the attention-mask product)
- (gradient through the key projection)
- (gradient through the query projection)
Again, all intermediate calculations stay in SRAM, and only the final accumulated , , are written to HBM.
Empirical speedup and memory results (Figure 3):
The paper reports concrete measurements:
- Runtime: "at least 2× faster than the PyTorch implementation" across sequence lengths 512 to 8192. The baseline runtime grows quadratically with sequence length, while Lightning Attention grows approximately linearly.
- Memory: "up to 4× more efficient than the baseline when the sequence length is 8192." At sequence length 8192 with feature dimension 2048, Lightning Attention uses approximately 10 GB vs. approximately 40 GB for the baseline.
These improvements are not theoretical—they are measured wall-clock and memory footprint comparisons on actual GPU hardware, and they apply to both forward and backward passes.
Why Lightning Attention matters beyond speed: Without this algorithm, the theoretical complexity of linear attention would not translate to practical speed advantages during training because the baseline implementation (materializing in HBM) is essentially in practice due to memory bandwidth limitations. Lightning Attention makes the theoretical advantage real, which is what allows the paper to claim that TransNormerLLM is genuinely more efficient than Transformers, not just asymptotically more efficient in theory.
Robust Inference Algorithm: Numerical Stability for Autoregressive Generation
During inference, TransNormerLLM operates in recurrent mode—it maintains a running state that accumulates the outer product of keys and values, and computes each new output as the matrix-vector product of the query with this state. The original inference algorithm (Algorithm 1) inherits a subtle numerical stability problem from the exponential decay in the positional encoding.
The original inference algorithm (Algorithm 1):
For each time step :
where , are the query, key, and value vectors at position , and is the decay factor. The term undoes the decay that was applied to the query side (), so that the product yields the un-decayed dot product.
The numerical stability problem:
The paper identifies a critical issue with this formulation:
As the sequence length grows, and increase. Since , approaches 0 for large , making the query vector vanish toward zero. Conversely, grows without bound (since and ), making the key vector explode toward infinity. For a sequence of length 8192 with a typical decay factor of , and —both far beyond the representable range of FP16 or BF16.
The robust inference algorithm (Algorithm 2):
The solution is to re-factor the decay so that both the query and key sides remain bounded:
What this computes: Instead of storing the un-decayed accumulated key-value state and applying decay separately to queries and keys, the robust algorithm applies the decay directly to the state at each step. At time , the state represents the exponentially decayed sum of all past key-value outer products, with decay factor per step. The query (without any decay factor) is then multiplied by this state to produce the output.
Proof of equivalence (Appendix C):
The paper provides an inductive proof that the two algorithms produce identical mathematical results. The core insight is that:
where is the state from Algorithm 2 (robust) and is the state from Algorithm 1 (original). Multiplying both sides by yields . Plugging this into the output computation (Algorithm 2) gives , which is exactly the output from Algorithm 1. The key advantage is that in Algorithm 2, both and remain at normal magnitudes— is a weighted average (not sum) of past outer products, and is the raw query without scaling.
Consequence for inference efficiency:
Because the state has fixed size independent of sequence length, each new token requires only:
- One outer product and state update ()
- One matrix-vector product ()
This gives constant per-token cost, and total inference cost is , linear in . The memory footprint is constant ( for the state), in contrast to the Transformer's KV cache which grows as .
Figure 4 (Inference Time and Memory Footprint): The paper demonstrates that TransNormerLLM inference time and memory are essentially constant as sequence length increases from 256 to 32000, while Transformer inference time and memory grow approximately quadratically. At sequence length 32000, TransNormerLLM uses about 1.5 GB vs. approximately 15 GB for the Transformer equivalent, and takes a fraction of the runtime.
The constant inference speed is not automatic—it requires this robust algorithm. Without the robust re-factorization, Algorithm 1 would produce NaN values for sequences longer than a few hundred tokens (when exceeds the floating-point range), making the model unusable for long-form generation. The robust algorithm ensures that the recurrent inference mode—which is the primary inference efficiency advantage over Transformers—actually works in practice.
Model Parallelism on TransNormerLLM: Distributing Linear Attention Across GPUs
Scaling to 175B parameters requires distributing the model across multiple GPUs. The paper adapts the Megatron-LM model parallelism strategy (Shoeybi et al., 2019) to the specific structure of TransNormerLLM, with separate parallelism schemes for the SGLU and GLA components.
Model parallelism on SGLU:
The SGLU computation (Equation 5, 11) is:
where is the input, , and .
The model-parallel version splits the feed-forward dimension across two GPUs:
where are column-wise splits of , and similarly for . Each GPU computes its half of the intermediate product independently, requiring no communication. After computing the element-wise products and , the outputs are multiplied by the output projection:
where are row-wise splits of . This requires an all-reduce to sum the two partial outputs across GPUs.
What this achieves: Only one all-reduce communication per SGLU block (in both forward and backward passes). The three GEMMs inside SGLU (, , and the two partial products) are split across GPUs, each running at half the original size. This is analogous to Megatron-LM's MLP parallelism, adapted from the standard two-layer MLP () to the SGLU structure (). The key difference is that SGLU has three projections rather than two, but the parallelism strategy (splitting the intermediate dimension and all-reducing the output) works identically.
Model parallelism on GLA:
The GLA block uses a combined QKVU projection for efficiency, projecting the input into all four matrices (, , , ) simultaneously. For model parallelism, the attention head dimension is split:
where each split corresponds to half the attention heads. Each GPU computes linear attention independently on its subset of heads:
The split output is then multiplied by a row-wise split output projection and all-reduced, similar to SGLU.
Note on the combined projection: The paper states that "in our implementation, we use the combined QKVU projection to improve computation efficiency for linear attention." This means that instead of four separate matrix multiplications (, , , ), the weight matrices are concatenated into a single matrix, and one large GEMM produces all projections at once. This improves efficiency because one large GEMM is faster than four smaller ones on GPUs (better utilization of tensor cores, fewer kernel launches).
Empirical parallelism results (Table 12):
For a TransNormerLLM-7B model with a context length of 2048 and batch size of 2:
- Model parallel size 1: 64.0 GB/GPU, 32048.6 tokens/sec
- Model parallel size 8: 24.1 GB/GPU, 24280.0 tokens/sec
Increasing the model parallel size from 1 to 8 reduces memory by 62.3% (from 64.0 GB to 24.1 GB per GPU) while reducing throughput by only 24% (from 32048 to 24280 tokens/sec). This favorable scaling (memory reduction far outpaces throughput reduction) enables fitting the 7B model on GPUs with less than 32 GB memory, and enables scaling to 175B by distributing across multiple nodes.
Comparison with Transformer model parallelism (Table 12):
Under identical conditions, Transformer-7B with FlashAttention:
- Model parallel size 1: 66.3 GB/GPU, 26896.1 tokens/sec
- Model parallel size 8: 28.7 GB/GPU, 19973.6 tokens/sec
TransNormerLLM outperforms Transformer at every parallelism level in both speed and memory: at size 8, 24280.0 vs. 19973.6 tokens/sec (21.6% faster) and 24.1 vs. 28.7 GB (16.0% less memory).
Training Configuration and System Optimization Stack
The paper employs a collection of standard large-scale training techniques, adapted to the linear attention setting:
Fully Sharded Data Parallelism (FSDP): Following Zhao et al. (2023), all model parameters, gradients, and optimizer states are sharded across GPUs. When a GPU needs parameters for a computation, they are gathered from other GPUs via all-gather; after the computation, they are discarded. This reduces per-GPU memory proportional to the number of GPUs, enabling training of models larger than what fits on a single GPU.
Activation Checkpointing: During the forward pass, intermediate activations are not stored in memory. During the backward pass, they are recomputed from the saved inputs. This trades compute for memory: each activation that is checkpointed saves memory proportional to its size times batch size times sequence length, at the cost of recomputing the forward pass for that segment during backpropagation.
Automatic Mixed Precision (AMP) with BFloat16: The paper specifically uses BFloat16 (Kalamkar et al., 2019) rather than FP16. The rationale: "BFloat16... [has an] observed advantage in enhancing the training stability of TransNormerLLM models." BFloat16 has the same exponent range as FP32 (8 bits) but only 7 bits of mantissa, compared to FP16's 5 exponent bits and 10 mantissa bits. The wider dynamic range makes BFloat16 more robust to the gradient scaling issues that can cause NaN values in FP16 training, which is particularly important for the exponential decay factors in TransNormerLLM's positional encoding.
Adam Optimizer: The paper uses Adam (Kingma & Ba, 2017) without specifying learning rate, betas, weight decay, or warmup schedule in the main text. This is a standard choice for LLM pretraining.
Training Corpus and Sequence Length: All benchmark models (385M, 1B, 7B) use an input sequence length of 8192 tokens. These are trained on a 6TB cleaned corpus derived from over 700TB of raw web text, totaling approximately 2 trillion tokens. The data preprocessing pipeline (Figure 5, Appendix D) involves rule-based filtering, MinHash-based deduplication, and an iterative self-cleaning scheme where a 385M model trained on the corpus serves as a perplexity-based quality filter, followed by human evaluation. This is an interesting meta-approach: the model architecture's effectiveness is bootstrapped by using a smaller version of itself to curate its own training data.
4. Key Insights and Innovations
Innovation 1: Linear Attention for LLMs is a Systems Integration Problem, Not an Algorithmic One
The deepest conceptual move in this paper is a reframing of the linear attention challenge. Prior work implicitly treated the gap between linear attention and softmax attention as an algorithmic problem: find the right kernel function, the right approximation, the right initialization scheme. The literature accumulated a catalog of linear attention variants (CosFormer, Performer, Linear Transformer, various kernel approximations) that each showed promise on moderate-length sequences or controlled benchmarks but never translated to LLM-scale training where softmax Transformers are the dominant paradigm.
TransNormerLLM's thesis is that this framing is wrong—or at least incomplete. The reason linear attention had not succeeded at LLM scale is not that the core mathematical operation ( instead of ) is fundamentally less expressive, but that this operation creates a cascade of secondary failure modes in positional encoding, gating, normalization, numerical stability, and hardware efficiency that must each be addressed before the architecture is viable. None of these failure modes are unique to linear attention in isolation—positional encoding matters for all Transformers, gating is used in many architectures, normalization is universal—but the specific manifestation of each failure mode is unique to the linear attention regime, and only by diagnosing and fixing all of them together does the architecture leapfrog its softmax counterpart.
The evidence for this reframing is architectural rather than ablated: no single modification in the paper is wholly novel. LRPE was introduced in Qin et al. (2023b). Gating follows Flash (Hua et al., 2022). Lightning Attention adapts the FlashAttention tiling pattern (Dao et al., 2022a). NormAttention was in the original TransNormer. What is novel is the recognition that the absence of softmax changes the requirements at every layer of the stack, and that the cumulative effect of these jointly-required modifications produces a model that beats Transformers not by a hair but by a widening gap (5% at 385M, 9% at 1B in Table 1). If any one modification were omitted, the remaining failure mode would dominate and the architecture would underperform—as the original TransNormer did (Table 2: 4.858–4.910 PPL vs. 4.770 for TransNormerLLM).
This reframing has significant implications beyond TransNormerLLM itself. It suggests that the Transformer is not uniquely expressive among sequence modeling architectures, but rather that it is uniquely robust: softmax attention's sharp normalization and well-understood training dynamics paper over design fragilities that other architectures must explicitly address. Building a competitive non-Transformer LLM therefore requires not a single algorithmic replacement but a systems-level re-co-design of the entire model stack, from positional encoding to hardware kernels. This is a conceptual template for how future architectures should be developed—diagnose failure modes holistically, not component-by-component in isolation—and it raises the bar for what counts as a credible attempt to dethrone the Transformer for LLMs.
This innovation is fundamental rather than incremental because it changes what the community believes the problem is. Before TransNormerLLM, the default hypothesis for linear attention's failure was "the linear approximation loses something essential about softmax." After TransNormerLLM, the alternative hypothesis—"the linear attention core is fine, but it needs different surrounding engineering than softmax attention"—has strong empirical support. This is analogous to how the ResNet did not change the nature of deep networks' computations but changed the belief about why deep networks were hard to train (vanishing gradients rather than representational insufficiency), thereby enabling architectures that worked at depths previously thought impossible.
Innovation 2: Exponential Decay as a Unified Mechanism for Both Attention Dilution Control and Hierarchical Receptive Fields
The specific positional encoding design—LRPE with exponential decay—is an instance of a broader conceptual innovation: using continuous multiplicative decay as a single, differentiable mechanism that simultaneously solves two problems that prior work addressed separately.
Before this paper, the field had two distinct approaches to managing the spatial structure of attention in linear models. The first, exemplified by the original TransNormer's DiagAttention, was hard local windowing: restrict attention to a fixed diagonal band around each token, sacrificing long-range interaction for local precision. The second, exemplified by ALiBi (Press et al., 2022), was additive positional bias: add a linearly decreasing penalty to attention scores as a function of distance, which biases attention toward nearby tokens without hard restrictions. The paper's LRPE-d design unifies and improves both approaches: the exponential decay acts as a soft, multiplicative gating on attention scores, smoothly reducing distant-token influence without eliminating it entirely.
What makes this conceptually distinctive is not the decay itself (exponential decay of attention over distance has precedent in the state-space model literature) but rather (a) the hierarchical per-layer-per-head decay schedule and (b) the integration of decay with learned relative position encoding. The schedule in Equation 2 assigns different decay rates to different heads and layers, making lower layers focus more locally (stronger decay) and upper layers attend more globally (weaker decay, with the top layer having effectively infinite receptive field). This turns the decay factor from a uniform hyperparameter into a structured inductive bias: the model's effective attention span is not a single fixed value but a spectrum, with different parts of the network specializing in different temporal scales. This hierarchical specialization is not learned—it is imposed by the architecture's deterministic schedule—which means the model does not have to spend capacity learning where to attend globally vs. locally; it inherits this structure from the architecture design.
This is a fundamental advance over prior positional encoding schemes because it introduces the concept of architecturally-determined multi-scale temporal receptive fields into linear attention. RoPE (used in LLaMA and many Transformer variants) encodes relative position through rotation but does not impose any bias toward locality—the model must learn locality preferences entirely from data. ALiBi (used in some efficient Transformer variants) does impose a locality bias but applies it uniformly across all heads and layers, without multi-scale structure. LRPE-d combines the strengths: the complex exponential provides rich relative position information (like RoPE), while the per-head per-layer decay provides a structured bias toward multi-scale locality (going beyond both ALiBi and DiagAttention). The decoding temperature further ensures that this multi-scale structure makes conceptual sense: lower layers, which primarily process local syntactic patterns, have shorter effective attention spans; higher layers, which integrate information across the document, have longer spans.
The empirical payoff is visible in Table 3, where LRPE-d achieves 2.236 loss and 4.728 PPL, significantly better than pure exponential decay (2.267, 4.834) or pure LRPE (2.287, 4.899), confirming that both components—decay for locality bias and complex rotation for fine-grained relative position—are necessary and synergistic. The Mix variant selected for the final model (LRPE-d on the first layer only, pure decay on subsequent layers) demonstrates that much of the benefit can be realized with lower computational cost, suggesting that the first layer's role as the entry point for positional information is disproportionately important—an architectural finding that generalizes beyond this specific model.
Innovation 3: The Training-Inference Decoupling Principle — Left-Multiplication for Training, Right-Multiplication for Inference
The Lightning Attention algorithm and the robust inference algorithm together embody a decoupling principle that represents a conceptual advance beyond the FlashAttention lineage: the optimal computational strategy for linear attention is qualitatively different during training vs. inference, and a well-engineered system should use fundamentally different algorithms in each phase.
In standard softmax attention, training and inference share the same algorithmic structure: compute , apply softmax, multiply by . FlashAttention accelerates this by tiling, but the underlying computation is identical in both phases. The only difference is causal masking during training (to prevent attending to future tokens while still computing all outputs in parallel) vs. autoregressive generation during inference.
Linear attention breaks this symmetry. During training, the right-multiplication trick () is mathematically appealing but requires cumsum operations that prevent GPU parallelism—the very parallelism that makes Transformers fast to train despite their quadratic cost. During inference, the right-multiplication trick is naturally efficient because autoregressive generation is inherently sequential anyway, and the cumulative state can be updated with constant per-token cost.
The paper's key insight is to stop trying to make one algorithm work for both phases. Lightning Attention uses left-multiplication during training (), which is parallelizable but materializes the attention matrix. It then makes this left-multiplication IO-efficient through the same tiling pattern that FlashAttention popularized, avoiding the memory bottleneck that would otherwise make left-multiplication impractical for long sequences. The robust inference algorithm uses right-multiplication with a reformulated state update () that is numerically stable and has constant per-token cost.
This decoupling is conceptually significant because it rejects the implicit assumption that a single algorithmic primitive should serve both training and inference. It acknowledges that GPU architectures fundamentally favor different computational patterns for parallel training (maximize throughput by exploiting parallelism across the sequence dimension) and sequential inference (minimize per-step latency by maintaining a compact state). The Transformer architecture, for all its success, conflates these two regimes: the same computation is used in both, leading to the well-known inference bottleneck where the KV cache grows linearly with sequence length and attention cost grows quadratically. TransNormerLLM's decoupling achieves the best of both worlds: parallel training (via Lightning Attention's tiled left-multiplication) and constant-cost inference (via the robust recurrent update), without either phase paying for the other's constraints.
The evidence for this principle's effectiveness is in the combined efficiency data: Figure 3 shows training speed more than 2× faster than the baseline with 4× less memory, while Figure 4 shows inference time and memory that are constant with respect to sequence length (unlike Transformers, which grow approximately quadratically and linearly respectively). Neither efficiency gain alone would make the architecture competitive—faster training at the cost of slow inference would not displace Transformers in deployment, and fast inference with slow training would make model development prohibitively expensive. The decoupling achieves both.
This principle is fundamental rather than incremental because it establishes a design pattern that any future linear-complexity architecture should follow: do not force one computational approach to serve both training and inference; instead, design optimized algorithms for each phase that exploit their fundamentally different parallelism properties. This is a departure from the unified-attention paradigm that has dominated Transformer engineering and opens a design space where training and inference optimizations can be pursued independently.
5. Experimental Analysis
Evaluation Methodology
-
Dataset. The paper uses a self-collected pre-training corpus exceeding 6TB in size, containing over 2 trillion tokens, sourced from publicly accessible web text totaling over 700TB before cleaning. The data preprocessing pipeline involves three stages: rule-based filtering (removing HTML tags, URLs, garbled text, redundant punctuation, standardizing numbers, preserving Markdown/LaTeX), MinHash and Locality-Sensitive Hashing (LSH) based deduplication at the document and line level, and an iterative self-cleaning scheme where a 385M model trained on the corpus serves as a perplexity-based quality filter, followed by human evaluation. The final cleaned corpus is categorized into Academic Writings (200B tokens), Books (198B tokens), Code (689B tokens), Encyclopedia (5B tokens), Filtered Webpages (882B tokens), and Others (52B tokens). Tokenization uses Byte-Pair Encoding (BPE) with additional Chinese characters incorporated into the vocabulary; out-of-vocabulary items are broken into constituent UTF-8 characters.
-
Base model(s). All experiments use the TransNormerLLM architecture with variants at 385M, 1B, 3B, 7B, 13B, 65B, and 175B parameters. The 385M model has 24 layers, 1024 hidden dimensions, and 8 attention heads; the 1B model has 16 layers, 2048 hidden dimensions, and 16 heads; the 7B model has 30 layers, 4096 hidden dimensions, and 32 heads. For comparison, Transformer baselines with equivalent configurations are trained under identical conditions. The choice of PaLM 2-class scale (up to 175B parameters) positions the evaluation in a regime where softmax attention-based LLMs have established strong baselines, making it possible to test whether linear attention degrades at scale.
-
Metrics. The primary metric in ablation studies is language modeling loss and perplexity (PPL), computed as the average over the last 1,000 training iterations to reduce fluctuation. For benchmark evaluation, the primary metrics are accuracy scores on standard NLP benchmarks: BoolQ, PIQA, HellaSwag, WinoGrande, ARC-easy, ARC-challenge, OpenBookQA (all 0-shot), and MMLU, CMMLU, C-Eval (all 5-shot). All commonsense reasoning benchmarks are evaluated using the LM-Eval-Harness framework; MMLU, CMMLU, and C-Eval use their official evaluation scripts. The aggregated metrics report overall accuracy on each benchmark individually, with no composite score across benchmarks.
-
Baselines. The paper compares against multiple open-source Transformer-based LLMs at equivalent parameter scales. At the ~350–400M scale: OPT (350M), Pythia (400M), BLOOM (560M), and RWKV (430M, as the non-Transformer comparator). At the ~1B scale: GPT-Neo (1.3B), OPT (1.3B), Pythia (1.4B), BLOOM (1.1B), RWKV (1.5B), and Falcon (1B). At the ~7B scale: GPT-J (6.9B), OPT (6.7B), Pythia (6.9B), BLOOM (7.1B), RWKV (7.4B), MPT (6.9B), Falcon (7.2B), Baichuan 1 and 2 (7B), ChatGLM 1 and 2 (6.7B, 7.1B), OpenLLaMA v1 and v2 (6.7B), LLaMA 1 and 2 (6.7B). In architecture ablation studies (Tables 1–8), the primary baseline is an identically-configured softmax Transformer trained on the same corpus for the same number of updates. This within-study control (same data, same training budget, same model size, different architecture) is the cleanest comparison in the paper.
-
Generation budget / compute accounting. In ablation studies, compute is measured in training updates (100K updates for all 385M and 1B ablation models), with all models trained on a 300B-token subset of the full corpus. Loss and PPL are reported at this fixed update budget, making the comparison a direct measure of convergence speed and final performance under identical compute. For benchmark models, training budgets are reported in total tokens processed: 385M model trained on 1 trillion tokens, 1B model on 1.2 trillion, 7B model on 1.4 trillion. The input sequence length is fixed at 8192 tokens throughout pretraining. For inference efficiency comparisons (Figures 3, 4), compute is measured in wall-clock runtime (milliseconds) and GPU memory footprint (GB) at varying sequence lengths with fixed feature dimensions. For model parallelism experiments (Tables 12, 13, 14), throughput is measured in tokens per second per GPU. There is no FLOPs-matched comparison between pretraining and inference compute analogous to the PaLM 2-S* paper's Section 7—efficiency claims are based on wall-clock measurements rather than theoretical FLOP counting.
-
Cross-validation / statistical protocol. For ablation studies, the paper reports that "in order to reduce the fluctuation of Losses and PPLs... we compute the average Losses and PPLs of the last 1k iterations as the final metrics." There is no mention of multiple random seeds, standard deviations, confidence intervals, or statistical significance testing. All ablation tables report single values, and no error bars appear in any figure. For benchmark evaluations, results are reported as single accuracy numbers per benchmark per model; competing models' results are reproduced by the authors using released model checkpoints (denoted in normal typeface) unless they are from prior publications (denoted in italics). The paper does not describe any cross-validation protocol for hyperparameter selection or benchmark evaluation. This is a notable methodological gap: with a 500-question test set equivalent (common in prior work), the absence of statistical rigor means small differences between models (e.g., 25.90 vs. 24.85 on MMLU at 385M scale) cannot be reliably interpreted as meaningful.
Main Quantitative Results
Architecture Ablations: TransNormer vs. Transformer (Table 1)
The cleanest comparison in the paper is the head-to-head training of Transformer and TransNormerLLM architectures under identical configurations (same parameter count, same training data, same number of updates). At 385M parameters:
- Transformer achieves 2.362 loss, 5.160 PPL after 100K updates.
- TransNormerLLM achieves 2.248 loss, 4.770 PPL after the same budget.
This represents a 5% perplexity improvement (4.770 vs. 5.160). At 1B parameters:
- Transformer achieves 2.061 loss, 4.765 PPL after 100K updates.
- TransNormerLLM achieves 1.896 loss, 3.729 PPL after the same budget.
This represents a 9% perplexity improvement (3.729 vs. 4.765). The widening gap from 5% at 385M to 9% at 1B suggests that TransNormerLLM's advantages may compound with scale—the linear attention architecture converges faster or to a better minimum than softmax attention at larger model sizes, under identical training budgets. However, this trend is based on only two data points, and the 7B comparison (which would be needed to confirm the scaling trend) uses different training token budgets (1.4T for TransNormerLLM-7B vs. 1.0T for LLaMA-7B), making direct convergence-rate comparisons impossible at that scale.
TransNormer vs. TransNormerLLM (Table 2)
The ablation comparing the original TransNormer with the improved TransNormerLLM establishes a performance baseline for the architectural modifications. At 385M parameters with 100K updates:
- TransNormerLLM achieves 2.248 loss, 4.770 PPL.
- TransNormer-T1 (an original TransNormer variant) achieves 2.290 loss, 4.910 PPL.
- TransNormer-T2 (another original variant) achieves 2.274 loss, 4.858 PPL.
TransNormerLLM improves over the best original variant by approximately 1% (4.770 vs. 4.858 PPL) and over the weaker variant by approximately 2%. While these improvements appear modest relative to the Transformer comparison (5–9% PPL gains), they are meaningful because both TransNormer variants already used linear attention—these gains represent the marginal value of LRPE-d, gating, and the other modifications beyond what the original linear attention architecture could achieve.
Positional Encoding Ablations (Tables 3, 4)
Table 3 compares five positional encoding variants at 385M parameters with 100K updates:
- LRPE-d (LRPE with exponential decay applied to all layers): 2.236 loss, 4.728 PPL — the best result.
- Mix (LRPE-d on first layer only, exponential decay on remaining layers): 2.248 loss, 4.770 PPL.
- Exp-Decay (pure exponential decay, no complex rotation): 2.267 loss, 4.834 PPL.
- LRPE (pure LRPE, no exponential decay): 2.287 loss, 4.899 PPL.
- APE (Absolute Positional Encoding): 2.387 loss, 5.253 PPL — the worst result.
The key finding is that LRPE-d achieves the best perplexity, but the Mix variant is chosen for the final model because it "boosts the training speed up to 20% while only slightly worse than LRPE-d" (0.042 PPL degradation). This is a practical tradeoff: the 0.9% perplexity penalty (4.770 vs. 4.728) is accepted in exchange for a 15–20% training speedup.
The 0.064 PPL gap between LRPE and Exp-Decay (4.899 vs. 4.834) isolates the benefit of exponential decay alone, while the 0.099 PPL gap between Mix and pure Exp-Decay (4.770 vs. 4.834) isolates the benefit of adding LRPE-d to the first layer. The large gap between APE and all relative encoding methods (5.253 vs. 4.728–4.899) confirms that relative position encoding is essential for this architecture—absolute positions are insufficient to address attention dilution.
Table 4 ablates the decay temperature in the decay schedule (Equation 2). The results:
- With temperature: 2.248 loss, 4.770 PPL.
- Without temperature (uniform decay across all layers): 2.258 loss, 4.804 PPL.
The 0.034 PPL improvement from adding the layer-dependent temperature is small but consistent with the design intuition that lower layers benefit from shorter effective attention spans. This ablation confirms that the hierarchical receptive field strategy (stronger decay in lower layers, global attention in the top layer) provides a measurable benefit over uniform decay.
Gating Mechanism Ablations (Tables 5, 6, 7)
Table 5 ablates the presence of the gate in GLA:
- With gate (GLA as defined in Equation 3): 2.248 loss, 4.770 PPL.
- Without gate (pure NormAttention, no projection): 2.263 loss, 4.820 PPL.
The gate reduces loss by 0.015 and PPL by 0.050 at 385M scale. While this is a relatively small absolute improvement, the paper's design logic suggests that gating becomes more important at larger scales where the model has more capacity to exploit input-dependent selectivity.
Table 6 compares activation functions in the GLA structure (for the applied to and ):
- Swish: 2.248 loss, 4.770 PPL — selected for the final model.
- 1+elu: 2.252 loss, 4.767 PPL — essentially identical performance.
- No Activation: 2.283 loss, 4.882 PPL — substantially worse.
The near-identical performance of Swish and 1+elu is notable because these are very different functional forms (swish is smooth and unbounded below zero; 1+elu is bounded below at 0). The choice of Swish over 1+elu is driven by training stability rather than accuracy: "using 1+elu in our 7B model may encounter a NaN problem." This is a practical engineering consideration—the two activations have similar expressivity at 385M but 1+elu becomes unstable at larger scales, likely due to the sharp transition when the elu input is near -1 (where the +1 shift is sensitive to small changes). The poor performance of No Activation (0.035 worse loss than Swish) confirms that some nonlinearity is necessary on the query and key projections—the gate alone cannot compensate for linear queries and keys.
Table 7 ablates the activation function in the GLU channel mixer (comparing SGLU with standard GLU):
- No Activation (SGLU): 2.248 loss, 4.770 PPL.
- Swish (standard GLU): 2.254 loss, 4.788 PPL.
The difference is negligible—removing the activation from GLU has no measurable impact on performance. This is a strong result because it demonstrates that the element-wise product already provides sufficient nonlinearity in the channel mixing pathway, and the additional Swish activation is redundant. This is the empirical justification for the SGLU simplification and the associated speedup from removing activation computations.
Normalization Function Ablations (Table 8, Figure 2)
Table 8 compares three normalization functions at 385M parameters:
- SRMSNorm: 2.248 loss, 4.770 PPL.
- RMSNorm: 2.247 loss, 4.766 PPL.
- LayerNorm: 2.247 loss, 4.765 PPL.
The performance differences are effectively zero—all three normalization methods produce statistically indistinguishable results. This means the choice of SRMSNorm is purely an implementation optimization: the custom Triton kernel for SRMSNorm provides a speed advantage over PyTorch's built-in normalization, particularly at larger dimensions, without any accuracy cost.
Figure 2 demonstrates the speed advantage of the Triton SRMSNorm implementation. The upper panels show runtime for forward and backward passes at varying sequence lengths (fixed feature dimension 3072): the Triton implementation is consistently faster than PyTorch's SRMSNorm, with the gap widening at longer sequences. The lower panels show runtime at varying feature dimensions (fixed sequence length 4096): the Triton advantage becomes pronounced for feature dimensions above 1024, with the gap widening substantially at 16384. This is directly relevant for the 7B model (feature dimension 4096) and larger variants (up to 12288). The paper does not quantify the exact speedup percentage in the text, but the figures show visually that the Triton implementation is approximately 1.5–2× faster for large feature dimensions in both forward and backward passes.
Lightning Attention Efficiency (Figure 3)
Figure 3 provides the key empirical evidence for the training efficiency claims. The left panel shows runtime (forward + backward pass in milliseconds) for sequence lengths from 512 to 8192, with a fixed feature dimension of 2048, comparing Lightning Attention against the "Original Linear Attention" (PyTorch baseline implementation):
- At sequence length 512: both methods are comparable (~10–15 ms).
- At sequence length 1024: Lightning Attention is slightly faster.
- At sequence length 2048: Lightning Attention shows a clear advantage (~20 ms vs. ~40 ms).
- At sequence length 4096: Lightning Attention (~50 ms) vs. baseline (~120 ms) — approximately 2.4× faster.
- At sequence length 8192: Lightning Attention (~100 ms) vs. baseline (~250 ms) — approximately 2.5× faster.
The baseline runtime grows approximately quadratically (consistent with the complexity of the naive implementation), while Lightning Attention grows approximately linearly, achieving "at least 2× faster" as claimed in the text.
The right panel shows memory footprint (GB) for the same configuration:
- At sequence length 512: both methods use ~2 GB.
- At sequence length 2048: Lightning Attention uses ~4 GB vs. ~8 GB for baseline (approximately 2× more efficient).
- At sequence length 4096: Lightning Attention uses ~6 GB vs. ~20 GB (approximately 3.3× more efficient).
- At sequence length 8192: Lightning Attention uses ~10 GB vs. ~40 GB (approximately 4× more efficient).
The baseline memory grows quadratically, while Lightning Attention memory grows approximately linearly, achieving the claimed "up to 4× more efficient" at sequence length 8192.
These measurements are for a single attention operation (presumably one head of one layer, though the paper does not specify the batch size or number of heads for this benchmark), and they represent the forward + backward pass combined. The improvements are substantial and directly support the paper's efficiency claims for training.
Inference Efficiency (Figure 4)
Figure 4 demonstrates the inference-time advantage of TransNormerLLM over Transformer. The left panel shows inference runtime (milliseconds) for sequence lengths from 256 to 32000, with both models presumably at 7B scale (the paper does not explicitly state the model size for this figure, but it is likely the 7B variant given the context of Table 12 and surrounding discussion):
- At all sequence lengths, TransNormerLLM inference time is approximately constant (roughly 1–2 ms).
- Transformer inference time grows approximately quadratically, from near-zero at 256 to approximately 15 ms at 32000.
The right panel shows inference memory footprint (GB):
- TransNormerLLM memory is approximately constant at 1.5 GB across all sequence lengths.
- Transformer memory grows approximately linearly, from near-zero at 256 to approximately 15 GB at 32000.
These results validate the claim of "constant inference speed, regardless of the sequence length" from the abstract. The robust inference algorithm (Algorithm 2) with its fixed-size state is what enables this constant-cost inference—the Transformer's KV cache, by contrast, must store key and value vectors for every previous token, causing memory and computation to scale with sequence length.
Benchmark Performance: Commonsense Reasoning and Aggregated Benchmarks (Table 9)
Table 9 reports results across 11 benchmarks for models at approximately 385M, 1B, and 7B parameters, compared against a range of open-source LLMs.
At the 385M scale (TransNormerLLM-385M, 1.0T tokens, vs. comparably-sized models):
- BoolQ: 62.14 (highest among all models in this size class, beating Pythia-410M at 60.40 and OPT-350M at 57.74).
- PIQA: 66.70 (competitive with RWKV-430M at 67.52, ahead of Pythia at 67.08).
- HellaSwag: 46.27 (highest; Pythia at 40.52, RWKV at 40.90, OPT at 36.69).
- WinoGrande: 54.46 (competitive; OPT at 52.49, RWKV at 51.14).
- ARC-e: 55.43 (highest; RWKV at 52.86, Pythia at 51.81).
- ARC-c: 27.99 (highest; Pythia at 24.15, RWKV at 25.17).
- OBQA: 32.40 (tied with RWKV; Pythia at 29.40).
- MMLU: 25.90 (competitive; Pythia at 25.99, OPT at 26.02, RWKV at 24.85).
- CMMLU: 25.05 (comparable to competitors in the 25.16–25.35 range).
- C-Eval: 25.24 (competitive; OPT at 25.71, Pythia at 24.81).
TransNormerLLM-385M outperforms or is competitive with all models in this size class across most benchmarks, which is notable given that several competitors (Pythia, OPT, BLOOM) have been trained for shorter token budgets. However, the 385M TransNormerLLM was trained on 1T tokens vs. 300B for most competitors, making the comparison favorable to TransNormerLLM—better performance could result from more training data rather than better architecture.
At the 1B scale (TransNormerLLM-1B, 1.2T tokens):
- BoolQ: 63.27 (competitive; Falcon-1B at 61.38, RWKV-1.5B at no reported score).
- PIQA: 72.09 (competitive; Falcon at 75.14, RWKV at 72.36).
- HellaSwag: 56.49 (below Falcon at 61.50, but above Pythia-1.4B at 47.18).
- WinoGrande: 60.38 (comparable to Falcon at 60.30, OPT-1.3B at 59.35).
- ARC-e: 63.68 (highest among non-Falcon; Falcon at 63.38).
- ARC-c: 35.24 (highest; Falcon at 32.17, Pythia at 26.88).
- OBQA: 36.60 (highest; Falcon at 35.60).
- MMLU: 27.10 (competitive; BLOOM-1.1B at 27.30, Pythia at 26.55).
- CMMLU: 25.88 (competitive).
- C-Eval: 26.01 (competitive; BLOOM at 26.50, OPT at 25.32).
At this scale, TransNormerLLM-1B shows competitive or leading performance on most benchmarks, with particular strength on ARC-challenge and OBQA. The training token budget (1.2T tokens) is substantially higher than most competitors (300M–350M), which again makes attributing performance to architecture vs. data quantity difficult.
At the 7B scale (TransNormerLLM-7B, 1.4T tokens):
This is the most competitive weight class, with strong baselines including LLaMA 1/2, Baichuan 1/2, and ChatGLM 1/2.
- BoolQ: 75.87 (competitive; LLaMA-7B at 76.50, ChatGLM2 at 77.65).
- PIQA: 80.09 (highest; LLaMA at 79.80, Falcon at 79.38).
- HellaSwag: 75.21 (competitive; MPT at 76.25, LLaMA at 76.10, Falcon at 76.30).
- WinoGrande: 66.06 (below LLaMA at 70.10, MPT at 68.27).
- ARC-e: 75.42 (competitive; MPT at 74.79, Falcon at 74.62, LLaMA at 72.80).
- ARC-c: 44.40 (competitive; Falcon at 43.60, LLaMA2 at 46.33).
- OBQA: 63.40 (highest by a significant margin; LLaMA at 57.20, the next highest, is 6.2 points lower).
- MMLU: 43.10 (competitive; Baichuan1 at 42.30, ChatGLM1 at 40.63, well below Baichuan2 at 54.16 and ChatGLM2 at 45.46).
- CMMLU: 47.99 (competitive; Baichuan2 at 57.07 is substantially higher, ChatGLM2 at 48.80).
- C-Eval: 43.18 (competitive; Baichuan2 at 54.00 and ChatGLM2 at 52.55 are substantially higher).
The standout result at 7B is the 63.40 on OpenBookQA, which is dramatically higher than any other model in the comparison—LLaMA-7B scores 57.20, a 6.2-point gap. This is a striking outlier that the paper does not discuss or explain. Possible explanations include: (1) the training corpus contains substantial scientific/academic text that transfers well to OBQA, (2) the linear attention architecture's positional encoding structure is particularly well-suited to the fact-retrieval style of OBQA questions, or (3) there is an evaluation methodology difference (though the paper claims to use LM-Eval-Harness uniformly). Without ablation or analysis, this result remains an unexplained anomaly.
The Baichuan2 and ChatGLM2 substantially outperform TransNormerLLM-7B on CMMLU (57.07 and 48.80 vs. 47.99) and C-Eval (54.00 and 52.55 vs. 43.18). These are Chinese-language benchmarks (CMMLU evaluates Chinese multitask understanding, C-Eval is a Chinese evaluation suite), and both Baichuan and ChatGLM were developed specifically with Chinese-language performance in mind. TransNormerLLM's training corpus includes Chinese (555B tokens out of 2T total, per Table 11), but the gap to the Chinese-optimized models suggests that the architecture or training recipe may not be as well-tuned for Chinese as these purpose-built models.
Model Parallelism Efficiency (Tables 12, 13)
Table 12 compares model parallelism performance for Transformer-7B (with FlashAttention) and TransNormerLLM-7B (with Lightning Attention) on a single 8-GPU A100 node with NVLink, using a batch size of 2 and context length of 2048:
Memory scaling:
- At model parallel size 1: TransNormerLLM uses 64.0 GB/GPU vs. Transformer's 66.3 GB (3.5% less).
- At size 8: TransNormerLLM uses 24.1 GB/GPU vs. Transformer's 28.7 GB (16.0% less).
- TransNormerLLM memory savings increase from 3.5% to 16.0% as model parallelism increases, suggesting that the GLA and SGLU parallelism strategies are more communication-efficient than Megatron-LM's self-attention parallelism (fewer intermediate activations to store, or more favorable partitioning).
Throughput scaling:
- At model parallel size 1: TransNormerLLM at 32048.6 tokens/sec vs. Transformer at 26896.1 (19.2% faster).
- At size 8: TransNormerLLM at 24280.0 tokens/sec vs. Transformer at 19973.6 (21.6% faster).
- Both models lose throughput as model parallelism increases (due to communication overhead), but TransNormerLLM maintains a consistent ~20% speed advantage at all parallelism levels.
Table 13 extends the comparison to larger model sizes (7B to 175B) with a fixed context length of 2048, maximizing batch size to fill GPU memory:
- 7B: TransNormerLLM at 4081.0 tokens/sec/GPU vs. Transformer at 3362.7 (21.4% faster), both using ~72 GB/GPU.
- 13B: TransNormerLLM at 2104.3 vs. Transformer at 1735.6 (21.2% faster), both using ~71–74 GB/GPU.
- 65B: TransNormerLLM at 406.9 vs. Transformer at 318.2 (27.9% faster), both using ~69–73 GB/GPU.
- 175B: TransNormerLLM at 136.6 vs. Transformer at 106.2 (28.6% faster), both using ~69–70 GB/GPU.
Two trends emerge: (1) TransNormerLLM is consistently faster at all scales, and (2) the relative speed advantage increases with model size (21.4% at 7B to 28.6% at 175B). This suggests that the linear attention architecture's FLOP advantage becomes more pronounced at larger scales—the complexity delivers proportionally more savings when (feature dimension) is large relative to (sequence length), and larger models have larger feature dimensions (4096 at 7B, 12288 at 175B). At the same time, the quadratic attention cost in Transformers grows with both and , so the gap widens.
Context Length Stress Tests (Table 14)
Table 14 reports the maximum trainable context length for Transformer and TransNormerLLM at various model sizes on 64 A100 80GB GPUs with a batch size of 1, along with relative training speed:
- 7B: TransNormerLLM achieves 48K context at 1.21× Transformer speed (Transformer: 37K context, 1× speed).
- 13B: TransNormerLLM achieves 35K context at 1.23× Transformer speed (Transformer: 24K context).
- 65B: TransNormerLLM achieves 23K context at 1.29× Transformer speed (Transformer: 19K context).
- 175B: TransNormerLLM achieves 12K context at 1.35× Transformer speed (Transformer: 10K context).
The context length advantage narrows at larger scales—1.30× longer at 7B (48K vs. 37K), 1.25× at 13B (35K vs. 28K), 1.21× at 65B (23K vs. 19K), and 1.20× at 175B (12K vs. 10K). This narrowing likely reflects the growing contribution of other memory consumers (optimizer states, activation checkpoints, model parameters) relative to the attention matrix. At 175B, the attention computation is a smaller fraction of total memory, so the linear attention advantage becomes proportionally less impactful. The speed advantage, however, increases with scale (1.21× to 1.35×), suggesting that the remaining computation is more FLOP-efficient in TransNormerLLM even when memory savings are proportionally smaller.
Ablation Studies and Robustness Checks
TransNormerLLM vs. Transformer scaling trend (Tables 1, 9): The head-to-head training comparison in Table 1 shows a 5% PPL advantage at 385M widening to 9% at 1B. This is the strongest evidence for architectural superiority because all variables except architecture are controlled (same data, same training budget, same model size). However, the trend is only two data points, and the 7B comparison in Table 9 uses different training budgets (1.4T tokens for TransNormerLLM vs. 1.0T for LLaMA-7B), preventing a clean scaling comparison at the largest scale. A 7B head-to-head training run with identical data and budget would be the natural extension.
Positional encoding hierarchy (Mix vs. LRPE-d, Table 3): The Mix variant (LRPE-d on first layer only) sacrifices 0.042 PPL (4.770 vs. 4.728) for 15–20% training speedup. The ablation confirms that most of the positional encoding benefit can be realized with LRPE-d on just one layer, which is a non-obvious efficiency finding—it suggests that the first layer shoulders a disproportionate burden for encoding position information in this architecture, and subsequent layers primarily refine content-based representations where exponential decay alone suffices.
Decay temperature ablation (Table 4): Adding the temperature reduces PPL by 0.034 (4.804 to 4.770). While small, this confirms that the hierarchical receptive field design (shorter attention spans in lower layers, global in top layer) provides a measurable benefit over uniform decay across all layers. The effect is likely more important for longer sequences than the 8192 tokens used in these ablations, where the distinction between "local" and "global" attention becomes more meaningful.
Gating sensitivity to activation function scale (Table 6, NaN at 7B with 1+elu): The finding that 1+elu causes NaN at 7B while Swish remains stable is a practical robustness result. The paper does not diagnose the root cause, but it's likely related to gradient magnitudes: 1+elu approaches 0 for very negative inputs, but the gradient approaches the gradient of elu, which saturates at a constant near 1 for positive inputs. In contrast, Swish's gradient decays to 0 for large negative inputs, providing natural gradient clipping. At 7B scale with large weight matrices and long training horizons, this gradient-taming property matters more.
SGLU activation removal robustness (Table 7): The finding that removing the activation from GLU causes negligible performance change (2.248 vs. 2.254 loss) is tested only at 385M scale. It is plausible that at larger scales, the additional nonlinearity from an activation function in the channel mixer becomes more important (as the model has more capacity to exploit it), but this was not tested. The paper does not report whether SGLU was validated at 1B or 7B scale before being used in the final architecture.
Normalization function equivalence (Table 8): The finding that SRMSNorm, RMSNorm, and LayerNorm produce indistinguishable results suggests that the NormAttention operator (Equation 6) is robust to the specific normalization formula, as long as some form of per-token normalization is applied. This is a robustness check confirming that the SRMSNorm speed optimization does not come with a hidden accuracy penalty.
Inference stability with robust algorithm (Algorithm 2, Appendix C): The mathematical proof in Appendix C establishes that Algorithms 1 and 2 produce identical outputs, but no empirical comparison is provided (e.g., measured numerical error at different sequence lengths, verification that Algorithm 1 produces NaN beyond a certain length while Algorithm 2 does not). Given that this is the paper's primary inference contribution, a quantitative stability measurement would strengthen the claim.
Training token budgets for benchmark models (Section 4 intro): The 385M model was trained on 1T tokens, the 1B on 1.2T, and the 7B on 1.4T. These are substantially larger budgets than most competitors in Table 9: OPT-350M and Pythia-410M were trained on 300B tokens, OPT-1.3B and Pythia-1.4B on 300B, BLOOM-560M and -1.1B on 350B. The comparison at 7B is more balanced (LLaMA-7B at 1.0T, Falcon-7B at 1.5T, MPT-7B at 1.0T), but the extra tokens at smaller scales make performance attribution ambiguous—better results could come from more training data rather than better architecture. The paper does not provide intermediate checkpoints or learning curves that would allow separating the effects of model architecture and training data quantity.
Critical Assessment
The paper makes one central empirical claim: that TransNormerLLM achieves competitive or superior performance to Transformer-based LLMs of equivalent size while being faster in both training and inference. The supporting evidence is strongest for the efficiency claims and weaker for the accuracy claims, with important caveats about training data mismatch and missing analyses.
Claim: TransNormerLLM outperforms Transformer in accuracy under identical training conditions. The evidence in Table 1 directly supports this at 385M and 1B scales: 5% and 9% PPL improvements with identical data, identical updates, and identical model sizes. This is the cleanest comparison in the paper and genuinely demonstrates architectural superiority. However, the number of data points is small (two scales), and the largest scale where this comparison could be definitive—7B or 13B—is not reported in a controlled setting. The 7B benchmark comparison in Table 9 uses different training budgets and cannot confirm or refute the scaling trend. The paper would be significantly strengthened by a 7B head-to-head training run with identical data and updates, which would establish whether the 5%–9% advantage persists, grows, or diminishes at scale. The stress test data in Table 13 shows that TransNormerLLM is faster at 7B–175B, but does not report perplexity, so we do not know whether the speed advantage comes with maintained or degraded accuracy at these scales.
Claim: TransNormerLLM is competitive with state-of-the-art Transformer LLMs on standard benchmarks. Table 9 shows that TransNormerLLM is broadly competitive, with some strengths (ARC-e, ARC-c, OBQA) and some weaknesses (CMMLU, C-Eval relative to Chinese-optimized models). The comparison is complicated by unequal training token budgets: TransNormerLLM-385M and -1B were trained on substantially more tokens than most competitors, making these comparisons favorable to TransNormerLLM in ways that may overstate the architectural contribution. At 7B, where training budgets are more comparable, TransNormerLLM is competitive but does not consistently outperform LLaMA or Baichuan—it leads on PIQA and OBQA but trails on WinoGrande, MMLU, CMMLU, and C-Eval. The claim of matching performance is conditionally supported (competitive, not dominant) with the caveat that training data quality and quantity are not controlled across comparisons.
Claim: TransNormerLLM is faster at training and inference. The efficiency claims are the strongest part of the paper. Figure 3 shows 2× faster training and 4× less memory for the attention operation. Figure 4 shows constant inference time and memory vs. growing Transformer costs. Table 12 shows 20% training speed advantages at 7B, and Table 13 shows this advantage widening to 29% at 175B. Table 14 shows longer maximum context lengths at all model sizes. These results are measured on real GPU hardware with wall-clock time and memory consumption as metrics, not theoretical FLOP counts, making them directly relevant to practice. The robustness of the speed advantage across scales (7B to 175B) and across parallelism configurations (Table 12) strengthens the claim.
What is not tested: The paper does not compare against FlashAttention-equipped Transformers in the training speed comparison (Figure 3). The Lightning Attention baseline is described as "PyTorch implementation of the NormAttention" and "Orignal Linear Attn"—it is not clearly specified whether this baseline uses any IO-awareness optimizations, making it an artificially weak comparison. Since FlashAttention achieves similar IO-awareness benefits for softmax attention, a Lightning Attention vs. FlashAttention training speed comparison would reveal whether the linear attention speed advantage persists over the best available softmax implementation, or whether FlashAttention eliminates (or narrows) the gap. Table 12 uses FlashAttention for the Transformer in the model parallelism comparison, but this is a throughput measurement at a single sequence length (2048), not a scaling curve like Figure 3. A FlashAttention vs. Lightning Attention scaling comparison (varying sequence length) is a critical missing experiment—without it, we cannot distinguish whether Lightning Attention is faster because linear attention is inherently more efficient, or simply because the baseline linear attention implementation was not optimized.
Single model family, single corpus: All experiments use the TransNormerLLM architecture with the self-collected 2T-token corpus. There are no experiments with different corpora (e.g., The Pile, C4, RedPajama) or different tokenizers, making it impossible to assess whether the architecture's performance depends on specific properties of the training data. The ablation studies use a 300B-token subset of this corpus, which is reasonable for architectural exploration but does not test corpus sensitivity.
OpenBookQA anomaly: The 63.40 score on OBQA at 7B is dramatically higher than any comparator (LLaMA-7B at 57.20, LLaMA2-7B at 44.20). This 6.2-point gap over the next-best model is large enough to suggest either an evaluation methodology difference, a training data contamination issue (the OBQA questions appear in or are closely similar to text in the training corpus), or a genuine architectural advantage specific to the type of reasoning OBQA requires. The paper provides no analysis, ablation, or discussion of this result. Even a brief investigation—checking the OBQA training data against the pretraining corpus for overlap, or reporting whether the 385M and 1B models also show disproportionately high OBQA scores relative to their size class—would substantially increase confidence that this is a real effect rather than an artifact.
No standard deviation or statistical significance reporting: All tables report single values without error bars, confidence intervals, or significance tests. The 500-question equivalent test sets for the benchmarks mean that differences of 1–2 percentage points (common in the comparison tables) could easily fall within sampling error. The paper's practice of averaging "the last 1k iterations" for loss and PPL is a reasonable smoothing technique but does not provide uncertainty quantification.
Missing intermediate-scale validation: The architectural ablations (Tables 1–8) are all conducted at 385M parameters. While this is a cost-effective scale for ablations, it does not guarantee that the optimal design choices at 385M remain optimal at 7B or 175B. The 1+elu NaN problem at 7B (noted in Table 6 discussion) is a direct example of a design choice that worked at 385M but failed at larger scale. The SGLU removal of GLU activation was tested only at 385M—if the additional nonlinearity becomes beneficial at larger scales, the SGLU choice might be suboptimal for the 7B and larger models. Ablation verification at 1B or 7B for the most impactful design choices (SGLU activation removal, GLA activation function, Mix vs. full LRPE-d) would improve confidence that the architecture scales cleanly.
No long-context evaluation beyond language modeling: The paper emphasizes the long-sequence capabilities of TransNormerLLM (Table 14 shows 48K context training at 7B vs. 37K for Transformer), but all downstream evaluations in Table 9 use standard benchmark formats that do not require or test long-context reasoning. Tasks like multi-document QA, long-document summarization, needle-in-a-haystack retrieval, or the SCROLLS benchmark would directly test whether the linear attention architecture's long-context training capability translates to improved long-context task performance. The absence of such evaluations leaves open the question of whether the architecture's long-context advantage is merely a memory efficiency benefit (can fit longer sequences in training) or also a representational benefit (can learn to use long-range dependencies more effectively).
6. Limitations and Trade-offs
The 385M Ablation Regime Does Not Guarantee Design Choices Transfer to 7B and Beyond
The assumption or constraint. All architectural ablations in Section 4.1 (Tables 1–8) are conducted at the 385M parameter scale, trained on a 300B-token subset for 100K updates. The paper implicitly assumes that the design choices validated at this scale—the SGLU activation removal, the Mix positional encoding, the Swish activation in GLA, the SRMSNorm normalization, and the non-learnable decay schedule—remain optimal or at least non-harmful when the model is scaled to 1B, 7B, and beyond.
The consequence. The paper itself provides a concrete counterexample to this assumption. The discussion of Table 6 reveals that the 1+elu activation function, which performed "similar" to Swish at 385M (2.252 vs. 2.248 loss), "may encounter a NaN problem" when used in the 7B model. This is a direct instance of a design choice that validated cleanly at the ablation scale but failed at the target scale. The concern is that this pattern may extend to other design choices that were not tested at scale. Specifically, the SGLU removal of the GLU activation function was tested only at 385M (Table 7: 2.248 vs. 2.254 loss). If the additional nonlinearity from an activation in the channel mixer becomes beneficial at larger model sizes—as is plausible when a model has excess capacity and can exploit richer transformations—the current 7B and potentially 175B models may be operating with a suboptimal channel mixer design. Similarly, the Mix positional encoding (LRPE-d on the first layer only) was selected over full LRPE-d for a 15–20% speedup at the cost of 0.042 PPL at 385M. Whether this tradeoff remains favorable at 7B, where the relative cost of the positional encoding computation is a smaller fraction of total FLOPs, is unknown.
What evidence exists in the paper. The 1+elu NaN problem at 7B is the only reported case of a scale-dependent failure. The paper does not report ablation results at 1B or 7B for the SGLU activation removal, the Mix vs. full LRPE-d tradeoff, or any other design choice validated only at 385M. Figure 2 shows that the advantage of the Triton SRMSNorm kernel grows with feature dimension, but this is a speed comparison, not an accuracy validation. The benchmark results in Table 9 demonstrate that the 7B model is competitive overall, but they cannot isolate whether any individual design choice is suboptimal at scale—a model can be competitive despite a suboptimal component if other components compensate.
Mitigation status. The paper does not acknowledge this as a general limitation. The 1+elu issue is noted as a specific practical finding rather than an instance of a broader methodological concern. The authors do not suggest future work to validate architectural choices at target scales before committing to expensive full-scale training runs. A natural mitigation—running key ablations (SGLU activation, positional encoding scheme) at an intermediate scale like 1B before scaling to 7B—is not described and may or may not have been performed.
Training Token Budgets Are Not Controlled Across Benchmark Comparisons, Confounding Architecture and Data Effects
The assumption or constraint. The benchmark comparison in Table 9 compares TransNormerLLM models against a range of open-source LLMs at similar parameter counts, but with substantially different training token budgets. The paper trains its 385M model on 1 trillion tokens, its 1B model on 1.2 trillion tokens, and its 7B model on 1.4 trillion tokens. In contrast, most competing models at the smaller scales were trained on far fewer tokens: OPT-350M and Pythia-410M on approximately 300B tokens, BLOOM-560M on approximately 350B tokens. The paper reports these training budgets transparently in Table 9 but does not control for them in the comparison—the performance attribution is implicitly "model architecture + training data quantity + training data quality," with no way to separate these factors.
The consequence. At the 385M and 1B scales, TransNormerLLM's training token advantage is vast—3.3× more tokens than OPT and Pythia at 385M, 3.4–4× more than most competitors at 1B. It is well-established from scaling laws (Kaplan et al., 2020; Hoffmann et al., 2022) that language model performance improves predictably with more training data, especially for undertrained models. The 5% and 9% PPL advantages over Transformer in Table 1 (where training budgets ARE controlled) demonstrate genuine architectural benefits, but the benchmark comparisons in Table 9 overstate the architectural contribution because the extra training tokens independently boost performance. A practitioner reading Table 9 might conclude that TransNormerLLM-385M is the best architecture in its size class because it achieves the highest scores, when in reality the scores reflect both the architecture and the much larger training budget. The 385M TransNormerLLM was trained on 1T tokens—more than the 300B used for most competitors—so its benchmark advantage is partially a data effect.
What evidence exists in the paper. Table 9 reports token budgets in the "T" column. A careful reader can note the discrepancies, but the paper makes no effort to adjust for or acknowledge them. The 7B comparison is somewhat less affected: TransNormerLLM-7B (1.4T tokens) is within the range of LLaMA-7B (1.0T), Falcon-7B (1.5T), and MPT-7B (1.0T). However, even here, LLaMA2-7B was trained on 2.0T tokens and achieves substantially higher scores on several benchmarks (MMLU 45.30 vs. 43.10, ARC-c 46.33 vs. 44.40), raising the question of whether additional training tokens would close or reverse TransNormerLLM's advantages. The paper does not provide intermediate checkpoints, learning curves, or iso-token comparisons that would allow separating architecture from data effects in the benchmark setting.
Mitigation status. Unaddressed. The paper does not discuss this confound, does not provide iso-token comparisons for any benchmark models below 7B, and does not include a scaling law analysis showing that the architectural advantage persists after controlling for tokens. The abstract claims that TransNormerLLM "match[es] the performance of state-of-the-art LLMs with Transformer," which is true at face value for the reported numbers, but the uncontrolled token budgets mean the statement overstates the architectural contribution. A simple mitigation—training the 385M and 1B models on the same token budgets as competitors (300B tokens) and reporting those results alongside the fully-trained models—would cleanly separate architecture and data effects and is conspicuously absent.
Lightning Attention Is Compared Against an Unoptimized Linear Attention Baseline, Not FlashAttention for Softmax Transformers
The assumption or constraint. The headline efficiency claim in Figure 3—that Lightning Attention achieves more than 2× faster runtime and 4× lower memory than the baseline—compares against what the paper calls "Orignal Linear Attn" and "PyTorch implementation of the NormAttention." This baseline is described as the naive PyTorch implementation that materializes the full QK^T matrix in HBM. The comparison does not include a FlashAttention-optimized softmax Transformer, which would be the relevant baseline for determining whether the linear attention architecture provides a genuine efficiency advantage over the best available Transformer implementation.
The consequence. FlashAttention (Dao et al., 2022a; Dao, 2023) achieves similar IO-awareness benefits for standard softmax attention as Lightning Attention achieves for linear attention—both use tiling to keep computation in SRAM and avoid materializing the full n × n attention matrix in HBM. For a practitioner evaluating whether to adopt TransNormerLLM, the relevant comparison is not "Lightning Attention vs. naive linear attention" but "Lightning Attention vs. FlashAttention on a softmax Transformer." The current Figure 3 demonstrates that Lightning Attention is well-engineered and IO-aware, which is valuable, but does not demonstrate that the linear attention architecture is inherently more efficient than the softmax architecture once both are similarly optimized. The paper acknowledges the FlashAttention lineage explicitly (Lightning Attention is described as "inspired by" Dao, 2023; Dao et al., 2022a), but the efficiency comparison in Figure 3 is against an unoptimized linear attention baseline, not against FlashAttention. This makes the 2× and 4× claims about the architecture's efficiency advantage misleading—these numbers primarily measure the improvement from IO-awareness (which FlashAttention also provides for softmax attention) rather than the improvement from linear complexity.
What evidence exists in the paper. Table 12 and Table 13 do compare against Transformers using FlashAttention, but these are throughput measurements at fixed context lengths (2048 in Table 12, 2048 with maximum batch size in Table 13). They show TransNormerLLM is ~20% faster at equivalent model sizes, which is a meaningful advantage. However, Figure 3—which is the paper's primary efficiency visualization and the source of the headline 2×/4× claims—does not include a FlashAttention baseline. The scaling behavior with sequence length (the regime where the linear vs. quadratic complexity difference should be most visible) is therefore only shown for the naive baseline, not for the best available Transformer implementation. At sequence length 2048, where Table 12 shows a 20% advantage, the quadratic attention cost in Transformers is not yet the dominant computational bottleneck, so the complexity difference may be proportionally smaller than the architecture suggests. The paper does not report how the speed advantage scales with sequence length when both architectures use optimized attention kernels—this is precisely the regime where practitioners with long-context workloads need guidance.
Mitigation status. Partially addressed in Tables 12 and 13, where FlashAttention is used for the Transformer baseline. These tables show consistent ~20% speed advantages for TransNormerLLM at context length 2048 across model sizes, which is a genuine architectural benefit even after FlashAttention optimization. However, the paper never presents a scaling curve (like Figure 3) comparing Lightning Attention against FlashAttention across varying sequence lengths. The mitigation is incomplete because the sequence-length-scaling behavior is the key metric for long-context applications, and the 2048-token measurements in Tables 12–13 do not reveal whether the advantage grows, stays constant, or diminishes at longer sequences. A Lightning Attention vs. FlashAttention efficiency comparison at sequence lengths from 512 to 8192+, analogous to Figure 3, would resolve this uncertainty and is a critical missing experiment.
The 63.40 OpenBookQA Score at 7B Is an Unexplained Outlier That Undermines Confidence in Benchmark Results
The constraint. The TransNormerLLM-7B model achieves 63.40 on OpenBookQA in Table 9, which is 6.2 points higher than the next-best model in the comparison (LLaMA-7B at 57.20) and substantially higher than all other 7B-scale models (Pythia-6.9B at 37.00, Falcon-7B at 43.80, MPT-6.9B at 42.20, Baichuan2-7B at 39.60, ChatGLM2-7B at 37.00). This is the single largest relative advantage TransNormerLLM shows on any benchmark at any scale, and it is dramatically out of proportion with the model's performance on related reasoning benchmarks. On ARC-challenge (44.40) and ARC-easy (75.42), TransNormerLLM is competitive but not dominant; on MMLU (43.10), it is in the middle of the pack. The OBQA score is unexplained by any architectural feature, training data property, or evaluation methodology difference described in the paper.
The consequence. A 6.2-point outlier on a benchmark with a test set of approximately 500 questions (OBQA's test set size) demands explanation. Possible explanations include: (1) Training data contamination—the OBQA test questions or near-duplicates appear in the self-collected 2T-token training corpus, giving the model an unfair memorization advantage; (2) Evaluation methodology difference—despite claiming to use LM-Eval-Harness uniformly, there may be a prompt formatting, few-shot example selection, or answer extraction difference specific to OBQA; (3) Genuine architectural advantage—linear attention's positional encoding or gating mechanism is particularly well-suited to the fact-retrieval and commonsense reasoning style of OBQA questions in a way that does not transfer to superficially similar benchmarks like ARC or BoolQ. Without investigation, a practitioner cannot determine whether the OBQA score represents a reproducible capability advantage (in which case the architecture is genuinely better for certain reasoning tasks) or an artifact (in which case the benchmark results as a whole are less reliable than they appear). The outlier also raises concerns about other benchmarks—if one score is anomalous, others may be as well, but without per-benchmark analysis, the reader cannot assess the reliability of any individual result.
What evidence exists in the paper. Only the single number in Table 9. There is no discussion of the OBQA result in the text, no analysis of potential contamination, no reporting of whether the 385M and 1B models also show disproportionately high OBQA scores (at 385M, OBQA is 32.40, tied with RWKV-430M; at 1B, OBQA is 36.60, highest in class but only 1.0 point above Falcon-1B at 35.60). The anomaly only appears at 7B, which is suspicious—a genuine architectural advantage specific to OBQA-style reasoning should presumably manifest at smaller scales as well. The paper's silence on this point makes it impossible for a reader to determine whether the score is meaningful.
Mitigation status. Completely unaddressed. The paper does not acknowledge the outlier, does not provide any analysis or ablation, and does not discuss data contamination or evaluation methodology. The authors' stated commitment to open-source their models will enable third-party reproduction and investigation, but this is a post-hoc mitigation that does not address the concern within the paper itself. A minimal mitigation—checking the OBQA test set against the training corpus for overlap, reporting decontaminated scores if overlap is found, or providing per-question accuracy breakdowns—would substantially increase confidence in the benchmark results overall.
Difficulty Estimation and Robustness to Distribution Shift Are Not Addressed, Limiting Deployment Guidance
The constraint. The paper evaluates TransNormerLLM on standard benchmarks (commonsense reasoning, MMLU, CMMLU, C-Eval) that measure aggregate performance across predefined test sets, but it provides no analysis of how the architecture's performance varies with input difficulty, sequence length, domain shift, or prompt format. Despite emphasizing the architecture's long-context capabilities (Table 14 shows up to 48K training context at 7B), no downstream evaluation tests performance on tasks requiring long-range reasoning. Despite training on a multilingual corpus (English, Chinese, Code, and Others per Table 11), no language-specific performance breakdown is provided to reveal whether the architecture's advantages are language-dependent. Despite the linear attention mechanism being theoretically vulnerable to attention dilution—the very problem LRPE-d was designed to solve—there is no analysis of how performance degrades as sequence length increases in downstream tasks, or at what sequence length the dilution problem re-emerges despite the positional encoding mitigations.
The consequence. A practitioner considering deploying TransNormerLLM faces several unanswered questions that directly affect deployment decisions. First, on what kinds of inputs does the model fail? The benchmark averages in Table 9 mask per-instance performance variability. If the model performs well on simple factual questions but poorly on complex multi-hop reasoning (or vice versa), the aggregate score is misleading for applications that skew toward one difficulty level. Second, does the long-context training capability translate to long-context task performance? The ability to train with 48K context (Table 14) is a hardware efficiency benefit, but if the model cannot effectively use information beyond the first few thousand tokens in downstream tasks, the longer context is not practically useful. The linear attention architecture's fundamental tradeoff—replacing sharp softmax selectivity with smoother linear mixing—could manifest as degraded performance on tasks that require precise attention to specific tokens in long documents (e.g., finding a specific date in a contract, answering a question about a detail buried in a long passage). Third, does the architecture's performance advantage persist across languages? The large gap to Baichuan2 and ChatGLM2 on Chinese benchmarks (CMMLU: 47.99 vs. 57.07, C-Eval: 43.18 vs. 54.00) could indicate that TransNormerLLM's design is less effective for Chinese, or it could reflect training data composition differences—without a controlled comparison, a practitioner building a Chinese-language application cannot assess whether TransNormerLLM is appropriate.
What evidence exists in the paper. Essentially none. The benchmark results are aggregate scores with no difficulty, length, domain, or language breakdowns. The OBQA outlier is the only per-benchmark anomaly visible in the data, and it is unexplained. The long-context training capability is demonstrated in Table 14 (maximum trainable context lengths), but no evaluation confirms that this capability translates to effective long-range reasoning. The paper does not include any needle-in-a-haystack, long-document QA, multi-document summarization, or other long-context benchmark. The closest thing to a difficulty analysis is the loss and PPL progression during training (which is standard and not broken down by any input characteristic) and the architecture ablations (which use aggregate loss/PPL, not performance on specific input types).
Mitigation status. Not addressed and not acknowledged as a limitation. The paper's scope is focused on establishing that linear attention can achieve competitive aggregate performance—a necessary first step—but it does not provide the granular analysis that would guide practical deployment. Future work on "exploring transformer extrapolation" is cited (Qin et al., 2023c) but not investigated. To make this architecture practically deployable, a practitioner would need to conduct their own difficulty-stratified evaluation, long-context task benchmarking, and language-specific performance analysis—the paper provides no guidance on what to expect.
No FLOPs-Matched or Latency-Adjusted Comparison Between Pretraining and Architecture Scaling
The constraint. The paper makes efficiency claims based on wall-clock measurements (tokens per second, memory footprint, inference time) at fixed model sizes, but it never asks: given a fixed total compute budget, should I train a larger Transformer or a smaller TransNormerLLM with the savings invested in more training tokens or longer sequences? This question is the direct analog of the pretraining-vs-inference tradeoff analysis in Hoffmann et al. (2022) and the test-time compute scaling analysis in the PaLM 2-S* paper. The absence of such an analysis means the paper demonstrates that TransNormerLLM is faster than Transformer at equivalent parameter counts, but does not demonstrate that TransNormerLLM is the most compute-efficient way to achieve a target performance level.
The consequence. The paper's efficiency claims (20% faster training in Tables 12–13, constant inference cost in Figure 4) are meaningful in isolation, but they do not answer the resource-allocation question that practitioners face. If an organization has a fixed GPU budget for training and deployment, the decision is not "TransNormerLLM-7B vs. Transformer-7B" (where the TransNormer wins on both speed and memory) but rather "for the cost of training a Transformer-7B, could I train a TransNormerLLM-13B that achieves better performance?" or "for the cost of deploying a Transformer-7B, could I deploy a TransNormerLLM-7B with a longer context window that improves task performance without increasing latency?" The paper provides the component measurements (speed and memory advantages) but does not synthesize them into a compute-optimal scaling analysis. The observed trend that TransNormerLLM's speed advantage grows with model size (21.4% at 7B to 28.6% at 175B in Table 13) is suggestive—it implies that the architecture becomes increasingly compute-efficient relative to Transformers at larger scales—but without a FLOPs-matched comparison showing that a TransNormerLLM trained with equivalent compute achieves better downstream performance, the claim remains suggestive rather than demonstrated.
What evidence exists in the paper. Tables 12 and 13 provide throughput comparisons at fixed model sizes. Table 9 provides accuracy comparisons at fixed approximate parameter counts but with uncontrolled training token budgets. Figure 4 shows inference time comparisons at what is presumably fixed model size (7B, though not stated). Nowhere does the paper combine these measurements: "if I have X total FLOPs, training a TransNormerLLM of size Y on Z tokens achieves accuracy A, while training a Transformer of size Y' on Z' tokens achieves accuracy A'." This type of analysis requires training multiple model sizes with controlled token budgets and measuring downstream performance—expensive but essential for establishing compute-optimality. The stress test data in Tables 13 and 14 show that TransNormerLLM scales to 175B with maintained speed advantages, which is promising, but does not include perplexity or downstream accuracy at those scales, making it impossible to compute the FLOP-accuracy tradeoff.
Mitigation status. Not addressed as a limitation. The paper's framing is "TransNormerLLM matches Transformer performance while being faster," which is a weaker claim than "TransNormerLLM is the most compute-efficient way to achieve a given performance level." The former is supported by the data; the latter would require experiments not performed. The paper's commitment to open-source the models enables third-party compute-optimal scaling analyses, but this outsources a question that is central to the paper's value proposition. A minimal step—training TransNormerLLM at a few sizes (e.g., 385M, 1B, 3B) with controlled token budgets and reporting the resulting loss-vs-FLOPs curve alongside an equivalent Transformer curve—would provide the missing synthesis without requiring the full expense of 7B+ training runs.
7. Implications and Future Directions
How This Work Changes the Landscape
This paper shifts the burden of proof in the efficient architecture literature from "linear attention could work for LLMs" to "linear attention does work for LLMs, conditional on holistic engineering." The conceptual shift is not that linear attention is mathematically capable—this has been known since Katharopoulos et al. (2020)—but that the failure to deliver competitive LLM-scale performance was an integration failure rather than an expressivity failure. The field had accumulated a catalog of linear attention variants, each optimizing one part of the pipeline (kernel functions, positional encodings, normalization schemes), and each falling short of Transformer baselines. TransNormerLLM's diagnosis is that these failures were correlated: removing softmax creates cascading secondary requirements (selective gating, dilution-aware positional encoding, numerically stable inference, IO-aware training kernels) that are individually addressable but must be solved jointly. The evidence for this diagnosis is not a single breakthrough component but the additive pattern in the ablation tables: each modification contributes small improvements (0.015–0.050 PPL per Table 3–8), but the cumulative effect—only visible when all modifications are present together—is what produces the 5–9% Transformer gap in Table 1. This reframing changes what it means to propose a competitive non-Transformer architecture: it is no longer sufficient to show that a new attention mechanism matches softmax perplexity on a moderate-length benchmark with everything else held constant. A credible contender must now demonstrate that the full training and inference stack—positional encoding, gating, normalization, numerical stability, hardware kernels—has been redesigned for the new attention regime. This raises the bar substantially and implicitly argues that many prior negative results (e.g., "linear attention underperforms Transformer") were measuring incomplete systems rather than fundamental architectural limitations.
The work also provides a reconciliation template for the conflicting prior results that had created confusion in the efficient architecture literature. Before TransNormerLLM, a practitioner surveying the field would see CosFormer (Qin et al., 2022b) showing promising results on moderate-length language modeling, RWKV (Peng et al., 2023b) demonstrating that linear RNNs can approach Transformer performance at scale, and multiple papers (Hua et al., 2022; Liu et al., 2022) documenting the cumsum bottleneck that made theoretical linear attention practically slower than optimized softmax attention. These results appeared contradictory: linear attention works and doesn't work and can be made to work with the right recurrence formulation. TransNormerLLM resolves this by demonstrating that the bottleneck is not the linear attention operation itself but the specific choices made around it—the choice of positional encoding (absolute vs. relative vs. decay-augmented), the choice of gating (present vs. absent), the choice of implementation strategy (IO-aware tiling vs. naive materialization). The paper does not explicitly frame itself as reconciling these prior results, but the architecture's design process—identifying each failure mode of the original TransNormer and systematically engineering a fix—effectively explains why prior attempts that solved only one or two of these failure modes would underperform. This template is generalizable: any future non-Transformer architecture should begin by identifying the specific failure modes that the architecture's deviation from softmax creates, then address them jointly rather than in isolation.
A concrete direction that becomes more attractive after this work is the systematic design of composite positional encoding schemes that combine multiple mechanisms (relative position, decay, complex rotation, hierarchical receptive field scheduling). Table 3 shows that LRPE-d (decay + complex rotation + hierarchical layer schedule) outperforms each mechanism alone (0.163 PPL better than LRPE, 0.106 better than Exp-Decay), and that the benefits are synergistic rather than additive (the combined scheme outperforms what either component alone would predict). This opens a design space where positional encoding is not a single method but an encoding stack—layered mechanisms that address different aspects of position-dependent attention (locality bias, relative ordering, long-range structure, multi-scale receptive fields). The success of the Mix variant (LRPE-d on first layer only, pure decay on subsequent layers) further suggests that different layers have different positional encoding needs, and a heterogeneous encoding scheme may outperform any uniform design. This makes positional encoding design a richer optimization problem than the prevailing "choose RoPE or ALiBi or absolute" decision.
A direction that becomes less attractive is the pursuit of aggressively simplified linear attention variants that remove components to achieve theoretical cleanliness at the expense of practical performance. The paper shows that the No Activation variant of GLA (Table 6: 2.283 loss vs. 2.248 for Swish) and the w/o gate variant (Table 5: 2.263 vs. 2.248) both lag measurably behind their augmented counterparts at 385M scale. This suggests that at LLM scale, the capacity introduced by gating and activation functions is not redundant—the model uses the additional expressivity. Research that prunes these components to achieve cleaner mathematical formulations (e.g., purely linear attention without gates or activations) would need to overcome the empirical evidence that these components contribute non-trivially to performance at scale. The paper does not prove that gating and Swish activation are necessary—a different gating scheme or activation function might work equally well—but it establishes that some form of input-dependent selectivity beyond raw dot-product attention is needed for competitive LLM performance, which narrows the design space for minimal linear attention variants.
Follow-Up Research This Work Enables
Lightning Attention vs. FlashAttention at scale across sequence lengths. The most pressing missing experiment is a direct wall-clock and memory comparison between Lightning Attention (linear attention with IO-aware tiling) and FlashAttention-2 (softmax attention with IO-aware tiling) across sequence lengths from 512 to 32K tokens, with both architectures using equivalent model sizes (matched parameter counts, matched feature dimensions, matched batch sizes). Figure 3 currently compares Lightning Attention against an unoptimized linear attention baseline; Table 12 compares TransNormerLLM against FlashAttention-equipped Transformers at a single sequence length (2048). Neither reveals how the efficiency gap scales with sequence length when both architectures use their best available kernels. At 2048 tokens, quadratic softmax attention is not yet the dominant cost, so the 20% advantage in Table 12 may underestimate the benefit at longer sequences where the complexity difference dominates. Conversely, at very long sequences (32K+), the constant overhead of Lightning Attention's tiling (loading blocks, managing the accumulator) may become comparable to FlashAttention's softmax recomputation overhead, and the gap may narrow. A scaling curve with sequence length—analogous to Figure 3 but with FlashAttention as the comparator—would directly inform practitioners choosing an architecture for long-context workloads. The experiment should also report whether the numerical precision of Lightning Attention (which uses BFloat16 for training stability) matches FlashAttention's precision at long sequences, since the exponential decay factors in LRPE-d could amplify numerical errors at extreme sequence lengths even with the robust inference algorithm.
Downstream long-context evaluation on SCROLLS, needle-in-a-haystack, or multi-document QA. Table 14 demonstrates that TransNormerLLM can train with longer contexts than equivalently-sized Transformers (48K vs. 37K at 7B, scaling to 12K vs. 10K at 175B), and Figure 4 shows that inference cost is constant with sequence length. However, the paper provides no evidence that this long-context capability translates to improved performance on tasks that require reasoning over long contexts. The key question is whether linear attention's fundamentally smoother attention distribution—even with LRPE-d's locality bias—can support the precise token-level retrieval that tasks like needle-in-a-haystack require (finding a specific fact embedded in a long document) or whether the attention dilution problem re-emerges when the model must attend sharply to one position among tens of thousands. A strong follow-up would evaluate TransNormerLLM-7B on: (1) the SCROLLS benchmark (Shaham et al., 2022) for long-document summarization and QA, comparing against LLaMA-7B at the same context lengths; (2) a needle-in-a-haystack retrieval task where a fact is inserted at varying positions in a long document, measuring accuracy as a function of fact position and document length; (3) a multi-document QA task requiring cross-document reasoning. The critical measurement is not aggregate accuracy but accuracy as a function of the distance between the query-relevant information and the answer position—this would directly test whether LRPE-d's exponential decay is soft enough to preserve long-range information while sharp enough to prevent dilution. If TransNormerLLM maintains constant retrieval accuracy regardless of distance while a FlashAttention Transformer degrades, the architecture's long-context advantage is validated for downstream use. If retrieval accuracy degrades with distance despite the architectural support for long contexts, the dilution problem has been mitigated but not solved, and the practical value of the long-context training capability is limited.
1+elu NaN diagnosis and scale-dependent activation selection. The paper reports that 1+elu performs comparably to Swish at 385M but produces NaN values at 7B (Section 3.1.2, Table 6 discussion). This is presented as a practical observation, but understanding why this happens would inform activation function selection for all large-scale linear attention models. The likely mechanism is that 1+elu has a non-zero gradient for very negative inputs (elu gradient saturates at 1 for positive inputs but approaches the exponential function for negative inputs, creating a non-zero gradient even for large negative arguments), while Swish's gradient decays to zero for large negative inputs. At 7B scale with long training horizons, the non-zero gradient of 1+elu may cause accumulated numerical drift in the attention state that eventually exceeds BFloat16's range. A systematic study would: (1) measure the distribution of pre-activation values in the and projections at different model scales (385M, 1B, 7B) and training checkpoints; (2) simulate the recurrent inference state over long sequences with both activations, measuring numerical error accumulation; (3) test whether gradient clipping or activation scaling (e.g., with ) can stabilize 1+elu at scale. The outcome would be a scale-dependent activation selection guideline for linear attention models: at small scales, 1+elu and Swish are interchangeable; at large scales, Swish is required for numerical stability. If the mechanism is confirmed as gradient-based, it would also suggest that other activations with non-zero asymptotic gradients (ReLU, GELU) may face similar stability issues at scale, narrowing the viable activation function space for very large linear attention models.
SGLU validation at 7B and the role of channel mixing nonlinearity at scale. The SGLU simplification (removing the activation function from GLU in the channel mixer) was validated only at 385M (Table 7: 2.248 loss for SGLU vs. 2.254 for Swish-GLU). The paper uses SGLU in the 7B benchmark model without reporting any scale-up validation. At larger model sizes, the channel mixer has substantially more parameters (the intermediate dimension scales with ), and the additional nonlinearity from a Swish activation might become beneficial as the model gains capacity to exploit richer transformations. A targeted experiment would train TransNormerLLM-1B or -7B variants with SGLU and Swish-GLU to convergence, measuring both training loss and downstream benchmark performance. The hypothesis is that at small scales, the gate in GLA provides sufficient global nonlinearity and the channel mixer's element-wise product is adequate; at large scales, the additional nonlinearity from a Swish in the channel mixer might improve feature learning in deeper layers. If SGLU remains optimal at 7B, it establishes that element-wise gating alone is sufficient for channel mixing in this architecture family, which is a strong architectural finding that simplifies future designs. If Swish-GLU pulls ahead at 7B, the current benchmark results slightly underestimate TransNormerLLM's potential. This experiment would also inform whether the design principles validated at 385M (all ablation tables) transfer cleanly to production scales—if SGLU does remain optimal, it provides one data point supporting the transferability of the 385M ablation regime to larger models; if it does not, it suggests that more extensive scale-dependent validation is needed before the ablation findings can be trusted at target scale.
English-Chinese controlled comparison and language-specific architectural diagnostics. Table 9 reveals a substantial performance gap between TransNormerLLM-7B and Chinese-optimized models on Chinese-language benchmarks: CMMLU 47.99 vs. Baichuan2-7B's 57.07, C-Eval 43.18 vs. Baichuan2-7B's 54.00. The gap could arise from: (1) training data differences (TransNormerLLM's Chinese corpus may be lower quality or less diverse than Baichuan2's, despite both having roughly 500B+ Chinese tokens); (2) tokenizer differences (BPE with added Chinese characters vs. a purpose-built Chinese tokenizer affects token efficiency and semantic granularity); or (3) architectural effects (linear attention's LRPE-d positional encoding may be less effective for Chinese's topic-prominent syntax and long-distance dependency patterns than for English's subject-predicate structure). To isolate the architectural contribution, a controlled experiment would: train a Transformer model on TransNormerLLM's exact 2T-token corpus (identical data, identical tokenizer, identical training recipe), then compare English-Chinese performance gaps between the two architectures. If the gap is similar, the difference is data/tokenizer-driven; if TransNormerLLM shows a larger English-Chinese gap than the Transformer, the architecture is genuinely less effective for Chinese. This would be the first language-specific diagnostic of a linear attention LLM and would inform whether TransNormerLLM-style architectures need language-specific adaptations (e.g., language-dependent decay schedules, language-specific positional encoding parameters) for multilingual deployment. The experiment is practical because the 2T-token corpus is already collected and processed—only the control Transformer training run is needed.
OpenBookQA anomaly investigation: contamination check and task-type ablation. The 63.40 OBQA score at 7B (6.2 points higher than any competitor) demands explanation before the benchmark results can be trusted. A minimum investigation would: (1) run a 13-gram overlap analysis between the OBQA test set and the 2T-token training corpus, using the deduplication pipeline described in Appendix D to check for test-set leakage—if significant overlap is found, report decontaminated scores; (2) evaluate TransNormerLLM-7B on OBQA using only the question stem without answer choices (open-ended generation), to check whether the multiple-choice format interacts anomalously with the architecture's scoring mechanism; (3) replicate the evaluation with different few-shot prompt formats (e.g., 0-shot, 1-shot, 5-shot, chain-of-thought) to see if the advantage is format-dependent; (4) compare the 385M, 1B, and 7B OBQA scores to the scaling trend on related benchmarks (ARC-e, ARC-c, BoolQ) to determine whether OBQA shows an anomalous scaling trajectory—if the 7B advantage is genuine, the OBQA scaling curve should deviate from the other reasoning benchmarks in a way that begins at 1B or 7B, not 385M. The outcome would either confirm a genuine architectural advantage specific to OBQA-style reasoning (in which case the paper has discovered a task type where linear attention excels) or identify an evaluation artifact that should be corrected or acknowledged.
Practical Applications and Downstream Use Cases
Long-context inference serving with constant latency and memory. Figure 4 shows that TransNormerLLM inference time and memory are approximately constant across sequence lengths from 256 to 32K tokens, while a comparable Transformer's cost grows approximately quadratically (time) and linearly (memory). At 32K tokens, TransNormerLLM uses roughly 1.5 GB of memory and takes approximately 1–2 ms per token, compared to roughly 15 GB and 15 ms for the Transformer equivalent. For a production serving system handling document QA, legal contract analysis, or multi-turn conversation with long history, this constant-cost property translates to predictable per-request latency and memory budgeting. A deployment serving 100 concurrent requests at 32K context length would require approximately 150 GB of GPU memory for TransNormerLLM vs. approximately 1.5 TB for Transformer—a 10× memory reduction that enables serving the same workload on a single A100 (80 GB × 8 = 640 GB with model parallelism) vs. requiring multiple nodes. The practical deployment scenario is: a document QA service where users upload lengthy documents (contracts, research papers, technical manuals) and ask questions that require reasoning over the full text. With TransNormerLLM, the service can process entire documents in a single forward pass without truncation, maintaining constant latency regardless of document length. The key caveat—which the paper does not resolve—is whether the long-context training capability translates to accurate long-range retrieval in practice. Until the needle-in-a-haystack experiment proposed above is conducted, the constant-cost inference property is a necessary but not sufficient condition for practical long-context deployment.
Cost-efficient batch inference for data processing pipelines. Organizations that run large-scale batch inference—evaluating models on benchmark suites, generating training data via rejection sampling, or scoring candidate completions—face costs proportional to total inference FLOPs. Table 13 shows that TransNormerLLM achieves consistent 20–29% higher throughput (tokens/sec/GPU) than equivalently-sized Transformers across model sizes from 7B to 175B, with the advantage growing at larger scales (28.6% at 175B). For a pipeline processing 100 million tokens through a 7B model, this efficiency translates to roughly 20% fewer GPU-hours, which at typical cloud GPU pricing ($2–4/GPU-hour for A100 equivalents) represents savings of hundreds to thousands of dollars per pipeline run, scaling with volume. The practical scenario is: a company periodically evaluates its fine-tuned model checkpoints on a large internal benchmark suite (thousands of questions across multiple tasks) or generates synthetic training data by sampling from the model at scale. Switching the inference backend from a Transformer to TransNormerLLM reduces the compute cost proportionally to the throughput advantage, with no accuracy degradation if the benchmark results in Table 9 are representative of the pipeline's task distribution. The efficiency advantage is most pronounced at larger model sizes and longer sequence lengths (Table 14 shows TransNormerLLM supports longer training contexts at all scales), making the switch particularly attractive for pipelines that need to process long documents or multi-turn conversations.
Edge and consumer-grade deployment of 1B-scale models with competitive reasoning. The 1B model results in Table 9 show that TransNormerLLM-1B is broadly competitive with similarly-sized Transformers on commonsense reasoning, achieving 72.09 PIQA, 63.68 ARC-e, and 35.24 ARC-c—numbers that are usable for lightweight applications like offline text classification, on-device autocomplete, or privacy-preserving document processing where a datacenter-scale model is infeasible. The constant inference memory (Figure 4) means that the model can process arbitrarily long inputs within a fixed memory budget, unlike a Transformer-1B whose KV cache grows with sequence length and can exhaust device memory. For a consumer-grade deployment (e.g., a local document analysis tool running on a laptop with 8 GB of unified memory), a Transformer-1B processing a 32K-token document requires roughly 1.5–3 GB just for the KV cache (depending on precision and number of layers), which may exceed available memory when combined with model weights and activations. TransNormerLLM-1B's constant state size ( per layer, roughly 2048 × 2048 = 4M elements × 30 layers ≈ 120M elements × 2 bytes in BF16 ≈ 240 MB total) is independent of sequence length, enabling processing of arbitrarily long documents within the same memory footprint. The practical benefit is that document-level NLP tasks (summarization, entity extraction, question answering) that currently require truncation or chunking on-device can potentially run on the full document with no architectural modifications, improving accuracy for tasks where context matters. The caveat, again, is the unvalidated long-range retrieval capability.
When to Prefer This Method
The paper positions TransNormerLLM as an alternative to softmax Transformer architectures for LLM training and deployment, with the primary tradeoff being efficiency (training speed, inference latency, memory footprint) vs. the extensive ecosystem and established reliability of Transformer-based models. The decision criteria are:
Prefer TransNormerLLM when:
- Long-context training or inference is a primary requirement. Table 14 shows 1.20–1.35× longer maximum context lengths during training compared to Transformers with FlashAttention, and Figure 4 shows constant inference cost vs. growing Transformer costs. If your application requires processing sequences longer than 8K tokens (the training context length used in this paper) and you cannot afford the quadratic cost scaling of softmax attention, TransNormerLLM's linear complexity provides a genuine architectural advantage.
- Inference latency and memory must be predictable. The constant per-token inference cost (Figure 4) means that 32K-token requests take the same time and memory per token as 256-token requests. For serving systems that must meet latency SLAs across variable input lengths, this predictability is a significant operational advantage over Transformers, where long inputs can cause latency spikes and out-of-memory errors.
- Throughput per GPU is the binding constraint for training. Tables 12 and 13 show 20–29% higher tokens/sec/GPU for TransNormerLLM compared to FlashAttention-equipped Transformers across 7B–175B scales. If your training budget is GPU-hours rather than dollars and you are I/O or communication-bound, the throughput advantage directly reduces training wall-clock time.
- Competitive but not necessarily state-of-the-art accuracy is acceptable. Table 9 shows that TransNormerLLM-7B is broadly competitive (leading on PIQA and OBQA, competitive on ARC, BoolQ, HellaSwag; trailing on MMLU, CMMLU, C-Eval vs. the best-in-class models) but does not consistently dominate the strongest Transformer-based models. If your application's accuracy requirements are within the range where TransNormerLLM is competitive (and you can validate on your specific task distribution), the efficiency gains may outweigh the accuracy gap on some benchmarks.
Prefer standard Transformer architectures when:
- Ecosystem maturity and off-the-shelf tooling matter. Transformers benefit from years of optimization in inference engines (vLLM, TensorRT-LLM, llama.cpp), quantization methods (GPTQ, AWQ, GGUF), fine-tuning libraries (LoRA, QLoRA, PEFT), and hardware-specific kernels. TransNormerLLM's Lightning Attention and SRMSNorm Triton kernels require custom integration with these tools, and the model's recurrent inference mode (Algorithm 2) may not be compatible with standard Transformer serving optimizations like continuous batching or prefix caching without additional engineering.
- State-of-the-art accuracy on Chinese-language benchmarks is required. The gap to Baichuan2-7B (CMMLU: 47.99 vs. 57.07; C-Eval: 43.18 vs. 54.00) is substantial, and even allowing for training data differences, there is no evidence that TransNormerLLM can close this gap without Chinese-specific architectural or data modifications that have not been demonstrated.
- The workload consists primarily of short sequences (fewer than 2K tokens). At context length 2048—where many production workloads operate (chat with moderate history, single-document QA, standard code completion)—Table 12 shows a ~20% throughput advantage for TransNormerLLM, which is meaningful but may not justify the ecosystem switching cost. The linear attention advantage grows with sequence length; for short sequences, the complexity difference is proportionally smaller and the constant-factor overheads of the custom kernels may erode the benefit.
- Maximum accuracy at any compute cost is the goal, and scaling model size is the primary lever. Table 13 shows that TransNormerLLM scales to 175B with maintained speed advantages, but the paper does not report perplexity or benchmark results at scales beyond 7B. Without evidence that the architecture's accuracy-scaling trajectory matches or exceeds Transformers at 13B, 65B, or 175B, a risk-averse team targeting maximum accuracy should prefer the Transformer's well-characterized scaling behavior over TransNormerLLM's unvalidated scaling promise. This caution should be updated if future work provides benchmark results at larger scales with competitive scores.