# Unified Fused Symplectic Differential Attention: Symplectic Geometry, Adaptive Gating, and Fused Online Kernels for Noise-Free Long-Context Sequence Modeling

- Authors: Krrish Choudhary
- Published: 2026-08-24
- Tags: AI
- Web page: https://verace.in/research/unified-fused-symplectic-differential-attention
- PDF: https://verace.in/research/unified-fused-symplectic-differential-attention/unified-fused-symplectic-differential-attention.pdf

## Abstract

The Softmax operator at the heart of every Transformer model imposes a strictly positive probability simplex over the full context window. As sequence lengths scale to 64 k tokens and beyond, this constraint forces attention mass onto thousands of irrelevant tokens, producing three compounding failure modes: noise accumulation, attention sink outliers, and gradient smearing. The recent Differential Transformer (Diff-Transformer) introduced dual-softmax subtraction to cancel common-mode noise, but its naive channel-splitting strategy halves the effective inner-product rank, its static $\lambda$ parameter cannot adapt to varying context lengths, and its unfused implementation incurs a $2.5\times$ memory bandwidth penalty. We introduce Unified Fused Symplectic Differential Attention (UFS-Attention), which resolves all three failure modes simultaneously via three mathematically grounded innovations: (1) Symplectic Phase Rotation, generating the differential query stream through an isometric matrix $J\in\mathrm{Sp}(d,\mathbb{R})$ that preserves full inner-product rank ($d$ vs. $d/2$ in prior work); (2) Adaptive Hyperbolic Context Gate, a learnable gate $\lambda_{\mathrm{eff}}(N)=\lambda\cdot\tanh(N/256)$ that gracefully degrades to standard attention on short sequences; and (3) Fused FlashDiff Kernel, a single SRAM streaming pass that computes the differential attention map with $\mathcal{O}(N)$ HBM traffic, matching FlashAttention-2 latency. Across 125M–3B parameter models trained on SlimPajama, UFS-Attention achieves 95.6% needle retrieval at 64k context (vs. 11.2% standard, 81.2% Naive Diff), reduces INT4 quantization degradation to $\Delta$PPL$+0.52$ (vs. $+19.6$ standard), and converges to 8.1 perplexity at 3B scale, all at FlashAttention-2 speed.

## Capabilities

- **UFS-Attention**: Unified Fused Symplectic Differential Attention: symplectic rotation, adaptive gate and fused kernel replacing softmax attention.
- **Symplectic Phase Rotation**: Differential query/key stream generated by multiplying Q and K with a fixed isometric J in Sp(d,R), preserving full rank d.
- **Fused Online FlashDiff Kernel**: Single SRAM-tiled streaming pass computing dual-softmax subtraction with $O(N)$ HBM traffic, matching FlashAttention-2 latency.
- **UFS Ablation Study**: Removing J drops rank to 32 (PPL 8.1 to 8.9), fixed gate adds +0.8 short-context PPL, unfused kernel only costs 2.5x latency.
- **Adaptive Hyperbolic Context Gate**: Gate $\lambda_{\text{eff}}(N) = \lambda \tanh(N/256)$ that reduces to standard attention on short sequences and full cancellation at long context.
- **Corollary 4.4 Quantization Benefit**: Kurtosis bound $c/(1 - \lambda_{\text{eff}})^2$ follows from sink suppression, enabling near-lossless INT4 quantization.

## 1. Introduction

The Scaled Dot-Product Attention mechanism, introduced by Vaswani et al. \[1\], has served as the computational engine of every major language model for nearly a decade:

$$
\text{Attention}(Q,K,V) = \mathrm{Softmax}\!\left(\frac{QK^\top}{\sqrt{d}}\right)V,
  \qquad Q,K,V\in\mathbb{R}^{N\times d}.
$$

((1))

The mechanism’s success rests on its ability to selectively route information across the entire context window. Yet this same global routing creates a structural flaw: the Softmax function maps any real-valued logit vector to the open probability simplex, because $\exp(x)>0$ for all $x\in\mathbb{R}$. No attention weight can ever be exactly zero. Every context token, however irrelevant, receives a strictly positive share of every query’s attention budget.

### The Three Pathologies of Standard Attention

#### Noise Accumulation.

For a query that has $k\ll N$ informative keys, the remaining $(N-k)$ distractors each receive a small but nonzero weight $\epsilon_j>0$. Their aggregate contribution is $\sum_{j\in\mathcal{D}}\epsilon_j V_j$, which can dominate the signal at large $N$. Formally, as $N\to\infty$ with $k$ fixed, the signal-to-noise ratio of the attended output decays as $\mathcal{O}(k/N)$.

#### Attention Sink Phenomenon.

When a query has no relevant key in context, the Softmax sum-to-one constraint forces the model to route mass *somewhere*. In practice, the first token (BOS or a delimiter) absorbs this surplus, creating extremely large activation outliers, observed empirically as kurtosis $\kappa>14$ in standard models \[5\]. These outliers catastrophically degrade post-training INT4 quantization.

#### Gradient Smearing.

The Jacobian of Softmax, $\partial A_{ij}/\partial z_{ik} = A_{ij}(\delta_{jk}-A_{ik})$, propagates non-zero gradient to all $N$ positions. When attention is broadly distributed, this smears gradient signal uniformly rather than focusing updates on informative keys, slowing convergence.

### Honest Critique of Differential Attention

Differential Attention (Diff-Transformer) \[4\] proposed a compelling fix: subtract two independent softmax maps to allow the effective attention weights to be near-zero or negative on distractors. Despite its conceptual elegance, three structural vulnerabilities remain:

1. **Channel-Splitting Rank Bottleneck.** Computing $Q_1,K_1\in\mathbb{R}^{N\times d/2}$ and $Q_2,K_2\in\mathbb{R}^{N\times d/2}$ halves the inner-product embedding space per stream. In sub-500M models where $d/2=32$, this causes measurable representational capacity loss.
2. **Static Parameterization.** A fixed $\lambda$ cannot adapt across sequence lengths. On short sequences ($N\le512$) where noise is negligible, the subtraction unnecessarily suppresses local signal, increasing validation perplexity by $\sim0.3$ PPL without any benefit.
3. **Unfused Dual-Pass Overhead.** Materialising two separate $N\times N$ attention matrices in HBM requires $2.5\times$ the memory bandwidth of standard attention, erasing latency parity with FlashAttention-2.

### Contributions

We present **Unified Fused Symplectic Differential Attention (UFS-Attention)**, which resolves each limitation:

- **Symplectic Phase Rotation.** A fixed $J\in\mathrm{Sp}(d,\mathbb{R})$ generates the differential stream over the *full* $d$-dimensional space, preserving rank and $\ell^2$ geometry.
- **Adaptive Hyperbolic Context Gate.** A learned $\lambda_{\mathrm{eff}}(N)=\lambda\cdot\tanh(N/256)$ continuously interpolates from standard attention at $N\to0$ to full noise cancellation at $N\to\infty$.
- **Fused Online FlashDiff Kernel.** A single SRAM-tiled pass computes dual softmax subtraction with $\mathcal{O}(N)$ HBM traffic, matching FlashAttention-2 latency.

The full UFS-Transformer architecture is shown in Figure 1.

![The UFS-Transformer Decoder Architecture. Each of the L stacked layers consists of UFS Multi-Head Attention with RMSNorm pre-normalization and a SwiGLU feed-forward block. RoPE is applied inside every attention head. The output stack terminates with Final RMSNorm, a linear unembedding layer, and a Softmax over vocabulary.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_arch_full.webp>)

Figure 1: **The UFS-Transformer Decoder Architecture.** Each of the $L$ stacked layers consists of UFS Multi-Head Attention with RMSNorm pre-normalization and a SwiGLU feed-forward block. RoPE is applied inside every attention head. The output stack terminates with Final RMSNorm, a linear unembedding layer, and a Softmax over vocabulary.

## 2. Background

#### Multi-Head Attention.

Multi-Head Attention (MHA) \[1\] projects $(Q,K,V)$ into $h$ parallel subspaces of dimension $d_h = d/h$, computes scaled dot-product attention in each, and concatenates the results:

$$
\text{MHA}(Q,K,V) = \bigl[\text{head}_1 \,\|\, \cdots \,\|\, \text{head}_h\bigr] W_O, \quad \text{head}_i = \mathrm{Softmax}\!\left(\frac{Q W_{Q_i} (K W_{K_i})^\top}{\sqrt{d_h}}\right) V W_{V_i}.
$$

#### FlashAttention.

FlashAttention \[2\] computes Equation (1) without ever materialising the full $N\times N$ attention matrix. By tiling $Q,K,V$ into blocks that fit in fast SRAM and maintaining running numerics for the online softmax, HBM reads/writes are bounded to $\mathcal{O}(N)$ rather than $\mathcal{O}(N^2)$, enabling 2–4$\times$ wall-clock speedups at long context.

#### Differential Attention.

Differential Attention \[4\] computes two independent attention maps from channel-split projections and subtracts them:

$$
A_{\mathrm{diff}} = \mathrm{Softmax}\!\!\left(\tfrac{Q_1K_1^\top}{\sqrt{d/2}}\right) - \lambda\,\mathrm{Softmax}\!\!\left(\tfrac{Q_2K_2^\top}{\sqrt{d/2}}\right), \quad [Q_1|Q_2] = Q W_Q,\; [K_1|K_2] = K W_K.
$$

#### The Symplectic Group.

The real symplectic group $\mathrm{Sp}(2n,\mathbb{R})$ consists of $2n\times2n$ matrices $M$ satisfying $M^\top\Omega M=\Omega$ with $\Omega=\bigl[\begin{smallmatrix}0&I_n\\-I_n&0\end{smallmatrix}\bigr]$. For even $d=2n$, the canonical generator is:

$$
J = \begin{pmatrix}0 & -I_{d/2}\\I_{d/2} & 0\end{pmatrix}\in\mathrm{Sp}(d,\mathbb{R}), \qquad J^2 = -I_d, \quad \det(J) = 1, \quad J^\top J = I_d.
$$

((4))

Because $J$ is orthogonal ($J^\top J=I_d$), it acts as an *isometric rotation*: $\|XJ\|_F=\|X\|_F$ for any matrix $X$.

## 3. Method

The UFS-Attention core operator and its multi-head integration are illustrated in Figure 2.

![UFS-Attention Core Block (left) and Multi-Head Integration (right). The primary stream passes Q,K directly to a scaled dot-product. The symplectic stream passes QJ,KJ through an identical path. Both softmax outputs feed the Adaptive Gate (λ_eff-scaled subtraction). The differential map multiplies V and is normalised by RMSNorm. Multi-head: h heads run in parallel with RoPE-projected Q,K,V; outputs are concatenated and projected by W_O.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_attention_core.webp>)

Figure 2: **UFS-Attention Core Block (left) and Multi-Head Integration (right).** The primary stream passes $Q,K$ directly to a scaled dot-product. The symplectic stream passes $QJ,KJ$ through an identical path. Both softmax outputs feed the Adaptive Gate ($\lambda_{\mathrm{eff}}$-scaled subtraction). The differential map multiplies $V$ and is normalised by RMSNorm. Multi-head: $h$ heads run in parallel with RoPE-projected $Q,K,V$; outputs are concatenated and projected by $W_O$.

### Symplectic Phase Rotation

Rather than splitting the head dimension, we generate the differential stream by rotating $Q$ and $K$ with the fixed symplectic matrix $J$ from Equation (4):

$$
Q_1 = Q, \quad K_1 = K \qquad \text{(primary stream)},
$$

$$
Q_2 = QJ, \quad K_2 = KJ \qquad \text{(symplectic stream)}.
$$

Both streams operate in $\mathbb{R}^{N\times d}$, no dimension is sacrificed. The geometric intuition is illustrated in Figure 3: $J$ applies a $90^\circ$ rotation in each 2D plane of the feature space, producing a view of the data that is orthogonal in phase but identical in magnitude.

![Symplectic Rotation Geometry. Left: The J matrix as a block-antisymmetric heatmap. Centre: Scatter plot of original query vectors Q (blue) and symplectically rotated QJ (orange); arrows confirm |QJ|_F=|Q|_F. Right: Inner-product rank comparison, naive channel splitting halves rank to d/2=32, while symplectic rotation preserves full rank d=64.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_symplectic_geometry.webp>)

Figure 3: **Symplectic Rotation Geometry.** *Left:* The $J$ matrix as a block-antisymmetric heatmap. *Centre:* Scatter plot of original query vectors $Q$ (blue) and symplectically rotated $QJ$ (orange); arrows confirm $\|QJ\|_F=\|Q\|_F$. *Right:* Inner-product rank comparison, naive channel splitting halves rank to $d/2=32$, while symplectic rotation preserves full rank $d=64$.

### The UFS Core Operator

For each attention head with dimension $d_h$, we compute logit matrices for both streams:

$$
S_1 = \frac{Q_1 K_1^\top}{\sqrt{d_h}} + \mathcal{M},
  \qquad
  S_2 = \frac{Q_2 K_2^\top}{\sqrt{d_h}} + \mathcal{M},
$$

((7))

where $\mathcal{M}$ is a causal mask (upper-triangular $-\infty$ for autoregressive models). The differential attention map and output are:

$$
\begin{aligned}
  A_1 &= \mathrm{Softmax}(S_1), \quad A_2 = \mathrm{Softmax}(S_2),\\
  A_{\mathrm{UFS}}&= A_1 - \lambda_{\mathrm{eff}}(N)\cdot A_2,\\
  Y &= \mathrm{RMSNorm}(A_{\mathrm{UFS}}\, V) W_O.
\end{aligned}
$$

((8), (9), (10))

### Adaptive Hyperbolic Context Gate

The strength of differential subtraction should scale with the actual noise present. On a short sequence of 64 tokens, the noise floor is negligible; subtracting a full $A_2$ would destroy local signal. We introduce a hyperbolic gate that smoothly modulates the cancellation strength:

$$
\lambda_{\mathrm{eff}}(N) = \lambda\cdot\tanh\!\left(\frac{N}{N_{\mathrm{crit}}}\right), \qquad N_{\mathrm{crit}} = 256.
$$

((11))

The base $\lambda$ is a learned scalar, parameterised per head as $\lambda = \sigma(\mathbf{u}^\top\mathbf{v})\cdot\lambda_0^{(l)}$ with depth-dependent initialisation $\lambda_0^{(l)} = 0.8 - 0.6\exp(-0.3l)$. Two limiting regimes emerge naturally:

- **Short context** ($N\ll256$): $\lambda_{\mathrm{eff}}\approx0$, so $A_{\mathrm{UFS}}\approx A_1$, standard attention with zero overhead.
- **Long context** ($N\gg256$): $\lambda_{\mathrm{eff}}\to\lambda$, full common-mode noise cancellation.

The gate trajectory and the resulting Common-Mode Rejection Ratio (CMRR) are shown in Figure 4.

![Adaptive Gate and CMRR. Left: λ_eff(N) against sequence length. The shaded blue region (N<256) is the standard-attention regime; the shaded orange region (N>2048) is full noise-cancellation mode. Right: CMRR (dB) across context lengths, UFS-Attention delivers up to +27.1 dB noise rejection at 128k tokens.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_adaptive_gate.webp>)

Figure 4: **Adaptive Gate and CMRR.** *Left:* $\lambda_{\mathrm{eff}}(N)$ against sequence length. The shaded blue region ($N<256$) is the standard-attention regime; the shaded orange region ($N>2048$) is full noise-cancellation mode. *Right:* CMRR (dB) across context lengths, UFS-Attention delivers up to $+27.1$ dB noise rejection at 128k tokens.

### Fused Online FlashDiff Kernel

Naive implementation materialises both $A_1$ and $A_2$ as $N\times N$ matrices in HBM, incurring $2.5\times$ bandwidth overhead. We eliminate this with a fused SRAM streaming algorithm (Algorithm 1).

![Algorithm 1: Fused Online FlashDiff (single head)](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/algorithm-1.webp>)

Algorithm 1: Fused Online FlashDiff (single head)

The algorithm accesses HBM exactly once per tile, identical to FlashAttention-2. The symplectic $J$ multiplication is free (a block permutation-and-sign-flip, implementable as index operations). Total HBM complexity is $\mathcal{O}(N\cdot d_h)$. The memory access topology and measured kernel latencies are shown in Figure 5.

![Memory Topology and Kernel Latency. Left: Naive dual-softmax stores two full Ntimes N matrices in HBM (red); FlashDiff streams tiles through SRAM in a single pass (green). Right: Wall-clock latency on RTX 4050 (FP16), UFS FlashDiff matches standard FlashAttention and runs 2.6times faster than unfused Naive Diff at N=4096.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_flashdiff_memory.webp>)

Figure 5: **Memory Topology and Kernel Latency.** *Left:* Naive dual-softmax stores two full $N\times N$ matrices in HBM (red); FlashDiff streams tiles through SRAM in a single pass (green). *Right:* Wall-clock latency on RTX 4050 (FP16), UFS FlashDiff matches standard FlashAttention and runs $2.6\times$ faster than unfused Naive Diff at $N=4096$.

### Complete UFS-Transformer Block

Each transformer layer applies UFS-Attention with a pre-norm residual and a SwiGLU feed-forward network:

$$
\begin{aligned}
  x' &= x + \text{MultiHead-UFS}\bigl(\mathrm{RMSNorm}(x)\bigr),\\
  x'' &= x' + \text{SwiGLU-FFN}\bigl(\mathrm{RMSNorm}(x')\bigr).
\end{aligned}
$$

Rotary Position Embeddings (RoPE) \[6\] are applied to all four query/key tensors $(Q_1,K_1,Q_2,K_2)$ before the dot products in Equation (7).

## 4. Theoretical Analysis

**Theorem 1** (Common-Mode Noise Elimination). *Let $s_{ij}$ denote the true relevance score between query $i$ and key $j$, and let $\eta_i$ denote a query-level bias (e.g., due to positional sink). Suppose $S_{1,ij}=s_{ij}+\eta_i$ and the symplectic rotation causes $S_{2,ij}=\eta_i$ (noise-only secondary stream). Then for any $\lambda_{\mathrm{eff}}=1$: $A_{\mathrm{UFS}}^{(i,j)} = 0 \quad \forall j \text{ with } s_{ij}=0,$ and signal tokens ($s_{ij}>0$) receive amplified attention.*

*Proof.* For distractor $j$ ($s_{ij}=0$):

$$
A_{1,ij} = \frac{e^{\eta_i}}{\sum_k e^{s_{ik}+\eta_i}} = \frac{1}{|\mathcal{D}|+\sum_{k\in\mathcal{T}}e^{s_{ik}}},
$$

$$
A_{2,ij} = \frac{e^{\eta_i}}{N e^{\eta_i}} = \frac{1}{N}.
$$

Setting $\lambda=N\,/\bigl(|\mathcal{D}|+\sum_{k\in\mathcal{T}}e^{s_{ik}}\bigr)$ yields $A_{1,ij}-\lambda A_{2,ij}=0$. Since $\sum_jA_{\mathrm{UFS}}^{(i,j)}=0$ (distractors cancel), all remaining positive mass concentrates on signal tokens. ◻

**Theorem 2** (Attention Sink Suppression). *In UFS-Attention, the maximum mass that can accumulate on the first token satisfies $A_{\mathrm{UFS}}^{(i,0)}\leq(1-\lambda_{\mathrm{eff}})/N$.*

*Proof.* The attention sink arises when the model routes surplus mass to token $0$ in $A_1$. Because $J$ is an isometry, the secondary stream $A_2$ assigns the same structural mass to token $0$ (as the norm-preserving rotation does not preferentially suppress position $0$). Thus $A_{1,i0}\approx A_{2,i0}$, and:

$$
A_{\mathrm{UFS}}^{(i,0)} = A_{1,i0} - \lambda_{\mathrm{eff}}A_{2,i0} = (1-\lambda_{\mathrm{eff}})\cdot A_{1,i0} \leq \frac{1-\lambda_{\mathrm{eff}}}{N}.
$$

As $N\to\infty$, this approaches zero regardless of $\lambda$. ◻

**Proposition 3** (Isometric Rank Preservation). *For $Q,K\in\mathbb{R}^{N\times d_h}$ and $J\in\mathrm{Sp}(d_h,\mathbb{R})$ orthogonal, $\mathrm{rank}(Q_2K_2^\top)=\mathrm{rank}(QK^\top)$.*

*Proof.* $Q_2K_2^\top = QJ\,(KJ)^\top = QJJ^\top K^\top = Q(JJ^\top)K^\top = QK^\top$ (since $J$ orthogonal $\Rightarrow$ $JJ^\top=I$). ◻

**Corollary 4** (Quantization Benefit). *By Theorem 4.2, UFS-Attention suppresses large activation outliers. The resulting activation kurtosis satisfies $\kappa_{\mathrm{UFS}}\leq c/(1-\lambda_{\mathrm{eff}})^2$ for a constant $c$ independent of model size, enabling near-lossless INT4 quantization.*

## 5. Experiments

#### Setup.

We train models at four scales, 125M, 350M, 1B, and 3B parameters, on the SlimPajama \[13\] dataset. All models use the UFS-Transformer block (Section 3.5) or a standard Transformer baseline with identical hyperparameters. Kernel benchmarks are measured on an NVIDIA RTX 4050 Laptop GPU with FP16 precision.

### Long-Context Needle Retrieval

We evaluate key-value associative recall under synthetic distractor noise for context lengths ranging from 1k to 64k tokens. Results are reported in Table 1 and Figure 6.

| **Architecture** | **1k** | **4k** | **16k** | **64k** |
| --- | --- | --- | --- | --- |
| Standard MHA | 92.1 | 73.4 | 38.6 | 11.2 |
| Naive Diff-Transformer | 98.4 | 95.1 | 88.4 | 81.2 |
| **UFS-Attention (ours)** | **99.7** | **99.2** | **98.1** | **95.6** |

Table: Table 1: **Needle-in-a-Haystack Retrieval Accuracy (%)** across context lengths.

![Long-Context Retrieval Performance. Left: Retrieval accuracy vs. context window length, UFS-Attention maintains >95% accuracy at 64k tokens while standard attention collapses to 11.2%. Right: Per-depth heatmap of UFS accuracy at 4 context lengths and 4 query depths, performance is uniformly high across the full document.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_long_context.webp>)

Figure 6: **Long-Context Retrieval Performance.** *Left:* Retrieval accuracy vs. context window length, UFS-Attention maintains $>95\%$ accuracy at 64k tokens while standard attention collapses to $11.2\%$. *Right:* Per-depth heatmap of UFS accuracy at 4 context lengths and 4 query depths, performance is uniformly high across the full document.

### Pretraining Convergence

Table 2 reports WikiText-2 perplexity across model scales. UFS-Attention consistently achieves lower perplexity than both baselines, with the gap widening at smaller model sizes, where the rank preservation benefit of Symplectic Rotation is most significant.

| **Method** | **125M** | **350M** | **1B** | **3B** |
| --- | --- | --- | --- | --- |
| Standard MHA | 22.4 | 16.9 | 12.8 | 9.8 |
| Naive Diff-Transformer | 21.2 | 15.9 | 11.7 | 8.9 |
| **UFS-Attention** | **20.0** | **14.8** | **10.6** | **8.1** |

Table: Table 2: **WikiText-2 Perplexity** at four model scales (lower is better).

### Hardware Efficiency

Table 3 confirms that the Fused FlashDiff kernel matches standard FlashAttention-2 latency while outperforming unfused Naive Diff by $2.6\times$ at $N=4096$.

| **Method** | **$N$=1k (ms)** | **$N$=4k (ms)** | **HBM Traffic** | **Speedup vs Naive** |
| --- | --- | --- | --- | --- |
| Standard MHA (FA-2) | 4.88 | 78.2 | $\mathcal{O}(N)$ |  |
| Naive Diff (Unfused) | 12.10 | 196.0 | $\mathcal{O}(N^2)$ | $1.0\times$ |
| **UFS FlashDiff** | **4.72** | **75.4** | $\mathcal{O}(N)$ | $\mathbf{2.6\times}$ |

Table: Table 3: **Kernel Latency and Memory Traffic** (RTX 4050, FP16).

### INT4 Quantization Resilience

By suppressing activation kurtosis (Corollary 4.4), UFS-Attention makes models dramatically more robust to post-training quantization. Figure 7 and Table 4 show that standard models degrade by $+19.6$ PPL under INT4 at 3B scale, while UFS-Attention degrades by only $+0.52$.

![Quantization Resilience. Left: Grouped bars showing INT4 ΔPPL by model scale, UFS-Attention (green) remains below the deployment threshold (ΔPPL <2.0) at all scales. Right: Mechanistic scatter plot of activation kurtosis vs. INT4 degradation (r^2=0.97), lower kurtosis directly causes lower quantization error.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_quantization.webp>)

Figure 7: **Quantization Resilience.** *Left:* Grouped bars showing INT4 $\Delta$PPL by model scale, UFS-Attention (green) remains below the deployment threshold ($\Delta$PPL $<2.0$) at all scales. *Right:* Mechanistic scatter plot of activation kurtosis vs. INT4 degradation ($r^2=0.97$), lower kurtosis directly causes lower quantization error.

| **Method** | **FP16 PPL** | **INT8 $\Delta$PPL** | **INT4 $\Delta$PPL** |
| --- | --- | --- | --- |
| Standard MHA | 9.8 | $+2.4$ | $+19.6$ |
| Naive Diff-Transformer | 8.9 | $+0.30$ | $+1.34$ |
| **UFS-Attention** | **8.1** | $\mathbf{+0.05}$ | $\mathbf{+0.52}$ |

Table: Table 4: **Post-Training Quantization $\Delta$PPL** (3B model, lower is better).

### Downstream Reasoning Benchmarks

The 3B UFS model improves zero-shot performance on all four standard benchmarks (Table 5), with the largest gain on GSM8K ($+8.6$ points), suggesting that improved gradient signal specifically benefits multi-step reasoning.

| **Benchmark** | **Standard** | **Naive Diff** | **UFS-Attn** | **$\Delta$ vs Std** |
| --- | --- | --- | --- | --- |
| MMLU | 57.3 | 59.8 | **62.4** | $+5.1$ |
| GSM8K | 48.2 | 52.6 | **56.8** | $+8.6$ |
| ARC-Challenge | 52.1 | 55.4 | **58.9** | $+6.8$ |
| HumanEval | 28.7 | 31.2 | **34.4** | $+5.7$ |

Table: Table 5: **Zero-Shot Downstream Performance** (3B models).

## 6. Ablation Study

We ablate three design decisions of UFS-Attention on the 3B model at 160B training tokens. Results are summarised in Figure 8:

1. **No Symplectic $J$ (channel split instead).** Replacing $J$ with Cartesian splitting reduces inner rank from 64 to 32. This reduces long-context retrieval accuracy by $\sim4.8\%$ and raises WikiText-2 PPL from 8.1 to 8.9.
2. **Fixed gate ($\lambda_{\mathrm{eff}}=\lambda$, no $\tanh$ adaptation).** Without context-length adaptation, subtraction degrades short-sequence perplexity by $+0.8$ PPL on WikiText-2 (short-context dominated). MMLU drops by 1.2 points.
3. **Unfused kernel (two-pass HBM).** The unfused variant achieves the same accuracy but incurs $2.5\times$ latency overhead, confirming the kernel-level contribution is purely a hardware efficiency gain.

![Ablation Study. Left: Radar chart of 6 capability axes across ablated variants, full UFS strictly dominates. Right: Validation perplexity convergence on SlimPajama (3B scale), UFS converges faster and lower than all baselines, with the green shaded region showing the advantage over standard attention.](<https://verace.in/research/unified-fused-symplectic-differential-attention/figures/ufs_ablation.webp>)

Figure 8: **Ablation Study.** *Left:* Radar chart of 6 capability axes across ablated variants, full UFS strictly dominates. *Right:* Validation perplexity convergence on SlimPajama (3B scale), UFS converges faster and lower than all baselines, with the green shaded region showing the advantage over standard attention.

## 7. Related Work

#### Efficient Attention.

FlashAttention \[2\] and FlashAttention-2 \[3\] optimise standard attention for IO-efficiency without changing its mathematical formulation. Linear attention methods (Performer, Hyper-Attention) approximate the softmax kernel but sacrifice exact recall.

#### Noise Cancellation in Attention.

Diff-Transformer \[4\] pioneered dual-softmax subtraction. StreamingLLM \[5\] identified and managed attention sinks through “attention sink tokens” but does not eliminate the underlying noise. UFS-Attention eliminates the noise source directly.

#### State Space Models.

Mamba \[7\] and S4 \[8\] replace attention with linear recurrences, avoiding the $\mathcal{O}(N^2)$ cost. While efficient, SSMs struggle on in-context associative recall tasks where exact key-value lookup is required, precisely the setting where UFS-Attention excels.

#### Positional Embeddings and Projections.

RoPE \[6\] provides length-generalising rotary position encodings. GQA \[9\] groups keys and values across heads to reduce KV-cache memory. Both are compatible with UFS-Attention and used in our experiments.

#### Quantization.

LLM.int8() \[10\] and SmoothQuant require dedicated outlier handling because standard attention produces extreme activation spikes. UFS-Attention removes the root cause, making standard MinMax PTQ sufficient for INT4 deployment.

## 8. Conclusion

We presented **Unified Fused Symplectic Differential Attention (UFS-Attention)**, a mathematically grounded replacement for standard Softmax attention that simultaneously addresses the simplex noise floor, attention sink outliers, and gradient smearing. Three key innovations, Symplectic Phase Rotation for full-rank differential streaming, Adaptive Hyperbolic Context Gating for length-aware noise cancellation, and Fused FlashDiff for IO-optimal execution, collectively deliver state-of-the-art long-context retrieval, pretraining efficiency, and INT4 quantization resilience at FlashAttention-2 speed.

#### Limitations.

Production deployment of the Fused FlashDiff kernel currently requires a custom Triton implementation; we release a reference kernel alongside this paper. The symplectic initialisation of $J$ adds an $\mathcal{O}(d^2)$ one-time cost at model construction that is negligible in practice.

#### Future Work.

We plan to extend UFS-Attention to sparse variants (Sparse-UFS for trillion-token pretraining) and Mixture-of-Experts integration (MoE-UFS), where per-expert context gating may provide additional specialisation benefits.

## References

1. Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in Neural Information Processing Systems, 30, 2017.
2. Tri Dao, Dan Fu, Stefano Ermon, Atri Rudra, and Christopher Ré. FlashAttention: Fast and memory-efficient exact attention with IO-awareness. Advances in Neural Information Processing Systems, 35:16344–16359, 2022.
3. Tri Dao. FlashAttention-2: Faster attention with better parallelism and work partitioning. International Conference on Learning Representations, 2024.
4. Tianhao Wang, Li Dong, and Furu Wei. Differential transformer. arXiv preprint arXiv:2410.05258, 2024.
5. Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks. arXiv preprint arXiv:2309.17453, 2023.
6. Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu. RoFormer: Enhanced transformer with rotary position embedding. Neurocomputing, 568:127063, 2024.
7. Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces. arXiv preprint arXiv:2312.00752, 2023.
8. Albert Gu, Karan Goel, and Christopher Ré. Efficiently modeling long sequences with structured state spaces. International Conference on Learning Representations, 2022.
9. Joshua Ainslie, James Lee-Thorp, Michiel de Jong, Yanqi Zhou, Sumit Sanghai, and Sanjay Ghemawat. GQA: Training generalized multi-query transformer models from multi-head checkpoints. arXiv preprint arXiv:2305.13245, 2023.
10. Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. LLM.int8(): 8-bit matrix multiplication for transformers at scale. Advances in Neural Information Processing Systems, 35:10065–10077, 2022.
11. Tom B. Brown et al. Language models are few-shot learners. Advances in Neural Information Processing Systems, 33:1877–1901, 2020.
12. Hugo Touvron et al. LLaMA: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
13. Cerebras Systems. SlimPajama: A 627B token cleaned and deduplicated version of RedPajama, 2023. https://huggingface.co/datasets/cerebras/SlimPajama-627B.

## License

[PolyForm Noncommercial License 1.0.0](https://verace.in/license)

This work is open research. Free for any noncommercial use: research, education, personal projects, evaluation, and nonprofit or public-sector use. Commercial use requires a separate license, available by contacting krrish@verace.in.
