Taylor Multi-Head Self-Attention
- Taylor Multi-Head Self-Attention (T-MSA) is a reformulation of standard attention that uses a truncated Taylor series to approximate softmax for efficient global modeling.
- It factorizes computations into global sums and per-query inner products, reducing the quadratic complexity to linear time for handling long time-frequency sequences.
- When integrated with Spatial-Channel Enhancement Attention (SCEA) in the LORT architecture, T-MSA achieves competitive speech enhancement performance with minimal parameters.
Searching arXiv for the cited papers to ground the article in the current records. Taylor Multi-Head Self-Attention (T-MSA) is a Taylor-based reformulation of multi-head self-attention designed to reduce the quadratic cost of softmax attention on long sequences by replacing the exponential kernel with a truncated Taylor series and algebraically factorizing the resulting computation into global sums and per-query inner products. In the speech-enhancement architecture LORT, T-MSA is instantiated with a first-order truncation, integrated with Spatial-Channel Enhancement Attention (SCEA), and deployed in a multi-resolution U-Net-like encoder-decoder to provide efficient global modeling for time-frequency representations while maintaining a low parameter count and computational complexity (Wang et al., 28 Sep 2025).
1. Motivation and problem setting
In speech enhancement, spectrogram sequences are long, and standard softmax attention incurs quadratic complexity in sequence length. Within U-Net-like multi-resolution processing, global modeling across many time-frequency tokens becomes expensive. T-MSA addresses this by replacing the exponential kernel implicit in softmax with a low-order Taylor polynomial, yielding a linear-time attention computation while preserving global context (Wang et al., 28 Sep 2025).
The standard difficulty is the need to construct and normalize dense affinity matrices of size . This is both time- and memory-intensive, and it can be numerically sensitive when logits have large magnitude. T-MSA avoids the explicit softmax normalization over all query-key pairs by using a polynomial approximation that factors computations into global sums and low-rank aggregations. In the formulation reported for LORT, the resulting complexity drops from to approximately with respect to the number of tokens .
For input of patches and hidden dimension , the reported costs are
Since , the Taylor-based form is more efficient as grows. In LORT, this efficiency is part of a lightweight design that achieves only 0 parameters while retaining multi-resolution global modeling (Wang et al., 28 Sep 2025).
2. Mathematical formulation
For reference, standard scaled dot-product attention for head 1 is defined with
2
3
and
4
T-MSA replaces the exponential in softmax by a truncated Taylor series. For a scalar 5,
6
In LORT, a first-order truncation is adopted:
7
For query 8, key 9, and value 0, standard attention applies
1
With the first-order Taylor expansion,
2
The numerator and denominator then factorize as
3
4
where
5
6
7
Thus,
8
This factorization avoids the explicit 9 matrix and enables linear-time aggregation. LORT retains the 0 scaling, and a stabilized form is also given as
1
The same construction is applied independently across heads after linear projections
2
followed by splitting into 3 heads and final recombination through
4
A feature-mapping interpretation is also provided: the first-order approximation corresponds to polynomial features 5, so that softmax attention is approximated by a normalized bilinear form in 6 and 7 (Wang et al., 28 Sep 2025).
3. Integration with SCEA and multi-resolution LORT
In LORT, T-MSA is not used in isolation. It is enhanced by Spatial-Channel Enhancement Attention, a complementary branch introduced to facilitate inter-channel information exchange and alleviate the spatial attention limitations inherent in Taylor-based Transformers. The design explicitly assigns different roles: T-MSA emphasizes global attention primarily within each channel, while SCEA re-introduces inter-channel information exchange and spatial saliency (Wang et al., 28 Sep 2025).
SCEA has two branches. The channel-attention branch performs 2-D average pooling over time-frequency to obtain channel descriptors 8 and applies a 1-D convolution across channels with kernel size 9 and a sigmoid:
0
The spatial-attention branch pools over channels to obtain 1 and applies a 2 convolution with sigmoid:
3
These weights modulate the T-MSA output multiplicatively, and the SCEA-modulated output is fused with the T-MSA branch. The stated purpose is to alleviate limited spatial sensitivity and inject inter-channel communication missing in T-MSA.
At the architectural level, LORT uses a U-Net-like encoder-decoder. The encoder has two convolutions, expanding to 4 channels and halving frequency resolution, followed by a Dilated DenseNet. A deformable embedding, denoted DSDCN, controls receptive field offsets. Between encoder and decoder, LORT stacks 5 locally refined Taylor transformer blocks, each containing LayerNorm, T-MSA + SCEA, a feed-forward network, and a Locally Refined Convolution block. Features pass through T-MSA modules at multiple resolutions using alternating downsampling and upsampling, so that increasingly coarse time-frequency scales capture long-range dependencies before subsequent refinement during upsampling.
The LRC block complements T-MSA by modeling local structure. It integrates convolutional feed-forward layers, time-frequency dense local convolutions, and gated units. The paper characterizes the division of labor as follows: multi-resolution attention captures long-range temporal and spectral interactions for global denoising, while LRC captures fine local time-frequency patterns associated with transient preservation and artifact reduction. This suggests that T-MSA is intended as the global component in an explicitly hybrid global-local design (Wang et al., 28 Sep 2025).
4. Computational profile, normalization, and implementation
The per-head complexity description in LORT distinguishes standard MSA from T-MSA. Standard MSA requires 6 to form 7 and 8 to apply 9, with memory 0 to store the attention matrix. For first-order T-MSA, the main precomputations are 1, 2, and 3, after which each query needs only inner products with the pre-aggregated statistics. The resulting total is
4
with memory
5
and no 6 matrix (Wang et al., 28 Sep 2025).
The overall LORT model has only approximately 7 parameters. The stated reasons are the small encoder channel count of 8, the use of efficient T-MSA instead of quadratic softmax attention, and the lightweight local convolutions and gated units in LRC. On VCTK+DEMAND with 9 blocks, LORT achieves 0 FLOPs.
Several implementation details are specifically tied to T-MSA. The Taylor order is 1. LayerNorm is placed around attention modules, and residual connections are used in both attention and LRC blocks. SCEA uses 2-D pooling with 1-D convolution in the channel branch and channel-wise pooling with 2 convolution in the spatial branch, both with sigmoid activations and multiplicative broadcast modulation. Positional encoding is not explicitly stated; instead, positional context is said to rely on deformable embeddings and multi-resolution processing.
The paper also notes stabilization mechanisms. Because the first-order truncation neglects higher-order terms, LORT adds Multi-Scale Attention Refinement (MSAR), which learns local corrections from 3 and 4 via lightweight local operations to rectify the Taylor-approximated output. Together with LayerNorm, residual connections, and the optional addition of a small 5 in the denominator, these choices are presented as measures that stabilize training.
The STFT configuration relevant to the full system is FFT length 6, window 7, hop 8, and sample rate 9. The stated experimental optimum is hop 0; larger hops reduce FLOPs but hurt PESQ, CSIG, and COVL. With 1 Taylor blocks and 2 channels, the reported runtime profile is approximately 3 FLOPs per 4, 5 sample, which is described as feasible for modern edge devices (Wang et al., 28 Sep 2025).
5. Training objective and empirical behavior
Within LORT, T-MSA participates in a system that decodes enhanced magnitude and phase spectra independently and optimizes them with a composite loss:
6
The complex loss is
7
the magnitude loss is
8
and the phase loss is decomposed into group delay, instantaneous angular frequency, and instantaneous phase components:
9
0
1
with
2
The STFT consistency loss is
3
The metric-guided adversarial terms are
4
5
The paper sets 6 and uses AdamW (Wang et al., 28 Sep 2025).
On VCTK+DEMAND, LORT with 7 parameters and 8 FLOPs achieves PESQ 9, STOI 0, CSIG 1, CBAK 2, and COVL 3. On the DNS Challenge datasets under general DNS noise, it attains average PESQ 4 and average STOI 5. Under Babble and Factory noise, it delivers the highest average PESQ values of 6 and 7, and top STOI values of 8 and 9.
The ablation results specifically indicate the role of SCEA alongside T-MSA. Removing SCEA lowers PESQ from 00 to 01 and COVL from 02 to 03. The paper interprets this as evidence that SCEA effectively complements T-MSA by enhancing spatial saliency and inter-channel exchange. Removing CFN or TF-DLC also degrades performance, supporting the stated complementarity between attention-based global modeling and LRC-based local modeling. A plausible implication is that the efficacy of T-MSA in LORT depends not only on its linear attention approximation, but also on the surrounding corrective and local-refinement mechanisms (Wang et al., 28 Sep 2025).
6. Relation to TaylorShift and other efficient attention variants
A broader and more general Taylor-based perspective is provided by TaylorShift, which reformulates Taylor-Softmax so that full token-to-token interactions can be computed in linear time and space with respect to sequence length 04 while permitting a “shift back” to standard attention for short sequences (Nauen et al., 2024). TaylorShift uses a second-order truncation, 05, rather than the first-order truncation used in LORT.
In TaylorShift, the attention polynomial is
06
with unnormalized numerator and denominator
07
and output
08
The key algebraic device is the factorization of the elementwise-squared term through a “boxtimes” operator, giving
09
This yields an efficient per-head implementation,
10
with an analogous denominator computed by replacing 11 by an all-ones vector or by augmenting 12 with a ones channel. TaylorShift also introduces a normalization strategy based on L2-normalizing queries and keys, a per-head temperature 13, scaling by 14, and scaling 15 by 16, with an additional normalization factor proportional to 17 to maintain numerical stability.
The complexity trade-off in TaylorShift differs from first-order T-MSA. For the efficient second-order implementation, the dominant per-head cost is linear in 18 but cubic in 19:
20
Its empirical crossover behavior is reported as memory-efficient for sequences as short as approximately 21 tokens and faster than standard attention for inputs of approximately 22 tokens and beyond. In full Transformer encoders, TaylorShift uses less memory than the standard Transformer at 23, is faster at 24, and reduces memory by approximately 25 at 26 and approximately 27 at 28 on NVIDIA A100 GPUs (Nauen et al., 2024).
The LORT paper positions first-order T-MSA relative to other efficient attention variants in more qualitative terms. Performer is described as using random features for the softmax kernel, thereby achieving linear attention through Monte Carlo approximations but introducing variance. Linformer is described as reducing complexity by projecting keys and values along the sequence dimension to a fixed rank, potentially imposing a learned low-rank bottleneck. Nyströmformer is described as using landmark points to approximate softmax attention and thus requiring landmark selection. LORT’s T-MSA is characterized as deterministic, polynomial, and based on closed-form global sums. Higher-order polynomial or Taylor attentions are said to improve accuracy at higher cost; LORT therefore adopts 29 and compensates with MSAR and SCEA. This suggests a spectrum of Taylor-based attention designs in which LORT occupies the lightweight, speech-enhancement-oriented end, while TaylorShift provides a more general second-order formulation for long-sequence Transformers (Wang et al., 28 Sep 2025).
7. Limitations, misconceptions, and scope
A recurring misconception is that all linear-time attention methods discard dense token-to-token interactions. The TaylorShift formulation explicitly argues otherwise: under the polynomial surrogate, all interactions are preserved and the computation is merely reordered through pre-aggregated moments (Nauen et al., 2024). In contrast, LORT’s first-order T-MSA is described in a more task-specific way, emphasizing efficient global context rather than making a general claim about preserving the full fidelity of exact softmax.
The main limitation identified for LORT’s T-MSA is approximation error from first-order truncation. The paper states that accuracy may drop when 30 has large magnitude or broad distribution. It also notes that reduced cross-channel attention in the T-MSA branch requires explicit compensatory mechanisms such as SCEA. These are not incidental details: SCEA is presented as necessary to restore inter-channel exchange and spatial saliency, while MSAR provides local corrective terms to offset the neglected higher-order Taylor terms.
Resource scaling also imposes a boundary on applicability. T-MSA is motivated for long spectrogram sequences and resource-constrained speech enhancement, especially on-device or low-memory settings. The practical guidance given in LORT is to prefer T-MSA when quadratic attention is prohibitive and when architectures already include local modules such as LRC for fine-grained modeling. Stability recommendations include retaining the 31 scaling, adding 32 to the denominator, using LayerNorm and residual connections, and employing MSAR and SCEA (Wang et al., 28 Sep 2025).
For TaylorShift, the corresponding limitations are different. The approximation quality depends on the polynomial order 33; 34 is a surrogate to softmax rather than an exact replacement. The efficient implementation scales as 35 per head, so very large head dimensions reduce the practical advantage of linear-in-36 scaling. The linear-time guarantees also depend on mask structure: they hold for all-to-all, causal, and structured masks that allow reusable aggregation, but fully arbitrary per-query masks may lose those guarantees (Nauen et al., 2024).
Taken together, these formulations define T-MSA not as a single universally fixed mechanism but as a family of Taylor-based attention constructions. In LORT, the term refers specifically to a first-order Taylor multi-head self-attention module embedded in a speech-enhancement system with SCEA, LRC, deformable embedding, and multi-resolution processing. In the broader TaylorShift formulation, the same underlying principle is developed into a second-order, general-purpose Transformer mechanism with explicit switching criteria between efficient and standard attention regimes.