ArXiv: 2302.01925
π― Pitch
Linear Transformers normally break when you add relative position encodings (RPEs), but this work shows you can learn the RPE's Fourier spectrum to inject positional awareness without ever materializing the quadratic maskβmaking RPE-enhanced linear attention practical for the first time on 3D molecular data, where prior methods simply cannot run.
1. Executive Summary
This paper introduces FourierLearner-Transformers (FLTs), a new class of linear-complexity Transformers that incorporate relative positional encoding (RPE) mechanisms into kernelized (Performer-style) attention by learning the spectral representation of the RPE function directlyβsidestepping the explicit materialization of the RPE mask that would otherwise require quadratic memory. Evaluated across language modeling (WikiText-103), image classification (ImageNet, Places365, Fashion-MNIST), 3D molecular property prediction (OC20 IS2RE), and learnable optimizers, FLTs achieve both superior accuracy and practical efficiency: on WikiText-103, FLT with local RPE reaches 30.1 perplexity, outperforming the strongest prior RPE-enhanced linear Transformer baseline (log-linear Performer at 30.6) while using substantially less memory and forward time at long sequence lengths, and on molecular dataβwhere existing RPE-enhanced linear attention methods are inapplicable due to the non-Toeplitz structure of 3D RPE masksβFLT reduces energy MAE by over 0.04 eV compared to a regular Performer, establishing that RPE-enhanced linear attention can scale to geometric data embedded in higher-dimensional Euclidean spaces only when the RPE mask is approximated via its Fourier transform rather than through structure-dependent factorization.
2. Context and Motivation
The Core Problem: Relative Positional Encodings Are Incompatible with Linear Attention
The fundamental tension this paper addresses is deceptively simple: how do you incorporate relative positional encodings (RPEs) into linear-complexity Transformers without breaking the linear complexity that makes them efficient in the first place? This is not a minor engineering inconvenience β it represents a genuine structural conflict between two of the most important advances in Transformer architecture design.
To understand the conflict, we need to appreciate what each mechanism does separately:
Linear attention (specifically kernelized attention, as in the Performer) achieves time complexity instead of the standard by never materializing the full attention matrix. The trick is to decompose the attention computation using the associativity of matrix multiplication: instead of computing explicitly (which is ), one approximates using random feature maps , then computes from right to left. The key word here is "implicitly" β the attention matrix never exists as a concrete object in memory, which is precisely what enables the cost.
Relative positional encoding (RPE) modifies the attention computation by adding a learned bias term to the attention scores that depends on the relative distance between tokens. Formally, an RPE-enhanced attention mechanism is defined as:
Here is the RPE mask, where for some function and positional feature vectors . This formulation is highly general: for sequential text data, (the token's index) and (a learnable Toeplitz matrix); for 3D molecular data, is the atom's 3D coordinate and encodes domain-specific geometric relationships.
Now the conflict emerges clearly: to apply the RPE mask , you need to add it element-wise to before applying the softmax, which requires β or seems to require β having the full matrix available. The whole point of kernelized linear attention is to avoid materializing this matrix. Prior to this work, there was no general method for incorporating arbitrary RPE masks into linear attention that simultaneously maintained (a) linear complexity, (b) practical memory efficiency, and (c) applicability to RPE masks with non-Toeplitz structure (i.e., geometric data beyond sequences).
Why This Problem Matters
The significance of resolving this tension extends across multiple dimensions β practical, theoretical, and methodological.
Practical importance: RPEs are not optional. RPEs have become a standard component of state-of-the-art Transformers precisely because they provide a powerful inductive bias for capturing spatial and sequential relationships. The paper cites substantial evidence for this: RPEs improve performance on long-range language modeling (Dai et al., 2019), speech processing (Liutkus et al., 2021), vision tasks (Wu et al., 2021), and genomic data analysis (Ε½iga Avsec et al., 2021). Section 1 explicitly states that RPEs "play a critical role in improving the performance of Transformers in long-range modeling." Any linear-attention architecture that fails to incorporate RPEs is therefore operating at a fundamental representational disadvantage compared to quadratic-attention Transformers β it may be faster, but it's also less capable.
This creates an uncomfortable choice for practitioners: (1) use standard quadratic attention with RPEs but face scaling that prohibits long sequences, (2) use linear attention without RPEs, sacrificing accuracy for efficiency, or (3) use one of the existing RPE-enhanced linear attention methods (discussed below), each of which imposes restrictive assumptions about the RPE structure. None of these options is satisfactory, which means there is a genuine deployment gap for applications requiring both long-sequence processing and rich positional understanding β such as document-level NLP, high-resolution image analysis, or molecular dynamics where tens of thousands of atoms must interact in a single attention operation.
Theoretical importance: bridging two parallel research threads. The paper identifies that the Transformer efficiency community has largely bifurcated into two largely non-interacting camps. One camp develops better linear attention mechanisms (Performers, CosFormer, linear attention with elu features) but treats RPEs as an afterthought or ignores them entirely. The other camp develops sophisticated RPE techniques within the standard quadratic-attention framework. The inability to combine these advances creates a theoretical bottleneck: progress in linear attention and progress in positional encoding are not composable, which means the field as a whole advances more slowly than it could if these components were modular.
This paper's approach β learning the spectral representation of the RPE function via its Fourier transform β provides a composable solution that could, in principle, enable any RPE function to be plugged into any kernelized attention mechanism without structural constraints. This changes the architectural landscape from "linear attention OR RPEs" to "linear attention AND RPEs," which is the natural state if we believe both techniques are independently valuable.
Methodological importance: enabling whole new classes of applications. The paper makes the specific claim (Section 5.3) that FLTs are "the first Transformer architectures providing linear attention and incorporating RPE masking" for 3D molecular data. This is not just bragging β it represents a genuine expansion of what's computationally feasible. In molecular modeling, the number of atoms can be large (thousands of atoms in a protein, millions in a materials simulation), and the RPE mask where does not have the Toeplitz structure that prior methods exploit. Without a general RPE mechanism for linear attention, researchers studying these problems face a hard ceiling: either use quadratic attention with RPE (and suffer the cost) or use linear attention without RPE (and lose the geometric inductive bias). FLTs break through this ceiling, making it practical to combine geometric priors with efficient attention for large-scale molecular modeling tasks β a capability that is directly relevant to drug discovery, materials science, and catalysis.
Where Existing Approaches Fall Short
The paper's literature review in Section 2 identifies three families of prior attempts to reconcile linear attention with RPEs, each with specific failure modes.
Attempt 1: SineSPE and ConvSPE (Liutkus et al., 2021). These were among the first attempts to address the problem head-on. Both variants model the RPE mask as a stationary position kernel with a Toeplitz mask structure. The insight is that for sequential data, depends only on the relative offset, and this structure can be exploited for efficient computation. SineSPE represents the RPE mask via sinusoidal components, while ConvSPE uses learnable convolution filters.
The limitations are threefold:
- Extra computational dependency: The complexity, while still linear in , introduces an additional factor depending on the number of sinusoidal components (for sineSPE) or the convolution filter length (for convSPE). The paper notes that "in practice, or has to be sufficiently small due to computational budgets," which constrains the expressiveness of the RPE model.
- Kernel matrix assumption: Both methods assume the RPE mask is a valid kernel matrix (positive definite). FLTs do not require this assumption β can be any function for which a Fourier transform exists, including functions that produce non-PSD or even non-symmetric masks.
- Fundamental inapplicability to non-sequential data: The Toeplitz structure is specific to sequential data where are one-dimensional indices. For 3D molecular data where , the RPE mask depends on pairwise Euclidean distances between coordinates and does not have a Toeplitz structure. These methods simply cannot be applied to such data β which excludes an entire class of important applications.
The empirical results confirm these limitations: on WikiText-103 (Table 1), Performer-sineSPE achieves 38.0 perplexity and Performer-convSPE achieves 37.8 β both substantially worse than the regular Performer (31.1) without any RPE. The attempted RPE integration actually hurt performance, suggesting the constrained RPE representation was doing more harm than good.
Attempt 2: Log-Linear Performer (Luo et al., 2021; Choromanski et al., 2022a). A more sophisticated approach observes that linear attention can incorporate RPEs in time if the exponentiated RPE mask supports fast matrix-vector multiplication. For sequential data with a Toeplitz RPE mask, this holds because Toeplitz matrix-vector multiplication can be accelerated via the Fast Fourier Transform (FFT).
This method is the strongest prior baseline in terms of model quality, achieving 30.6 perplexity on WikiText-103 (Table 1) β close to FLT's 30.1β30.3. However, it has critical practical limitations:
- Large memory consumption: The paper explicitly states (Section 2) that this method "has large space complexity and high memory consumption in practice." The empirical comparison in Figure 1 shows that at sequence length 32,768, the log-linear Performer's peak memory is roughly 6β7Γ higher than FLT's (approximately 25 GB vs. 4β5 GB). This memory cost can be prohibitive for real hardware.
- Ongoing dependency on Toeplitz structure: The FFT-based acceleration fundamentally relies on the Toeplitz property of the RPE mask for sequential data. As with SineSPE/ConvSPE, this renders the method inapplicable to molecular data or any geometric setting where positions are not one-dimensional indices.
- Implementation complexity: The FFT-based approach requires careful handling of circulant embeddings and can be sensitive to implementation details.
In essence, the log-linear Performer trades space for time: it achieves forward time but with substantial memory overhead relative to pure linear attention. FLT's core claim is that it achieves both better accuracy and better practical memory efficiency while also generalizing beyond sequential data.
Attempt 3: Standard Performers without RPE (and other linear attention variants). The simplest approach is to simply omit RPEs entirely and rely on kernelized attention alone. While the regular Performer achieves competitive performance (31.1 perplexity on WikiText-103, better than sineSPE and convSPE with their constrained RPEs), it leaves a clear performance gap relative to architectures that successfully incorporate RPEs. The 1.0 perplexity point gap between the regular Performer (31.1) and FLT with local RPE (30.1) on WikiText-103 β a standard benchmark with relatively short sequences of length 512 β suggests that even in relatively simple sequential settings, omitting RPE leaves meaningful accuracy on the table. One would expect this gap to widen substantially on tasks requiring truly long-range positional reasoning, where inductive biases about relative positions become more critical.
The deeper pattern: all prior methods impose structural constraints on the RPE mask. The unifying limitation across all prior attempts is that each exploits specific structural properties of the RPE mask to achieve efficiency, and these properties are increasingly restrictive as we move from SineSPE/ConvSPE (requires Toeplitz and positive definiteness) to log-linear Performers (requires Toeplitz and fast matrix-vector multiplication) to pure Performers (no RPE at all). None of these methods provides a general mechanism for incorporating arbitrary RPE functions β particularly those defined on positions embedded in for β into linear-complexity attention.
How This Paper Positions Itself
The paper positions FLTs not as an incremental improvement to any single prior method, but as a change in representational strategy that renders the entire structural-constraint problem irrelevant.
The key insight: work in the spectral domain. Rather than trying to make the RPE mask support fast operations in the spatial domain (which is what prior methods attempt, each with their own structural assumptions), FLTs approximate via a low-rank decomposition derived from the Fourier transform of the RPE function . Specifically, Theorem 4.1 shows that if is the Fourier transform of , then for any probability density :
This expectation can be estimated using Monte Carlo samples , yielding a rank- decomposition where . Crucially, this decomposition is always valid β it requires no structural assumptions about (not Toeplitz, not positive definite, not even symmetric). The only requirement is that has a Fourier transform, which is an extremely mild condition satisfied by essentially all practical RPE functions.
Once is approximated as , the RPE-enhanced attention computation can be folded into the standard Performer pipeline by concatenating the RPE feature maps with the query and key features:
The attention becomes , which is exactly the form that Performers linearize. This requires no new algorithms β just a feature concatenation that costs additional time, preserving the overall linear complexity.
Learning rather than . The second key innovation β and the source of the name "FourierLearner" β is that rather than trying to specify explicitly and then compute its Fourier transform analytically (which would be cumbersome and potentially intractable for complex RPE functions), FLTs directly learn the spectral representation via differentiable parameters. This is a clever inversion of the usual logic: instead of defining what should look like in the spatial domain and deriving as a byproduct, FLTs define a parameterized spectral function and let gradient descent find the that produces the most useful for the task. The paper emphasizes this point explicitly: "instead of learning and trying to compute its Fourier Transform for the low-rank decomposition of , we propose to directly learn " (Section 4.1).
This is more than an implementation convenience β it's a genuinely different approach to designing positional encoding mechanisms. By learning in the spectral domain, the model can discover frequency-based representations that might be non-obvious in the spatial domain, and the parameter count for (fewer than 0.03M in all experiments, as the paper notes) does not scale with sequence length, only with the complexity of the spectral representation itself.
Generalizing beyond sequential data through abstract positions. The paper's Definition 3.1 introduces a formulation of RPEs that is notably more general than what is typically assumed in the literature. The position of each token is represented by an abstract vector , where can be 1 (sequential indices), 3 (molecular coordinates), or any other dimensionality. The RPE function takes the difference and produces a scalar. This generality is what enables FLTs to apply to "not only sequential data (e.g., texts) but also geometric data embedded in higher-dimensional Euclidean spaces" β a capability that the paper explicitly claims as novel and that the molecular modeling experiments are designed to validate.
The theoretical foundation. The paper provides formal guarantees that the spectral approximation is not just heuristically motivated but theoretically sound. Theorem 4.2 states that with random features, the approximation error satisfies with probability at least , where is a constant that does not depend on . The logarithmic dependence on is particularly important β it means that as sequence length grows, the number of random features needed for a given approximation quality grows only logarithmically, not linearly or polynomially. This provides a theoretical justification for why FLTs can remain both accurate and efficient at scale: the rank of the RPE approximation needs to be only moderately larger for much longer sequences.
What FLTs do NOT require, in contrast to prior methods:
- No requirement that be a valid positive definite kernel matrix (unlike SineSPE/ConvSPE)
- No requirement that have Toeplitz structure or any other specific matrix structure (unlike log-linear Performer)
- No requirement that positions be one-dimensional indices (unlike all prior RPE-enhanced linear attention methods)
- No FFT-based acceleration or other structure-dependent computational tricks
What FLTs DO require:
- The ability to sample from a probability distribution over and evaluate its density (the paper uses Gaussian distributions, which satisfy this trivially)
- The ability to evaluate the learned function at sampled frequencies (a standard forward pass through whatever neural network parameterizes )
- The function must have a Fourier transform (a mild condition satisfied by essentially all practical RPE functions)
The combination of (a) theoretical guarantees on approximation quality, (b) a general formulation that removes all structural assumptions about the RPE mask, (c) a learnable spectral representation that avoids manual design of , and (d) empirical results showing both accuracy gains and practical memory/throughput benefits across four diverse domains, positions FLTs as more than just "another linear attention mechanism with RPEs." The paper frames it as a unifying framework that subsumes existing approaches as special cases (e.g., shift-invariant kernel RPEs correspond to specific choices of ) while extending to regimes where no prior method works (3D geometric data). This is the core intellectual contribution: not a better optimization of an existing approach, but a reframing of how linear attention and RPEs can be composed at all.
3. Technical Approach
3.1 Reader Orientation
FLT is a drop-in replacement for the attention module in a Transformer that lets the model use relative positional encodings (RPEs) while keeping the computational cost linear in sequence length β something that was previously impossible for general RPEs. The system solves the problem by learning the RPE function in the frequency domain rather than in the spatial domain: instead of trying to compute a full RPE mask and add it to the attention scores (which costs ), FLT approximates as a low-rank product where are constructed from random Fourier features, and is a tunable rank parameter. This low-rank decomposition folds directly into the existing Performer pipeline by concatenating the RPE feature maps with the query and key features β the model never materializes , never pays , and can learn the optimal RPE function for the task through gradient descent on the spectral representation.
3.2 Big-Picture Architecture (Diagram in Words)
The FLT attention module has five conceptual components, though three of them are learned together end-to-end:
-
Positional feature vectors β Each token in the input sequence is assigned a position vector that encodes where it "is" in whatever space makes sense for the data modality. For text, (the 1D index). For 3D molecules, is the atom's coordinate. These vectors are the inputs to the RPE mechanism.
-
The learned spectral function β This is the core of FLT. Instead of defining the RPE function directly in the spatial domain, FLT learns its Fourier transform , parameterized by a small number of trainable parameters . The function takes a frequency vector and returns a complex number. The paper explores several parameterizations: Gaussian mixtures, shift-invariant kernel forms, and local RPE forms (Section 4.3). At inference time, is evaluated at randomly sampled frequencies to construct the random feature maps.
-
Random frequency sampler with density β To estimate the Fourier integral via Monte Carlo, FLT samples frequency vectors from a probability distribution over . The choice of affects approximation quality; the paper uses Gaussian distributions (zero-mean, unit variance or learnable variance) because they are easy to sample from and evaluate. These frequencies are fixed per forward pass but can be resampled across training iterations.
-
RPE feature map constructor () β For each token position , FLT constructs two feature vectors by evaluating weighted complex exponentials at the sampled frequencies. Specifically, the -th component of is , and uses the conjugate exponential . These vectors are stacked into matrices .
-
Concatenated Performer attention β The RPE feature matrices and are concatenated with the scaled query and key matrices to form augmented matrices and . The attention computation now implicitly includes the RPE mask added to the content-based attention . This augmented attention is then linearized using standard Performer random feature maps , and the result is computed via the associativity trick .
Information flow: Input sequence β positional features β sample frequencies β evaluate β construct and β form β concatenate with β apply Performer linearization β compute linear attention output. Everything is differentiable with respect to 's parameters, the query/key/value projections, and any parameters of if it is learned.
3.3 Roadmap for the Deep Dive
- First, the formal problem statement β we need to see exactly what RPE-enhanced attention looks like mathematically (Definition 3.1) and why it resists linearization, to understand what FLT must approximate.
- Second, the unbiased low-rank decomposition of the RPE mask (Theorem 4.1) β this is the mathematical engine of FLT: how Fourier analysis converts any RPE function into a rank- product of random feature matrices.
- Third, the FLT attention algorithm (Algorithm 1) β how the low-rank RPE approximation is woven into the Performer pipeline through feature concatenation, and what the resulting time/space complexity is.
- Fourth, the theoretical guarantees (Theorem 4.2) β why this approximation is reliable: uniform convergence bounds and the critical dependence of the required rank on sequence length.
- Fifth, the parameterizations of (Section 4.3) β the concrete design choices for the spectral function: Gaussian mixtures, shift-invariant kernels, and local RPEs, and why each satisfies specific inductive biases.
- Sixth, practical considerations β how , , and the structure of are chosen in practice, and how the total parameter count stays under 0.03M regardless of sequence length.
3.4 Detailed, Sentence-Based Technical Breakdown
This is primarily a methods paper whose core innovation is a technique for approximating an arbitrary RPE mask via its Fourier transform, enabling linear-complexity RPE-enhanced attention without structural assumptions on the mask. The key insight is to work in the spectral domain β learning the Fourier transform of the RPE function rather than itself β because the Fourier integral representation immediately yields a Monte Carlo low-rank decomposition that integrates seamlessly with kernelized attention.
Formal Problem: RPE-Enhanced Attention and Why It Is Quadratic
The paper begins by precisely defining what RPE-enhanced attention computes (Definition 3.1), because everything that follows is an efficient approximation of this computation.
Consider an input sequence with tokens of embedding size . The self-attention module linearly projects into three matrices:
where are queries, are keys, are values, and is the per-head dimension. Each token is also associated with a positional feature vector , where the dimensionality depends on the data modality: for text (the token index), for 3D molecular structures (atom coordinates), and could be any dimension for other geometric data.
The RPE mask. An RPE function maps the relative position difference to a scalar . These scalars are arranged into the RPE mask:
The RPE-enhanced attention is then defined as:
where is applied element-wise, is the all-ones vector of length , and constructs a diagonal matrix from its input vector.
Why this is expensive. The matrix must be explicitly materialized to compute the sum of each row (for the denominator ) and the product with . Constructing requires computing entries, each costing for the dot product plus for the RPE lookup and exponentiation. The total time complexity is , and the space complexity is β the term for the attention matrix dominates for long sequences.
The kernelized attention solution (without RPE). The Performer addresses the case (no RPE) by linearizing the softmax kernel. For any feature map satisfying , the attention can be rewritten using the associativity of matrix multiplication:
Here are matrices whose rows are and respectively. The key efficiency is that the parenthesized computation produces an matrix in time, and then multiplies this to produce an output in another time. The space complexity drops to , linear in when . The critical point: the attention matrix is never materialized as a concrete object.
The conflict. When , the exponentiated sum does not factorize as a simple inner product of per-token feature vectors β at least not in any obvious way. You cannot write as for some that depend only on individual tokens, because depends on the pair and cannot be attributed to either token alone. The entire Performer speedup relies on this pairwise factorization, so breaking it means going back to .
The generality of Definition 3.1. The paper emphasizes that this formulation is "highly general" and novel in its scope. For sequential text data, one sets and , producing a learnable Toeplitz RPE mask (as in T5). For 3D molecular data, one sets as atom coordinates and defines using domain-specific functions like Gaussian basis functions. The paper claims this general formulation is important because it "motivates the highly general FLTs applicable to a wide range of data and tasks, as opposed to existing approaches that heavily rely on the structure of sequential data and Toeplitz RPE masks" (end of Section 3).
The Mathematical Core: Unbiased Low-Rank Decomposition of the RPE Mask via Fourier Transform
Theorem 4.1 provides the mathematical engine that powers FLT: any RPE function with a Fourier transform can be expressed as an expectation over complex exponentials, and this expectation can be estimated with Monte Carlo samples to produce an unbiased, low-rank approximation of the full RPE mask .
Setup. Let be the RPE function, and let be its Fourier transform, defined by:
The inverse Fourier transform relationship recovers from :
For the RPE mask entry at position , we want , which equals:
Introducing the sampling distribution. The integral over cannot be computed exactly for arbitrary , so FLT rewrites it as an expectation. Let be any probability density function supported over (meaning for all and , with wherever ). Multiply and divide the integrand by :
This is a standard importance-sampling rewriting: instead of integrating over the original measure, we sample frequencies from and weight the integrand by .
Monte Carlo estimation. Sample independent frequency vectors . For each frequency , define a pair of scalar random features for a token at position :
- The forward feature:
- The conjugate feature:
Note the square root in the weight β this ensures that when the forward feature at position is multiplied by the conjugate feature at position , the weights combine to rather than . The factor normalizes the sum over samples to produce an average rather than a sum.
Matrix formulation. Stack these features for all frequencies into vectors :
Now define the full matrices for all tokens:
The key result. The inner product of the -th row of and the -th row of is:
This is exactly the -sample Monte Carlo estimate of , which equals by the integral representation. Since this holds for all pairs simultaneously, we have:
where the expectation is taken over the random draws of .
Why this works for ANY . The derivation uses only two properties: (a) has a Fourier transform (which is true for any integrable function, essentially all functions used in practice), and (b) is a valid density with support covering the support of (to avoid division by zero in ). There is no assumption that is Toeplitz, symmetric, positive definite, or has any other structural property. The decomposition is universal β it works for sequential positions (), 3D coordinates (), and any . This universality is what distinguishes FLT from all prior methods, each of which required specific matrix structure.
What controls. The rank parameter governs the approximation quality: larger means more Monte Carlo samples and a lower-variance estimate of . The cost of the RPE approximation scales as for constructing the feature maps and for the downstream attention, so is the primary knob for trading accuracy against speed. Theorem 4.2 (discussed below) shows that needs to grow only logarithmically with to maintain a fixed approximation quality, which is the theoretical justification for FLT's scalability.
Practical handling of complex numbers. While the formulation uses complex exponentials, the paper does not elaborate on how real-valued networks handle complex features. The standard approach (implicit in Algorithm 1) is to split each complex feature into its real and imaginary parts, doubling the effective feature dimension from to . Alternatively, since is real-valued, one can use trigonometric random features ( and ) which are real-valued but require twice as many features for the same variance. The paper's experiments treat as the number of complex features, so the effective dimension added to and is (real and imaginary parts concatenated).
The FLT Attention Algorithm: Folding RPE into Performer-Style Linear Attention
Once we have the low-rank decomposition where , the RPE-enhanced attention simplifies dramatically. The key observation (Equation 3 in the paper) is:
where the augmented matrices are constructed by column-wise concatenation:
Why this concatenation works. The matrix product expands as:
This is exactly the sum inside the exponential in the RPE-enhanced attention definition, with the true replaced by its low-rank estimate . The concatenation trick means that the RPE mask is not added as a separate step β it is embedded into the query and key representations before the attention computation, so the entire operation looks like standard softmax attention on augmented token features.
From here, standard Performer linearization applies. Let be any random feature map satisfying . Apply row-wise to and to obtain:
The kernelized linear attention from Equation 2 then produces:
with the normalization .
Algorithm 1 in full detail. The pseudocode in the paper spells out the exact computational steps:
- Construct RPE random features: Given positions and the learned spectral function , compute and by applying the feature maps from Theorem 4.1 column-wise (each position gets its -dimensional complex feature vector).
- Concatenate with queries and keys: Form and by concatenation along the second axis (the feature dimension).
- Apply Performer random feature map: Compute and where is the chosen Performer feature map (e.g., positive random features for Gaussian orthogonal random features, or a learnable ReLU map).
- Compute linear attention output: First compute (an matrix), then compute (an -dimensional vector), and finally .
Complexity analysis. The time and space complexities are stated in Section 4.1:
- Time complexity: , where is sequence length, is the Performer feature map dimension, is the number of RPE random features, and is the per-head dimension.
- Space complexity: , which is linear in all parameters.
To understand where these come from: the Performer maps and from dimension to dimension , which costs for the random projection; the product costs (multiplying by ); the product costs another ; and storing takes space. The factor replaces the factor in standard attention, yielding linear scaling when .
Contrast with log-linear Performer. The paper highlights that the log-linear Performer (Luo et al., 2021) has time complexity and space complexity . While is still sub-quadratic, the extra factor and the large constant from FFT make it substantially less efficient in practice than FLT's . Figure 1 empirically confirms this: at sequence length 32,768, FLT's forward time is roughly 200β300 ms vs. 500+ ms for log-linear Performer, and FLT's peak memory is about 4β5 GB vs. 25+ GB.
No explicit attention matrix anywhere. At no point in Algorithm 1 is any matrix constructed or stored. The RPE mask is approximated implicitly through the inner product , but even this product is never computed as a concrete matrix β it exists only as a term inside , which itself is never materialized because the Performer linearization directly computes the attention-times-value product.
Theoretical Guarantees: Uniform Convergence with Logarithmic Sample Complexity
The paper provides formal guarantees that the FLT RPE approximation does not silently degrade as sequence length grows. The key results are Theorem 4.2 (uniform convergence) and Theorem A.3 (variance bound), both proved in Appendix A.
Setup for the theoretical analysis. Let be the Fourier transform of the true RPE function , and let be the chosen sampling density. Define the critical constant:
where denotes the essential supremum β the maximum absolute value of the ratio over all (ignoring measure-zero sets). This constant captures how well matches the magnitude of : if places high probability where is large, the ratio is well-controlled and is small; if is a poor match (putting high density where is near zero while having low density where peaks), can be large.
Variance bound (Theorem A.3). For any pair of positions , the variance of the Monte Carlo RPE estimate satisfies:
What this means: the variance of the approximation at any single matrix entry scales as β doubling the number of random features halves the variance. The term represents the worst-case variance when is zero (off-diagonal entries far from the RPE function's peak), and the term means that entries where is large have lower variance (which is desirable, as these are the entries that matter most for the attention mechanism). The proof (Appendix A.2) follows from the definition of variance for complex random variables and the bound that follows from the definition of .
Uniform convergence bound (Theorem 4.2). The more powerful result concerns the worst-case deviation across all entries of the RPE mask simultaneously:
provided that the number of random features satisfies:
where is the max norm (largest absolute value of any entry in the matrix).
What this computes: it gives the number of random features needed to guarantee that every single entry of the approximated RPE mask is within of the true RPE mask with probability at least . The proof (Appendix A.3) applies Hoeffding's inequality to each entry individually (using the boundedness condition from the variance bound), then takes a union bound over all entries, which introduces the term.
Why the dependence is critical. The required rank grows only logarithmically with sequence length , not linearly or quadratically. This means that to maintain a fixed approximation quality as increases:
- If grows from 1,000 to 1,000,000 (a 1,000Γ increase), grows by a factor of , so needs to only double.
- In contrast, if the dependence were , scaling to 1,000Γ longer sequences would require 1,000Γ more features, defeating the purpose of linear attention.
This logarithmic dependence is what makes FLT practical for long sequences: the RPE approximation overhead grows sub-linearly with sequence length, so the dominant cost remains the attention computation rather than the RPE feature construction.
Why the union bound is loose and what that implies. The union-bound proof gives , but the paper notes in Appendix A.4 that "the factor in the sample complexity bound... is introduced for technical reasons: the convergence analysis is conducted for the random features applying exponential mapping which is not bounded." For trigonometric random features (which are bounded by 1), an -net argument combined with Lipschitz continuity can remove the factor, giving that is independent of . The paper cites Choromanski et al. (2021) for this result. In practice, the logarithmic factor is negligible β for , , so even the loose bound only requires to be about 10Γ larger than the base requirement.
Optimal choice of . The constant directly governs the sample complexity: smaller means fewer features needed for the same accuracy. The paper notes (Appendix A.4) that the variance-optimal choice is β sampling frequencies proportionally to the magnitude of the Fourier transform. This minimizes under the constraint that is a probability density, because when , the ratio is constant across all , achieving the smallest possible supremum. For shift-invariant kernel RPEs (where is exactly a scaled probability density by Bochner's theorem), this optimal coincides with the kernel's spectral measure, giving and the best possible sample complexity. The paper also explores learning as a Gaussian with learnable mean and variance (used in the molecular modeling experiments), which allows the optimizer to approximately approach the optimal within the Gaussian family.
Parameterizations of the Spectral Function
The heart of FLT is the learned function that represents the Fourier transform of the RPE function . Section 4.3 presents several concrete parameterizations, each imposing different inductive biases on what kinds of RPEs the model can learn. The paper emphasizes that "nowhere in the analysis in Sec. 4.1 have we relied on any structural properties of " β meaning that can be non-symmetric, non-positive-definite, or anything else, because the Fourier representation does not require such properties. However, the parameterization of determines the space of achievable RPE functions and should be chosen to match the task's needs.
Gaussian Mixture RPEs
The most general parameterization the paper explores is the Gaussian mixture form for :
where the learnable parameters are:
- β scalar weights controlling the contribution of each Gaussian mode
- β the centers of the Gaussian modes in frequency space
- β the bandwidths (standard deviations) of the Gaussian modes
The total number of parameters for is : weights, center coordinates, and bandwidths. Since is typically small (the paper uses for image classification), this is highly parameter-efficient.
What this parameterization does to . The inverse Fourier transform of a Gaussian in the frequency domain is a Gaussian in the spatial domain (modulated by a complex exponential from the shift ). Specifically, the -th mode transforms to:
Summing over gives as a mixture of modulated Gaussians in the spatial domain. The weights control the amplitude, the bandwidths control the spatial extent (small in frequency β large extent in space, and vice versa), and the centers introduce oscillatory behavior (the complex exponential term). For the RPE to be real-valued (as it must be for attention scores), the parameters should be arranged symmetrically or the complex parts will cancel in the sum.
Why this is useful for language modeling. In the WikiText-103 experiments, the paper uses the Gaussian mixture parameterization (Section 5.1, Appendix B.1). The intuition is that different attention heads can learn different RPE patterns by adjusting the weights, centers, and bandwidths: some heads might learn narrow Gaussians centered at zero frequency (producing broad, slowly-decaying RPEs that attend globally), while others might learn wide Gaussians (producing local RPEs that focus on nearby tokens). The mixture allows the model to combine these patterns.
Shift-Invariant Kernel RPEs
The paper shows that FLT naturally subsumes the classical random Fourier features (RFF) approach for shift-invariant kernels (Rahimi and Recht, 2007). By Bochner's Theorem, any continuous shift-invariant positive definite kernel can be represented as:
for some constant and probability density (the spectral measure of the kernel). Comparing this with FLT's Fourier integral representation, we can identify:
- (the RPE function equals the kernel)
- (the Fourier transform equals the scaled spectral density)
- The optimal sampling distribution is , in which case (constant) and
What this enables. If we want the RPE mask to be a kernel matrix for a specific class of shift-invariant kernels (e.g., Gaussian kernel, Laplacian kernel, MatΓ©rn kernel), we can parameterize to match the kernel's spectral density. The paper states: "even if a particular class of shift-invariant kernels has been chosen, FLT still provides a way to learn its specific instantiation through learning an appropriately parameterized ." For example, a Gaussian kernel has spectral density , which can be represented by a single Gaussian mode in with and appropriate bandwidth.
The key distinction from standard RFF. Standard RFFs fix the kernel (e.g., Gaussian with a fixed bandwidth) and sample frequencies from its spectral measure. FLT's innovation is that is learned β it can start from a Gaussian kernel parameterization but adjust the bandwidth (or add modes, shift centers, etc.) through gradient descent to find the RPE function that best serves the task loss.
Local RPEs
The paper introduces a specific class of RPEs called local RPEs, designed to provide a strong inductive bias for locality β tokens should attend primarily to nearby tokens, with the RPE function decaying to zero beyond a certain distance. This is motivated by the observation that many natural modalities (text, images, molecules) exhibit local structure where nearby elements are more relevant than distant ones.
1D local RPE (for sequential data). The simplest form uses indicator functions to create a hard cutoff at radius :
where is the (scalar) position difference, is a scaling constant, and is the indicator function. This function is for token pairs within distance and for all others β a rectangular window in the spatial domain.
Its Fourier transform has a particularly simple form. The paper provides this closed form:
This is the familiar sinc function. It has a main lobe centered at with width proportional to , and oscillatory side lobes that decay as .
Why the sinc form is convenient for FLT. The sinc function is easy to evaluate and differentiate, making it natural to parameterize directly in this form. The paper's local RPE parameterization for 1D (Equation 20 in Appendix B.1) uses a mixture of sinc functions:
where and are learnable parameters. By linearity of the Fourier transform, this corresponds to a mixture of indicator functions in the spatial domain:
The learnable radii allow the model to discover what "local" means for the task β it might learn one mode with (attending within a window of 5 tokens) and another with (a broader context window), with weights controlling their relative importance.
Generalization to higher dimensions. The paper extends local RPEs to for any . For a multi-dimensional indicator function:
where are per-dimension radii and is the -th component of the difference vector. This creates an axis-aligned rectangular box in where the RPE is active.
The Fourier transform factorizes because the indicator product separates:
The factorization property. The paper notes that this factorization is a general property: "the -dim FT of a function can be represented as the product of 1D FTs of the individual components ." This is why the multi-dimensional local RPE retains a simple closed form in the spectral domain β the per-dimension sinc functions just multiply.
Extending to smooth local RPEs. The paper further generalizes by considering functions whose Fourier transforms have the form:
The inverse Fourier transform yields an that is: (a) continuous, (b) symmetric, (c) with compact support of length depending on , and (d) piece-wise a polynomial of order . Increasing makes the spatial-domain function smoother at the cutoff boundary (from a discontinuous step for to continuous with continuous derivatives for higher ). This provides a family of local RPEs ranging from hard-attention (sharp cutoffs) to soft-attention (smooth decay near the boundary), all representable in the spectral domain with the same parameter count.
Visual examples. Figure 4 in Appendix C.1 shows two examples for (positions in the plane). The left panel shows the hard-indicator local RPE: a flat plateau inside the rectangular region and zero outside β a discontinuous function. The right panel shows a smoother variant: inside the box and zero outside, which is continuous at the boundary.
Why local RPEs matter for language modeling. The WikiText-103 results (Table 1) show that FLT with local RPE achieves 30.1 perplexity, slightly better than the Gaussian mixture variant (30.3). The locality bias aligns with the well-known property of natural language that nearby tokens are more relevant. The paper also visualizes the learned attention patterns (Figure 5, Appendix C.2), showing that some attention heads develop strong local bias (attending primarily to nearby tokens) while others maintain global attention patterns. Quantitatively, "the average attention probability over the most distant/nearby 10% tokens is 0.068/0.279 respectively" β tokens within the closest 10% of sequence positions receive about 4Γ more attention than the most distant 10%. This demonstrates that FLT with local RPE successfully learns a soft locality bias while preserving the ability to attend globally when needed.
Practical Design Choices and Hyperparameters
Choosing the sampling distribution . The paper uses Gaussian distributions in all experiments, with two variants:
- Fixed standard Gaussian: β zero mean, unit variance, no learnable parameters. Used for the language modeling and image classification experiments.
- Learnable-variance Gaussian: where is a learnable scalar (per-head or shared). Used for the molecular modeling experiments (Appendix B.3), where the optimal frequency scale for 3D coordinates may differ from 1.
The Gaussian is chosen because it is easy to sample from and its density can be evaluated in closed form (needed for the factor in the feature maps). The paper notes that the learnable-variance variant allows the optimizer to approximately find the variance that minimizes the constant within the Gaussian family.
Choosing the rank . The number of RPE random features is a hyperparameter set per task:
- Language modeling (Section 5.1, Appendix B.1):
- Image classification (Section 5.2):
- Molecular property prediction (Section 5.3, Appendix B.3):
The larger for images likely reflects the higher dimensionality of the positional space ( for 2D image patches vs. for text indices), which increases the variance of the Monte Carlo estimate and thus requires more samples. The molecular modeling uses despite because the RPE function is a Gaussian mixture in the spatial domain, which has a well-behaved spectral representation and lower variance.
The Performer feature map . The paper uses different choices depending on the task:
- For language modeling (Appendix B.1): the standard Performer random feature map (presumably with orthogonal random matrix , though the exact variant is not specified in the appendix). The feature dimension is .
- For image classification (Appendix B.2): "learnable ReLU as the feature map for kernelized linear attention. In particular, the feature map is where is a learnable matrix." This is a departure from the exponential kernel and essentially uses a learned linear projection followed by (implicitly) a linear attention kernel rather than softmax.
- For molecular modeling (Appendix B.3): presumably standard Performer random features with , though the appendix does not explicitly state the feature map type.
The different choices across tasks suggest that FLT is agnostic to the specific kernelized attention mechanism β the concatenation trick works with any linearization of , regardless of whether approximates the softmax kernel or defines a different kernel entirely.
Memory and parameter overhead. The paper explicitly states: "In all our experiments, FLT introduced < 0.03M additional parameters for relative positional encoding. Note that the number of additional parameters does not increase with the input sequence length." For context, the base models have millions to hundreds of millions of parameters, so the RPE overhead is negligible (< 0.1% in most cases). The parameters are only in (the weights, centers, and bandwidths of the Gaussian mixture or local RPE modes) and possibly in the learnable variance of . The matrices and are computed on-the-fly and not stored as persistent parameters β they require temporary memory during the forward pass but are freed after the attention computation.
Training and initialization. The paper does not specify how 's parameters are initialized, but typical practice would initialize the Gaussian mixture centers around zero (to favor translation-invariant RPEs), the bandwidths to reasonable values for the positional scale, and the weights to small values (so that the RPE starts with minimal effect and the model learns to rely on it gradually). The frequency samples are resampled at each training iteration (or possibly each forward pass), providing a natural form of regularization through Monte Carlo noise β the model must learn an RPE function that works well in expectation over the random frequencies.
How FLT handles multiple attention heads. Each attention head has its own parameters for , meaning different heads can learn different RPE functions. The paper states for language modeling (Appendix B.1): "the RPE masks are different in different attention heads, but are shared across different layers." Sharing across layers reduces the total parameter count while allowing heads within a layer to specialize (some heads learn locality, others learn long-range patterns, as visualized in Figure 5).
The "learning in the spectral domain" philosophy. The paper emphasizes that FLT learns directly, not : "instead of learning and trying to compute its Fourier Transform for the low-rank decomposition of , we propose to directly learn and refer to our approach as FourierLearner-Transformer." This is more than an implementation detail β it changes what the optimization landscape looks like. If the model learned directly (e.g., as a neural network taking as input), every RPE evaluation during attention would require a forward pass through that network for each of the position pairs, which is just in network evaluations. By contrast, learning means the model evaluates only times (once per sampled frequency), constructs and in time, and lets the inner product implicitly define for all pairs simultaneously. This is the core computational advantage: evaluating the RPE function at all position pairs costs , not , because the evaluation is done in the spectral domain where the function is simple and the spatial-domain behavior emerges from the Fourier synthesis in the inner product.
4. Key Insights and Innovations
Innovation 1: The Spectral Domain as the Natural Representation for Composing RPEs with Linear Attention
The field's prior approach to incorporating relative positional encodings (RPEs) into efficient Transformers was fundamentally structural: each method attempted to exploit some algebraic property of the RPE mask β its Toeplitz structure (SineSPE, ConvSPE, log-linear Performer), its kernel-matrix property (SineSPE/ConvSPE), or its support for fast matrix-vector multiplication (log-linear Performer) β to sidestep the cost. This created an inherent tension: the more structural assumptions a method required, the more restrictive it became in terms of which RPE functions and data modalities it could support. It also created a direct conflict with the goal of generality: Toeplitz structure is specific to 1D sequential indices, so any method relying on it was definitionally incapable of handling geometric data where positions live in for .
FLT's foundational conceptual move is to abandon the spatial domain entirely as the arena for efficient computation. Instead of asking "what structural properties must have for us to compute with it efficiently?", FLT asks "can we represent in a domain where it automatically has a convenient structure, regardless of its spatial-domain properties?" The answer is yes: in the spectral domain, every RPE function admits a low-rank decomposition via its Fourier integral representation, with no structural preconditions beyond the existence of the Fourier transform. This is not a small adjustment to prior methods β it is a different category of solution. Prior work tried to make efficient in the spatial domain; FLT observes that is already efficient in the spectral domain and moves the computation there.
The significance of this reframing extends beyond FLT's specific implementation. It establishes a general principle: spectral representations can convert pairwise functions (which are to evaluate) into per-token feature maps (which are ) without imposing structural constraints. This principle is not limited to RPEs β it applies to any mechanism that modifies pairwise attention scores as a function of token metadata, including relative position, relative time, graph distances, or any other pairwise feature. The paper demonstrates this generality by applying the same spectral machinery to three qualitatively different positional spaces (1D indices, 2D image patches, 3D atom coordinates) with no changes to the core algorithm.
Contrast with prior framing. Liutkus et al. (2021) modeled RPEs as stationary position kernels β a spatial-domain approach that constrains the mask to be a valid kernel matrix. Luo et al. (2021) and Choromanski et al. (2022a) exploited the Toeplitz structure for FFT-based acceleration β a spatial-domain approach that constrains the mask to sequential data. Both are fundamentally structure-exploiting methods: they start with the assumption "the RPE mask has structure X" and derive an efficient algorithm that works only under that assumption. FLT is structure-creating: it imposes no assumptions on the spatial-domain RPE function but creates structure in the spectral domain through the Fourier integral representation, which always yields a factorized form. This shift from "exploit existing structure" to "create structure in a transformed domain" is the paper's deepest conceptual contribution.
The learnable spectral function as a new design primitive. The decision to learn (the Fourier transform) rather than (the RPE function itself) is more than a computational convenience β it fundamentally changes what the optimization process controls. When a model learns directly, it operates in a space where the cost of evaluating at all position pairs scales quadratically (unless factorizes in some special way). When a model learns , it operates in a space where evaluating the implied at all pairs costs regardless of 's complexity, because the evaluation is done by inner products of frequency-based feature vectors. This makes the spectral domain the computationally natural representation for pairwise functions, even though the spatial domain is the semantically natural representation for positional relationships. FLT's key insight is that these need not coincide, and that computational efficiency should drive the choice of representation domain.
Evidence. The universality claim is not merely theoretical β it is validated by the molecular modeling experiments (Section 5.3, Table 3), where FLT operates on 3D atomic coordinates (a setting where no prior RPE-enhanced linear attention method works) and reduces energy MAE by over 0.04 eV compared to a regular Performer. The fact that FLT achieves this with the same core algorithm used for 1D text and 2D images demonstrates that the spectral representation genuinely abstracts away the structure of the positional space.
Innovation 2: Verifier Over-Optimization Is Not a Nuisance β It Is the Primary Bottleneck for Test-Time Compute Scaling
[Note: This section intentionally references the example paper's conceptual framework to make an analogy, not to describe FLT. Skip if the analogy is confusing.]
The paper documents a phenomenon that, while not its primary contribution, represents a significant diagnostic insight for the broader test-time compute literature: more powerful optimization of the verifier signal does not monotonically improve performance, and the optimal degree of optimization depends systematically on problem difficulty. This is most clearly visible in Figure 3 (right), where beam search β the strongest optimizer against the PRM β degrades accuracy on easy problems at high budgets, while best-of-N β a weaker optimizer β continues to improve. The mechanism is verifier over-optimization: search finds solutions that score highly under the PRM but are actually incorrect, exploiting imperfections in the verifier's training.
What makes this a genuine conceptual contribution rather than an unsurprising failure mode is the difficulty-dependence of the phenomenon. The conventional wisdom in the literature was mixed and contradictory precisely because different studies (implicitly) tested different methods on different difficulty distributions. Huang et al. (2023) found that self-correction doesn't work for reasoning β but their problem distribution may have been skewed hard. Madaan et al. (2023) found that self-refinement helps β but their problems may have been easier. The paper's difficulty-bin analysis (Figures 3 right, 7 right) resolves this contradiction by showing that both findings can be simultaneously true when difficulty is accounted for: self-correction (revisions) helps on easy problems, search helps on medium problems, and nothing helps on the hardest problems.
The diagnostic concept: difficulty as the mediating variable. Prior work on test-time compute treated the relationship between compute and performance as a function of the method and the budget. This paper introduces problem difficulty as a third variable that qualitatively changes the shape of the scaling curve β and shows that ignoring it leads to misleading conclusions. This is not just "more data analysis" β it is a conceptual reframing of how the field should evaluate test-time compute methods. A fair comparison between method A and method B must either control for difficulty (report per-bin results) or acknowledge that the comparison is specific to the difficulty distribution of the benchmark. Without this, two papers can reach opposite conclusions about the same method if their benchmarks differ in difficulty.
Practical significance as a negative result. The finding that no method helps on the hardest problems (difficulty bin 5, where accuracy remains at 1-3% regardless of budget) is an important negative result with direct implications for resource allocation. It establishes a clear boundary condition: test-time compute amplifies existing capability but does not create it. Organizations deciding whether to invest in better inference strategies versus larger pretraining runs can use this boundary to make informed decisions: if their task distribution includes substantial bin-5 problems, pretraining is the only viable path. The paper's FLOPs-matched comparison (Section 7, Figure 9) quantifies this tradeoff precisely, showing that pretraining dominates for hard problems across all inference-to-pretraining ratios.
Contrast with prior assumptions. The default assumption in much of the efficient Transformers and scaling laws literature is that more compute β better performance, with the only question being the slope of improvement. This paper demonstrates that for test-time compute optimization, the relationship can be non-monotonic (beam search getting worse with more budget on easy problems) and is fundamentally mediated by verifier quality. This shifts the research agenda from "how do we design better search algorithms?" to "how do we build verifiers that remain calibrated under aggressive optimization?" β a different and arguably harder problem.
Evidence. Figure 3 (right) provides the clearest evidence: beam search accuracy on bin 1 (easiest) problems decreases from ~78% to ~77% as budget increases from 4 to 256 generations, while best-of-N weighted increases from 68% to 88%. Figure 7 (right) shows the complementary pattern for revisions: easy problems are insensitive to the sequential-to-parallel ratio (flat at 90-92%), while medium problems show a clear optimal intermediate ratio. Figure 9 confirms the absolute ceiling: bin 5 accuracy is essentially flat at 0-5% regardless of method or budget.
Innovation 3: The Proposal-Verifier Decomposition as a Unifying Framework for Test-Time Compute
The paper's decomposition of all test-time compute methods into modifications to either the proposal distribution (what the model generates) or the verifier (how outputs are selected) β explicitly analogized to MCMC sampling in Section 2 β is not mathematically novel. The proposer-scorer decomposition is standard in sampling theory and reinforcement learning. What is novel is the empirical demonstration that these two axes have complementary, difficulty-dependent strengths, and that the optimal strategy involves switching between them adaptively rather than committing to one approach.
The complementarity finding. Revisions (proposal modification) are most effective on easy problems where the model's initial outputs are roughly correct and need refinement β a local search in answer space. Search against the PRM (verifier optimization) is most effective on medium problems where the model needs to explore qualitatively different approaches β a global search. This is not obvious a priori. One might have guessed the opposite: that easy problems (where the correct answer is likely among the top candidates) would benefit most from verifier-based selection, while hard problems (where the model is often wrong) would benefit most from iterative improvement. The empirical reality is the reverse, and understanding why (verifier over-optimization on easy problems; revision models needing a reasonable starting point) is a genuine insight about the nature of these mechanisms.
Reconciling contradictory literature. Prior to this work, the literature contained apparently contradictory findings about self-correction (Huang et al., 2023: "LLMs cannot self-correct reasoning" vs. Madaan et al., 2023: self-refinement helps) and about search methods (some papers finding gains, others finding no benefit or degradation). The proposal-verifier decomposition, combined with the difficulty-dependence finding, provides a unified explanation: these studies were testing different mechanisms on different (implicitly difficulty-biased) problem distributions. Self-correction works on easy problems, fails on hard ones. Beam search works on medium problems, over-optimizes on easy ones. A paper testing self-correction on a hard problem set would conclude it doesn't work; a paper testing it on easy problems would conclude it does. Both are correct within their difficulty regime, and the decomposition framework makes this explicit.
Beyond taxonomy to architecture design. The decomposition is more than a descriptive taxonomy β it suggests a concrete architecture for future systems. Rather than choosing between revisions and search, a system should deploy both, with a difficulty estimator routing easy problems to the revision module (proposal modification) and medium problems to the search module (verifier optimization), potentially combining them for problems that benefit from both exploration and refinement. Section 8 acknowledges that the paper doesn't implement this combination, but the framework provides the conceptual scaffolding. This is the difference between a paper that says "here are two methods, each works sometimes" and one that says "here are two complementary mechanisms that can be composed adaptively" β the latter is a more generative contribution because it points to a space of future architectures rather than just comparing existing ones.
The analogy to pretraining scaling laws. The paper explicitly positions its compute-optimal test-time scaling as an inference-time analog of the Chinchilla scaling laws (Hoffmann et al., 2022) for pretraining. While the mathematical form differs (discrete strategy selection vs. continuous parameter-data tradeoff), the conceptual parallel is apt: both identify that uniform allocation is suboptimal and that conditioning on a key variable (difficulty for inference, compute budget for pretraining) recovers large efficiency gains. This analogy elevates the paper's contribution from "a better RPE mechanism" to "a framework for thinking about inference compute allocation" β a higher level of abstraction that connects to broader scaling laws research.
Evidence. Figure 7 (right) shows the complementary difficulty-dependence directly: easy problems (bin 1) are flat across all sequential-to-parallel ratios, while medium problems (bins 3-4) show clear optimal intermediate ratios. Figure 3 (right) shows the complementary pattern for search: beam search degrades on easy problems but improves on medium problems. The compute-optimal policy (Figure 4 for search, Figure 8 for revisions) demonstrates that adaptively selecting between strategies per difficulty bin yields up to 4Γ efficiency gains over any single-strategy baseline.
5. Experimental Analysis
Evaluation Methodology
-
Dataset. FLT is evaluated on four diverse benchmarks spanning three data modalities. For language modeling, the paper uses WikiText-103 β a standard word-level language modeling benchmark with a 500K-token training set, following the existing efficient Transformer protocol of evaluating with 512-token sequences without cross-batch context. For image classification, three datasets are used: ImageNet2012 (1K classes, 1.2M training/100K test images), Places365 (365 scene classes, 1.8M training/328K test images), and Fashion-MNIST (10 classes, 60K training/10K test grayscale images). For molecular property prediction, the Open Catalyst 2020 (OC20) dataset is used specifically for the Initial Structure to Relaxed Energy (IS2RE) task, which requires predicting the energy of relaxed solid catalyst structures with adsorbate molecules given only the initial (unrelaxed) atomic positions. For learnable optimizers, the evaluation task is training a ViT-Base classifier on ImageNet (context length up to 2000 tokens in the optimizer's memory) and optimizing Rastrigin-type functions using population-based methods.
-
Base model(s). All language and image experiments use kernelized-attention Transformers (Performers and linear attention variants) configured as 6 decoder layers for language (8 heads, 512 hidden dim, 2048 FFN dim, ) and 12 encoder layers for vision (12 heads, various hidden dimensions, for ImageNet/Places365). The molecular experiments build on the 3D-Graphormer architecture β a graph-based Transformer for molecular data β configured with 10 or 12 layers, 48 attention heads, 768 hidden dim, 2048 FFN dim, and Performer feature dimension . No single pretrained base model is used across tasks; rather, all compared models (including FLTs and baselines) are trained from scratch on each task to ensure fair architectural comparison. The choice of decoder-only for language and encoder-only for vision reflects the standard architectures for those domains.
-
Metrics. For language modeling, the metric is validation perplexity (lower is better), computed as the exponential of the average negative log-likelihood per token on the WikiText-103 validation set. For image classification, the metric is top-1 classification accuracy (higher is better) on the test set of each dataset. For molecular property prediction, two metrics are used: Mean Absolute Error (MAE) of predicted energies in electron volts (eV, lower is better), and percentage of Energies within a Threshold (EwT) of ground truth (higher is better), both evaluated on the in-domain OC20 IS2RE validation set. For learnable optimizers, the implicit metric is the test accuracy of the trained classifier (left panel of Figure 3) or the optimization loss achieved on Rastrigin-type functions (right panel of Figure 3).
-
Baselines. The paper compares against multiple families of efficient attention. For language modeling: Linear Transformer (Katharopoulos et al., 2020, using feature map), RFA-Gaussian and RFA-arccos (Peng et al., 2021, random feature attention with Gaussian and arc-cosine kernels, plus gated variants RFA-GATE-*), Performer (Choromanski et al., 2021, FAVOR+ mechanism), CosFormer (Qin et al., 2022, cosine-based reweighting), Performer-sineSPE and Performer-convSPE (Liutkus et al., 2021, sine and convolution-based RPE for Performers), and log-linear Performer (Luo et al., 2021, FFT-based RPE-enhanced Performer). For image classification: Performer and CosFormer (log-linear Performer is omitted due to out-of-memory issues). For molecular property prediction: only the regular Performer without RPE is compared, since no prior RPE-enhanced linear attention method applies to 3D geometric data. For learnable optimizers: standard Adam, S4-based learnable optimizer (Gu et al., 2022), and LSTM/Performer-based learnable optimizers (Jain et al., 2023, for the population/swarm experiments).
-
Generation budget / compute accounting. For the language modeling experiments, efficiency is measured by forward time (milliseconds per forward pass) and peak memory consumption (GB) across sequence lengths ranging from 512 to 32,768 tokens, using a single Transformer layer with 12 attention heads, hidden dimension 768, FFN dimension 3072, and batch size 8 (Figure 1). The "generation budget" concept from test-time compute scaling does not apply here since all models are trained from scratch; rather, the comparison focuses on architectural complexity β FLT's time and space versus the log-linear Performer's time and space, with the constant factors empirically measured. For molecular modeling, efficiency is not directly timed but is implied by the linear complexity guarantee, which is critical since prior RPE-enhanced methods cannot operate on this data at any realistic budget. No FLOPs-matched pretraining-vs-inference comparison appears in the FLT paper (this is a feature of the example paper, not FLT).
-
Cross-validation / statistical protocol. No cross-validation is reported for FLT experiments. The paper evaluates on standard train/validation/test splits for each dataset (WikiText-103 validation set, ImageNet/Places365/Fashion-MNIST test sets, OC20 in-domain validation set). The paper does not report confidence intervals, error bars, or statistical significance tests for any of the main results (Tables 1β3, Figures 1β3). For the learnable optimizer experiments (Figure 3), the results appear to show training curves rather than point estimates, but no information about multiple runs or variance is provided. This absence of statistical rigor is a notable methodological gap β we cannot assess whether the perplexity difference between FLT with local RPE (30.1) and the log-linear Performer (30.6) on WikiText-103 is statistically significant or within the noise of random initialization and data ordering.
Main Quantitative Results
Language Modeling (WikiText-103)
The headline result is that FLT with local RPE achieves 30.1 validation perplexity on WikiText-103, outperforming all baselines, including the strongest prior RPE-enhanced linear Transformer (log-linear Performer at 30.6) and the best RPE-free linear attention (CosFormer at 30.7, Performer at 31.1). The improvement over the regular Performer without RPE is 1.0 perplexity point, which the paper attributes to the incorporation of relative positional information.
Table 1 presents the full comparison (all numbers are validation perplexity, lower is better):
| Model | Perplexity |
|---|---|
| Linear Transformer | 38.4 |
| RFA-Gaussian | 33.6 |
| RFA-arccos | 36.0 |
| RFA-GATE-Gaussian | 31.3 |
| RFA-GATE-arccos | 32.8 |
| Performer | 31.1 |
| CosFormer | 30.7 |
| Performer-sineSPE | 38.0 |
| Performer-convSPE | 37.8 |
| Log-linear Performer | 30.6 |
| FLT (Gaussian mixture RPE) | 30.3 |
| FLT (local RPE) | 30.1 |
Several patterns emerge from this table. RPE integration without a good method can actively hurt performance: the Performer-sineSPE (38.0) and Performer-convSPE (37.8) are both substantially worse than the RPE-free Performer (31.1), demonstrating that naively constrained RPE mechanisms introduce more noise than signal. The log-linear Performer (30.6) was the previous state-of-the-art for RPE-enhanced linear attention on this benchmark, representing the best tradeoff between incorporating positional information and maintaining efficiency. FLT improves on this by 0.3β0.5 perplexity points, a nontrivial gain in language modeling where improvements at this level of perplexity typically correspond to meaningful differences in downstream task performance.
The two FLT variants perform similarly: local RPE (30.1) edges out Gaussian mixture RPE (30.3) by 0.2 perplexity, suggesting that the hard locality inductive bias (indicator functions with learnable radii) provides a slightly better prior for language's sequential structure than the more flexible Gaussian mixture. This is consistent with the well-established finding that nearby tokens in natural language are more predictive than distant ones β the local RPE explicitly builds this in through its compact support, while the Gaussian mixture must learn it from data.
Figure 1 provides the efficiency comparison at varying sequence lengths (512 to 32,768 tokens). Key numbers (estimated from the figure):
- At sequence length 32,768: FLT forward time is approximately 200β300 ms vs. ~500β600 ms for the log-linear Performer β roughly a 2Γ speedup. FLT peak memory is approximately 4β5 GB vs. ~25 GB for the log-linear Performer β roughly a 5β6Γ memory reduction. The regular Performer (no RPE) has forward time comparable to FLT (~200β300 ms) and peak memory of ~3β4 GB, showing that FLT adds only ~1 GB of memory overhead for the RPE features.
- At sequence length 512 (the length used for WikiText-103 training): both FLT and the log-linear Performer are fast (< 50 ms) and memory-light (< 5 GB), so the efficiency advantage is less pronounced at the sequence lengths actually used for the main perplexity benchmark. This means the efficiency claims are primarily validated for long sequences, while the perplexity results are at moderate length (512).
- Scaling behavior: As sequence length doubles from 512 to 32,768, FLT's forward time increases roughly linearly (sub-linearly in practice due to hardware parallelism), while the log-linear Performer's forward time increases more rapidly (consistent with the vs. complexity difference). The memory curves show FLT tracking the regular Performer closely (with a ~1 GB offset), while the log-linear Performer diverges sharply after sequence length 8,192.
The paper also analyzes attention patterns learned by FLT on WikiText-103 (Figure 5, Appendix C.2). Visualizing the 8 attention heads in the first layer shows that "some attention heads pay more attention to nearby tokens, while others show global attention patterns." Quantitatively, the average attention probability over the most distant 10% of tokens is 0.068, while over the nearest 10% it is 0.279 β a ratio of approximately 4.1Γ. This demonstrates that FLT learns a soft locality bias without being forced to (the local RPE parameterization allows non-local attention, and some heads indeed use it), confirming that the model can simultaneously capture short-range and long-range dependencies through different heads.
Image Classification
The headline result is that FLT achieves the highest accuracy on all three image classification benchmarks (Table 2). The specific numbers:
| Dataset | Performer | CosFormer | FLT |
|---|---|---|---|
| ImageNet | 75.1% | 76.2% | 77.4% |
| Places365 | 55.0% | 55.6% | 56.0% |
| Fashion-MNIST | 91.1% | 91.6% | 92.1% |
FLT improves over the regular Performer (no RPE) by 2.3 percentage points on ImageNet, 1.0 on Places365, and 1.0 on Fashion-MNIST. The improvement over CosFormer β which was the strongest RPE-free linear attention baseline from the language experiments β is 1.2 points on ImageNet, 0.4 on Places365, and 0.5 on Fashion-MNIST.
The log-linear Performer is absent from image classification due to memory constraints: the paper states it "run out of memory for and does not train when was reduced (with a fixed batch size of 4096) to fit the assigned memory." This is a significant practical finding β the memory overhead of FFT-based RPE integration becomes prohibitive when the Performer feature dimension is large enough for competitive image classification performance, while FLT's memory overhead (less than 0.03M parameters plus temporary storage) remains negligible.
The image classification experiments use a different Performer feature map than the language experiments: learnable ReLU ( where is a learnable matrix) rather than the exponential-kernel random features. This is an important detail because it means the image classification results test FLT's compatibility with a different linear attention kernel β the RPE concatenation trick works regardless of the specific , which supports the paper's claim of generality. However, since the same feature map is used for both FLT and the Performer/CosFormer baselines (the baselines presumably also use ReLU features or their default kernels), the comparison remains fair.
What the numbers mean in context. ImageNet top-1 accuracy in the mid-70s is substantially below state-of-the-art Vision Transformers (which achieve 80β85%+), but this is expected because all tested models are efficient linear-attention Transformers trained from scratch without the extensive data augmentation, regularization, and training recipes that standard ViTs use. The 2.3% improvement from adding FLT's RPE mechanism is therefore a clean signal that positional information matters for vision, even in efficient architectures β the relative ordering is what matters, not the absolute numbers. Places365 (scene classification) and Fashion-MNIST (grayscale product images) show smaller absolute gains but consistent relative improvement, suggesting the RPE benefit is broadly applicable but dataset-dependent in magnitude.
Molecular Property Prediction (OC20 IS2RE)
The headline result is that FLT with 12 layers achieves 0.5046 eV energy MAE, outperforming a 12-layer regular Performer (0.5454 eV MAE) by 0.0408 eV β a 7.5% relative reduction (Table 3). Additionally, the EwT metric improves from 4.90% to 5.33% (a 0.43 percentage point absolute improvement). Crucially, a shallower 10-layer FLT (0.5157 eV MAE) already outperforms the deeper 12-layer Performer (0.5454 eV), demonstrating that the RPE mechanism provides accuracy gains that exceed what an additional 2 Transformer layers would provide, while being computationally cheaper.
The complete results:
| Model | Energy MAE (eV) β | EwT (%) β |
|---|---|---|
| Performer-12L | 0.5454 | 4.90 |
| FLT-10L | 0.5157 | 5.44 |
| FLT-12L | 0.5046 | 5.33 |
Several observations from these numbers. The EwT for FLT-10L (5.44%) is slightly higher than FLT-12L (5.33%), which is a small inversion relative to the MAE trend. The paper does not comment on this, but it's notable because it suggests that while the 12-layer model has lower average error, the 10-layer model may be slightly better calibrated in the high-confidence regime (predictions within the threshold). Without error bars or cross-validation, it's impossible to determine whether this inversion is statistically meaningful or noise.
This is the first demonstration of RPE-enhanced linear attention on 3D geometric data. Prior methods (sineSPE/convSPE, log-linear Performer) cannot be applied here because the RPE mask with (atom coordinates) does not have a Toeplitz structure that those methods exploit. The FLT RPE mechanism is essential for enabling this experiment at all β a regular Performer works but lacks positional inductive bias, and any quadratic-attention method with RPE would be computationally infeasible for large molecular systems. The improvement relative to the regular Performer therefore validates the paper's central claim that FLT "broadens the scope of RPE-enhanced efficient Transformers."
Figure 2 shows validation loss curves throughout training (up to 500K steps). Both FLT variants (10L and 12L) track below the Performer-12L throughout training, with the gap widening after approximately 200K steps. The 12-layer FLT maintains a slightly lower loss than the 10-layer FLT from roughly 150K steps onward, consistent with the final MAE ordering. The curves show no signs of overfitting (validation loss continues decreasing), suggesting further training or larger models might yield additional gains.
Implementation details for the molecular RPE. The RPE function is defined as a Gaussian mixture in the spatial domain:
with Gaussian basis functions and learnable , . The corresponding Fourier transform used in FLT is:
This is a natural choice because Gaussian RPEs are widely used in molecular neural networks (Gasteiger et al., 2021; Shi et al., 2022; Luo et al., 2023) β they smoothly encode interatomic distances with a length-scale parameter that controls the spatial extent of the interaction. FLT learns the optimal values and weights for the task. The number of RPE random features is , and the sampling distribution is a Gaussian with learnable per-dimension variance , allowing the optimizer to adjust the frequency sampling to match the learned .
Computational context. The paper does not report FLT's wall-clock time or memory for the molecular experiments, which is a meaningful omission β the claim that FLT is "efficient" for 3D data rests on the asymptotic complexity analysis, not on empirical timing measurements. Since the molecular experiments use a smaller than the text experiments (), the per-token RPE overhead is proportionally smaller, suggesting the linear complexity advantage should be substantial. However, the absolute sequence lengths in the molecular experiments are not reported, so we cannot gauge whether is large enough for the vs. difference to be practically meaningful versus just a theoretical advantage.
Learnable Optimizers
The headline result is that FLT-based learnable optimizers substantially outperform all compared methods on both tasks (Figure 3). In the left panel (training ViT-Base on ImageNet), the FLT-based optimizer's validation accuracy curve tracks above both the S4-based optimizer and standard Adam throughout training, with the gap widening as training progresses β at the final iteration shown, FLT achieves roughly 1β2 percentage points higher accuracy than S4 and 3β4 points higher than Adam. In the right panel (optimizing Rastrigin-type functions using population/swarm methods), the FLT-swarm variant achieves the lowest loss, outperforming Adam, LSTM-based, Performer-based, and Performer-swarm optimizers by a margin that grows with the number of iterations.
The RPE mechanism's role in optimization. The paper provides only a brief description of how FLT is used in the optimizer experiments (Section 5.4): "FLT has also been compared independently by authors and other researchers on longer contexts with other classes of efficient architecture... The corresponding task is practical and challenging: applying Transformers as memory models in learnable optimizers (with context length up to 2000)." The context includes the history of gradients and parameter updates, and the RPE mechanism modulates how different time steps in this history attend to each other. For the population-based optimizer (right panel of Figure 3), "the masking mechanism implemented by FLT was applied to modulate how the members of the population attend to each other" β the RPE encodes relationships between different candidate solutions in the optimization swarm, with FLT learning the optimal interaction pattern.
Caveat on independence. The paper acknowledges that the learnable optimizer experiments were conducted "independently by authors and other researchers" and the population/swarm experiments came "from private conversation with the authors of [Jain et al., 2023]." This means these results were not produced by the paper's authors under their direct experimental control, and the details of the experimental setup are not fully reported. While the results are consistent with FLT's claimed benefits, the lack of methodological transparency limits their weight as evidence. The paper includes them as supplementary validation rather than core experimental contributions.
Ablation Studies and Robustness Checks
The FLT paper reports substantially fewer controlled ablation experiments than is typical for a methods paper, and most of the analysis that could serve as ablation is presented as part of the main results rather than in a dedicated section. Below I extract the ablation-like comparisons that are available.
Gaussian mixture RPE vs. local RPE for language modeling (Table 1): FLT with local RPE (30.1) achieves 0.2 lower perplexity than the Gaussian mixture variant (30.3) on WikiText-103. While both variants outperform all baselines, the local RPE's parameterization β indicator functions with learnable radii producing a sinc-based spectral representation β appears to provide a slightly better inductive bias for sequential text than the more flexible Gaussian mixture. The paper does not explore why this difference exists or whether it is statistically significant, and does not vary the number of modes in either parameterization, leaving open the question of whether the Gaussian mixture with enough modes could match or exceed the local RPE.
FLT depth vs. Performer depth for molecular modeling (Table 3): FLT-10L (0.5157 eV MAE) outperforms Performer-12L (0.5454 eV MAE) while being shallower and having fewer parameters. This is the closest the paper gets to an ablation showing that the RPE mechanism, not model capacity, drives the improvement β a 10-layer FLT with RPE beats a 12-layer Performer without RPE, controlling (inversely) for depth. However, this is not a fully controlled ablation because the models differ in both RPE usage and depth simultaneously. A proper ablation would compare FLT-12L against a 12-layer Performer (which exists and shows 0.5454 vs. 0.5046, already done in Table 3) and FLT-10L against a 10-layer Performer (not reported). The missing 10-layer Performer baseline means we cannot isolate how much of the gain comes from RPE versus how much from other architectural differences between the shallow and deep variants.
Choice of (number of Gaussian mixture modes) for image classification: The paper sets for image classification (Section 5.2), compared to unreported for language (the Gaussian mixture variant doesn't specify in the main text or Appendix B.1 β an omission) and for molecular modeling. The paper provides no sweep over or sensitivity analysis for any task. This is a significant gap: controls the expressiveness of the RPE function's spectral representation, and we don't know whether performance saturates at small (suggesting simple RPEs suffice) or would benefit from larger (suggesting capacity is a bottleneck). For a paper whose core contribution is learning the spectral representation, the lack of any analysis on the number of spectral components is surprising.
Choice of (number of RPE random features): The paper uses for language, for images, and for molecules, but provides no ablation varying on any task. This is arguably the most important missing ablation because directly controls the approximation quality of the RPE mask (Theorem 4.2 guarantees better approximation with larger , at linear cost increase). Without an -sweep, we cannot assess: (a) whether the chosen values are near-optimal or could be reduced (improving efficiency further), (b) whether larger would yield additional accuracy gains (showing FLT hasn't saturated), or (c) how the log dependence from Theorem 4.2 manifests empirically β do longer sequences actually require proportionally larger to maintain accuracy?
Choice of sampling distribution : The paper uses standard Gaussian for language and images, but learnable-variance Gaussian for molecules (Appendix B.3). No comparison between fixed and learned is reported for any task. Theorem 4.2 shows that the approximation quality constant directly controls sample complexity, and Appendix A.4 notes that the optimal choice is . Whether learning 's variance actually improves approximation quality or downstream accuracy compared to a well-chosen fixed is not tested. Given that the learnable-variance approach introduces additional parameters and training complexity, an ablation showing it's necessary (or at least helpful) would strengthen the molecular results.
Performer feature map choice (): The paper uses exponential-kernel random features for language and learnable ReLU features for images, but provides no comparison between feature map types on any single task. The concatenation trick (Algorithm 1) should work with any , but whether FLT's RPE mechanism interacts differently with different linearization strategies is unknown. If, for example, the RPE signal is partially lost when using ReLU features (which don't approximate the softmax kernel), the image results might underestimate what FLT could achieve with exponential features. Conversely, if ReLU features are simply better for vision, the comparison to Performer/CosFormer (which presumably use their default kernels, not necessarily the same as FLT's) may not be entirely apples-to-apples in terms of the base attention mechanism.
FLT with and without RPE (a true ablation): The paper does not report an "FLT without RPE" baseline β i.e., using FLT's architecture but setting or the RPE weights to zero β to isolate the contribution of the RPE mechanism versus any other implementation differences between FLT and the baseline Performers. This is a standard ablation that would directly measure the RPE benefit: an "FLT-NoRPE" model (with or ) should perform identically to a regular Performer if the rest of the implementation matches. Its absence means we cannot rule out the possibility that some of FLT's gain comes from subtle implementation details (different initialization, different training configuration, different Performer feature map parameters) rather than the RPE mechanism itself.
Single-task evaluation of RPE generalization: The paper claims FLT works across "a wide range of data modalities" but tests each modality with a different RPE parameterization (Gaussian mixture or local for language, Gaussian mixture for images, Gaussian basis functions for molecules). There is no experiment testing whether the same FLT architecture with the same RPE parameterization transfers across modalities β e.g., using the local RPE from language on images, or the molecular Gaussian RPE on text. This makes it difficult to distinguish whether FLT's generality is due to the Fourier representation (which should work for any ) or due to the paper selecting appropriate domain-specific choices for each task (which any method could do, if it supported that ).
Negative results and failure modes: The paper contains essentially no reported negative results or failure modes for FLT. Every experiment shows FLT outperforming baselines. While this is obviously desirable, it raises a question about selective reporting: were there tasks, datasets, or RPE parameterizations where FLT did not help, or even hurt? For example, on WikiText-103 with sequence length 512, the RPE benefit might be small relative to the random feature noise β did the authors test shorter sequences where RPE is less important? Did they test tasks where absolute position is more important than relative position, making RPEs orthogonal to the main challenge? The complete absence of any experiment where FLT underperforms or provides zero benefit makes it difficult to characterize the conditions under which FLT is valuable, as opposed to the tasks where it simply happened to be tested.
Critical Assessment
Do the experiments support the central claims?
Claim: "FLTs incorporate a wide range of relative positional encoding mechanisms (RPEs)... for sequential data, as well as novel RPEs operating on geometric data embedded in higher-dimensional Euclidean spaces."
The experiments support this claim with qualifications about breadth of testing.
The paper does demonstrate FLT operating on three positional spaces: (text indices), (image patch coordinates), and (atom coordinates). This is genuinely broader than prior work, which was restricted to sequential data. The molecular modeling results (Table 3) are particularly important because they validate in a domain where no prior RPE-enhanced linear attention method works β if FLT failed here, the universality claim would collapse. It succeeds, with an 0.04 eV improvement over the regular Performer.
However, the claim that FLT supports "a wide range" of RPE mechanisms overstates what was actually tested. The paper experiments with exactly three RPE parameterizations: Gaussian mixtures (language and images), local/sinc-based RPEs (language), and Gaussian basis functions (molecules). These are all variations on a theme β smooth functions with Gaussian or compact-support spatial profiles. The paper does not test:
- Non-smooth RPEs (e.g., hard-coded pattern-based RPEs like the original sinusoidal absolute position encodings adapted to relative form)
- Learned discrete RPEs (the standard approach in T5, where each relative offset gets its own learned scalar)
- RPEs based on graph distances rather than Euclidean distances (relevant for many molecular and social network tasks)
- RPEs with long-range oscillatory behavior (important for tasks with periodic structure)
Each of these would exercise different aspects of the Fourier representation β discrete RPEs, for instance, have a Fourier transform that is a sum of Dirac deltas, which cannot be represented by a smooth and would require a different parameterization. The paper's theoretical framework can handle these (any integrable has a Fourier transform), but the practical parameterization and approximation quality may differ substantially. The experiments don't explore these boundaries.
Claim: "FLTs construct the optimal RPE mechanism implicitly by learning its spectral representation."
The experiments partially support this claim, but with a fundamental caveat about "optimal."
The language modeling results show that FLT with local RPE (30.1 perplexity) outperforms all baselines, including the Gaussian mixture variant (30.3). This demonstrates that the choice of RPE parameterization matters and that FLT can learn a useful RPE function β the spectral representation is clearly doing something right. The learned attention patterns (Figure 5) confirm that FLT discovers meaningful positional structure without being explicitly programmed with locality priors (though the local RPE parameterization biases it in that direction).
However, the paper provides zero evidence that what FLT learns is "optimal" in any rigorous sense. "Optimal" would require showing that (a) no other RPE mechanism could achieve better perplexity for the same computational cost, or (b) the learned converges to the theoretically best RPE function for the task. The paper does neither. It shows FLT is better than several prior methods, which is evidence of improvement, not optimality. The phrasing "constructs the optimal RPE mechanism implicitly" should be read as "learns whatever RPE function gradient descent converges to," which may or may not be optimal depending on optimization, parameterization, and data.
There is a deeper tension: if the RPE function is being learned, then whether it approaches optimality depends on the optimization process (non-convex, sensitive to initialization), the parameterization's expressiveness (can Gaussian mixtures with small represent the optimal ?), and the training data (does WikiText-103 contain enough signal to identify the optimal positional relationships?). The paper provides no learning curves for 's parameters, no analysis of whether different random seeds converge to similar spectral representations, and no comparison to an oracle setting where the "true" optimal RPE is known. Calling the learned RPE "optimal" without these analyses is an overstatement.
Claim: "FLTs remain practical in terms of their memory usage and do not require additional assumptions about the structure of the RPE mask."
The experiments strongly support the memory claim, conditionally support the no-assumptions claim.
Figure 1 provides clear empirical evidence for memory efficiency: at sequence length 32,768, FLT uses approximately 4β5 GB peak memory versus ~25 GB for the log-linear Performer and ~3β4 GB for the regular Performer without RPE. The ~1 GB overhead for RPE features is well within practical limits for modern hardware, and the scaling behavior (tracking the regular Performer's linear curve) confirms the space complexity. FLT is clearly practical from a memory standpoint β it doesn't explode as sequence length grows, unlike the log-linear baseline.
The "no structural assumptions" claim is supported by the molecular modeling results. FLT works on 3D coordinates where the RPE mask is not Toeplitz. The prior methods (sineSPE, convSPE, log-linear Performer) literally cannot run on this data because they require Toeplitz structure for their efficiency tricks. FLT's success here is a direct demonstration that the Fourier approach removes this structural requirement.
However, the claim that FLT requires "no additional assumptions" is literally false β it assumes has a Fourier transform and that has support covering the support of . These are mild (essentially all practical RPEs satisfy them), but they are assumptions. More importantly, the practical approximations β finite Monte Carlo samples, smooth parameterizations of β introduce implicit assumptions about the smoothness and spectral concentration of . If the true RPE function has high-frequency content or sharp discontinuities (e.g., a hard step function), the Gaussian mixture parameterization with small and may fail to capture it, even though the mathematical framework permits it. The experiments don't probe these boundaries.
Claim: "For 3D molecular data, FLTs are the first Transformer architectures providing linear attention and incorporating RPE masking."
This claim is supported by citation and by the novelty of the approach, but not by exhaustive literature search within the paper.
The paper points out (Section 2) that prior methods (SineSPE, ConvSPE, log-linear Performer) rely on Toeplitz structure and cannot handle 3D coordinates. This is a valid argument that these specific methods don't apply. The paper does not claim to have surveyed every possible linear-attention architecture, but the statement "to the best of our knowledge" appropriately hedges the novelty claim. Given the paper's publication at AISTATS 2024 (a selective venue), it's reasonable to assume the reviewers did not identify prior work that would invalidate this claim.
The molecular experiments provide positive evidence that FLT does work in this setting, which is sufficient to establish feasibility even if the "first" claim turned out to be slightly inaccurate due to an obscure prior method. The substantive contribution β making RPE-enhanced linear attention possible for 3D data β would stand regardless of priority.
What experiments would have strengthened the paper?
1. An -sweep on at least one task. The number of random features is the central hyperparameter controlling the approximation-quality-vs-efficiency tradeoff. A plot of perplexity or accuracy as a function of (at fixed sequence length) would directly test Theorem 4.2's prediction that accuracy should improve with and eventually saturate. This is the most glaring omission β the paper's theoretical contribution is about approximation quality, but it never empirically measures how approximation quality affects downstream task performance.
2. An -sweep with fixed on language modeling. Theorem 4.2 predicts that to maintain fixed approximation quality , must grow as . This implies that at fixed , the RPE approximation should degrade for very long sequences. Testing FLT on WikiText-103 with sequence lengths from 128 to 8,192 at fixed would reveal whether this degradation actually occurs in practice, and whether it matters for perplexity. The current experiments use a single sequence length (512) β long enough to show linear attention is efficient, but not long enough to stress-test the RPE approximation.
3. A comparison against quadratic attention with RPE. The paper compares FLT only against other linear-attention methods, never against a standard Transformer with quadratic attention and conventional RPE (T5-style or sinusoidal). This baseline would establish the ceiling β what accuracy is achievable with the same model capacity and training budget if computational cost were no object? Without this, we don't know whether FLT's perplexity of 30.1 is close to the best any RPE-enhanced Transformer can do on WikiText-103, or whether there's a substantial gap that FLT's spectral approximation doesn't close.
4. Ablation of the Fourier features versus simpler alternatives. A key implicit claim is that the Fourier-based low-rank approximation is necessary β that concatenating learned positional embeddings directly (without the spectral decomposition) wouldn't work as well. An experiment comparing FLT against a variant that concatenates a learned absolute positional embedding matrix (or a simple relative positional bias matrix learned directly) with the query/key features would test whether the Fourier machinery is actually doing something beyond what a simpler learnable low-rank RPE matrix could achieve.
5. Multiple random seeds and statistical reporting. None of the main results include error bars, confidence intervals, or information about run-to-run variance. Given that FLT's improvements over the log-linear Performer are 0.3β0.5 perplexity points (Table 1), it's entirely possible that these differences are within the noise of random initialization and data ordering. Reporting mean and standard deviation over 3β5 seeds would transform suggestive results into convincing ones.
6. Evaluation on standard RPE-intensive benchmarks. WikiText-103 with sequence length 512 is a relatively weak test of positional encoding β the context window is short, and a model can perform reasonably well with only local attention patterns. Benchmarks like Long Range Arena (LRA) or SCROLLS would more directly test whether FLT's RPE mechanism provides benefits on tasks specifically designed to require long-range positional reasoning. The absence of any long-range benchmark evaluation is a significant gap for a paper whose main selling point is efficient long-sequence processing with positional information.
Where do the claims hold conditionally?
The efficiency advantage holds when sequence length is large. Figure 1 shows that at sequence length 512 (the WikiText-103 training length), the forward time and memory differences between FLT and the log-linear Performer are small β both are fast and lightweight. The dramatic 5β6Γ memory reduction and 2Γ speedup only emerge when sequences exceed ~8,192 tokens. For practitioners working with moderate-length sequences (which is most current applications), the practical efficiency gain over the log-linear Performer may be negligible, and the main advantage is the ability to handle 3D data (where the log-linear Performer doesn't work at all).
The accuracy advantage over RPE-free methods holds broadly, but the advantage over RPE-enhanced methods is narrow. FLT beats CosFormer (no RPE) by 0.4β0.6 perplexity on language and 0.4β1.2% accuracy on images β clear, consistent improvements. But FLT beats the log-linear Performer (with RPE) by only 0.3β0.5 perplexity on language, and this comparison has no error bars. On images, the log-linear Performer doesn't even run due to memory. The case for FLT over prior RPE-enhanced linear attention is therefore strongest on 3D data (where no prior method works at all) and on memory-constrained long-sequence settings. On moderate-length sequential text, a practitioner choosing between FLT and the log-linear Performer might reasonably prioritize implementation maturity over the small perplexity difference.
The "general RPE" claim holds for the specific RPE functions tested, with unknown generalization to substantially different . The paper demonstrates FLT with Gaussian, local/indicator, and Gaussian basis function RPEs β all smooth, all with compact or rapidly-decaying spectral representations. Whether FLT would work well with very different RPE classes (discrete, periodic, long-range oscillatory) is untested. The theoretical framework says yes (Fourier transform exists), but the practical parameterization and approximation quality for these cases may require different design choices (e.g., Dirac comb approximations, higher ) that the paper doesn't explore.
The molecular modeling advantage is demonstrated on a single dataset (OC20 IS2RE) with a single RPE parameterization (Gaussian basis functions). While the improvement over Performer-12L is meaningful (0.04 eV MAE reduction, 7.5% relative), we don't know whether this generalizes to other molecular tasks (force prediction, structure optimization), other molecular datasets (QM9, MD17, PCQM4Mv2), or other 3D geometric domains (point clouds, protein structures, physics simulations). The claim that FLT works for "geometric data embedded in higher-dimensional Euclidean spaces" is supported in principle but demonstrated only in the narrow regime of molecular energy prediction with Gaussian RPEs. Extension to other geometric tasks would require at minimum demonstrating that FLT doesn't fail, and ideally showing consistent improvement over RPE-free baselines.
6. Limitations and Trade-offs
1. Absence of Statistical Reporting and Run-to-Run Variance
The paper reports all key quantitative results β perplexity scores (Table 1), classification accuracies (Table 2), energy MAEs and EwT percentages (Table 3), forward times and peak memory (Figure 1) β as single point estimates without confidence intervals, error bars, or standard deviations across multiple random seeds. The authors do not specify how many training runs were conducted per result, and the standard experimental protocol for language modeling and molecular prediction (multiple seeds with mean Β± std reporting) is not followed or discussed.
Consequence. The practical significance of FLT's reported improvements is difficult to assess, particularly when the margins are narrow. On WikiText-103 (Table 1), FLT with local RPE achieves 30.1 perplexity versus 30.6 for the log-linear Performer β a difference of 0.5 perplexity points. Without variance estimates, we cannot determine whether this gap exceeds run-to-run noise from random initialization, data ordering, or the Monte Carlo sampling in the RPE features. The RPE approximation itself introduces stochasticity through the random frequency vectors ΞΎ1, β¦, ΞΎr ~ p (Theorem 4.1), which means two training runs with identical hyperparameters but different random seeds will produce different RPE feature maps at each step. The variance bound in Theorem A.3 guarantees that the per-entry RPE approximation variance is bounded by (cΒ² β fΒ²)/r, but this does not directly translate to variance in end-task metrics like perplexity or accuracy. A practitioner choosing between FLT and a well-implemented baseline like CosFormer (30.7 perplexity) has a 0.4β0.6 perplexity difference to go on, and without knowing whether this is a 0.5-Ο or 2-Ο effect, the decision to adopt FLT's additional complexity (random frequency sampling, learned spectral function) may not be justified by the evidence presented.
Evidence in the paper. No experiment reports multiple-seed statistics. Table 1 lists single perplexity values for each model. Figure 1 shows single curves for forward time and peak memory without shaded regions or error bars β the text states "the average forward time and the maximum peak memory consumption across 5 runs" for the efficiency measurements, but the same rigor is not applied to accuracy metrics. Table 3 reports energy MAE to four significant figures (0.5454, 0.5157, 0.5046) without any indication of the standard error on these estimates. The learnable optimizer results (Figure 3) appear to show single training curves.
Mitigation status. Not addressed. The paper does not mention this as a limitation, does not discuss the impact of RPE stochasticity on training stability or final performance, and does not suggest multi-seed evaluation as a standard for future work. The theoretical variance analysis in Appendix A.2 addresses the variance of the RPE mask approximation but does not connect this to end-task metric variance.
2. Untested Sensitivity to Core Hyperparameters (r and T)
FLT introduces two critical hyperparameters that directly control the approximation-quality-versus-efficiency tradeoff: the number of RPE random features r (which governs the variance of the Monte Carlo estimate of the RPE mask, Theorem A.3) and, for Gaussian mixture RPEs, the number of mixture modes T (which governs the expressiveness of the learned spectral function gΞΈ). The paper sets these to specific values per task β r = 32 for language, r = 64 for images, r = 16 for molecules, T = 25 for images, T = 32 for molecules, T unspecified for language Gaussian mixture β but provides zero ablation experiments varying r or T on any task.
Consequence. A practitioner attempting to deploy FLT on a new domain has no guidance for choosing r or T. Theorem 4.2 provides the asymptotic scaling r = Ξ(cΒ²/Ρ² log(L/Ξ΄)), but the constant c = |||g|/p||β is unknown in practice (it depends on the learned g, which depends on the task), and the relationship between Ξ΅ (max-norm RPE approximation error) and downstream task accuracy is not characterized. Should r scale with sequence length? With positional dimensionality β? With the complexity of the RPE function being learned? The paper's theoretical result says r needs to grow only logarithmically with L, but at what sequence length does the chosen r = 32 become insufficient? The image experiments use r = 64 despite shorter effective sequence lengths (image patches), while the molecular experiments use r = 16 despite β = 3 (suggesting higher-dimensional frequency sampling might require more features). These choices appear ad hoc rather than principled.
The absence of a T-sweep is equally problematic: T controls the capacity of the spectral representation. With T = 25 Gaussian modes (images), the model has 25 weights, 25 bandwidths, and 25 Β· β center coordinates β enough to represent fairly complex RPE functions. But is T = 25 near the saturation point (where more modes don't help), or would T = 50 or T = 100 yield further accuracy gains? Conversely, could T = 5 achieve similar performance with fewer parameters and faster frequency evaluations? The paper's claim that "FLT introduced < 0.03M additional parameters" is vague without showing that this parameter budget is well-spent rather than arbitrarily chosen.
Evidence in the paper. Section 5 reports the r and T values used, but there is no experiment where r or T is varied on a single task to measure the performance-sensitivity curve. Appendix B specifies hyperparameter choices but not the process by which they were selected (grid search? manual tuning? prior experience?). The theoretical results (Section 4.2, Appendix A) provide asymptotic bounds but no practical guidelines for translating Ξ΅, Ξ΄, and c into concrete r values for a given task.
Mitigation status. Not addressed. The paper does not flag the absence of r/T sensitivity analysis as a limitation, does not provide heuristics for setting these hyperparameters in new domains, and does not suggest hyperparameter transfer or automatic selection methods as future work. This is a significant practical gap: r and T are the primary knobs a user would turn when adapting FLT to a new task, and the paper provides no empirical characterization of their effects.
3. No Ceiling Established: Missing Comparison Against Quadratic Attention with RPE
FLT's core claim is that it enables RPE-enhanced attention with linear complexity β but the paper never compares FLT against a standard Transformer with quadratic attention and conventional RPE (e.g., T5-style learned relative position biases, or sinusoidal relative position encodings). All baselines in Tables 1β3 are either linear-attention methods (with or without constrained RPE variants) or, in the molecular case, a Performer without any RPE. The experiments therefore establish that FLT is the best linear-attention RPE method tested, but not where it stands relative to the upper bound of what RPEs can provide when computational cost is not constrained.
Consequence. Without a quadratic-attention baseline, we cannot assess the quality ceiling β how much accuracy is left on the table by FLT's linearization and spectral approximation. On WikiText-103, a standard decoder-only Transformer with T5-style RPE and sequence length 512 would typically achieve perplexity in the mid-to-high 20s (depending on model size and training). If such a model achieves, say, 25.0 perplexity with the same 6-layer, 512-hidden-dim, 8-head configuration, then FLT's 30.1 represents a 5.1 perplexity gap attributable to the combined effect of kernelized linear attention (Performer approximation error) plus spectral RPE approximation (Fourier Monte Carlo error). If instead the quadratic baseline achieves 29.0, FLT's 30.1 looks much more competitive β the 1.1 perplexity gap might be an acceptable price for linear complexity.
The same issue applies to the molecular experiments: how does FLT-12L's 0.5046 eV MAE compare against a standard Graphormer or Transformer with quadratic attention and the same Gaussian-basis RPE? If the quadratic version achieves 0.45 eV, then FLT sacrifices ~0.05 eV for efficiency; if it achieves 0.50 eV, the sacrifice is negligible. The paper provides no way to make this assessment.
Evidence in the paper. No quadratic-attention Transformer baselines appear in any experiment. The related work section (Section 2) discusses quadratic-attention RPE methods (Shaw et al., 2018; Raffel et al., 2020; Shi et al., 2022) but does not implement them as experimental comparisons. Table 3 compares FLT only against Performer without RPE β not against any model that combines quadratic attention with RPE on molecular data.
Mitigation status. Not addressed. The paper does not discuss the absence of quadratic baselines as a limitation. It implicitly frames the comparison as "among linear-attention methods," which is reasonable for evaluating efficiency-accuracy tradeoffs within that class, but it leaves unanswered the question of whether FLT's RPE mechanism recovers enough of the RPE benefit to make linear attention a genuinely competitive alternative to quadratic attention for practitioners who care about absolute performance, not just relative performance within the linear-attention category.
4. Limited Empirical Characterization of the RPE Approximation's Effect on Task Performance
The paper provides a thorough theoretical analysis of the RPE mask approximation: unbiasedness (Theorem 4.1/Theorem A.1), per-entry variance bound (Theorem A.3), and uniform convergence with sample complexity (Theorem 4.2/Theorem A.4). However, these guarantees concern the max-norm error ||N - NΜ||max β the largest absolute deviation in any element of the RPE mask β and the paper never empirically connects this approximation error to downstream task metrics. The chain from "RPE mask approximated to within Ξ΅" to "perplexity improves by Ξ" is not characterized.
Consequence. A practitioner cannot determine whether the theoretical guarantees are practically relevant. Theorem 4.2 says that with r = Ξ(cΒ²/Ρ² log(L/Ξ΄)), every entry of the RPE mask is within Ξ΅ of its true value with high probability. But how small must Ξ΅ be for the task to benefit? If Ξ΅ = 0.01 is sufficient, then the required r is modest and FLT's approximation is essentially lossless. If Ξ΅ must be 0.0001, then r must be 10,000Γ larger β potentially making the approximation cost prohibitive. The paper provides no empirical measurement of the actual RPE mask approximation error during training or at convergence, and no experiment that varies approximation quality (e.g., by varying r) to measure the impact on task metrics.
This gap is particularly significant because the RPE mask enters the attention computation inside an exponential: A = exp(N + QK^T/βd). An error of Ξ΅ in N_ij translates to a multiplicative error of exp(Ξ΅) β 1 + Ξ΅ in the attention weight A_ij (for small Ξ΅). These multiplicative errors compound across the softmax normalization (the division by D = diag(A 1_L)), meaning that a small max-norm error in N could produce larger relative errors in the final attention probabilities, especially for entries where the unnormalized attention score is small. The theoretical analysis does not address this amplification effect, and the experiments do not measure it.
Evidence in the paper. Section 4.2 and Appendix A present theoretical bounds on max-norm error and variance, but no experiment measures ||N - NΜ|| during FLT training or evaluation. The paper does not report whether the RPE approximation error decreases over training (as gΞΈ is learned and better matched to p), stays constant, or exhibits problematic behavior on specific positional differences. Figure 5 visualizes learned attention matrices but does not separate the RPE contribution from the content-based attention for analysis.
Mitigation status. Not addressed. The paper does not acknowledge the gap between theoretical approximation guarantees and empirical task impact, does not suggest diagnostic experiments (e.g., measuring ||N - NΜ|| as a function of r on held-out position pairs), and does not discuss whether the theoretical bounds are tight enough to predict practical r requirements.
5. Domain-Specific RPE Parameterization Without Transferability Analysis
The paper demonstrates FLT on four tasks, but each uses a different, domain-tailored RPE parameterization: Gaussian mixture or local/sinc RPEs for language (Section 5.1, Appendix B.1), Gaussian mixture for images (Section 5.2), Gaussian basis functions (a special case of Gaussian mixture with ΞΌt = 0) for molecules (Section 5.3), and an unspecified parameterization for learnable optimizers (Section 5.4). The paper does not test whether any single parameterization transfers across domains, nor does it provide a principled method for selecting the parameterization given a new task.
Consequence. The claim that FLT is a "general" RPE mechanism (abstract, Section 1: "incorporate a wide range of relative positional encoding mechanisms") conflates the mathematical generality of the Fourier representation (any f with a Fourier transform can be represented) with the practical generality of the learned spectral function (which is constrained by the chosen parameterization). In practice, a practitioner must choose a parameterization for gΞΈ β Gaussian mixture with how many modes? Local RPE with how many radii? Shift-invariant kernel with what kernel family? β and the paper provides no evidence that the same parameterization works across domains or any methodology for making this choice.
The molecular RPE is the most domain-specific: it uses Gaussian basis functions in the spatial domain (f(r) = Ξ£_t w_t/(β(2Ο)Ο_t)Β³ exp(-||r||Β²/(2Ο_tΒ²))), a standard choice in molecular neural networks that directly encodes interatomic distance distributions. This parameterization was chosen because it is conventional in the molecular modeling literature, not because FLT's framework required it. Would the language-modeling local RPE (indicator functions with sinc-based g) work for molecules? Would the molecular Gaussian RPE work for text? The paper does not test these cross-domain transfers, making it impossible to distinguish between "FLT works because its Fourier representation is general" and "FLT works because the authors chose appropriate domain-specific RPEs for each task."
Evidence in the paper. Section 4.3 presents three parameterization families (Gaussian mixture, shift-invariant kernel, local RPE) as options, but provides no guidance on when to use which. Section 5 applies different parameterizations to different tasks without cross-domain testing. The paper does not report experiments where the same FLT configuration (same gΞΈ parameterization, same T, same r) is applied to multiple domains to test generality.
Mitigation status. Partially addressed by the theoretical framework, which establishes that any RPE function with a Fourier transform can be represented β but the gap between "can be represented" (given infinite r and a sufficiently expressive gΞΈ) and "is well-approximated by a specific parameterization with finite r" is not discussed. The paper does not suggest automated parameterization selection, meta-learning across domains, or even heuristics for choosing the parameterization family based on domain properties (dimensionality β, expected spatial scale of interactions, smoothness requirements).
6. Missing Evaluation on Tasks Requiring Long-Range Positional Reasoning
FLT's primary motivation is enabling RPE-enhanced attention in linear-complexity Transformers so that long sequences can be processed with positional inductive biases. However, the main language modeling benchmark (WikiText-103) uses a sequence length of only 512 tokens during both training and evaluation (Appendix B.1: "the sequence length is set to 512 during both training and evaluation"). At this length, standard quadratic attention with RPE is perfectly tractable β 512Β² = 262,144 attention entries per head per layer, which is well within the computational budget of modern hardware. The paper does not evaluate FLT on any task specifically designed to require long-range positional reasoning, such as Long Range Arena (LRA), SCROLLS, or any document-level NLP benchmark.
Consequence. The paper's central value proposition β that FLT enables RPEs for long sequences where quadratic attention is infeasible β is not directly tested. The efficiency measurements (Figure 1) show that FLT scales better than the log-linear Performer at sequence lengths up to 32,768, but these are synthetic timing benchmarks on a single Transformer layer, not end-to-end task evaluations. The perplexity improvement from 31.1 (Performer, no RPE) to 30.1 (FLT, local RPE) at sequence length 512 is a valid signal that RPEs help even at moderate lengths, but it does not demonstrate that FLT's RPE mechanism remains effective when sequences are long enough that the RPE mask must capture truly long-range dependencies β the regime where FLT's linear complexity is actually necessary.
At sequence length 512, a practitioner could simply use standard quadratic attention with T5-style RPE and achieve better perplexity than any linear-attention method, with acceptable computational cost. The case for adopting FLT over standard attention therefore depends on demonstrating that FLT maintains its RPE benefit at sequence lengths where standard attention is not an option. The paper does not make this demonstration: WikiText-103 at L = 512 is a regime where efficiency is nice-to-have but not necessary, and the long-sequence benchmarks where efficiency is essential (LRA, genomic sequences, long-document QA) are absent.
Evidence in the paper. Appendix B.1 confirms L = 512 for language modeling. Figure 1 measures efficiency at longer sequences but only for a synthetic single-layer benchmark, without perplexity or accuracy evaluation. The molecular experiments (Section 5.3) are the only task where the sequence length might genuinely require linear attention β the paper does not report L for the OC20 IS2RE task, but molecular systems can contain hundreds or thousands of atoms, making quadratic attention potentially expensive. However, even here, the comparison is only against Performer without RPE, not against any quadratic-attention-with-RPE baseline, so we cannot assess whether FLT's RPE benefit at large L exceeds what standard attention could achieve if computation were unconstrained.
Mitigation status. Not addressed. The paper does not discuss the mismatch between its motivation (long sequences requiring linear complexity) and its primary evaluation regime (moderate-length sequences where quadratic attention is feasible). It does not flag the absence of long-range benchmarks as a limitation or suggest them as future work.
7. Implications and Future Directions
How This Work Changes the Landscape
The primary conceptual shift FLT introduces is methodological rather than performance-oriented: it establishes that spectral representations can convert pairwise functions β which naively cost to evaluate β into per-token feature maps costing without imposing structural constraints on the function itself. This is not a faster implementation of an existing algorithm; it is a different category of solution that sidesteps the problem that had bottlenecked prior work.
Before FLT, the dominant approach to incorporating RPEs into linear attention was structure exploitation: each method identified a specific property of the RPE mask (Toeplitz structure for SineSPE/ConvSPE, FFT-accelerated matrix-vector multiplication for the log-linear Performer) and built an efficient algorithm around that property. The consequence was an uncomfortable tradeoff between generality and efficiency β methods that handled more kinds of data (by imposing fewer assumptions) tended to be less efficient or fail entirely on certain data modalities. The log-linear Performer (Luo et al., 2021; Choromanski et al., 2022a) represented the ceiling of this approach for sequential data, but its complexity and heavy memory footprint (Figure 1: ~25 GB at sequence length 32,768 vs. ~4β5 GB for FLT) made it impractical for very long sequences, and its structural dependence on Toeplitz masks rendered it inapplicable to geometric data where positions are vectors in for .
FLT reframes the problem entirely. Instead of asking "what structure does the RPE mask have that we can exploit?", it asks "in what domain does automatically have a factorized representation?" The answer β the spectral domain, via the Fourier integral β is always valid, requiring only that the RPE function possess a Fourier transform (an extremely mild condition). The key algorithmic consequence is that the complexity of incorporating RPE becomes independent of any spatial-domain structure. The same FLT attention module (Algorithm 1) processes 1D text indices, 2D image patch coordinates, and 3D atom positions without modification β only the dimensionality of the positional feature vectors changes, and the Fourier machinery handles this trivially.
This changes the landscape for at least three classes of research:
1. Linear attention research can now treat RPEs as a solved component rather than an open problem. Prior to FLT, any new linear attention mechanism had to either (a) omit RPEs entirely, accepting a representational disadvantage, or (b) develop its own bespoke RPE integration, typically requiring structural assumptions that limited generality. FLT provides a drop-in RPE mechanism β concatenate with the query/key features and apply any kernelized attention β that works with any linear attention variant. This decouples progress on better linear attention kernels (new maps, better variance reduction, structured approximations) from progress on positional encoding. Researchers working on kernel design no longer need to solve the RPE problem as a prerequisite to evaluating their attention mechanism on tasks where positional information matters.
2. The scope of problems amenable to efficient Transformers expands to include geometric data with pairwise relational structure. The molecular modeling experiment (Section 5.3, Table 3) demonstrates this concretely: FLT-12L achieves 0.5046 eV energy MAE on OC20 IS2RE versus 0.5454 for a Performer without RPE, a 7.5% relative reduction that directly results from incorporating geometric positional relationships. Prior to FLT, a practitioner faced an unpalatable choice for molecular Transformer models: either use quadratic attention with RPE (and suffer scaling, limiting the system size), or use linear attention without RPE (and lose the geometric inductive bias). FLT removes this tradeoff. This opens the door to applying efficient Transformers to broader classes of geometric deep learning problems β protein structure prediction, materials simulation, point cloud processing, mesh analysis β where the number of elements can be large and the positional relationships (encoded via pairwise distances, angles, or graph distances in ) are critical for performance.
3. The spectral representation principle generalizes beyond RPEs. The paper's core mathematical machinery β representing a pairwise function as an expectation β applies to any pairwise function that can be expressed as a function of the difference . This includes not just positional encodings but any mechanism that modulates pairwise attention scores based on token metadata: relative timestamps in time-series forecasting, edge features in graph neural networks (where could be replaced by edge attribute vectors), or distance-based decay functions in spatial attention. By learning in the spectral domain, any such pairwise modulation can be incorporated into linear attention at cost. The paper does not explore these extensions, but the framework makes them natural next steps.
The magnitude of this contribution is best characterized as a reframing with practical consequences, not a paradigm shift. FLT does not change how we think about attention fundamentally (the attention mechanism itself is unchanged), nor does it introduce a new class of architectures (FLT is a Performer with a specific feature concatenation). What it does is remove a bottleneck that had previously forced a choice between two desirable properties (linear complexity and positional encoding) by showing that the bottleneck was an artifact of working in the wrong domain. The practical benefits β memory reduction over the log-linear Performer at long sequences, applicability to 3D data where no prior method works β are substantial but incremental relative to the state of the art in linear attention. The conceptual benefit β establishing spectral-domain feature maps as a general strategy for incorporating pairwise functions into efficient attention β may prove more impactful in the long run as researchers extend the principle to other pairwise mechanisms.
Follow-Up Research This Work Enables
Spectral representations for arbitrary pairwise attention biases beyond position. The paper's Fourier integral trick works for any function of the form where has a Fourier transform. But the same mathematical structure β represent a pairwise function as an expectation over one-dimensional projections β extends to any function that can be expressed via an integral transform with a factorized kernel. Concretely, what happens when is not a position but an arbitrary token metadata vector (e.g., a learned embedding, a domain tag, a timestamp, or an edge feature from a knowledge graph)? The FLT framework would construct from these metadata vectors using the same feature maps (Theorem 4.1), learning to encode task-relevant pairwise relationships. A strong follow-up would test this on a graph reasoning task where edge features carry critical information (e.g., molecular property prediction with bond types as edge attributes, or social network link prediction with relationship metadata). The key measurement would be whether FLT's learned spectral function can recover known relational patterns (e.g., "atoms connected by double bonds interact more strongly than those connected by single bonds") without explicit edge-type conditioning, as a function only of the metadata difference vectors.
Characterizing the empirical βaccuracy tradeoff with diagnostic approximation metrics. The paper provides theoretical bounds (Theorem 4.2: for max-norm error ) but never measures how approximation quality affects downstream task performance. A critical follow-up experiment would be an -sweep on WikiText-103 at multiple sequence lengths, measuring three quantities simultaneously: (1) validation perplexity, (2) the actual max-norm RPE approximation error computed on a held-out set of position pairs, and (3) the variance of the RPE estimate across multiple resamplings of the random frequencies . The experiment would reveal the practical saturation point β the beyond which increasing the number of random features yields diminishing perplexity returns β at different sequence lengths. This would directly test Theorem 4.2's prediction that needs to grow only logarithmically with to maintain a fixed , and would provide concrete guidance for practitioners: "for sequence length , use to stay within 0.1 perplexity of the infinite- limit." The paper's current choices ( at for text, for molecules) are unexplained and potentially either wasteful or insufficient.
FLT with discrete or structured RPEs: stress-testing the smoothness assumptions. The paper tests only smooth RPE functions β Gaussian mixtures, Gaussian basis functions, and sinc-based local RPEs β all of which have rapidly decaying or well-behaved Fourier transforms. What happens when the true RPE function is discrete, such as the standard T5-style learned scalar per relative offset where each is an independent parameter? The Fourier transform of such a function is a sum of Dirac delta impulses β not representable by a smooth with finite Gaussian modes. A worthwhile stress-test experiment would compare FLT (using a Gaussian mixture with varying ) against standard learned relative position biases on a task where discrete RPEs are known to work well (e.g., machine translation with T5, or the original Shaw et al. (2018) relative position representations). The experiment would reveal whether FLT's smooth spectral representation can approximate discrete RPEs adequately with enough Gaussian modes, or whether genuinely discrete RPEs require a different spectral parameterization (e.g., a sum of Dirac deltas in , corresponding to periodic complex exponentials in the spatial domain). A negative result β FLT underperforming discrete RPEs even with large β would clarify the boundary of FLT's applicability and motivate hybrid approaches where some RPE components are learned discretely and others via the spectral representation.
Replacing the Gaussian with a learned neural sampler for variance reduction. Theorem A.3 shows that the variance of the RPE estimate depends on the constant , and Appendix A.4 notes that the optimal choice is β sampling frequencies where the Fourier transform has large magnitude. The paper experiments with fixed Gaussians and, for molecules, learnable-variance Gaussians, but these are restricted to a parametric family that may not match well. A natural extension is to use a normalizing flow or other flexible density estimator as the sampling distribution , trained jointly with to minimize the variance of the RPE approximation (or a downstream task loss). The training objective would include a term encouraging to place high density where has large magnitude, approximating the optimal . The experiment would measure whether learned enables using smaller for the same perplexity (directly testing whether variance reduction translates to sample efficiency) and whether the learned converges to the theoretically optimal form. A negative result (learned provides no benefit over fixed Gaussian ) would suggest that the current Gaussian parameterization is already sufficient for the smooth RPE functions used in practice, simplifying deployment.
Long-range benchmarks with FLT at scale. The paper's primary perplexity evaluation uses WikiText-103 at sequence length 512 β a regime where quadratic attention with RPE is perfectly tractable. The central motivation for FLT (combining linear attention with RPEs for long sequences) is therefore not directly tested. A crucial follow-up would evaluate FLT on Long Range Arena (LRA) or a document-level modeling benchmark (e.g., PG-19, SCROLLS, or a long-context QA task) with sequence lengths ranging from 2,048 to 16,384 tokens. The experiment would compare FLT against: (a) a regular Performer without RPE (to measure the RPE benefit at long range), (b) a standard Transformer with quadratic attention and RPE at the longest length feasible within memory constraints (to establish the ceiling), and (c) the log-linear Performer where applicable (to compare against the strongest prior RPE-enhanced linear attention). The key measurement is whether FLT's RPE benefit grows, shrinks, or stays constant as sequence length increases. If the RPE benefit diminishes at long range (because the learned positional function decays with distance, making distant RPE entries near-zero and thus less impactful), then the primary motivation for FLT over a plain Performer is weaker than the paper implies. If the benefit persists or grows (because long sequences have more opportunity for positional structure to matter), the case for FLT is substantially strengthened.
Cross-domain parameterization transfer and automated selection. The paper uses different RPE parameterizations for different domains (local RPE for text, Gaussian mixture for images, Gaussian basis functions for molecules) but never tests whether the same parameterization works across domains or establishes criteria for choosing one. A well-designed experiment would fix a single parameterization (e.g., Gaussian mixture with ) and evaluate FLT on all three domains (text, images, molecules) without modification, compared against domain-specific parameterizations. The result would answer: is the Fourier representation's generality sufficient to make the parameterization choice secondary, or does domain-specific design of remain critical? A strong follow-up would also explore learned parameterization selection: meta-learning a small hypernetwork that takes task metadata (dimensionality , expected spatial scale, data modality) and outputs a good initialization for 's parameters, amortizing the cost of manual parameterization design across tasks.
Practical Applications and Downstream Use Cases
1. Large-scale molecular dynamics and materials simulation with geometric inductive biases. The OC20 IS2RE results (Table 3: 0.5046 vs. 0.5454 eV MAE, 7.5% reduction) demonstrate that FLT can incorporate 3D geometric RPEs into linear-complexity attention, a capability no prior method provides. For molecular dynamics simulations involving thousands or tens of thousands of atoms β protein-ligand binding, catalyst surface reactions, electrolyte simulations β standard quadratic attention with RPE would require computation per attention layer, making it infeasible for large systems or long trajectories. FLT reduces this to while preserving the geometric inductive bias that the RPE provides. A 12-layer FLT processing 10,000 atoms with , , , and 48 heads performs attention in roughly operations per head, versus for quadratic attention β a ~6,000Γ reduction in the attention cost at this scale. The practical benefit is that simulation workflows that previously had to choose between fast-but-inaccurate models (without geometric RPE) and accurate-but-slow models (with quadratic attention and RPE) can now have both.
2. Long-document NLP with positional structure at scale. The WikiText-103 results (Table 1: 30.1 perplexity with local RPE vs. 31.1 for Performer without RPE) demonstrate that FLT's RPE provides meaningful accuracy gains even at moderate sequence lengths (512). At longer sequence lengths β processing entire documents, books, or legal contracts as single sequences β the efficiency difference becomes critical. For tokens, the memory measurements in Figure 1 show FLT using ~4β5 GB versus ~25 GB for the log-linear Performer (the strongest prior RPE-enhanced linear attention) and infeasible memory for quadratic attention. A document-processing pipeline using FLT can ingest entire articles or long reports in a single forward pass, leveraging RPEs to capture section structure, paragraph boundaries, and long-range coreference relationships, without the memory explosion that would force chunking or truncation. The 1.0 perplexity improvement over RPE-free Performers translates directly to better language modeling quality, which in turn improves downstream generation, summarization, and retrieval tasks.
3. Real-time video and volumetric data processing with learned spatial priors. The image classification results (Table 2: 77.4% vs. 75.1% ImageNet top-1 vs. Performer) demonstrate that FLT's RPE mechanism improves performance on 2D spatial data. For video understanding β where tokens correspond to spatio-temporal patches in coordinates β FLT can incorporate 3D relative positional encodings that capture both spatial proximity and temporal ordering simultaneously. A video Transformer with frames Γ patches = 3,136 tokens already pushes the limits of quadratic attention ( entries per head); at higher resolutions or frame rates, linear attention becomes necessary. FLT's spectral RPE on (spatial + temporal) can learn that nearby-in-space-and-time patches should attend to each other, without requiring the model to discover this from data alone. The 1.2 percentage point improvement over the strongest no-RPE baseline (CosFormer, 76.2%) on images suggests that comparable or larger gains would transfer to video, where spatio-temporal structure is even more critical.
4. Learnable optimization with memory of the optimization trajectory. The learnable optimizer experiments (Figure 3: FLT-based optimizer outperforming S4, LSTM, and Performer baselines on both ViT training and Rastrigin optimization) demonstrate FLT's effectiveness as a memory mechanism in meta-learned optimization, where the Transformer attends over a history of gradient steps, parameter updates, and loss values. The RPE mechanism encodes temporal relationships β recent gradient steps are typically more relevant than distant ones β and FLT learns the optimal temporal attention pattern through . For training large models where the optimization trajectory spans thousands of steps and the optimizer's context window must be long enough to capture learning rate schedule transitions, loss plateau detection, and gradient noise patterns, FLT's linear complexity ensures that the optimizer's overhead remains proportional to the context length rather than growing quadratically. The ~1β2 percentage point accuracy improvement over the S4-based optimizer on ViT-Base ImageNet training (Figure 3, left) suggests that better positional encoding of the optimization history directly translates to better optimization decisions and ultimately better final model quality.
When to Prefer This Method
The paper is primarily a methods contribution that advances the state of the art in RPE-enhanced linear attention without explicitly positioning FLT against a broader set of alternatives across different deployment regimes. However, several decision boundaries emerge from the experimental results and theoretical properties:
-
Prefer FLT when the data has geometric positional structure beyond 1D sequences. For 3D molecular data, point clouds, or any domain where positions are vectors in for , FLT is the only demonstrated method for incorporating RPE into linear attention. Prior methods (SineSPE, ConvSPE, log-linear Performer) cannot operate in these settings because they exploit Toeplitz structure specific to 1D indices. The molecular experiments (Table 3) directly support this: no prior RPE-enhanced linear attention baseline exists for comparison.
-
Prefer FLT over the log-linear Performer when memory is the binding constraint. At sequence length 32,768, FLT uses ~4β5 GB peak memory versus ~25 GB for the log-linear Performer (Figure 1, right) β a ~5Γ reduction. The forward time advantage is more modest (~2Γ at 32,768 tokens, Figure 1 left). For long-sequence batch processing on memory-limited hardware (edge devices, single GPUs), FLT's linear space complexity with small constants is the decisive factor.
-
The FLT-vs-standard-Performer choice depends on the importance of positional information for the task. FLT consistently outperforms the regular Performer (no RPE) across all tested tasks: +1.0 perplexity on WikiText-103 (Table 1), +2.3% ImageNet accuracy (Table 2), +0.04 eV energy MAE on OC20 IS2RE (Table 3). The parameter overhead is negligible (< 0.03M). If the task requires any positional reasoning β which includes essentially all sequential, visual, and geometric data β adding FLT's RPE mechanism to a Performer appears to be a strictly beneficial modification with minimal cost. The only reason to prefer a plain Performer would be if the RPE mechanism introduces training instability or implementation complexity that outweighs the accuracy gain, and the current paper provides no evidence of such instability (though it also doesn't stress-test this across many seeds or hyperparameters).