The Transformer architecture has revolutionized natural language processing, but adapting it to audio domains—such as speech recognition, speech synthesis, and music generation—reveals a fundamental scaling bottleneck.
In text processing, a sentence might consist of a few dozen tokens. In contrast, audio signals possess exceptionally high temporal resolution. A standard 30-second audio clip sampled at 16 kHz or processed via 100-Hz spectrogram frames easily translates into thousands of individual time steps. Because the standard self-attention mechanism requires computing pairwise interactions between every single token in a sequence, its computational and memory complexity scales quadratically ($O(N^2)$) with the sequence length $N$.
When processing high-resolution audio, this quadratic scaling quickly leads to memory exhaustion and prohibitive training and inference latencies. To make Transformers practical for long-form audio, researchers have developed a diverse suite of techniques designed to bypass or eliminate this $O(N^2)$ bottleneck.
The Audio Sequence Length Bottleneck
To understand why standard self-attention fails on audio, consider how the attention matrix is computed:
$$\text{Attention}(Q, K, V) = \text{softmax}\left(\frac{QK^T}{\sqrt{d_k}}\right)V$$
The intermediate matrix $QK^T$ represents the pairwise similarity between all tokens, resulting in an $N \times N$ matrix. As noted by Yuankai Chang et al. in End-to-End Multi-speaker Speech Recognition with Transformer, this global comparison becomes computationally prohibitive for high-resolution audio signals containing thousands of steps per second. Yu Zhang et al. demonstrated in Very Deep Convolutional Networks for End-to-End Speech Recognition that high temporal resolution severely complicates the attention mechanism's ability to efficiently map inputs to outputs, creating massive memory overhead.
When models scale up to raw waveforms or document-level audio, the problem worsens. Strategies to overcome this bottleneck generally target different parts of the computation, falling into four main paradigms: compressing the input sequence, restricting the attention window, linearizing the attention operation, or replacing attention entirely with linear-time recurrent states.
Reducing Sequence Length via Downsampling and Tokenization
The most direct way to mitigate quadratic complexity is to reduce the sequence length $N$ before it ever reaches the attention layers. If a model can compress the input sequence by a factor of $k$, the attention matrix shrinks by $k^2$.
One prominent approach is progressive downsampling, where convolutional or pooling layers gradually compress the temporal dimension across successive stages of the network. Maxime Burchi et al. leveraged this in Efficient conformer: Progressive downsampling and grouped attention for automatic speech recognition to drastically cut down computational complexity while maintaining high automatic speech recognition (ASR) accuracy. Similarly, Chen Xu introduced a progressive downsampling framework in Bridging the Granularity Gap for Acoustic Modeling to bridge the gap between fine-grained speech frames and coarse-grained text units, achieving up to a 32x compression ratio. In downstream tasks like event extraction, Bin Wang et al. utilized a specialized "Shrinking Unit" in SpeechEE: A Novel Benchmark for Speech Event Extraction to handle long-range dependencies in document-level audio.
An alternative to architectural downsampling is discrete tokenization. Just as subword tokenization shortens text sequences, discrete compression algorithms can merge redundant musical or acoustic attributes. For example, the authors of Byte Pair Encoding for Symbolic Music applied Byte Pair Encoding (BPE) to symbolic music tokens. By merging frequent sequences of musical attributes into single tokens, they significantly reduced sequence lengths and bypassed the quadratic memory constraints that typically limit long-form musical composition.
Restricting Attention to Local Windows
Because audio signals are highly continuous, a given audio frame is often most strongly correlated with its immediate neighbors. Global self-attention wastes significant computation calculating dependencies between distant frames that share little phonetic or acoustic relationship.
To exploit this locality, researchers have proposed local and sliding window attention mechanisms, which restrict each token to attending only to a small window of size $W$ around it. This changes the computational complexity from quadratic ($O(N^2)$) to linear ($O(N \times W)$).
- Local Windows: Menglong Xu et al. proposed Local Dense Synthesizer Attention in Transformer-Based End-to-End Speech Recognition with Local Dense Synthesizer Attention, restricting pairwise calculations to a local window and replacing expensive global dot-products with a feed-forward network.
- Dilated Windows: For high-fidelity audio generation where sequences consist of raw waveform samples, Chenfeng Miao et al. introduced a dilated sliding window mechanism in A compact transformer-based GAN vocoder, enabling a tiny model footprint to process extremely long raw waveform sequences 113x faster than real-time.
- Dynamic Convolutions: Taking locality to its logical conclusion, Yuya Fujita et al. completely replaced self-attention layers with lightweight and dynamic convolutions in Attention-based ASR with Lightweight and Dynamic Convolutions, achieving linear complexity while remaining highly competitive with standard Transformers.
- Dual-Path Processing: For tasks like speech separation, where models must process every single sample with a minimal stride, architectures like SepFormer—explored by Cem Subakan et al. in On Using Transformers for Speech-Separation and the authors of Attention is All You Need in Speech Separation—break the 2D sequence into smaller chunks. They apply attention intra-chunk and inter-chunk sequentially, modeling global context without ever constructing a full $N \times N$ matrix.
When global context is required, it can be computed sparsely. Lei Xie et al. demonstrated in Efficient Conformer with Prob-Sparse Attention Mechanism for End-to-End Speech Recognition that a KL-divergence-based metric can identify and compute only the most "dominant" attention queries, cutting memory and inference latency by 45%.
Linearizing the Attention Mechanism
If global context must be preserved across the entire sequence without downsampling or windowing, the mathematical structure of attention itself must be altered. Linear attention achieves this by changing the order of operations in the attention equation.
Standard attention computes $softmax(QK^T)V$. Because the softmax couples $Q$ and $K$ non-linearly, we must compute $QK^T$ first. However, if the softmax is replaced by an uncoupled feature map $\phi(\cdot)$, the equation can be rewritten using the associative property of matrix multiplication:
$$\text{Attention}(Q, K, V) = \phi(Q) \left( \phi(K)^T V \right)$$
By computing $\phi(K)^T V$ first, the model creates an intermediate matrix of size $d \times d$ (where $d$ is the hidden dimension, typically 256 or 512) instead of $N \times N$. Multiplying $\phi(Q)$ by this intermediate matrix results in a total computational complexity of $O(N \cdot d^2)$. Since $d \ll N$ in long audio sequences, the complexity scales linearly with the sequence length.
Shengqiang Li et al. successfully applied this kernel-trick formulation to speech processing in Efficient conformer-based speech recognition with linear attention, achieving a 50% parameter reduction and significant training speedups.
Alternatively, global context can be aggregated via simple pooling operations. Titouan Parcollet et al. introduced SummaryMixing in SummaryMixing: A Linear-Complexity Alternative to Self-Attention for Speech Recognition and Understanding. Instead of computing pairwise attention weights, SummaryMixing replaces the quadratic operation with a simple global mean "summary" of the entire utterance. Each frame then mixes its local representation with this global summary vector:
Standard Attention: [Frame t] <---> Pairwise weights with all N frames (O(N²))
SummaryMixing: [Frame t] <---> Global Mean Summary Vector (O(N))
This formulation reduces memory usage by half and speeds up training by 28%. Rogier van Dalen et al. later extended this paradigm to streaming scenarios in Linear Time Complexity Conformers with SummaryMixing for Streaming Speech Recognition, proving that global context can be tracked efficiently in real-time without quadratic overhead.
Recurrence as a Linear-Time Alternative
The final paradigm abandons the attention mechanism entirely, replacing it with modern, highly parallelizable recurrent formulations like State Space Models (SSMs) and Linear RNNs.
Traditional RNNs process sequences step-by-step, which prevents parallel training on GPUs. Modern linear recurrent architectures circumvent this by using an associative scan, allowing them to train in parallel like a Transformer while maintaining a fixed-size hidden state during inference. The hidden state $h_t$ acts as a constant-size memory buffer:
$$h_t = A_t h_{t-1} + B_t x_t$$
Because the size of $h_t$ does not grow with the sequence length, generation memory remains $O(1)$, and training scales completely linearly ($O(N)$).
Xiangyu Zhang et al. explored this transition in Mamba in Speech: Towards an Alternative to Self-Attention, integrating Selective State Space Models (Mamba) into Transformer and Conformer frameworks to match state-of-the-art speech recognition performance while slashing computational overhead. For generation tasks, Se Jin Park developed Long-Form Speech Generation with Spoken Language Models (SpeechSSM), demonstrating the first state-space spoken language model capable of generating up to 16 minutes of continuous, high-quality speech without running out of hardware memory.
This linear-time recurrence has proven equally powerful for raw audio waveforms. Konrad Szewczyk et al. introduced HarmonicRNN in Linear RNNs for autoregressive generation of long music samples, combining linear Gated Recurrent Units (LRUs) with temporal pooling to autoregressively generate music samples containing up to one million tokens. Similarly, Jie Song et al. proposed the REB-former: RWKV-enhanced E-branchformer for Speech Recognition, fusing the global modeling power of the E-Branchformer with the linear computational efficiency of the RWKV (Receptance Weighted Key Value) model to significantly reduce inference latency.
By re-engineering how models capture context—whether by shrinking the sequence, restricting the view, changing the algebra, or maintaining a recurrent state—the field has successfully broken the quadratic bottleneck, making long-form audio processing highly scalable and practical.
Key Foundational Work
Very Deep Convolutional Networks for End-to-End Speech Recognition (2016) — contributed 1 concept elements to this direction.
Audio Scene Classification with Deep Recurrent Neural Networks (2017) — contributed 1 concept elements to this direction.