Conceptio › Archive › arXiv CS
arXiv CS open access

Online Temporal Rotations for 2 Bit KV-Cache Quantization in Video Diffusion Transformers

Ryan Lucas et al. · arxiv_cs
arXiv CS · Papers
Open Source ↗Direct PDF ↓
artificial-intelligenceknowledge-representationreasoning
Video diffusion transformers reuse key--value (KV) caches across denoising steps, which quickly becomes a bottleneck for long video generation. We find that quantizing temporally distant cache vectors leads to a large range and high quantization error, but that nearby video tokens in the KV-cache sh
Conceptio Open Archive

Analyze & explore related research in Conceptio

Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.

Online Temporal Rotations for 2 Bit KV-Cache Quantization in Video Diffusion Transformers Ryan Lucas

Petros Prastakos

Rahul Mazumder

Operations Research Center, Massachusetts Institute of Technology

arXiv:2611.26334v1 [cs.CV] 19 Nov 2026

{ryanlu,pprastak,rahulmaz}@mit.edu

Abstract

previously generated content [4, 5, 10, 17, 21, 28]. Like autoregressive language models, these systems store the keys and values of past frames in a KV-cache, so the history need not be recomputed at every denoising step. However, this computational saving from the KV-cache brings with it substantial memory requirements. Each frame contributes thousands of tokens, and the cache holds a key and a value vector per token, head, and layer. It therefore grows linearly with the generated history and can reach tens of gigabytes, more than commodity GPUs can hold [26]. Capping the cache, for example with a sliding window, shrinks the context the model can attend to and erodes longrange consistency of subjects, scene layout, and motion [26]. KV-cache quantization is mature for large language models [2, 8, 14], but these methods were designed for the unique structure of LLM KV-caches and lose substantial accuracy when applied directly to video DiTs [26]. Rotation transforms have proved remarkably effective for low-bit LLM quantization [2, 15, 16, 22]. A central motivation for rotations in KV-cache quantization of LLMs is the empirically well-documented outlier structure along the channel dimension of the activations and KV-cache of LLMs. A small set of channels contain consistently large values across all tokens, forcing low-bit quantization to cover a wide range at the expense of resolution for smaller values. One intuition for why rotations are so effective in LLMs is that they take linear combinations of channels, ‘mixing’ the outlier channels with more benign channels and thus leading to much flatter distributions that are more friendly to quantization [2]. We identify two unique properties of video diffusion KVcaches that motivate online temporal rotations (Figure 1). (i) Temporal structure within a video. For a given video and channel of the cache, keys and values are highly correlated across nearby frames, with only localized changes as the scene evolves. We illustrate this structure in the first five panels of Figure 1. This similarity, however, decays over time. Frames that are distant in time, such as frames 20 and 64 of the first video, can have substantially different values.

Video diffusion transformers reuse key–value (KV) caches across denoising steps, which quickly becomes a bottleneck for long video generation. We find that quantizing temporally distant cache vectors leads to a large range and high quantization error, but that nearby video tokens in the KV-cache share a persistent pattern per channel. These patterns also vary across videos, motivating rotations that are adapted to each video’s unique cache. We propose Temporal Rotation Quantization (TRQ), a method that rotates frames in the cache that are adjacent in time before quantization. For each block of temporally adjacent cache vectors, TRQ fits an orthogonal transform that maps the block’s per-channel means to a vector that is close to a constant across channels. To keep the quantization format lightweight, we parameterize this rotation as a tree of 2 × 2 planar rotations, each stored with only two bits, followed by a fixed Hadamard transform shared across all blocks. The rotations are fit without gradients or changes to model weights, and we prove that a simple greedy fit is globally optimal for our ’mean-flattening’ objective. The transforms are fit online for each new video, and we release fused Triton kernels to make this process efficient at inference. At 2-bit precision and matched compression, TRQ improves VBench subject consistency over the state-of-theart method QVG from 90.38 to 92.02 on LongCat-Video-13B and from 86.33 to 87.61 on HY-WorldPlay-8B, as well as improving other metrics.

1. Introduction Diffusion transformers (DiTs) [19] have become the dominant architecture for video generation. They underpin proprietary systems such as Sora [3] and Movie Gen [20], as well as open models including CogVideoX [27], HunyuanVideo [11], and Wan [24], which synthesize high-fidelity videos from text or image prompts. To go beyond a few seconds of footage, toward minute-scale or interactive generation, recent work produces video autoregressively or by continuation, denoising one chunk at a time conditioned on 1

temporally distant frames are temporally much moredistant dissimilar frames are much more dissimilar Frame 20

Frame Frame 24 20

Frame Frame 28 24

Frame Frame48 28

⋯

Frame Frame 64 48

⋯

|K|

|V| |K|

Vide o

x

d Vi

eo

y

Vide o

x

d Vi

eo

Image

y

temporally adjacent frames are temporally similar adjacent frames are similar

Different video

0.5

Frame64 64 |V| Frame

|K|

2.5

0.4

2

0.3

1.5

0.2

1

0.1

0.5

0

0

|V| |K| Image

0.5

|V|

2.5

0.4

2

0.3

1.5

0.2

1

0.1

0.5

0

0

different videos have different cache structures

Figure 1. Structure of video-diffusion KV cache. Each panel overlays key and value magnitudes (|K| and |V |) on the corresponding video frame. We observe that (i) Within a video, nearby frames share persistent spatial patterns and (ii) the final two panels show that these patterns differ across videos, even at the same frame index and channel. Together, these observations motivate fitting rotations online to each video’s cache and sharing them within local temporal blocks. For other channels, see Section 7 of the appendix.

(ii) Heterogeneous structure across videos. Although the cache is stable over adjacent frames within a video, the pattern itself differs from one video to the next. The final two panels of Figure 1 show frame 64 of two different videos at the same layer, head, and channel, and their key and value patterns are markedly different. A generic channel rotation, such as the fixed random rotations used by QuaRot [2], does not explicitly exploit either of these properties. A fixed rotation must simultaneously accommodate temporal and cross-channel variation with a single rotation. Moreover, because this temporal structure differs across videos, a rotation chosen before generation cannot adapt to the cache of the video actually being generated. Instead of applying a single rotation shared across all tokens, TRQ allows adjacent frames within one video to share a rotation adapted to the content they have in common. Specifically, we divide the cache at each patch into blocks of nB consecutive latent frames and fit one orthogonal rotation RB per block, which is applied to every frame in the block (Fig. 2). Fitting the rotation separately for each video and block allows it to track the scene as it evolves, while sharing the rotation within a block amortizes its storage cost over nB cache vectors.

error. However, the temporal mean shared by nearby frames generally varies across channels, widening the range that must be quantized even when frame-specific deviations are small. We therefore seek a rotation RB that transforms the block’s mean over time into a vector that is nearly constant across channels. This lets the quantizer’s offset to capture the shared component, leaving its limited quantization levels to represent the smaller frame-specific deviations more accurately (we make this more concrete in Section 4). A general d × d rotation per block would be prohibitively expensive for a KV-cache quantized to two bits per scalar. To reduce this overhead, we construct each rotation as a balanced tree of 2 × 2 planar rotations followed by a fixed Hadamard transform shared across all blocks. Each planar rotation mixes two channels, with its angle chosen from {0, π/4, π/2, 3π/4}. It is therefore stored with two bits and applied using only additions, subtractions, and a shared scaling. The tree uses d − 1 such rotations to progressively concentrate the energy of the block’s temporal mean into a single coordinate (Fig. 3), which the Hadamard transform then spreads evenly across all d channels. For d = 128, the adaptive rotation parameters require only 254 bits per block. We fit the angles greedily, level by level in the tree, without gradients or changes to model weights. For a fixed tree (which refers to the chosen pairings of channels for the planar rotations), this procedure is globally optimal for our mean-flattening objective (Theorem 1). We also provide a custom Triton implementation of our scheme, which means that these rotations can be optimized online with almost no run-time overhead (Sec. 4.6). In experiments on LongCatVideo-13B, Self-Forcing-Wan-1.3B, and HY-WorldPlay-8B, TRQ outperforms the state-of-the-art video KV-cache quantization method QVG [26] at matched compression on all seven evaluated video fidelity and quality metrics for LongCat and Self-Forcing, and on six of seven for HY-WorldPlay (Sec. 5).

frames cache K V

K RB

1

V RB

block B1

1

K RB

2

V RB

2

block B2

K RB

3

V RB

3

block B3 t

time

Figure 2. Block-wise temporal rotations. At each image patch, the cached keys and values are divided into temporal blocks of nB consecutive latent frames. Each block receives its own key rotation K V RB and value rotation RB , applied to every frame in the block.

What should this shared rotation accomplish? An asymmetric quantizer stores a separate offset for each vector, allowing any component that is constant across channels to be represented without introducing additional quantization

2. Related Work Diffusion and flow-based generation. Diffusion transformers replace convolutional denoisers with transformer 2

backbones in latent generative models [19]. LongCat-Video combines a diffusion-transformer architecture with videocontinuation training and long-video inference [17]. HYWorldPlay-8B is a streaming video diffusion world model that generates long-horizon video autoregressively in chunks, conditioned on user actions such as camera motion, and dynamically reconstitutes context from past frames to maintain long-term geometric consistency [23]. Our method targets the conditioning KV-cache used during such long-horizon generation. It does not alter the training objective, sampling schedule, or model parameters.

corresponds to an image patch. Long videos are produced by continuation: rather than generating the whole video at once, the model generates it chunk by chunk, each chunk a short sequence of latent frames conditioned on everything generated so far. Let x1 , . . . , xc denote the chunks generated (or provided by the user) so far. The next chunk x∗ = xc+1 is generated conditioned on the clean prefix xctx = (x1 , . . . , xc ). c Once xc+1 has been generated, it is appended to the prefix, and the process repeats with xctx c+1 = (x1 , . . . , xc+1 ). We omit text conditioning from the notation for simplicity. LongCat-Video and the other models tested in this paper are trained with flow matching [13]. With a time coordinate t ∈ [0, 1] running from data (t = 0) to noise (t = 1), training interpolates linearly between the target chunk and Gaussian noise, xt = (1 − t)x∗ + t ϵ with ϵ ∼ N (0, I). The velocity along this path is dxt /dt = ϵ − x∗ . During training, the ground-truth chunk x∗ is known, and a transformer vϕ is trained to predict this velocity:   ∗ 2 ∗ L(ϕ) = E(xctx ∥vϕ (xt , t, xctx c ) − (ϵ − x )∥2 (1) c ,x ), ϵ, t

Quantization of diffusion models. Q-Diffusion addresses post-training quantization of denoising networks through timestep-aware calibration and split shortcut quantization [12]. Those mechanisms concern quantizing the denoiser activations and network weights. The goal of this work is to instead quantize the KV-cache which is reused over a continuation’s denoising steps. The closest work is QVG [26], which groups similar cache tokens, subtracts each group’s centroid and quantizes the remaining residuals in several stages. QVG explicitly represents cache patterns using centroids. Our method instead represents a local temporal mean implicitly through an adaptive orthogonal transform, motivated by the success of orthogonal transforms for the quantization of LLMs [2, 15, 16].

Here the expectation is over context–target pairs, Gaussian noise, and the training-time distribution over t. At inference, generation proceeds in the reverse direction, from noise to data. Each new chunk is initialized from (0) noise, xc+1 ∼ N (0, I), and the learned velocity field is approximately integrated from t = 1 to t = 0. For instance, for timesteps 1 = t0 > t1 > · · · > tJ = 0, inference applies denoising iteratively:

Rotations and KV-cache quantization in LLMs. Early methods for KV-cache quantization in LLMs mainly exploit the distinct structure of keys and values. KIVI quantizes keys per channel and values per token [14], and KVQuant finds that pre-RoPE keys are more friendly for quantization [8]. A second line of work rotates the cache before quantization so that outlier channels are spread across many coordinates. QuaRot uses orthogonal rotations to redistribute activation outliers while folding the inverse transform into the weights [2], SpinQuant learns rotations using Cayley SGD [15], and RotateKV applies them before RoPE and across grouped heads [22]. PolarQuant and TurboQuant use random rotations to make the coordinate distribution predictable enough for simple scalar or polar quantizers [7, 29]. In all of these methods, the rotation is either fixed or calibrated once and shared across tokens, and it targets outliers within each vector. Our transform instead adapts to each temporal block and targets the mean shared by neighboring frames. Because these transforms vary across blocks, they cannot be absorbed into one global rotation, so we parameterize them in a much more light-weight fashion (Sec. 4.2).

(j+1)

(j)

(j)

xc+1 = xc+1 + (tj+1 − tj ) vϕ (xc+1 , tj , xctx c )

(2)

Each step requires a full forward pass through all transformer layers, and the cached context enters this computation at every layer. In LongCat-Video [18], the context is processed independently of the noisy chunk and its timestep, so these keys and values are identical at every denoising step. They are therefore computed once and stored as a KV-cache Cc = (ℓ) (ℓ) {(Kc , Vc )}L ℓ=1 , which is reused for all denoising steps of chunk c + 1. After video chunk xc+1 has been generated, its clean latents are passed through the network once more to produce their keys and values, and these are appended to the existing cache rather than recomputing it. The new rows come from the Tc+1 S tokens of the new chunk (Tc+1 latent frames of S patches Pc each). After c chunks, the prefix contains Nc = S i=1 Ti tokens. With L layers, nhead heads, and d channels per head, the cache then holds 2 L nhead Nc d scalars, so its size grows linearly with the number of chunks generated and, for long videos, quickly dominates inference memory. Because the cache is append-only, each block is formed from frames that are already cached, and is compressed once.

3. Preliminaries 3.1. Video continuation and conditioning caches Video diffusion transformers generate in the compressed latent space of a video VAE, where each latent time index summarizes several RGB frames and each spatial position 3

3.2. Uniform Quantization

for short blocks (see Section 7.3 of the appendix). The shared term 1nB µB is identical in every row but generally varies across channels. Unlike the constant shifts absorbed by the quantizer’s offset in Sec. 3.2, this variation can widen each row’s range, increasing the quantization scale ∆ even when the frame-specific deviations are small. We therefore change the channel coordinates. Let RB ∈ Rd×d be an orthogonal ⊤ transform (RB RB = Id ) applied to every row. Then:

d

For a row vector y ∈ R , a b-bit uniform quantizer stores an offset m(y), a scale ∆(y), and one integer code qi (y) ∈ {0, . . . , 2b − 1} for each entry i = 1, . . . , d. For KV-cache vectors quantized online, this is typically implemented as asymmetric round-to-nearest (RTN) quantization: m(y) = min yi , i

−m(y) ∆(y) = maxi2ybi−1 ,

−m(y)  qi (y) = round yi∆(y) . (3) A key property is translation invariance: for y ′ = y + c1⊤ d, we have m(y ′ ) = m(y) + c, ∆(y ′ ) = ∆(y), and q(y ′ ) = q(y). Thus, ŷ ′ = ŷ + c1⊤ d , so the quantization error is unchanged by any value that is constant across channels. Our method exploits this invariance, as we now describe.

VB RB = 1nB (µB RB ) + EB RB

ybi = m(y) + ∆(y)qi (y),

Ideally, we could choose RB so that: µB RB ≈ cB 1⊤ d, VB RB ≈ cB 1nB 1⊤ d + EB RB Instead of a different shared value µj in each channel, the shared component now contributes the same value cB to every channel and every frame. The quantizer’s offset absorbs it, and the quantization levels are spent on the frame-specific deviations EB RB . This is similar in motivation to QVG’s centroid-based approach [26], which separates representative cache patterns from their residuals. Rather than explicitly subtracting and storing a centroid, however, we change coordinates so that the quantizer’s existing offset captures the shared temporal component.

Fix a layer ℓ, an attention head h, and a point in generation after c chunks. The cached keys and values of this head form matrices: K (ℓ,h) , V (ℓ,h) ∈ RN ×d , with one row per context token, where N = Nc is the current number of cached tokens. We describe TRQ for the values V (ℓ,h) . The keys are handled identically and independently, with their own rotations. For readability, we drop the layer and head superscripts and the chunk index from Pc here on. The N = T S context tokens come from T = i=1 Ti frames, each divided into S image patches. Consider the tokens covering the same image patch in nB consecutive frames. Stacking their value vectors as rows gives a temporal block VB ∈ RnB ×d . Nearby frames typically show much of the same visual content in a given patch, so their cached vectors share a substantial component that is stable over time (Fig. 1). Collecting these stable components in each channel to a vector gives: 1 ⊤ µB = (µ1 , µ2 , . . . , µd ) = 1 VB n B nB Writing each entry of VB as its channel mean plus a framespecific deviation ϵt,j , the block is:   µ1 + ϵ1,1 µ2 + ϵ1,2 · · · µd + ϵ1,d  µ1 + ϵ2,1 µ2 + ϵ2,2 · · · µd + ϵ2,d    VB =  , .. .. .. ..   . . . . µ2 + ϵnB ,2

···

4.1. Concentrating the channel means To make the temporal mean approximately constant across channel, we construct RB in two steps. We factor RB = GB H, where an adaptive orthogonal transform GB first concentrates the mean’s mass into its first coordinate, and a fixed Walsh–Hadamard transform H then spreads that coordinate evenly across all channels. Only GB is adapted to the block, while H is the same for every block. The key intuition here is that H can flatten a vector with mass concentrated in its first coordinate, but not an arbitrary vector. We explain this property and how it motivates our construction. Flattening. For d a power of two, let H be the normalized √ Walsh–Hadamard matrix [25]. Its first row is 1⊤ d / d, so any vector with all its mass √ in the first coordinate is mapped to a constant vector: ( d c, 0, . . . , 0)H = c1⊤ d . However, applying H directly to an arbitrary mean vector need not make it flatter. For example, it maps (3, 4, 5, 6) to (9, −1, −2, 0), increasing rather than reducing its range. Indeed, the remaining rows of H contain positive and negative entries and are orthogonal to the constant vector, so mass outside the first coordinate produces variation across channels. Thus, to exploit the flattening property of H, we first need to concentrate the temporal mean of the block into its first coordinate. Once the mean is concentrated, the spreading operation is independent of the block, so the same H can be reused across all blocks. Concentrating. Motivated by this property, we choose an adaptive orthogonal transform GB that moves as much of

µd + ϵnB ,d

or equivalently, in compact form: VB = 1nB µB + EB ,

(6)

for some constant cB ∈ R, in which case:

4. Method

µ1 + ϵnB ,1

(5)

(4)

How large and stable the shared component µB is of course depends on how fast the motion of the content is, but we expect that, especially for small block sizes, we should see the residual component being small. The shared component accounts for most of the cache’s squared norm, particularly 4

µ√B as possible into the first coordinate. Ideally, µB GB = ( d cB , 0, . . . , 0), so that µB RB = cB 1⊤ d is exactly constant. In general, some mass remains in the other coordinates, which we collect in a residual vector ρ ∈ Rd−1 : √ µB GB = ( d cB , ρ⊤ ) (7)

with the same sign, but not every pair. To adapt to different magnitudes and signs, we choose each angle from Θ = {0, π/4, π/2, 3π/4}, which gives four mappings: (µ1 , µ2 ) 7−→ (µ2 , −µ1 ), √ √ θ = π/4 : (m − δ, m + δ) 7−→ ( 2 m, 2 δ), √ √ θ = 3π/4 : (−m + δ, m + δ) 7−→ ( 2 m, − 2 δ) (11) Each choice suits a different kind of pair. The choice θ = 0 forwards µ1 unchanged and suits pairs in which the first channel already dominates, |µ1 | ≫ |µ2 |, leaving only the small µ2 in the residual. The swap θ = π/2 sends µ2 to the first coordinate and suits the opposite case, |µ2 | ≫ |µ1 |. The normalized sum θ = π/4 suits similar values with the same sign, where the common component m is large and the difference δ small. The normalized difference θ = 3π/4 suits similar magnitudes with opposite signs, for which the sum would cancel but the difference preserves the shared magnitude m. In each case, the residual is small exactly when the pair matches the pattern the angle is designed for. Since every direction in the plane lies within 22.5◦ of one of these four axes, the best of the four angles always concentrates at least cos2 (22.5◦ ) ≈ 85% of the pair’s mass on the first coordinate. Each angle is stored with two bits, and applying a planar rotation requires no general multiplications, only additions/subtractions, or a rescaling. For each pair of channels with current mean coordinates (µ1 , µ2 ), we select: θ = π/2 :

Applying H then gives: ⊤ µB RB = cB 1⊤ d + (0, ρ )H

(8)

The first term is constant across channels and can be absorbed by the quantizer’s offset, while the second captures the remaining variation of the temporal mean. Because the rows of H are orthogonal, this residual has zero channel mean and preserves the norm ∥ρ∥2 . Therefore, 2 2 2 2 ∥µB RB − cB 1⊤ d ∥2 = ∥ρ∥2 = ∥µB ∥2 − dcB

(µ1 , µ2 ) 7−→ (µ1 , µ2 ),

θ=0:

(9)

Thus, concentrating more mass into the first coordinate directly reduces the variation of the transformed mean across channels. An exact concentrating transform always exists, for example a Householder reflection [9], but it requires a full-precision d-dimensional vector per block. We instead construct GB from a tree of discrete planar rotations requiring only 2(d − 1) bits (Sec. 4.2).

4.2. Tree of discrete planar rotations Since we are concerned with two (or very low) bit quantization of the KV-cache, every piece of additional metadata is important. A block of nB cache vectors is stored with only 2nB d bits of codes, e.g., 2048 bits for nB = 8 and d = 128. A Householder vector stored in 16-bit precision would cost another 2048 bits, doubling the storage of the block. The transform GB also needs to be applied to every cached row at encoding and inverted at decoding, so it must be cheap to apply as well. We therefore need a concentrating transform that is described by very few bits and can be applied with a handful of additions/subtractions per channel. Planar rotations. We build GB from the smallest rotations available, planar (Givens) rotations [6], which mix only two channel means at a time. Each such planar rotation right-multiplies a pair of coordinates by:   cos θ − sin θ Q(θ) = , (10) sin θ cos θ

θ⋆ = arg max(µ1 cos θ + µ2 sin θ)2

(12)

θ∈Θ

The first coordinate always carries at least as much mass as either input alone, (µ1 cos θ⋆ + µ2 sin θ⋆ )2 ≥ max{µ21 , µ22 }. The tree. A single planar rotation concentrates only two coordinates, whereas the Hadamard step requires the mass of all d channel means to be concentrated in a single coordinate. We therefore construct a binary tree to compose planar rotations and combine all d channel means into one root coordinate. Each planar rotation merges two active coordinates into one forwarded coordinate, so exactly d − 1 rotations are needed to reduce d active coordinates to a single root. We arrange them in a balanced binary tree (see Fig. 3). For d = 2S , the first level pairs the d channels; each subsequent level pairs the coordinates forwarded by the previous one, halving the number of active coordinates. After S = log2 d levels, a single root coordinate remains active, while all d coordinates are retained in the transform, the residual of every rotation stays in its own coordinate, so nothing is discarded. Formally, a planar rotation acting on coordinates (i, j) is the d × d matrix Rij (θ) obtained by embedding Q(θ) into Id at rows and columns i and j. Writing θs,k for the angle

so that a pair of mean coordinates (µ1 , µ2 ) becomes (z(θ), r(θ)) = (µ1 cos θ + µ2 sin θ, −µ1 sin θ + µ2 cos θ). Since Q(θ) is orthogonal, z(θ)2 + r(θ)2 = µ21 + µ22 , so maximizing z(θ)2 is equivalent to minimizing r(θ)2 . For example, θ = π/4 computes a normalized sum and difference. Writing µ1 = m − δ and µ2 = m + δ makes its effect clear: √ √ (m − δ, m + δ) 7−→ ( 2 m, 2 δ). The first coordinate captures the common component and the residual captures the difference, which vanishes when the inputs are equal. Thus π/4 suits pairs of similar values 5

of the k-th rotation at level s of the tree: µB

s

d/2 −1

Ls =

Y

Ris,k js,k (θs,k ),

GB = L1 L2 · · · LS

1

2

3

4

5

−4

4

5

3π/4

level 1

k=0

− √92

(13) Because vectors multiply from the left, the first level appears leftmost. Every factor is orthogonal, so G⊤ B GB = Id , and it is never necessary to materialize a dense matrix. In total, GB costs 2(d − 1) bits, 254 bits for d = 128, or about 0.25 bits per scalar for nB = 8, and O(nB d) operations to apply. The angles are fitted greedily from the leaves to the root. We initialize a working vector with µB and traverse the tree level by level where at each planar rotation, we select the angle by Eq. (12) and immediately update the two coordinates. Fitting thus requires only the block mean and no gradients. Our Triton implementation fuses each tree level for fast online fitting; see Section 7.3 of the appendix.

range 9

π/4

− √12

√9 2

1 √ 2

0

1 √ 2

3π/4

level 2

µB GB

− √12

9

√ = ( d cB , ρ ⊤ )

H: spread the root over all channels µB GB H

4.50

4.50

3.79

5.21

range 1.41

Figure 3. Tree of planar rotations for the four-channel mean µB = (5, −4, 4, 5) of Sec. 4.2.

each cached key or value is read by every query of the current chunk, which costs O(d) operations per query, whereas the transform is applied once per cached vector.

4.3. Global optimality for a fixed tree

Example. Figure 3 illustrates the procedure for µB = (5, −4, 4, 5). The tree progressively concentrates 81 of the vector’s total squared norm of 82 into the first coordinate. The Hadamard transform then spreads this mass across channels, reducing the range from 9 to approximately 1.41.

We now show that the greedy rule in Eq. (12) achieves the best possible mean flattening for a fixed tree. A tree layout T specifies the ordered channels pairs (is,k , js,k ), indexed by level s and rotation position k within that level, as defined in Eq. (13). In each pair, the first coordinate is forwarded to the next level, while the second remains as a residual. The final forwarded coordinate occupies position 1. The pairings and order of the levels are fixed and only the rotation angles vary. Thus, with Θ = {0, π/4, π/2, 3π/4}, the feasible set is: s Y  S d/2 Y−1 GT = Ris,k js,k (θs,k ) : θs,k ∈ Θ for all s, k

Applying the transform. Although the angles are fitted to the mean, the same GB is applied to every frame in the block: VB GB = 1nB (µB GB ) + EB GB The transform acts on channels, not on time, so it remains d × d for any block length, including a shorter final block. Only the shared mean is concentrated and the frame-specific deviations are rotated along with it and quantized as usual. Applying RB = GB H to a cache vector is inexpensive and never requires materializing a dense d × d matrix. Each of the d − 1 planar rotations, by Eq. (11), either copies its inputs (θ = 0), swaps them with a sign change (θ = π/2),√or forms a sum and a difference followed by a scaling by 1/ 2 (θ ∈ {π/4, 3π/4}). The tree therefore costs at most 2(d − 1) additions per vector. The Hadamard step is computed with the fast Walsh–Hadamard transform in d √ log2 d additions and subtractions. Its normalization by 1/ d scales every channel equally and can be folded into the quantizer’s scale and offset. For d = 128 (as in LongCat-Video-13B), the full transform thus takes roughly 1,150 additions/subtractions per vector, or about nine per channel. The rotations within each tree level and the butterflies within each Hadamard stage act on disjoint pairs and can run in parallel, and every row of the block is processed independently. Decoding inverts the transform at the same cost. Since H ⊤ is symmetric and orthogonal, RB = HG⊤ B . We apply the fast Walsh–Hadamard transform again and then the planar rotations in reverse order with transposed angles, read from the stored two-bit codes. This cost is small relative to the attention computation in which the decoded vector is used:

s=1

k=0

(14) There are 4d−1 possible angle assignments to this fixed tree. For the block mean µB and the normalized Hadamard matrix H, we define the mean-flatness objective as: 2 JB (G) := min ∥µB GH − c1⊤ d ∥2 c∈R

(15)

This measures the squared deviation of the transformed mean from its best constant approximation. As seen in Eq. (9), this is equivalent to minimizing the residual ∥ρ∥22 . Theorem 1 (Global optimality for a fixed tree). For any block mean µB and fixed tree layout T , let G⋆ be obtained by selecting each angle greedily according to Eq. (12), from leaves to root. Then: JB (G⋆ ) = min JB (G) G∈GT

(16)

Given µB , greedy fitting therefore solves the joint optimization over all 4d−1 angle assignments in O(d) operations. Although the objective couples angles across levels, for this angle set the best attainable parent magnitude depends only on its input magnitudes and is nondecreasing in each. Maximizing a child’s forwarded magnitude therefore cannot worsen the best outcome at its parent. We provide 6

cB = back to the model’s original channel coordinates, K ⊤ ⊤ b b b YK,B RK,B and VB = YV,B RV,B . Since RB is orthogonal, its inverse exactly recovers the original cache vectors in the absence of quantization. Thus, the rotation changes only the coordinates presented to the quantizer, leaving the network’s full-precision computation unchanged. After undoing the calibrated channel permutation, the reconstructed keys and values enter the model’s existing attention operation.

the proof in Section 7.1 of the appendix. To connect mean flatness to reconstruction error, the following corollary provides a bound on the quantization reconstruction error of our procedure. Corollary 1 (Quantization error bound). Let nB , b ≥ 1 be integers and XB = 1nB µB + EB ∈ RnB ×d , where 1⊤ nB EB = 0. For each G ∈ GT , set R = GH and cB (G) = Qb (XB R)R⊤ . Then: X cB (G) − XB ∥2 ∥X JB (G) + ∥EB ∥2F /nB F (17) ≤ nB d 2(2b − 1)2 Moreover, Theorem 1 implies that greedy fitting globally minimizes the reconstruction-error upper bound in Eq. (17) over GT .

4.6. Efficient Triton Kernel We implement our block-wise rotation scheme with specialized Triton kernels for CUDA GPUs. We fuse the rotation fitting operation for all tree levels into one kernel, and each forward or inverse traversal loads a tile of channel vectors once and writes the result after the final level. Independent temporal blocks and spatial sites run in parallel, avoiding the repeated indexing operations and intermediate tensors of a level-by-level implementation. These changes reduce kernel-launch and intermediate-memory overhead without changing the quantization algorithm or stored representation. For timings against native PyTorch, see Section 7.3 of the appendix.

The bound in Eq. (17) identifies the two contributions to reconstruction error, the frame-dependent variation ∥EB ∥2F /nB and the residual from JB (G). If JB (G) = 0, translation invariance of Eq. (3) gives: Qb (XB R) − XB R = Qb (EB R) − EB R

(18)

Thus an exactly flattened mean contributes no quantization error under asymmetric uniform quantization and only the rotated frame-specific deviations remain. For the proof, see Section 7.2 of the appendix.

5. Experiments 5.1. Experimental setup

4.4. Calibration, encoding, and metadata

Following QVG [26], we evaluate LongCat-Video-13B, HY-WorldPlay-8B, and Self-Forcing-Wan-1.3B at 480p under the long-generation setting, comparing each quantized method against the corresponding BF16 KV-cache baseline. We clone the QVG package and reproduce the models and their baseline directly from this. We follow [26] and use the prompt suite from the MovieGen Video Bench [20], specifically the extended prompt list adopted by Self-Forcing. MovieGen Video Bench contains 1,003 prompts spanning human activity, animals, natural scenes, physical phenomena, and unusual subjects and activities. We sample 100 prompts from this collection, and use the same prompts across models and our baselines.

Offline tree layout selection. Since the channels in K or V can be reordered arbitrarily without changing the fullprecision output, we use a small calibration process to determine which channels meet in the tree (i.e. the tree layout T ). We represent this layout by a permutation P , selected independently for each layer, head, and key, value. To determine this, we use eight videos disjoint from evaluation. The permutation search starts with the original layout and proposes 32 swaps of subtrees, accepting changes that reduce the squared reconstruction error on the training blocks. The calibration videos determine the shared layout, but increasing their number does not change the online algorithm or layout size. Once selected, P is fixed across evaluation videos. In contrast, the angles are fitted to each new block by Eq. (12), which optimizes mean flatness for new videos. Unlike the fitted angles, H is determined entirely by d and requires neither calibration nor per-block metadata.

Quantization and calibration. TRQ uses eight-latentframe temporal groups (i.e. nB = 8), INT2 codes, and FP4 E2M1 minima and scales in 64-channel groups. We use these FP4 minima and scales to avoid extra storage overhead when the cache itself is quantized to 2-bits. Permutation calibration and online angle fitting follow Sec. 4. Offline calibration uses eight videos with images and prompts disjoint from evaluation. We ablate the components of TRQ in Section 7.3 of the appendix. For a fair comparison, QuaRot [2], KIVI [14], and TurboQuant [29] use the same INT2 code precision, group size of 64, and scaled FP4 E2M1 metadata precision as TRQ. QuaRot and KIVI store minima and scales, while TurboQuant stores norms. For QuaRot, we use the official implementation but quantize only the KV-cache.

4.5. Integration with attention We apply the rotation when the model constructs or adds to its conditioning cache. For each temporal block, the rotated keys and values are YK,B = KB RK,B and YV,B = VB RV,B . The key and value rotations use independently fitted angles, but the same H is shared by both and across all blocks. After quantization and dequantization, let YbK,B and YbV,B denote the corresponding reconstructed tensors in the rotated channel coordinates. Before attention, we map them 7

Table 1. Generated-video quality and encoded cache compression on 100 matched videos per method at 480p and 25 matched videos per method at 720p. The model rows give BF16 VBench scores. Bold values indicate the best quantized results within each model and resolution at the reported precision, including ties. Uncertainties denote sample standard errors across videos. Method

Compression Runtime Ratio (BF16) / Dense↓

LongCat-Video-13B TurboQuant QuaRot KIVI QVG TRQ

7.64× 7.53× 7.37× 6.88× 6.89×

LongCat-Video-13B TurboQuant QuaRot KIVI QVG TRQ

7.64× 7.53× 7.47× 7.12× 6.90×

PSNR↑

SSIM↑

1.00×

INT2 KV-cache, 480p

1.05× 1.03× 1.02× 1.07× 1.05×

19.40 ± 0.34 22.71 ± 0.46 23.18 ± 0.44 24.06 ± 0.46 26.53 ± 0.57

0.66 ± 0.01 0.79 ± 0.01 0.81 ± 0.01 0.83 ± 0.01 0.87 ± 0.01

1.00×

INT2 KV-cache, 720p

1.03× 1.00× 0.97× 1.06× 1.05×

18.86 ± 0.67 22.15 ± 0.87 22.44 ± 0.83 24.50 ± 0.96 25.59 ± 1.04

0.65 ± 0.03 0.77 ± 0.03 0.79 ± 0.03 0.83 ± 0.02 0.85 ± 0.02

1.00×

INT2 KV-cache, 480p

1.09× 1.06× 1.03× 1.06× 1.08×

19.07 ± 0.25 22.03 ± 0.28 23.90 ± 0.32 21.16 ± 0.29 27.50 ± 0.41

Self-Forcing-Wan-1.3B

1.00×

INT2 KV-cache, 480p

5.30× 5.25× 5.24× 4.98× 5.01×

1.08× 1.05× 1.02× 1.12× 1.10×

17.99 ± 0.42 20.81 ± 0.42 18.76 ± 0.39 22.45 ± 0.51 25.37 ± 0.65

HY-WorldPlay-8B TurboQuant QuaRot KIVI QVG TRQ TurboQuant QuaRot KIVI QVG TRQ

3.28× 3.27× 3.25× 3.15× 3.19×

0.61 ± 0.01 0.74 ± 0.01 0.82 ± 0.01 0.71 ± 0.01 0.90 ± 0.01 0.58 ± 0.02 0.70 ± 0.01 0.59 ± 0.02 0.75 ± 0.01 0.83 ± 0.01

LPIPS↓

Background Consistency↑

Image Quality↑

Subject Consistency↑

Aesthetic Quality↑

94.61 ± 0.30

67.95 ± 0.89

93.02 ± 0.57

63.68 ± 0.99

0.31 ± 0.01 88.50 ± 0.46 0.16 ± 0.01 93.08 ± 0.35 0.15 ± 0.01 93.22 ± 0.37 0.13 ± 0.01 93.30 ± 0.31 0.10 ± 0.01 94.10 ± 0.32

43.44 ± 1.26 62.85 ± 1.00 62.03 ± 1.10 63.46 ± 0.95 65.46 ± 0.90

81.36 ± 0.88 89.93 ± 0.64 90.16 ± 0.72 90.38 ± 0.58 92.02 ± 0.57

48.53 ± 1.01 59.25 ± 0.96 60.32 ± 1.03 60.50 ± 0.94 61.98 ± 0.95

94.86 ± 0.54

67.18 ± 1.85

93.96 ± 0.96

61.33 ± 2.34

0.36 ± 0.02 89.98 ± 0.95 0.19 ± 0.02 92.99 ± 0.79 0.19 ± 0.02 93.80 ± 0.63 0.15 ± 0.02 93.35 ± 0.74 0.13 ± 0.02 94.25 ± 0.71

43.94 ± 2.41 63.84 ± 2.01 61.92 ± 2.18 64.49 ± 1.92 65.97 ± 1.79

82.75 ± 2.06 90.68 ± 1.36 91.70 ± 1.21 91.06 ± 1.12 93.46 ± 1.06

46.99 ± 2.29 58.40 ± 2.43 59.19 ± 2.42 59.19 ± 2.31 61.11 ± 2.44

91.65 ± 0.44

64.71 ± 1.06

88.08 ± 0.76

58.10 ± 1.18

0.34 ± 0.01 87.69 ± 0.35 0.22 ± 0.01 89.76 ± 0.41 0.16 ± 0.01 91.20 ± 0.40 0.24 ± 0.01 90.49 ± 0.42 0.09 ± 0.01 91.40 ± 0.43

53.32 ± 1.18 62.37 ± 1.02 62.93 ± 1.06 64.16 ± 1.04 63.44 ± 1.09

80.16 ± 0.60 85.05 ± 0.69 87.61 ± 0.66 86.33 ± 0.68 87.61 ± 0.74

48.15 ± 0.89 54.81 ± 1.01 56.27 ± 1.11 56.00 ± 1.04 57.38 ± 1.16

92.26 ± 0.50

65.59 ± 1.03

87.94 ± 1.06

60.29 ± 1.11

0.38 ± 0.01 89.01 ± 0.51 0.22 ± 0.01 91.09 ± 0.48 0.36 ± 0.01 87.48 ± 0.42 0.18 ± 0.01 91.85 ± 0.49 0.12 ± 0.01 92.31 ± 0.48

56.17 ± 1.23 62.83 ± 1.12 55.13 ± 1.26 64.81 ± 1.09 65.37 ± 1.01

81.70 ± 1.03 85.68 ± 0.98 78.85 ± 0.84 87.14 ± 1.06 88.11 ± 1.02

52.91 ± 1.02 56.94 ± 1.00 50.47 ± 0.89 59.63 ± 1.10 60.23 ± 1.09

QVG [26] does not store asymmetric minima and scales in this form, so we keep their method as is, using the default settings from the official repository with INT2 cache quantization. TurboQuant requires no calibration; we use one-bit MSE quantization plus one-bit QJL residual correction for keys and two-bit MSE quantization for values.

720p for LongCat. On HY-WorldPlay, it is best or tied on six of seven metrics; the exception is image quality, where QVG scores higher. These improvements carry over to the full rollouts evaluated by VBench. Subject consistency, which reflects long-range coherence, improves by 1.6 points over QVG on LongCat and 1.0 point on Self-Forcing and TRQ significantly narrows the gap to the BF16 dense model.

Metrics. We follow the evaluation protocol of QVG [26] and evaluate PSNR, SSIM, and LPIPS on the first 20 raw decoded RGB frames with the paired BF16 output. For LongCat these are the first continuation chunks; for HY and Self-Forcing these are zero-based frames 29–48 and 93–112 which occur after the first compressed context is used, respectively. PSNR is averaged per frame in decibels, SSIM uses the repository’s 11 × 11 box window with zero padding, and LPIPS uses RGB inputs in [0, 1] with normalization enabled. VBench background consistency, image quality, subject consistency, and aesthetic quality are reported as percentages using CLIP, MUSIQ, DINO, and LAION respectively as evaluators, as in [26]. Their inputs are the encoded 180frame continuations for LongCat, the complete 285-frame HY videos, and 700 frames for Self-Forcing. Thus the three fidelity metrics measure the first affected window, whereas VBench evaluates the entire rollout window.

6. Conclusion and Limitations We introduced TRQ a 2-bit KV-cache quantization method for video diffusion transformers. TRQ exploits the observation that adjacent frames in a video cache share a slowly varying per-channel mean. It fits a separate rotation to each temporal block that flattens this mean, so the quantizer’s offset can absorb the shared component. Each rotation is a tree of 2 × 2 planar rotations with two-bit angles, followed by a fixed Hadamard transform. Across three video diffusion transformers, TRQ substantially improves fidelity over QVG and other KV-cache compression baselines at similar compression levels. TRQ benefits from exploiting temporal redundancy. This leaves open how best to handle content where that redundancy is weaker, such as fast motion or scene cuts. Block lengths that adapt to scene dynamics are a natural way to address this. Moreover, TRQ and centroidbased methods such as QVG exploit complementary structure, and combining the two could lead to gains over either alone. Finally, the online rotation fitting explored in TRQ has not been done to our knowledge for other model families and modalities, and is a promising avenue for future work.

5.2. Generated-video quality Table 1 compares TRQ with TurboQuant [29], QuaRot [2], KIVI [14] and QVG [26] at 2-bit precision. On LongCatVideo and Self-Forcing-Wan, TRQ achieves the best score on all seven fidelity and VBench metrics, at both 480p and 8

References

[16] Mehdi Makni, Ryan Lucas, and Rahul Mazumder. ThinQuant: Scalable rotation learning for weight and activation quantization of LLMs. arXiv preprint arXiv:2609.36120, 2026. 1, 3 [17] Meituan LongCat Team. LongCat-Video technical report. arXiv preprint arXiv:2510.22200, 2025. 1, 3 [18] Meituan LongCat Team. LongCat-Video: Official implementation. https://github.com/meituan-longcat/ LongCat-Video, 2025. Transformer and cache-enabled attention implementation. Accessed October 2026. 3 [19] William Peebles and Saining Xie. Scalable diffusion models with transformers. In IEEE/CVF International Conference on Computer Vision, 2023. 1, 3 [20] Adam Polyak et al. Movie gen: A cast of media foundation models. arXiv preprint arXiv:2410.13720, 2024. 1, 7 [21] Sand AI. MAGI-1: Autoregressive video generation at scale. arXiv preprint arXiv:2505.13211, 2025. 1 [22] Zunhai Su, Hanyu Wei, Zhe Chen, Wang Shen, Linge Li, Huangqi Yu, and Kehong Yuan. RotateKV: Accurate and robust 2-bit KV cache quantization for LLMs via outlier-aware adaptive rotations. In Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI-25, pages 6200–6208, 2025. 1, 3 [23] Wenqiang Sun, Haiyu Zhang, Haoyuan Wang, Junta Wu, Zehan Wang, Zhenwei Wang, Yunhong Wang, Jun Zhang, Tengfei Wang, and Chunchao Guo. WorldPlay: Towards longterm geometric consistency for real-time interactive world modeling. In Proceedings of the 43rd International Conference on Machine Learning, pages 117501–117523. PMLR, 2026. 3 [24] Team Wan. Wan: Open and advanced large-scale video generative models. arXiv preprint arXiv:2503.20314, 2025. 1 [25] Joseph L. Walsh. A closed set of normal orthogonal functions. American Journal of Mathematics, 45(1):5–24, 1923. 4 [26] Haocheng Xi, Shuo Yang, Yilong Zhao, Muyang Li, Han Cai, Xingyang Li, Yujun Lin, Zhuoyang Zhang, Jintao Zhang, Xiuyu Li, Zhiying Xu, Jun Wu, Chenfeng Xu, Ion Stoica, Song Han, and Kurt Keutzer. Quant VideoGen: Auto-regressive long video generation via 2-bit KV-cache quantization. In Proceedings of the 43rd International Conference on Machine Learning, pages 138028–138040. PMLR, 2026. 1, 2, 3, 4, 7, 8 [27] Zhuoyi Yang et al. CogVideoX: Text-to-video diffusion models with an expert transformer. In ICLR, 2025. 1 [28] Tianwei Yin et al. From slow bidirectional to fast autoregressive video diffusion models. In CVPR, 2025. 1 [29] Amir Zandieh, Majid Daliri, Majid Hadian, and Vahab Mirrokni. TurboQuant: Online vector quantization with nearoptimal distortion rate. arXiv preprint arXiv:2504.19874, 2025. 3, 7, 8

[1] Nir Ailon and Bernard Chazelle. Approximate nearest neighbors and the fast johnson-lindenstrauss transform. In Proceedings of the Thirty-Eighth Annual ACM Symposium on Theory of Computing, pages 557–563. Association for Computing Machinery, 2006. 10 [2] Saleh Ashkboos, Amirkeivan Mohtashami, Maximilian L. Croci, Bo Li, Pashmina Cameron, Martin Jaggi, Dan Alistarh, Torsten Hoefler, and James Hensman. QuaRot: Outlier-free 4-bit inference in rotated LLMs. In Advances in Neural Information Processing Systems, 2024. 1, 2, 3, 7, 8 [3] Tim Brooks, Bill Peebles, et al. Video generation models as world simulators. OpenAI technical report, 2024. 1 [4] Boyuan Chen et al. Diffusion forcing: Next-token prediction meets full-sequence diffusion. In NeurIPS, 2024. 1 [5] Guibin Chen et al. SkyReels-V2: Infinite-length film generative model. arXiv preprint arXiv:2504.13074, 2025. 1 [6] Wallace Givens. Computation of plane unitary rotations transforming a general matrix to triangular form. Journal of the Society for Industrial and Applied Mathematics, 6(1):26–50, 1958. 5 [7] Insu Han, Praneeth Kacham, Amin Karbasi, Vahab Mirrokni, and Amir Zandieh. PolarQuant: Quantizing KV caches with polar transformation. arXiv preprint arXiv:2502.02617, 2025. 3 [8] Coleman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Michael W. Mahoney, Yakun Sophia Shao, Kurt Keutzer, and Amir Gholami. KVQuant: Towards 10 million context length LLM inference with KV cache quantization. In Advances in Neural Information Processing Systems, 2024. 1, 3 [9] Alston S. Householder. Unitary triangularization of a nonsymmetric matrix. Journal of the ACM, 5(4):339–342, 1958. 5 [10] Xun Huang et al. Self forcing: Bridging the train-test gap in autoregressive video diffusion. arXiv preprint arXiv:2506.08009, 2025. 1 [11] Weijie Kong et al. HunyuanVideo: A systematic framework for large video generative models. arXiv preprint arXiv:2412.03603, 2024. 1 [12] Xiuyu Li, Yijiang Liu, Long Lian, Huanrui Yang, Zhen Dong, Daniel Kang, Shanghang Zhang, and Kurt Keutzer. Q-Diffusion: Quantizing diffusion models. In IEEE/CVF International Conference on Computer Vision, 2023. 3 [13] Yaron Lipman, Ricky T. Q. Chen, Heli Ben-Hamu, Maximilian Nickel, and Matt Le. Flow matching for generative modeling. In International Conference on Learning Representations, 2023. 3 [14] Zirui Liu, Jiayi Yuan, Hongye Jin, Shaochen Zhong, Zhaozhuo Xu, Vladimir Braverman, Beidi Chen, and Xia Hu. KIVI: A tuning-free asymmetric 2bit quantization for KV cache. In International Conference on Machine Learning, 2024. 1, 3, 7, 8 [15] Zechun Liu, Changsheng Zhao, Igor Fedorov, Bilge Soran, Dhruv Choudhary, Raghuraman Krishnamoorthi, Vikas Chandra, Yuandong Tian, and Tijmen Blankevoort. SpinQuant: LLM quantization with learned rotations. In International Conference on Learning Representations, 2025. 1, 3

9

7. Appendix

We now prove the main theorem statement, that the greedy algorithm minimizes the objective across all transforms G ∈ GT . Consider a node of the binary rotation tree, corresponding to a planar rotation that combines two coordinates. Let a, b ∈ R denote its two inputs, which are either original channel means at the first level or coordinates forwarded from the previous level of the tree. The coordinate forwarded by a rotation with angle θ is: fθ (a, b) := a cos θ + b sin θ For the four angles, its possible values are: fθ (a, b) θ 0 a √ π/4 (a + b)/ 2 π/2 b √ 3π/4 (b − a)/ 2 Set A = |a| and B = |b|. The sum and difference options satisfy: max{(a + b)2 , (b − a)2 } = a2 + b2 + 2|ab|

7.1. Proof of Theorem 1 Proof. Fix the block mean µB and tree layout T . Every G ∈ GT is orthogonal, since it is a product of rotations. We first show that minimizing our objective Eq (15) is equivalent to maximizing the squared root output of the tree, and then prove that the greedy algorithm attains the largest possible output magnitude over all angle assignments on T . Consider an arbitrary G ∈ GT and write: µB G = (z, ρ⊤ ),

ρ ∈ Rd−1

Let e1 be the first standard basis column vector, then: 1⊤ d √ e⊤ H = 1 d Transposing this equality and multiplying by H, using HH ⊤ = Id , gives: √ H1d = d e1 Thus,

= (|a| + |b|)2 Taking square roots therefore gives: max{|a + b|, |b − a|} = A + B Thus the largest magnitude is: max |fθ (a, b)| = F (A, B), θ∈Θ   (21) A+B F (A, B) := max A, B, √ 2 This holds for every sign combination of a and √ b. In particular, if ab ≥ 0, the angle π/4 attains (A + B)/ 2; if ab < 0, the angle 3π/4 attains that magnitude. The angles 0 and π/2 attain A and B, respectively. Hence it depends only on the input magnitudes, even though the angle that achieves it may depend on the input signs. The function F is nondecreasing in each argument on [0, ∞)2 . Indeed, if 0 ≤ A ≤ A′ and 0 ≤ B ≤ B ′ . Therefore F (A, B) ≤ F (A′ , B ′ ) (22) These two properties, dependence only on magnitudes and monotonicity, allow locally optimal choices to be composed throughout the tree. For each node v, let Tv denote the subtree rooted at v. Define Sv ⊂ R as the set of all values that node v can forward to its parent, considering every possible assignment of rotation angles within Tv . Define: Av := max |s|

z w := (0, ρ⊤ )H µB GH = √ 1⊤ d + w, d The residual row w has zero channel sum, since: w1d = (0, ρ⊤ )H1d √ = d (0, ρ⊤ )e1 = 0 This comes from the property of the normalized WalshHadamard matrix that all rows except the first have entries summing to zero [1]. Moreover, orthogonality of H implies ∥w∥22 = ∥ρ∥22 since an orthogonal transform does not change the norm. Thus w is orthogonal to every constant row vector. For any c ∈ R, expanding the norm gives: 2 ∥µB GH − c1⊤ d ∥2   2 z = w + √ − c 1⊤ d d 2    2 (19) z z = ∥w∥22 + 2 √ − c w1d + d √ − c d d  2 z = ∥ρ∥22 + d c − √ d The second term is nonnegative and becomes zero at c = √ z/ d. Therefore this is the unique minimizer, and:

JB (G) = ∥ρ∥22 Because G is orthogonal,

s∈Sv

∥µB ∥22 = ∥µB G∥22 = z 2 + ∥ρ∥22

Each set Sv is finite and nonempty, so this maximum is attained. We prove the claim by induction on the structure of the binary rotation tree, starting at the leaves (i.e. before any rotation has been performed and the channel means µB take their original values) and proceeding toward the root. At an original leaf node i there are no prior angles to choose, thus: Si = {µB,i }, Ai = |µB,i |

It follows that, for every transform G, JB (G) = ∥µB ∥22 − z 2

(20)

The first term is fixed. Hence minimizing JB is exactly equivalent to maximizing z 2 , or equivalently |z|, over all angle assignments on T . This completes the first part of the proof. 10

Now let v be an internal node with children ℓ and r. The two child subtrees have disjoint leaves and disjoint angle variables. Since the residual coordinates do not participate in subsequent rotations, each child passes only its forwarded scalar to node v. Any admissible assignment in Tℓ can therefore be combined with any assignment in Tr , giving   a ∈ Sℓ , b ∈ Sr , Sv = fθ (a, b) : θ∈Θ

Aroot . Therefore, by Eq. (20), JB (G) = ∥µB ∥22 − z 2 ≥ ∥µB ∥22 − A2root = JB (G⋆ ) Since G⋆ ∈ GT , it attains the global minimum, proving the theorem.

We claim that the exact subtree optimum is: Av = F (Aℓ , Ar )

7.2. Proof of Corollary 1

(23)

We prove both the upper bound and attainability. Upper bound. Take arbitrary child outputs a ∈ Sℓ and b ∈ Sr , and an arbitrary parent angle θ ∈ Θ. By definition, |a| ≤ Aℓ and |b| ≤ Ar . Using Eq. (21) and the monotonicity of F , we obtain

Proof. Fix any G ∈ GT and use R = GH as in the corollary. Since both factors are orthogonal, R is orthogonal as well. For the row quantizer in Eq. (3), rounding to the nearest integer incurs an error of at most half clof the quantization step in each coordinate. Thus, for any row y,

|fθ (a, b)| ≤ max |fφ (a, b)| φ∈Θ

∥Qb (y) − y∥22 ≤

= F (|a|, |b|) ≤ F (Aℓ , Ar )

(24)

For any c ∈ R, subtracting c from every coordinate leaves the range unchanged. For a row that is not constant, the maximum and minimum occur at distinct coordinates. The squared difference of their deviations from c is at most twice the sum of their squared deviations. Hence:

This holds for every admissible assignment in Tv , so Av ≤ F (Aℓ , Ar ). Attainability. Choose assignments in the two child subtrees whose outputs a⋆ and b⋆ satisfy |a⋆ | = Aℓ and |b⋆ | = Ar . Such assignments exist and, by subtree independence, can be used simultaneously. Choose an admissible angle at v that maximizes |fθ (a⋆ , b⋆ )|. Equation (21) then gives: |fθ⋆ (a⋆ , b⋆ )| = F (|a⋆ |, |b⋆ |)

d X (max yi − min yi ) ≤ 2 (yi − c)2 2

i

i

i=1

Combining it with Eq. (24) gives:

= F (Aℓ , Ar ) This is an attainable output of Tv , regardless of the signs of a⋆ and b⋆ . Thus Av ≥ F (Aℓ , Ar ), proving the claimed equality. We now connect this recurrence to the greedy rule in Eq. (12). At a leaf i, the actual forwarded value is µB,i and already has magnitude Ai . Suppose inductively that greedy fitting in the subtrees of an internal node v produces outputs ag and bg with: |ag | = Aℓ ,

d(maxi yi − mini yi )2 4(2b − 1)2

∥Qb (y) − y∥22 ≤

d 2(2b − 1)2

2 ∥y − c1⊤ d ∥2

(25)

We apply this inequality to every row of XB R, using the same scalar c for all rows. Orthogonality of R does not change the norm of ther reconstruction error, thus: cB (G) − XB ∥2 ∥X F = ∥Qb (XB R) − XB R∥2F d 2 ≤ ∥XB R − c1nB 1⊤ d ∥F 2(2b − 1)2

|bg | = Ar

At v, the greedy rule maximizes fθ (ag , bg )2 . Maximizing this square is equivalent to maximizing the absolute value, so the magnitude forwarded by the selected rotation is

Using Eq. (4) for XB gives: XB R − c1nB 1⊤ d = 1nB (µB R − c1⊤ d ) + EB R

max |fθ (ag , bg )| = F (|ag |, |bg |) θ∈Θ

(26)

Taking the squared Frobenius norm in Eq. (26), the cross 2 term is zero because 1⊤ nB EB = 0. Also, ∥EB R∥F = 2 ∥EB ∥F by orthogonality. Therefore

= F (Aℓ , Ar ) = Av The induction therefore holds at v. Proceeding from the leaves to the root proves that greedy fitting attains Av at every node and, in particular, the largest possible root magnitude Aroot . Now, for any G ∈ GT , let z denote its root output. By definition, |z| ≤ Aroot , while greedy fitting attains |z⋆ | =

2 ∥XB R − c1nB 1⊤ d ∥F 2 2 = nB ∥µB R − c1⊤ d ∥2 + ∥EB ∥F

(27)

Since the bound holds for every c ∈ R, minimize over c and 11

Channel 0

use the definition of JB in Eq. (15). Dividing by nB d gives cB (G) − XB ∥2 ∥X

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

⋯

F

|K|

|V| |K|

nB d nB JB (G) + ∥EB ∥2F (28) ≤ 2nB (2b − 1)2 JB (G) + ∥EB ∥2F /nB = 2(2b − 1)2 Finally, b, nB , and EB are fixed, so this upper bound depends on G only through JB (G). Theorem 1 therefore implies that greedy fitting globally minimizes the bound.

Vide o

x

Vid

eo

Image

y

0.5

|V|

2.5

0.4

2

0.3

1.5

0.2

1

0.1

0.5

0

0

Channel 1

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

1

|V|

3

0.8

|V|

⋯

2

0.6 0.4

|K|

1

0.2

Vide o

x

Vid

eo

Image

y

0

0

Channel 2

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

|V|

⋯

|K|

Vide o

x

Vid

eo

Image

y

0.6

|V|

1.5

0.4

1

0.2

0.5

0

0

Channel 3

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

1.6

|V|

|V|

⋯

1.5 0.8 1

|K|

Vide o

x

Vid

eo

2.5 2

1.2

0.4

Image

y

0.5

0

0

Channel 4

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

0.8

|V|

3.5 3

0.6

|V|

⋯

|K|

Vide o

x

Vid

eo

2

0.4

Image

y

0.2

1

0

0

Channel 5

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

0.5

|V|

1.5

0.4

|V|

⋯

1

0.3 0.2

|K|

0.5

0.1

Vide o

x

Vid

eo

Image

y

0

0

Channel 6

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

1.6

|V|

⋯

1.5 0.8 1

|K|

Vide o

x

Vid

eo

2.5 2

1.2

|V|

0.4

Image

y

0.5

0

0

Channel 7

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

0.8

|V|

0.6

⋯

0.4

|K|

Vide o

x

Vid

eo

Image

y

4.5 4 3

|V|

2

0.2

1

0

0

Channel 8

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

2

|V|

1.5

⋯

1

|K|

Vide o

x

Vid

eo

3

2

|V|

Image

y

1

0.5 0

0

Channel 9

Frame 20

Frame 24

Frame 28

Frame 48

Frame 64

|K|

0.25

|V|

3

0.2

⋯

|V| |K|

0.15 0.1

2

1

0.05

Vide o

x

Vid

eo

y

Image

0

0

Figure 4. Figure 1 shown for an additional 10 channels. There exist differences across channels, but within a channel adjacent frames tend to have similar values.

12

7.3. Additional Results and Ablations Table 2. Ablation results on 20 matched videos per configuration at 480p. VBench scores are percentages. Bold indicates the best result within each model. Config.

PSNR↑ SSIM↑ LPIPS↓ BG↑ Img.↑ Subj.↑ Aesth.↑

LongCat-Video-13B Full method 27.69 H only 25.90 H + random 2×2 23.30

0.883 0.853 0.803

0.082 94.60 69.04 94.21 0.099 94.37 68.52 93.84 0.140 93.69 64.07 92.12

63.06 62.59 60.89

0.898 0.792 0.761

0.078 91.56 65.80 88.53 0.158 90.80 64.88 87.89 0.179 90.59 64.92 87.37

59.36 57.97 57.48

HY-WorldPlay-8B Full method 27.11 H only 23.14 H + random 2×2 22.25

Table 3. Mean and residual squared norm in LongCat KV caches, averaged over 10 videos across all 32 heads and 48 layers. This indicates the percentage of total cache mass within contiguous temporal blocks. Keys Block size (nB ) 2 4 8 16

Values

Mean (µB )

Residual (EB )

Mean (µB )

Residual (EB )

91.22 85.23 80.61 76.88

8.78 14.77 19.39 23.12

77.59 64.92 57.08 51.94

22.41 35.08 42.92 48.06

Table 4. Complete timings for the online rotations on an NVIDIA H100 80GB. The custom Triton kernel substantially reduces the time required for multiplying and decoding the rotations. K/V pair Total Cache (ms) (s)

Implementation Native PyTorch implementation Eager Cuda graph Compact CUDA graph (Triton)

6.638 3.174 1.785

10.196 4.876 2.743

Figure 5. Variance across channels versus within a channel over time.

13

Related documents

Record · ID 1713155 · SHA-256 e44a217e5b5eae9f
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Bring this data into your agent: Connect via MCP or API · 20 free credits to start · no card required
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive