Elamur Research

Random Feature Attention

Paper · 2021 · Hao Peng, Nikolaos Pappas, Dani Yogatama et al.

Summary

Attention lets a system use relevant information from elsewhere in a sequence. Its strength is also its computational burden: a query can be compared with every available key, so longer inputs create increasingly large collections of interactions. Random Feature Attention, or RFA, investigates whether much of this behavior can be obtained without explicitly calculating and storing those interactions. The paper approaches transformer attention through kernel approximation, replacing expensive pairwise calculations with products between randomly constructed feature representations. This changes how information is accumulated and retrieved while preserving the interface through which attention receives queries, keys, and values.

The central construction separates information about the context from information about the current query. Keys and values contribute to a shared matrix, while keys also contribute to a normalization vector. Each query reads from these summaries. For autoregressive generation, where outputs arrive successively, the summaries can be updated recurrently rather than rebuilding attention over an expanding history. The authors also introduce RFA-Gate, which learns how much previous state to retain. This gives the system an explicit preference for recent information when that preference helps the task. The additional parameter count remains below 0.1%.

Experiments cover language prediction, translation, and classification of long sequences. On WikiText-103, ungated RFA trails the conventional transformer, but its gated Gaussian version improves on the baseline under both tested system sizes by at least 1.2 perplexity. In translation, replacing decoder attention while retaining conventional encoder attention produces similar BLEU scores and substantially faster generation: every tested RFA variant exceeds a 1.8× decoding speedup. In the long-sequence experiments, RFA performs competitively across ListOps, IMDb, and citation prediction using the ACL Anthology Network. Its reported IMDb accuracy is 66%, and its speed advantage depends strongly on sequence length.

The paper’s strongest efficiency results concern generation over long histories. In a controlled conditional-generation experiment with 2,048-length inputs and outputs, RFA runs around 12× faster than the conventional attention baseline while requiring less than 10% of its memory. These findings have important boundaries. Short-context language-prediction training receives no speed benefit and is around 15% slower because feature construction adds overhead. Furthermore, mathematical motivation does not make trained attention functions interchangeable: replacing one with the other after training causes severe translation-quality losses. RFA succeeds as a trainable alternative with a useful computational structure, rather than as a universally interchangeable numerical substitute for an already trained softmax operation.

Interesting ideas

Reorganize computation around shared summaries. An expensive collection of pairwise interactions may contain a reusable aggregate. RFA makes that aggregate explicit by combining transformed keys with values before a query arrives. The same reasoning can help with streaming statistics, repeated retrieval, and document analysis: identify what remains constant across requests, summarize it once, and reserve request-specific work for the final readout. The crucial condition is that the desired operation admits this rearrangement without discarding information needed by the task.

Separate total work from experienced latency. A better asymptotic operation count does not guarantee faster execution in every setting. The paper distinguishes sequential generation from training with known inputs, where many calculations can run concurrently. This distinction is useful whenever an algorithm moves between batch processing and interactive use. Efficiency reports should identify the execution regime, available parallelism, and auxiliary computation, because the same mathematical transformation can produce very different practical outcomes across those conditions.

Make forgetting an explicit design choice. RFA-Gate introduces a controlled way to reduce the influence of earlier information. Its benefit is task dependent: language prediction gains substantially, whereas translation shows little improvement. The reusable idea is to expose retention as an operation that can be inspected and tested. Streaming analysis, dialogue state, and changing statistical environments all raise the same question: should old observations remain equally influential, or should current evidence gradually replace them?

Test interchangeability independently from task quality. Similar benchmark scores do not establish that different components implement the same internal computation. The authors test this directly by exchanging attention functions after training, then separately examine recovery through further training. This distinction applies to approximate numerical routines, learned replacements for symbolic modules, compressed representations, and alternative parsers. A replacement can support a successful complete system while remaining incompatible with parameters or assumptions learned around the original component.

Treat representation size as a reliability parameter. Random features have a measurable approximation variance, but their size also affects memory, speed, and whether training converges. The paper therefore studies feature size instead of presenting compression as an unconditional benefit. This is a useful pattern for sketches, compact indexes, sampled statistics, and bounded working memories. The representation budget should be chosen against an observable failure criterion, with diminishing returns measured rather than assuming that either maximum compression or maximum size is preferable.

Use controlled comparisons to explain gains. The paper varies feature maps, gating, state persistence, and attention replacement while keeping the surrounding experimental setup comparable. It also fixes decoding batch size and gives the conventional baseline a cache. These choices make the comparison more informative than a single headline speed figure. The general lesson is to separate changes in representation, computation, available context, and resource allocation so that an improvement can be attributed to the mechanism that produced it.

Deep dive: Random Feature Attention

Random Feature Attention replaces pairwise softmax calculations with compact recurrent summaries, improving decoding speed and memory use. · about 39 minutes to read

How Mova uses it

Mova is a small, transparent language system written in Rust. Its native understanding follows dependency structure into frames and a maintained world; its default parser is an averaged perceptron rather than a neural attention system. A separate GPU parser uses a transformer, but the evidence available for Mova does not establish an RFA implementation or an application measurement for this paper. The connections below are therefore proposals assessed against documented mechanisms. The status labels describe that comparison; they do not establish that a proposal has been implemented or that the paper’s results transfer to Mova.

Idea: Search for reusable summaries before repeating pairwise work. Where: Random Feature Attention. Area: algorithms and data processing. Mova: частково є (the dictionary occurrence index stores reusable counts and feature summaries in tools/dictindex). RFA suggests a general audit of operations that repeatedly compare a request with the same accumulated evidence. Mova could identify which parts depend only on the source collection and prepare those separately. Its existing index already follows part of this pattern, although its summaries are discrete corpus statistics rather than random-feature attention states. Any further compression would need to preserve the evidence required by downstream queries.

Idea: Keep query-specific work outside context accumulation. Where: Random Feature Attention, the rearranged attention expression. Area: architecture. Mova: частково є (tools/dictindex separates corpus import from example retrieval). The paper’s separation between constructing a context summary and reading it with a query could guide additional interfaces for retained document knowledge. A source-bound preparation stage could expose a stable observation object to several question readers. This is an architectural analogy, not a claim that frame reasoning can be reduced to the paper’s algebra. Its usefulness would depend on whether repeated questions actually share enough preparation work.

Idea: Explore random-feature attention only behind an explicit experimental boundary. Where: Random Feature Attention and Complexity Analysis. Area: GPU parsing. Mova: нове. The separate gparse transformer offers a possible location for a controlled attention experiment, but there is no evidence that it currently uses RFA. A candidate would need comparison against the existing parser on parsing quality, memory, and elapsed time, instead of relying on translation results. Why Mova: it could reveal whether long-input neural parsing benefits from compact attention while leaving native rule-based understanding independently assessable.

Idea: Describe an approximation through its observable contract. Where: Random Feature Methods and Random Feature Attention. Area: mathematical modeling. Mova: частково є (groupants, executable approximants, and typed correspondence checks). The paper distinguishes a kernel estimator from the complete normalized attention operation and from a trained system’s behavior. Mova could encode those as separate observations, with explicit domains and failure conditions. Its existing modeling tools support this style of declaration, but no RFA-specific contract is established. This would prevent a theorem about one intermediate quantity from being treated as proof of equivalence for an entire pipeline.

Idea: Make representation budget part of acceptance. Where: Effect of Random Feature Size. Area: statistics and resource control. Mova: частково є (bounded worker execution and job resource estimates). The paper’s feature-size analysis shows that a smaller internal representation can undermine convergence before it becomes an acceptable efficiency tradeoff. Mova could apply the same discipline to bounded graph observations, retrieval summaries, or experimental numerical sketches. A configuration would be admitted only after its quality and resource behavior had been measured together. Existing budgets establish operational limits; they do not by themselves establish sufficient representational capacity.

Idea: Keep sampling variance distinct from downstream error. Where: Variance of Random Fourier Features. Area: statistics. Mova: нове. An experimental random-feature component could report the estimator’s mathematical variance separately from observed parsing or answering errors. The variance formula concerns a kernel estimate under stated assumptions, whereas downstream errors depend on the whole system. Why Mova: this separation fits Mova’s requirement that an approximation retain a reason and a declared scope, and it would prevent a compact numerical guarantee from being overstated as an answer-quality guarantee.

Idea: Test the cost of preparing an approximation. Where: Complexity Analysis and Language Modeling. Area: performance evaluation. Mova: частково є (tools/twin records predictions and measured runs; dictionary-index measurements distinguish cache scope and startup). RFA’s slower short-context training shows why preparation work belongs in efficiency accounting. Mova could explicitly measure feature construction, graph preparation, or index decoding alongside the operation they accelerate. The transferable mechanism is complete accounting of the relevant execution path. The paper supplies no evidence that random features would accelerate Mova’s present workloads.

Idea: Separate sequential latency from batch throughput. Where: Complexity Analysis and Detailed Complexity Analysis. Area: evaluation. Mova: частково є (CPU and GPU execution modes have distinct stage contracts and measurements). Mova could classify each performance claim by whether inputs are available together or arrive through successive dependent steps. A worker’s interactive response and a corpus batch may stress completely different bottlenecks. The paper gives a concrete reason for this distinction: parallelized conventional attention can conceal work that becomes expensive during generation. Existing execution modes provide a place to record the distinction, but the corresponding workload audit remains unverified.

Idea: Make recency a declared policy for working attention. Where: RFA-Gate: Learning with Recency Bias. Area: context management. Mova: нове. A bounded context reader could experiment with declining activation for older observations while keeping their original records intact. This would be a policy for selecting working evidence, not a revision of source facts. Why Mova: the system distinguishes durable knowledge from operationally useful information in RAM, so recency could help prioritize current context without silently deleting provenance or changing the narrative world.

Idea: Test forgetting separately for each task family. Where: Language Modeling and Machine Translation. Area: evaluation. Mova: частково є (regression-gated extensions and task-specific school assessments). The paper’s gate helps one task much more than another. Mova could therefore require separate evaluations before enabling any recency policy for story questions, dictionary evidence, or worker observations. A policy that improves current-task focus might damage questions about earlier events. Existing regression gates already support task-sensitive admission, but no measured recency policy is documented.

Idea: Update paired summaries consistently. Where: RFA-Gate: Learning with Recency Bias. Area: state integrity. Mova: частково є (tools/dictindex publishes payload references, directory updates, and cursors through coordinated storage operations). In gated RFA, both the value-bearing state and its normalization state receive the corresponding retention update. The general lesson is that related accumulators must describe the same evidence population. Mova could use this as a review criterion for incremental counts and retained observations. Its storage already coordinates related changes, although that is not an implementation of the paper’s recurrence.

Idea: Distinguish bounded state from complete memory. Where: causal Random Feature Attention and Related Work. Area: knowledge representation. Mova: частково є (the knowledge architecture separates skeleton, important graph, and durable global graph). RFA can carry information beyond a local block through a fixed-size state, but that state is not a verbatim record of the history. Mova could use a similar distinction when describing retained observations: compact working state supports computation, while source records support inspection and recovery. This connection reinforces an existing separation rather than demonstrating a new retention capability.

Idea: Evaluate fresh reading and retained-state reading separately. Where: Language Modeling, the stateful RFA experiment. Area: learning evaluation. Mova: вже є (world retention assessments and the fast reader distinguish fresh processing from prepared-graph use). Passing state between batches changes the information available to the system. The paper measures that setting separately rather than folding it into the ordinary block-based comparison. Mova’s documented fresh-process examinations and fast-reading comparisons already embody the relevant distinction. The useful borrowing is continued discipline about naming what was retained and which information was available at answer time.

Idea: Compare alternative feature families under a shared interface. Where: Discussion, Gaussian and arc-cosine variants. Area: experimental design. Mova: частково є (executable approximants and typed observations provide comparison machinery). Mova could expose competing statistical representations behind the same source-bound query contract, then measure their behavior under matching conditions. The paper shows why a shared interface is useful: feature families differ in size, stability, and performance despite serving similar roles. An interface match would not establish semantic equivalence, so corresponding observations and failure cases would still need explicit checks.

Idea: Test normalization as its own mechanism. Where: Discussion, the connection with fast weights. Area: mathematics and statistics. Mova: нове. The authors identify output normalization as a difference between RFA and related temporal-memory constructions but leave its role unresolved. Mova could investigate analogous normalization choices in experimental evidence aggregation, keeping raw counts and normalized scores independently inspectable. Why Mova: transparent scoring benefits from knowing whether a decision changed because evidence changed or because the denominator changed. The paper offers a research question instead of a demonstrated benefit for symbolic reasoning.

Idea: Learn only a narrow calibration layer when possible. Where: Discussion, learned random-feature variance. Area: parameter learning. Mova: частково є (school learners retain feature weights and role parameters separately from compiled seeds). RFA keeps random base directions fixed while learning a smaller scale vector. The general idea is to separate a stable representation from a limited adaptive calibration. Mova could test narrow parameter changes before revising broader rules, using its existing held-out gates. The mathematical role of RFA’s scale vector should not be equated with Mova’s current learned weights; the connection concerns controlled adaptation.

Idea: Prevent dependence on an accidental randomized representation. Where: Experimental Details, the pool of projection matrices. Area: robustness. Mova: нове. For any future randomized sketch or feature component, Mova could compare behavior across declared fixed projections before accepting a configuration. Training-time variation in the paper aims to discourage excessive specialization to one projection. Why Mova: robustness across controlled representations would help distinguish a stable gain from a fortunate random choice, while fixed seeds and recorded configuration identities could preserve reproducibility.

Idea: Move avoidable random-generation work out of the critical path. Where: Experimental Details. Area: data processing and execution. Mova: частково є (compiled global tables move preparation to build time). The authors prepare a matrix pool before training to avoid repeated Gaussian-sampling overhead. Mova already uses an analogous timing decision for declarative knowledge, compiling seeds into executable tables. Further candidates could be assessed by asking whether preparation can occur once without invalidating the later operation. This is a general scheduling principle; it does not imply that random matrices and compiled linguistic rules have the same evidential status.

Idea: Match training-time variation with a stable evaluation contract. Where: Experimental Details, test-time projection selection. Area: reproducibility. Mova: вже є (fixed seeds, deterministic inference, and repeated-run equality checks). The paper varies projections during training but fixes their use during evaluation when further variation provides no accuracy benefit. Mova’s existing determinism requirements already support the relevant separation. A future randomized training path would still need to record exactly which artifacts determine inference, so reproducibility would be established by the evaluated configuration rather than assumed from the training procedure.

Idea: Test task success and component interchangeability separately. Where: Train and Evaluate with Different Attention Functions. Area: evaluation. Mova: частково є (GPU stages are distinguished as exact or measured approximants; correspondence tools check declared observations). Mova could require both an end-to-end task comparison and an interface-substitution test when replacing a reader or numerical component. RFA demonstrates that similar complete-system scores can coexist with severe substitution failure. Existing approximation contracts provide a foundation, but no evidence establishes that every Mova replacement receives this particular diagnostic.

Idea: Compare inherited parameters with deliberate resets. Where: Knowledge Transfer from Softmax Attention to RFA. Area: training analysis. Mova: нове. When testing an alternative learner or representation, Mova could compare retaining existing parameters against resetting the parameters closest to the changed component. The paper uses that control to investigate what actually transfers across attention functions. Why Mova: it could prevent crediting inherited rule weights or feature parameters for a gain that comes from retraining the surrounding system. Such a comparison would remain offline and separate from assessment answering.

Idea: Measure recovery as well as immediate substitution failure. Where: Knowledge Transfer from Softmax Attention to RFA. Area: adaptation evaluation. Mova: частково є (reviewed supervision and later training are separate admitted operations). A changed component may initially fail while still offering an economical adaptation path. Mova could record immediate compatibility, recovery cost, and final held-out behavior as different outcomes. Its workflow already separates proposed material from admitted training, but no RFA-style recovery experiment is documented. This would help distinguish an unusable direct replacement from a promising revision that requires controlled relearning.

Idea: Give the baseline its normal optimizations. Where: Analysis, Notes on Decoding Speed. Area: benchmarking. Mova: частково є (benchmark documentation and measured execution profiles). The authors cache earlier representations for conventional attention instead of comparing against an unnecessarily slow implementation. Mova could apply the same standard to index queries, parser runs, and worker dispatch: compare realistic configurations with their ordinary reusable state. This principle matters because a proposed optimization can appear effective merely by reproducing an optimization missing from the baseline. Existing measurements support fair comparison, but each benchmark still needs its own configuration audit.

Idea: Hold resource allocation constant before exploring maximum throughput. Where: Analysis, Notes on Decoding Speed. Area: systems evaluation. Mova: частково є (bounded jobs record estimates and actual resource use). RFA could exploit larger batches, but the authors first compare equal batch sizes. Mova could similarly separate equal-resource comparisons from experiments that let each implementation use its largest feasible allocation. Both answer useful questions. Their results should remain distinct so that a speed claim identifies whether it comes from a better operation, more concurrency, or a different memory budget.

Idea: Preserve evidence after compressing operational state. Where: Random Feature Attention and the causal-state construction. Area: interpretability and storage. Mova: частково є (worker receipts, retained source identities, dictionary postings, and durable knowledge provenance). Compact numerical state makes efficient computation possible but does not expose individual supporting passages in the way a source record does. Mova could require an inspectable evidence path alongside any experimental compressed observation. This is particularly relevant to its rule that answers retain reasons. The paper demonstrates efficient aggregation, not a provenance system, so preserving source witnesses would be an additional Mova requirement.

Idea: Report accuracy, latency, and memory as separate outcomes. Where: Long Text Classification and Complexity Analysis. Area: evaluation. Mova: частково є (tools/twin, CPU/GPU agreement reports, and dictionary-index measurement records). The paper’s strongest argument depends on a combination of acceptable task performance and resource savings. Mova could present the same dimensions separately for candidate algorithms rather than reducing them prematurely to one score. A fast method that damages a rare but important class of questions may be unsuitable, while a quality improvement may justify extra cost. The decision requires declared priorities and measured task behavior.

These proposals preserve the paper’s distinction between an efficient computational representation and the behavior learned around it. For Mova, the broadest value lies in evaluation design, bounded-state contracts, and honest accounting of approximation. Direct adoption of neural attention would be a narrower experiment within the separate GPU path.

The problem and its context

The paper addresses a tension inside attention-based sequence processing. A system should be able to connect information even when relevant positions are far apart. Conventional attention provides that flexibility by scoring a query against the available keys, then combining their associated values. The scoring operation has no inherent requirement that useful information be nearby. This makes attention attractive for tasks where a later decision depends on an earlier expression or on a distant part of another sequence.

The cost follows from the number of interactions. With a complete sequence of queries and a complete sequence of keys, the calculation involves a grid of comparisons. Increasing sequence length enlarges both dimensions in self-attention. During generation, the problem appears incrementally: every new output requires another decision over an expanding prefix. Previously computed representations can be cached, but a fresh query must still examine the available history.

The authors place their contribution within a broader effort to create efficient sequence-processing systems. Their concern is practical as well as asymptotic. Some existing approaches reduce the growth rate of computation but introduce extra operations that weaken their advantage on moderately sized inputs. An algorithm that becomes attractive only for extremely long sequences may leave common generation workloads mostly unchanged. RFA aims to improve those workloads while also benefiting from longer contexts.

The paper traces the attention foundation to Bahdanau and colleagues’ translation work and the dot-product transformer architecture of Attention Is All You Need. Its review then distinguishes several approaches to reducing attention costs. Sparse attention restricts which positions interact. Those restrictions can be specified beforehand or learned. Sparse Transformers and Longformer belong to the surrounding discussion of approaches for long sequences.

A different strategy compresses the context along its sequence dimension or stores information in a limited memory module. These approaches reduce the effective amount of history that attention must inspect. RFA is related to that motivation, but its summary comes from a particular algebraic rearrangement: transformed keys and values are combined into a state that can subsequently be queried. The compression is therefore built into the attention calculation rather than attached as an independently described memory store.

The mathematical background comes from random-feature methods for kernel approximation. A kernel evaluates a relationship between inputs, potentially corresponding to a dot product in a richer representation space. Random features make a finite representation explicit so that an ordinary inner product approximates that relationship. The paper builds on earlier work using this approach for Gaussian kernels and for softmax-related calculations.

The authors also discuss a closely related linear-attention approach using the feature transformation ELU plus a constant. That work motivates RFA’s causal recurrence, but the controlled experiments show that the feature transformation matters greatly. A recurrent attention interface alone does not determine predictive quality. The paper’s contribution is consequently both computational and representational: it chooses features with a kernel interpretation and evaluates them in several attention settings.

Finally, the context includes recurrent networks and fast-weight memories. A recurrent state makes history available through an update rather than repeated direct inspection. Fast weights similarly connect temporal memory with rapidly changing internal associations. RFA draws on these connections to introduce gating, while retaining a normalization term inherited from its softmax motivation. That combination gives the paper a broader question than whether attention can be calculated cheaply: what useful architectural choices become available once attention is expressed as a state update?

The method, step by step

The easiest way to understand RFA is to follow the calculation from ordinary attention to a reusable state. The original operation compares a query with every key. RFA changes the representation so that contributions from keys and values can be accumulated before the query-specific readout.

From attention inputs to a reusable state

The steps in order.

From attention inputs to a reusable stateStep 1: Construct queries, keys, and values1. Construct queries, keys, and valuesStep 2: Normalize queries and keys2. Normalize queries and keysStep 3: Project into random feature space3. Project into random feature spaceStep 4: Accumulate key and value summaries4. Accumulate key and value summariesStep 5: Optionally gate the previous state5. Optionally gate the previous stateStep 6: Read and normalize the query result6. Read and normalize the query result

Start with the ordinary attention operation

A query represents the information currently being sought. A key provides a representation used to decide relevance, and a value provides the information returned when that key receives weight. In a translation decoder, a query can attend to keys and values derived from the source. In causal self-attention, it can attend only to positions already available in the output prefix.

attn(qₜ, {kᵢ}, {vᵢ}) = Σᵢ [exp(qₜ · kᵢ / τ) / Σⱼ exp(qₜ · kⱼ / τ)] vᵢᵀ

Here qₜ is the query at position t, kᵢ is a key, and vᵢ is its associated value. The dot indicates an inner product. The index i ranges over available positions, while j ranges over those same positions in the denominator. The exponential converts a score into a positive quantity, and the denominator normalizes the contributions. The superscript T denotes transposition. The temperature τ controls how concentrated the resulting weights are.

The important computational dependency is inside the exponential. Each query must interact with each key before the weights can be normalized. If there are N queries and M keys, a complete attention calculation contains interactions across those dimensions. In self-attention, the query and key sequences have the same length; in cross-attention, their lengths can differ.

Build an explicit random representation

The paper introduces a random Fourier feature map containing sine and cosine components.

φ(x) = √(1/D) [sin(w₁ · x), …, sin(wD · x), cos(w₁ · x), …, cos(wD · x)]ᵀ

The input x is a d-dimensional vector. Each wᵢ is a random projection direction, and D counts those directions. The output φ(x) has 2D components because each direction contributes both a sine and a cosine. The scale factor controls the magnitude of the representation.

The map is useful because inner products between transformed vectors estimate a Gaussian kernel.

E[φ(x) · φ(y)] = exp(−‖x − y‖² / (2σ²))

The expectation E is over the random projections. The vectors x and y are the original inputs, the double bars denote Euclidean norm, and σ determines the Gaussian kernel’s bandwidth in this expression. The right side is large when the inputs are close and decreases as their distance grows.

This is a statement about the average estimator under the theorem’s assumptions. A finite draw of random features produces an approximation, not the expectation itself. Increasing the number of projection directions reduces the estimator’s variance. That observation creates a direct connection between representation size and approximation quality, but it does not yet establish the behavior of normalized attention or of a complete trained system.

Connect the Gaussian kernel to exponential similarity

Softmax attention uses exponentiated inner products rather than an explicit distance kernel. The connection comes from an identity involving the norms of the inputs.

exp(x · y / σ²) = exp((‖x‖² + ‖y‖²) / (2σ²)) exp(−‖x − y‖² / (2σ²))

The vectors x and y and the scale σ have the same roles as above. This expression separates exponentiated similarity into norm-dependent factors and a Gaussian distance term. The distance term is the part approximated by random features.

For the main derivation, the authors normalize queries and keys to unit length. Their norm-dependent factors then cancel when attention weights are normalized. This yields the simpler attention expression used throughout the main presentation. The scale σ² plays the role of temperature.

Normalization has a practical consequence. Unit vectors have bounded inner products, so their raw scores can produce flatter attention than desired. The scale therefore matters: it adjusts how sharply the system distinguishes similarities. The authors learn a scale-related parameterization instead of relying only on a manually selected scalar.

Rearrange the approximate attention

Once the exponential interaction is represented by a dot product between feature vectors, the summation can be reorganized.

RFA(qₜ, {kᵢ}, {vᵢ}) = [φ(qₜ)ᵀ Σᵢ (φ(kᵢ) ⊗ vᵢ)] / [φ(qₜ) · Σⱼ φ(kⱼ)]

The transformed query is φ(qₜ), and φ(kᵢ) is a transformed key. The symbol ⊗ denotes an outer product: it produces a matrix from the key feature vector and the value vector. The numerator reads a value-bearing matrix with the current query. The denominator reads a separate key-summary vector to normalize the output.

The key engineering change is visible in the placement of the sums. They no longer contain the query. A context can therefore be summarized once and reused for different queries. The numerator needs the accumulated key–value matrix, while the denominator needs the accumulated key vector.

This also explains why RFA does not need to materialize a complete matrix of attention weights. The system can process context contributions sequentially and add them to the summary. Avoiding that large intermediate object is central to the memory argument.

For cross-attention, all source information is already available, so the summaries can be prepared before decoding queries read them. For encoder self-attention, the complete input is also available. Causal attention requires a different restriction: only the prefix up to the current position may contribute.

Turn causal attention into a recurrence

The causal construction maintains a matrix Sₜ and a vector zₜ. Each new position adds its contribution to the corresponding previous state.

Sₜ = Sₜ₋₁ + φ(kₜ) ⊗ vₜ

Sₜ is the accumulated key–value matrix through position t. Its predecessor Sₜ₋₁ represents the earlier prefix. The new transformed key φ(kₜ) and value vₜ supply the added outer product.

zₜ = zₜ₋₁ + φ(kₜ)

The vector zₜ accumulates transformed keys over the same prefix. It supplies the normalization information corresponding to the evidence stored in Sₜ. Both states begin as zero-valued arrays.

hₜ = [φ(qₜ)ᵀ Sₜ] / [φ(qₜ) · zₜ]

The output hₜ is the attention result at position t. The current query reads the stored matrix and divides by the matching normalization quantity. The matrix has shape 2D by d in the paper’s notation, and the normalization vector has 2D components.

The state size depends on the representation dimensions rather than the length of the prefix. History is still influencing the computation, but it is represented through accumulated statistics rather than an ever-growing list of separately inspected keys and values. This is the basis for efficient autoregressive decoding.

The construction also makes stateful processing natural. A final state from one input block can become the initial state of the next block. That changes how much earlier context is available, so the paper evaluates the stateful setting separately.

Add learned forgetting

Without gating, every past contribution remains in the accumulated state. RFA-Gate changes the update by learning a scalar retention decision from the current input representation.

gₜ = sigmoid(wg · xₜ + bg)

The current representation is xₜ. The vector wg and scalar bg are learned parameters. The sigmoid produces a gate gₜ between zero and one.

Sₜ = gₜ Sₜ₋₁ + (1 − gₜ) φ(kₜ) ⊗ vₜ

The gate scales the previous value-bearing state, while its complement scales the incoming contribution. A larger retention gate preserves more of the existing state.

zₜ = gₜ zₜ₋₁ + (1 − gₜ) φ(kₜ)

The normalization vector receives the corresponding update. Applying the policy to both summaries keeps their accumulated evidence aligned.

Repeated retention decisions progressively reduce the influence of older contributions. This creates an explicit recency preference whose strength depends on the inputs. The mechanism is inspired by gated recurrent computation, including the tradition represented by the recurrent encoder–decoder work of Cho and colleagues.

The appendix considers a related construction for ordinary softmax attention, where earlier keys and values are repeatedly decayed. That calculation introduces dependencies between successive steps and retains expensive normalization over the prefix. The authors use it to show that the recurrent RFA perspective makes this architectural extension much more direct.

Learn scales while retaining random directions

The implementation does not simply draw every effective projection independently and then learn all its entries. It separates random base vectors from learned scaling.

wᵢ = σ⃗ ∘ w̃ᵢ, with w̃ᵢ ∼ N(0, I_d)

The vector w̃ᵢ is sampled from a standard Gaussian distribution with identity covariance I_d. The vector σ⃗ contains learned scales, and ∘ denotes elementwise multiplication. The resulting wᵢ is used in feature construction. The base random vectors are not learned.

This changes the assumptions relative to the scalar, isotropic presentation. Different input dimensions can receive different learned scales. The authors explicitly caution that the earlier theorem does not transfer automatically to this parameterization. They adopt it because it works better empirically, distinguishing mathematical motivation from the complete practical recipe.

Random projection selection also varies during training. The implementation prepares a pool, typically containing 200 matrices, before training begins. Attention heads draw from that pool during training, avoiding repeated Gaussian-sampling overhead. At evaluation, projection use is fixed because varying it between test instances provides no observed accuracy advantage.

Examine alternatives and the size of the summary

The Gaussian construction is not the only feature family considered. The paper also evaluates an arc-cosine alternative using a rectified linear activation.

φarccos(x) = √(1/D) [ReLU(w₁ · x), …, ReLU(wD · x)]ᵀ

The input x, projection vectors wᵢ, and count D retain their earlier meanings. ReLU removes negative projected values. This feature map has D components, whereas the sine-and-cosine map has 2D.

That distinction matters when comparing speed and memory at the same D. Equal projection counts do not imply equal final feature dimensions. The authors attribute the arc-cosine variant’s slight resource advantage in the decoding analysis to this size difference.

The appendix also removes the unit-norm restriction. It introduces a norm-dependent scalar.

C(x) = exp(‖x‖² / (2σ²))

C(x) is a correction associated with the length of x. In the unrestricted construction, key contributions are multiplied by their correction before entering the summaries. The query’s corresponding factor cancels through normalization. This shows that unit normalization simplifies the implementation and derivation instead of being an absolute requirement of the approach.

The final practical choice is feature size. Larger summaries can improve approximation but consume more resources. The paper therefore treats D as an engineering parameter whose useful range must be tested, instead of assuming that the smallest possible state is adequate.

Experiments and results

The experiments ask whether RFA can preserve task quality while changing attention’s resource behavior. The answer depends on the task and execution regime. Language prediction emphasizes predictive quality and the value of gating. Translation exposes sequential decoding costs. Long-text classification examines processing when large inputs are available together.

The implementation uses JAX. Across the principal comparisons, the authors try to keep implementations, tuning, and training procedures comparable. Several detailed result tables are identified in the paper, but the numerical claims discussed here are those stated explicitly in its experimental narrative. They establish relative outcomes without supplying every individual score needed to reconstruct a complete leaderboard.

Language prediction on WikiText-103

WikiText-103 consists of English Wikipedia text. The task is language prediction, evaluated using perplexity, where lower values indicate better predictive performance. The conventional baseline follows a strong transformer language-prediction setup. RFA substitutes random-feature attention, and RFA-Gate adds the learned retention mechanism. Gaussian and arc-cosine features are both tested, alongside the ELU-based feature baseline.

The ordinary comparisons use blocks of 512 tokens for training and evaluation. Earlier mini-batches supply no context in this setting. The systems therefore receive matching local histories, which matters when interpreting the later stateful experiment. The paper reports small and big configurations with around 38M and 242M parameters, respectively, and describes RFA’s language-prediction features as 64-dimensional.

Without gates, both random-feature variants beat the ELU baseline. The reported test-perplexity margins exceed 2.4 for the small configuration and 2.1 for the big configuration. However, ungated RFA still performs worse than conventional attention. The Gaussian variant comes closer to that baseline than the arc-cosine variant.

Gating changes the comparison. Against the corresponding ungated RFA systems, the improvement exceeds 1.8 perplexity, with a larger gap in the small setting. RFA-Gate with Gaussian features surpasses the transformer under both size settings by at least 1.2 perplexity. Gaussian features generally perform better than arc-cosine features in these experiments.

The efficiency result is deliberately less favorable. At the tested 512-token context, RFA does not accelerate the workload. Training is around 15% slower because creating the feature representations adds work. The authors’ complexity discussion predicts this possibility when conventional attention can exploit sufficient parallelism.

The stateful Gaussian gated variant passes its recurrent state between mini-batches during both training and evaluation. Its test perplexity improves by more than 1.5 relative to the non-stateful setting. That result concerns access to additional historical information as well as the recurrence itself; it should not be folded into the matched-context comparison.

Training uses Adam, fixed sinusoidal position representations, and development-perplexity early stopping. The appendix gives a training limit of 150K gradient steps. It reports 16 TPU v3 accelerators for training and a single TPU v2 accelerator for testing.

Translation quality and decoding speed

The translation experiments use WMT14 EN-DE, WMT14 EN-FR, and IWSLT14 DE-EN. The WMT preprocessing follows the original transformer setup, with shared source–target vocabularies containing 32,768 byte-pair types within each language pair. The IWSLT setup uses separate source and target vocabularies of 9K/7K types. These are applications of subword segmentation, following the approach associated with Sennrich and colleagues.

The systems are based on a base-sized transformer. Crucially, RFA replaces attention in the decoder’s causal and cross-attention components, while the encoder keeps softmax attention. The experiment therefore evaluates a hybrid architecture targeted at decoding efficiency. The projection count D is 128 for cross-attention and 64 for causal attention. Gates, when present, act in causal decoder attention.

Quality is evaluated with BLEU. Both feature families give results similar to conventional attention across the translation datasets and substantially stronger than the ELU-based alternative. Unlike language prediction, translation receives no substantial benefit from gating. That contrast is useful evidence against treating recency preference as a universal improvement.

Every tested RFA variant decodes more than 1.8× faster than the conventional baseline. The paper also gives a 1.9× translation speedup in its complexity discussion. For the main decoding comparison, one TPU v2 accelerator processes batches of size 32.

For WMT, training lasts up to 350K gradient steps. The reported batches contain 1,024 instances for EN-DE and 4,096 for EN-FR. Evaluation combines SacreBLEU scoring, early stopping based on development BLEU, averaging of the latest 10 checkpoints, and beam search configured with a beam size of 4 and a length penalty of 0.6. Those conditions matter because decoding configuration can affect both output quality and elapsed time.

Long-sequence classification and retrieval

The long-input evaluation uses tasks from Long Range Arena. ListOps presents nested operations over single-digit integers and asks for the resulting digit. The experiment considers sequences containing 500–2,000 symbols and treats the task as 10-way classification. IMDb supplies character-level sentiment classification, while the ACL Anthology Network task predicts whether a citation exists between a pair of documents.

RFA is implemented on the benchmark’s transformer baseline, following its preprocessing, split, size, and training procedure. The feature setting is D=64 for IMDb and D=128 for the other tasks. Speed and memory measurements come from IMDb, so they should not be read as independent measurements for every dataset.

RFA exceeds the transformer’s accuracy on two tasks and reaches 66% accuracy on IMDb, the best reported result for that dataset in the comparison. Its average accuracy exceeds the transformer by 0.3%, while Big Bird leads it by 0.1%. The paper emphasizes RFA’s combined quality and efficiency instead of claiming the best accuracy everywhere.

Reported speedups range from 1.1–5.3× as sequence length changes. The larger result corresponds to a 4,000-length context. This contrasts with the absence of acceleration for the shorter language-prediction context and supports the paper’s central performance explanation: avoiding pairwise work becomes more valuable as available parallelism ceases to hide its cost.

Controlled long-output generation

A separate simulation studies conditional generation as input and output lengths vary together. It uses systems with 6-layer encoders and decoders, greedy generation, batch size 16, and a single TPU v2 accelerator. These are resource measurements under a controlled generation workload, not additional translation-quality results.

At a length of 2,048, RFA produces output around 12× faster while consuming less than 10% of the baseline memory. The recurrent state explains the trend: new output positions do not require an expanding cache of individually accessed history representations. The paper also reports a similar qualitative pattern for unconditional generation without an encoder.

A diagnostic showing that quality does not imply interchangeability

The most revealing numerical comparison concerns IWSLT14 DE-EN development BLEU after exchanging attention functions without further training. Both original trained systems exceed 35.2 BLEU, but substitution causes severe deterioration.

IWSLT14 DE-EN development BLEU after attention substitution

RFA and softmax both fail as immediate replacements inside systems trained with the other attention function.

IWSLT14 DE-EN development BLEU after attention substitutionSoftmax substituted into an RFA-trained system: 1.1Softmax substituted into an RFA-trainedsystem1.1RFA substituted into a softmax-trained system (this paper): 2.3RFA substituted into a softmax-trainedsystem (this paper)2.3
The numbers
System or settingBLEU
Softmax substituted into an RFA-trained system1.1
RFA substituted into a softmax-trained system (this paper)2.3

The starred result identifies the paper’s proposed attention function; it does not indicate an acceptable translation result. These scores show that the surrounding learned parameters depend strongly on the attention function used during training. The paper’s positive end-to-end results therefore cannot be interpreted as evidence that trained internal computations are numerically interchangeable.

What the ablations show

The controlled comparisons investigate several distinct explanations for RFA’s performance. They are especially valuable because the main idea combines a feature transformation, a summary-based computation, optional forgetting, and a different relationship to earlier context. An end-to-end score alone would not reveal which of those changes matters.

Feature-map choice affects predictive quality

The ELU-based baseline shares the attraction of linearized attention but performs substantially worse in the matched experiments. RFA’s Gaussian and arc-cosine features both improve on it. This comparison supports a limited but important conclusion: obtaining a recurrent attention calculation is insufficient by itself. The representation used inside that calculation affects what the system can learn.

The authors qualify this comparison through training duration. All systems receive 150K training steps in the principal language-prediction setup. They note that the earlier ELU-based approach may need 3 times more updates to approach conventional-attention performance. RFA’s advantage under the controlled budget is therefore clear, while a claim about every possible optimization schedule would be stronger than the evidence.

Gaussian features generally produce better language-prediction results and are reported as easier to train. The authors suggest that their fixed feature-vector norm may help. This is an explanation proposed from the feature construction, not an isolated causal demonstration. The experiments do not vary norm stability independently from every other difference between the feature families.

Gating helps selectively

Comparing RFA with its gated counterpart isolates the usefulness of learned retention more directly. Language prediction benefits substantially, whereas translation gains little. The contrast indicates that the gate is supplying a task-relevant bias rather than simply improving every use of random features.

The result also helps interpret ungated RFA’s weakness against conventional attention on WikiText-103. Reorganizing the computation alone does not deliver the best reported predictive behavior. The more successful configuration includes an architectural preference for recent context. It would therefore be misleading to attribute the full language-prediction improvement solely to approximating softmax.

State persistence changes the context available

The stateful experiment carries summary information across block boundaries. Its improvement demonstrates that the recurrent representation can use earlier context beyond the ordinary block. However, this is not a comparison in which every system sees exactly the same historical information.

The paper explicitly separates this setting from the block-based experiments. That distinction makes the result informative: it shows an additional capability enabled by the architecture without presenting it as a pure attention-function advantage. It also leaves open what information survives in the compact state and which dependencies it fails to retain.

Feature size has a practical lower bound

The appendix changes the sizes of cross-attention and causal-attention feature maps on WMT14 EN-DE development data. For Gaussian RFA, the final map contains 2D components, so the reported feature dimension must be distinguished from the projection count D.

Training fails to converge when cross-attention features have size 32 or 64, or when causal-attention features have size 32. The authors find useful improvements with 256-dimensional cross-attention features and 128-dimensional causal-attention features. Beyond those settings, further gains are marginal.

This analysis connects approximation capacity to a concrete failure mode. An insufficient representation can prevent learning rather than merely cause a small accuracy decrease. The larger practical lesson is that efficiency needs a viable representational budget; reducing state size is not automatically beneficial.

Projection variation acts as a training choice

Preliminary comparisons favor drawing training projections from a prepared pool over using one unchanged projection throughout training. The authors suggest that variation discourages attention heads from depending too strongly on a particular random representation.

The evidence supports their chosen recipe, but it does not establish the proposed explanation independently. At evaluation, changing projections across instances supplies no observed benefit. Training diversity and inference-time randomness therefore serve different purposes in the reported implementation.

Swapping attention exposes learned dependence

The substitution experiment is a direct test of the approximation interpretation. If task success meant that trained RFA had become an interchangeable implementation of softmax, the authors reason, exchanging the operations should preserve much more performance. The very low BLEU results contradict that expectation.

The conclusion concerns trained systems at the tested settings. It does not refute the random-feature kernel theorem. The theorem addresses an estimator under mathematical assumptions, while the experiment involves learned projections, surrounding parameters, normalization, and task optimization. Keeping those levels separate is essential to understanding the paper.

Recovery reveals what transfers

Further training can repair the substituted system. RFA initialized from a conventional transformer reaches similar training loss after approximately 1,500 steps. However, resetting its multi-head query, key, value, and output projection parameters produces a similar learning curve. The inherited attention projections therefore appear to offer little benefit under the changed attention function.

A further control resets those projections while retaining conventional attention. That system returns to the earlier training loss in less than 200 steps. Together, the controls show that recovery is much easier when the attention computation remains familiar to the inherited parameters.

The paper interprets recovery as a promising adaptation route, since it costs less than starting training anew. Yet recovering training loss is narrower evidence than recovering every downstream capability. The suggested transfer from a very large pretrained transformer remains a future application rather than a demonstrated outcome of these experiments.

Limitations

The paper contains both explicit qualifications and boundaries that follow from its experimental design. Distinguishing them helps preserve the contribution without expanding it into a general claim about all attention workloads.

An author-stated limitation is that faster asymptotic computation does not imply faster execution when conventional attention can be sufficiently parallelized. The WikiText-103 experiment makes that concrete: feature construction introduces overhead, and the tested short-context training is slower. RFA’s strongest practical case is sequential decoding or processing long inputs where available parallel resources no longer hide pairwise work.

The authors also state that feature size can erase resource advantages if it is too large, while inadequate size damages approximation or learning. Their cross-attention memory discussion gives a favorable regime when 2D is much smaller than source length M. This is a conditional argument. A compact recurrent state can still be expensive relative to a short source, and the feature-map construction itself consumes time and memory.

A mathematical qualification concerns the learned scale vector. The practical parameterization departs from the isotropic assumptions of the introductory theorem, and the authors acknowledge that the theoretical result does not apply automatically. Their evidence for that choice is empirical. Similarly, an unbiased kernel estimate does not establish an unbiased normalized attention output: normalization forms a ratio, and the full operation has additional dependencies.

A careful reader should also distinguish a positive target kernel from a finite trigonometric approximation. Sine-and-cosine feature inner products do not inherit positivity merely because the kernel they approximate is positive. The paper’s empirical training results demonstrate usable behavior in its tested configurations, but the central theorem alone is not a complete guarantee about every denominator or every numerical setting. This is a boundary of the mathematical argument, not a reported experimental failure.

The translation architecture supplies another design boundary. Its encoder retains softmax attention, so the translation results do not establish that replacing every attention component would preserve quality or produce the same resource profile. The experiment is persuasive for targeted decoder replacement. It should be described at that scope.

Hardware and workload conditions also constrain the speed figures. The decoding measurements use TPU hardware and specified batches. The controlled long-output experiment assumes matching source and target lengths and greedy generation. Its 12× result is a resource measurement under that simulation, rather than a translation-quality claim for naturally occurring documents of that length.

The authors make the conventional baseline more credible by caching earlier representations and matching batch sizes. They also note that RFA could exploit its memory savings through larger batches. These are different performance questions: equal-batch latency and maximum feasible throughput. The paper emphasizes the former for a cleaner comparison, leaving workload-specific deployment performance to further measurement.

The long-text evaluation covers a selected set of tasks. Classification and citation prediction over character sequences demonstrate useful long-input processing, but they do not directly establish faithful retrieval of arbitrary earlier facts or reliable reasoning across a complete document. A recurrent state can represent historical influence without preserving every detail required by a later question. That limitation follows from the distinction between compact computation and complete recoverable storage.

The gate is another conditional contribution. The authors report strong usefulness for language prediction and little benefit for translation. A recency preference can be helpful when older evidence becomes less relevant, but tasks requiring exact access to distant information may impose different demands. The paper does not establish a universally preferable forgetting policy.

Finally, the transfer experiments are deliberately modest in what they prove. Immediate attention replacement fails, while further training recovers the earlier training loss. The authors propose adapting a much larger pretrained system, citing GPT-3 as a motivating example, but leave that exploration open. The demonstrated result is recoverability in the tested translation setting, not preservation of broad pretrained knowledge under an unmeasured conversion.

What came after

The citation trail connects RFA with several continuing discussions: efficient architectures, long-context evaluation, recurrent sequence processing, and implementation speed. A citation alone does not reveal whether a later work adopted RFA, compared against it, or cited it as background. The later titles identify relevant directions, but they do not support detailed claims about implementation inheritance or numerical improvements.

Efficient Transformers: A Survey provides the broad efficiency context. RFA itself cites this survey, and it also appears in the citation list associated with RFA. That relationship should not be turned into a simple chronological succession, because the listed survey date precedes the date associated with Random Feature Attention. Its relevance is thematic: RFA belongs among approaches that reconsider the computational structure of attention instead of accepting pairwise calculation as unavoidable.

FNet: Mixing Tokens with Fourier Transforms has an especially tempting connection because RFA also uses trigonometric functions. The title establishes that FNet concerns Fourier-transform token mixing. It does not establish that this is the same mechanism as random Fourier features used to approximate a kernel. The useful distinction is between sharing a mathematical vocabulary and sharing a computational derivation. RFA constructs query and key features for a normalized retrieval operation; no further claim about FNet’s use of that construction follows from the citation record alone.

LongT5: Efficient Text-To-Text Transformer for Long Sequences connects with the task setting that motivates much of RFA: sequence-to-sequence processing with long inputs. RFA’s decoder experiments make clear why source processing and output generation should be evaluated separately. The later title establishes an interest in efficient long-sequence text-to-text computation, but it supplies no basis for saying that LongT5 implements random-feature attention.

The evaluation question becomes prominent in SCROLLS: Standardized CompaRison Over Long Language Sequences and BAMBOO: A Comprehensive Benchmark for Evaluating Long Text Modeling Capacities of Large Language Models. Their titles identify benchmark-oriented work on long sequences. They are relevant to an unresolved boundary in RFA: resource efficiency and successful classification do not by themselves establish every kind of long-context competence. The citation information does not provide their findings, so it cannot establish how RFA would perform on those evaluations.

Lost in the Middle: How Language Models Use Long Contexts points to another distinction: accepting a long context and using its contents effectively are separate questions. RFA makes longer histories computationally more manageable, but its main experiments do not comprehensively test the accessibility of information at different locations. The later work’s title identifies that broader usage question. Its particular experiments or conclusions cannot be inferred from the title alone.

Several cited works address the relationship between linear attention and recurrence more directly in their titles. The Devil in Linear Transformer belongs to the linear-transformer discussion, while Hierarchically Gated Recurrent Neural Network for Sequence Modeling identifies a gated recurrent direction. Both are relevant to RFA’s decision to represent causal attention through an evolving state. The available citation descriptions do not establish which RFA equations either work retains, changes, or rejects.

RNNs are not Transformers (Yet): The Key Bottleneck on In-context Retrieval makes retrieval capacity an explicit topic. This is closely connected to the limitation of any compact history representation: an efficient summary need not preserve everything a future query may ask for. RFA demonstrates useful recurrent computation, while leaving a comprehensive account of recoverable historical detail open. The later title identifies that concern without supplying evidence for a specific result about RFA.

Linearizing Large Language Models aligns with the paper’s proposed transfer direction. RFA’s appendix already asks whether a conventional pretrained transformer can be adapted to a more efficient attention operation. The title of the later work establishes that linearization of larger pretrained systems remained an active subject. It does not establish that the later method uses RFA’s feature map or confirms its transfer hypothesis.

Finally, FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision and Linear Attention Sequence Parallelism identify implementation and parallel-execution directions. These connections reinforce one of RFA’s most durable methodological lessons: computational form, parallelism, memory behavior, and task quality must be measured separately. The paper’s contribution remains specific and useful—a kernel-motivated route to compact attention state, an effective gated variant, and evidence that the resulting computation can improve generation efficiency without requiring a universal claim of interchangeability.

Cite

Cite as Hao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz, Noah A. Smith and Lingpeng Kong. 2021. Random Feature Attention. arXiv (Cornell University).

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2103.02143 · arXiv 2103.02143

@misc{hao2021random,
  title = {{Random Feature Attention}},
  author = {Hao Peng, Nikolaos Pappas, Dani Yogatama, Roy Schwartz, Noah A. Smith and Lingpeng Kong},
  year = {2021},
  doi = {10.48550/arxiv.2103.02143},
  eprint = {2103.02143},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2103.02143}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/hao-2021-random-feature-attention/

References

78 references, from the paper's own bibliography.

  1. Joshua Ainslie, Santiago Ontanon, Chris Alberti, Vaclav Cvicek, Zachary Fisher, Philip Pham, Anirudh Ravula, Sumit Sanghai, Qifan Wang, and Li Yang. ETC: Encoding long and structured inputs in transformers. In Proc. of EMNLP, 2020. our card
  2. Maximilian Alber, Pieter-Jan Kindermans, Kristof Schütt, Klaus-Robert Müller, and Fei Sha. An empirical study on the properties of random bases for kernel methods. In Proc. of NeurIPS, 2017. OpenAlex ↗ · Scholar ↗
  3. Haim Avron, Vikas Sindhwani, Jiyan Yang, and Michael W. Mahoney. Quasi-Monte Carlo feature maps for shift-invariant kernels. Journal of Machine Learning Research, 170 (120):0 1–38, 2016. OpenAlex ↗ · Scholar ↗
  4. Haim Avron, L. Kenneth Clarkson, and P. David and Woodruff. Faster kernel ridge regression using sketching and preconditioning. SIAM J. Matrix Analysis Applications, 2017. OpenAlex ↗ · Scholar ↗
  5. Jimmy Ba, Geoffrey E Hinton, Volodymyr Mnih, Joel Z Leibo, and Catalin Ionescu. Using fast weights to attend to the recent past. In Proc. of NeurIPS, 2016. OpenAlex ↗ · Scholar ↗
  6. Alexei Baevski and Michael Auli. Adaptive input representations for neural language modeling. In Proc. of ICLR, 2019. our card
  7. Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Proc. of ICLR, 2015. our card
  8. Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv: 2004.05150, 2020. our card
  9. S. Bochner. Harmonic Analysis and the Theory of Probability. University of California Press, 1955. OpenAlex ↗ · Scholar ↗
  10. Ondřej Bojar, Christian Buck, Christian Federmann, Barry Haddow, Philipp Koehn, Johannes Leveling, Christof Monz, Pavel Pecina, Matt Post, Herve Saint-Amand, Radu Soricut, Lucia Specia, and Aleš Tamchyna. Findings of the 2014 workshop on statistical machine translation. In Proc. of WMT, 2014. our card
  11. Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. arXiv: 2005.14165, 2020. our card
  12. Mauro Cettolo, Jan Niehues, Sebastian Stüker, Luisa Bentivogli, and Marcello Federico. Report on the 11th IWSLT evaluation campaign. In Proc. of IWSLT, 2014. our card
  13. Kehai Chen, Rui Wang, Masao Utiyama, and Eiichiro Sumita. Recurrent positional embedding for neural machine translation. In Proc. of EMNLP, 2019. OpenAlex ↗ · Scholar ↗
  14. Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv: 1904.10509, 2019. our card
  15. Kyunghyun Cho, Bart van Merriënboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using RNN encoder–decoder for statistical machine translation. In Proc. of EMNLP, 2014. our card
  16. Youngmin Cho and Lawrence K. Saul. Kernel methods for deep learning. In Proc. of NeurIPS, 2009. OpenAlex ↗ · Scholar ↗
  17. Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, David Belanger, Lucy Colwell, and Adrian Weller. Rethinking attention with performers. In Proc. of ICLR, 2020. our card
  18. Djork-Arné Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (ELUs). In Proc. of ICLR, 2016. our card
  19. Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive language models beyond a fixed-length context. In Proc. of ACL, 2019. OpenAlex ↗ · Scholar ↗
  20. Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. Universal transformers. In Proc. of ICLR, 2019. OpenAlex ↗ · Scholar ↗
  21. Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proc. of NAACL, 2019. our card
  22. Sergey Edunov, Myle Ott, Michael Auli, David Grangier, and Marc'Aurelio Ranzato. Classical structured prediction losses for sequence to sequence learning. In Proc. of NAACL, 2018. our card
  23. Yingbo Gao, Christian Herold, Weiyue Wang, and Hermann Ney. Exploring kernel functions in the softmax layer for contextual word classification. In International Workshop on Spoken Language Translation, 2019. OpenAlex ↗ · Scholar ↗
  24. Jie Hao, Xing Wang, Baosong Yang, Longyue Wang, Jinfeng Zhang, and Zhaopeng Tu. Modeling recurrence for transformer. In Proc. of NAACL, 2019. OpenAlex ↗ · Scholar ↗
  25. Geoffrey Hinton, Oriol Vinyals, and Jeffrey Dean. Distilling the knowledge in a neural network. In NeurIPs Deep Learning and Representation Learning Workshop, 2015. our card
  26. Jonathan Ho, Nal Kalchbrenner, Dirk Weissenborn, and Tim Salimans. Axial attention in multidimensional transformers. arXiv: 1912.12180, 2020. OpenAlex ↗ · Scholar ↗
  27. Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Computation, 90 (8):0 1735–1780, 1997. OpenAlex ↗ · Scholar ↗
  28. Thomas Hofmann, Bernhard Schölkopf, and Alexander J. Smola. Kernel methods in machine learning. Annals of Statistics, 360 (3):0 1171–1220, 2008. OpenAlex ↗ · Scholar ↗
  29. Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for NLP. In Proc. of ICML, 2019. our card
  30. Jungo Kasai, Nikolaos Pappas, Hao Peng, James Cross, and Noah A. Smith. Deep encoder, shallow decoder: Reevaluating the speed-quality tradeoff in machine translation. In Proc. of ICLR, 2021. OpenAlex ↗ · Scholar ↗
  31. Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Francois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention. In Proc. of ICML, 2020. OpenAlex ↗ · Scholar ↗
  32. Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proc. of ICLR, 2015. our card
  33. Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In Proc. of ICLR, 2014. our card
  34. Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In Proc. of ICLR, 2020. our card
  35. Juho Lee, Yoonho Lee, Jungtaek Kim, Adam Kosiorek, Seungjin Choi, and Yee Whye Teh. Set transformer: A framework for attention-based permutation-invariant neural networks. In Proc. of ICML, 2019. OpenAlex ↗ · Scholar ↗
  36. Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. In Proc. of NeurIPS, 2019. OpenAlex ↗ · Scholar ↗
  37. Peter J. Liu, Mohammad Saleh, Etienne Pot, Ben Goodrich, Ryan Sepassi, Lukasz Kaiser, and Noam Shazeer. Generating wikipedia by summarizing long sequences. In Proc. of ICLR, 2018. our card
  38. Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proc. of ACL, 2011. our card
  39. Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In Proc. of ICLR, 2017. our card
  40. Stephen Merity, Nitish Shirish Keskar, and Richard Socher. Regularizing and Optimizing LSTM Language Models. In Proc. of ICLR, 2018. our card
  41. Thomas Miconi, Kenneth Stanley, and Jeff Clune. Differentiable plasticity: training plastic neural networks with backpropagation. In Proc. of ICML, 2018. OpenAlex ↗ · Scholar ↗
  42. Lesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. Document-level neural machine translation with hierarchical attention networks. In Proc. of EMNLP, 2018. our card
  43. Abdelrahman Mohamed, Dmytro Okhonko, and Luke Zettlemoyer. Transformers with convolutional context for ASR. arXiv: 1904.11660, 2019. our card
  44. Nikita Nangia and Samuel Bowman. ListOps: A diagnostic dataset for latent tree learning. In Proc. of NAACL Student Research Workshop, 2018. OpenAlex ↗ · Scholar ↗
  45. Junier Oliva, William Neiswanger, Barnabas Poczos, Eric Xing, Hy Trac, Shirley Ho, and Jeff Schneider. Fast function to function regression. In Proc. of AISTATS, 2015. OpenAlex ↗ · Scholar ↗
  46. Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. In Proc. of WMT, 2018. our card
  47. Emilio Parisotto, H. Francis Song, Jack W. Rae, Razvan Pascanu, Caglar Gulcehre, Siddhant M. Jayakumar, Max Jaderberg, Raphael Lopez Kaufman, Aidan Clark, Seb Noury, Matthew M. Botvinick, Nicolas Heess, and Raia Hadsell. Stabilizing transformers for reinforcement learning. In Proc. of ICML, 2020. OpenAlex ↗ · Scholar ↗
  48. Niki Parmar, Ashish Vaswani, Jakob Uszkoreit, Lukasz Kaiser, Noam Shazeer, Alexander Ku, and Dustin Tran. Image transformer. In Proc. of ICML, 2018. OpenAlex ↗ · Scholar ↗
  49. Hao Peng, Roy Schwartz, Sam Thomson, and Noah A. Smith. Rational recurrences. In Proc. of EMNLP, 2018. OpenAlex ↗ · Scholar ↗
  50. Hao Peng, Roy Schwartz, Dianqi Li, and Noah A. Smith. A mixture of $h - 1$ heads is better than $h$ heads. In Proc. of ACL, 2020. OpenAlex ↗ · Scholar ↗
  51. Matt Post. A call for clarity in reporting BLEU scores. In Proc. of WMT, 2018. our card
  52. Jiezhong Qiu, Hao Ma, Omer Levy, Wen-tau Yih, Sinong Wang, and Jie Tang. Blockwise self-attention for long document understanding. In Findings of EMNLP, 2020. OpenAlex ↗ · Scholar ↗
  53. Dragomir R. Radev, Pradeep Muthukrishnan, and Vahed Qazvinian. The ACL Anthology network. In Proc. of the Workshop on Text and Citation Analysis for Scholarly Digital Libraries, 2009. OpenAlex ↗ · Scholar ↗
  54. Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners, 2018. OpenAlex ↗ · Scholar ↗
  55. Jack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, Chloe Hillier, and Timothy P. Lillicrap. Compressive transformers for long-range sequence modelling. In Proc. of ICLR, 2020. our card
  56. Ali Rahimi and Benjamin Recht. Random features for large-scale kernel machines. In Proc. of NeurIPS, 2007. OpenAlex ↗ · Scholar ↗
  57. Ankit Singh Rawat, Jiecao Chen, Felix Xinnan X Yu, Ananda Theertha Suresh, and Sanjiv Kumar. Sampled softmax with random Fourier features. In Proc. of NeurIPS, 2019. OpenAlex ↗ · Scholar ↗
  58. Aurko Roy, Mohammad Taghi Saffar, David Grangier, and Ashish Vaswani. Efficient content-based sparse attention with routing transformers. arXiv: 2003.05997, 2020. our card
  59. Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lighter. arXiv: 1910.01108, 2020. our card
  60. J. Schmidhuber. Learning to control fast-weight memories: An alternative to dynamic recurrent networks. Neural Computation, 40 (1):0 131–139, 1992. OpenAlex ↗ · Scholar ↗
  61. J. Schmidhuber. Reducing the ratio between learning complexity and number of time varying variables in fully recurrent nets. In Proc. of ICANN, 1993. OpenAlex ↗ · Scholar ↗
  62. Rico Sennrich, Barry Haddow, and Alexandra Birch. Neural machine translation of rare words with subword units. In Proc. of ACL, 2016. our card
  63. Sheng Shen, Zhen Dong, Jiayu Ye, Linjian Ma, Zhewei Yao, Amir Gholami, Michael W. Mahoney, and Kurt Keutzer. Q-BERT: Hessian based ultra low precision quantization of BERT. In Proc. of AAAI, 2020. OpenAlex ↗ · Scholar ↗
  64. Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. In Proc. of ACL, 2019. our card
  65. Yitong Sun. Random Features Methods in Supervised Learning. PhD thesis, The University of Michigan, 2019. OpenAlex ↗ · Scholar ↗
  66. Yi Tay, Dara Bahri, Donald Metzler, Da-Cheng Juan, Zhe Zhao, and Che Zheng. Synthesizer: Rethinking self-attention in transformer models. arXiv: 2005.00743, 2020a. our card
  67. Yi Tay, Dara Bahri, Liu Yang, Don Metzler, and Da-Cheng Juan. Sparse sinkhorn attention. In Proc. of ICML, 2020b. OpenAlex ↗ · Scholar ↗
  68. Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey. arXiv: 2009.06732, 2020c. our card
  69. Yi Tay, Mostafa Dehghani, Samira Abnar, Yikang Shen, Dara Bahri, Philip Pham, Jinfeng Rao, Liu Yang, Sebastian Ruder, and Donald Metzler. Long range arena: A benchmark for efficient transformers. In Proc. of ICLR, 2021. our card
  70. Yao-Hung Hubert Tsai, Shaojie Bai, Makoto Yamada, Louis-Philippe Morency, and Ruslan Salakhutdinov. Transformer dissection: An unified understanding for transformer's attention via the lens of kernel. In Proc. of EMNLP, 2019. OpenAlex ↗ · Scholar ↗
  71. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Ł ukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proc. of NeurIPS, 2017. our card
  72. Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity. arXiv: 2006.04768, 2020. OpenAlex ↗ · Scholar ↗
  73. Ronald J. Williams and David Zipser. A learning algorithm for continually running fully recurrent neural networks. Neural Computation, 1:0 270–280, 1989. OpenAlex ↗ · Scholar ↗
  74. Felix Wu, Angela Fan, Alexei Baevski, Yann Dauphin, and Michael Auli. Pay less attention with lightweight and dynamic convolutions. In Proc. of ICLR, 2019. our card
  75. Zhanghao Wu, Zhijian Liu, Ji Lin, Yujun Lin, and Song Han. Lite transformer with long-short range attention. In Proc. of ICLR, 2020. OpenAlex ↗ · Scholar ↗
  76. Weiqiu You, Simeng Sun, and Mohit Iyyer. Hard-coded Gaussian attention for neural machine translation. In Proc. of ACL, 2020. OpenAlex ↗ · Scholar ↗
  77. Felix Xinnan X Yu, Ananda Theertha Suresh, Krzysztof M Choromanski, Daniel N Holtmann-Rice, and Sanjiv Kumar. Orthogonal random features. In Proc. of NeurIPS, 2016. OpenAlex ↗ · Scholar ↗
  78. Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, and Amr Ahmed. Big bird: Transformers for longer sequences. arXiv: 2007.14062, 2020. our card