Papers
Topics
Authors
Recent
Search
2000 character limit reached

RFSQ: Robust Residual Finite Scalar Quantization

Updated 9 July 2026
  • RFSQ is a quantization framework that overcomes residual magnitude decay by conditioning the signals via learnable scaling or invertible LayerNorm.
  • It preserves the additive residual decomposition, enabling efficient autoencoder integration and achieving lower L1 error and improved perceptual metrics in neural compression.
  • In AffectCodec, Block-Diagonal RFSQ enforces explicit bit allocation between emotion and acoustic subspaces, preserving emotion-relevant information at low bitrates.

Robust Residual Finite Scalar Quantization (RFSQ) is a residual quantization framework built on Finite Scalar Quantization (FSQ) that is designed to keep multi-stage scalar quantization effective when a naive residual stack would otherwise suffer from progressively weaker residual signals. In the formulation introduced for neural compression, RFSQ conditions each residual stage with either learnable scaling factors or invertible layer normalization, while preserving the additive residual decomposition z^=k=1Kqk\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k and end-to-end training with straight-through gradient estimators (Zhu, 20 Aug 2025). In later speech codec work, AffectCodec realizes a structurally constrained variant, Block-Diagonal RFSQ (BD-RFSQ), in which emotion and acoustic subspaces are quantized through block-diagonal input and output projections, yielding explicit and structurally guaranteed bit allocation together with a flat token interface for downstream speech LLMs (Meng et al., 22 May 2026).

1. Origins in finite scalar and residual quantization

FSQ was introduced as a simpler, more stable alternative to classical Vector Quantization (VQ). Rather than learning a codebook, FSQ quantizes each dimension independently to a fixed number of levels. For a scalar ziz_i, the per-dimension quantizer is

FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},

so that the overall code-rate is ilog2Li\sum_i \log_2 L_i bits (Zhu, 20 Aug 2025).

The central motivation for RFSQ is the residual magnitude decay problem. Residual quantization repeatedly quantizes the error from the previous stage, but under naive residual FSQ the residual after the first step becomes small enough that subsequent FSQ layers receive vanishingly small signals and contribute little refinement. The generic RFSQ framework was proposed to restore effective multi-stage FSQ while retaining the simplicity of scalar quantization, lookup-free operation, and the absence of learned codebook maintenance (Zhu, 20 Aug 2025).

This original notion of robustness is therefore tied to the stability and efficacy of residual FSQ itself rather than to noisy-channel robustness or attribute preservation. That distinction becomes important in later literature, where the same acronym is adapted to different failure modes and application domains.

2. Formal definition of the generic RFSQ framework

In the generic formulation, RFSQ takes an input feature zRd\mathbf{z}\in\mathbb{R}^d and maintains residuals {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K with r0=z\mathbf{r}_0=\mathbf{z}. The overall quantized representation is the sum of the stagewise outputs,

z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.

At each stage, the residual is conditioned, passed through FSQ, and then subtracted from the running residual so that exact reconstruction across stages is preserved (Zhu, 20 Aug 2025).

Two conditioning strategies define the canonical RFSQ variants. The first uses a learned positive scalar αk\alpha_k at each stage:

(qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.

The second uses invertible LayerNorm. In that variant, the residual is normalized by a per-channel affine LayerNorm, quantized, and then mapped back through the inverse transform using the stored statistics, after which the residual is updated. The paper emphasizes that because the normalization statistics are stored, the LayerNorm transform is perfectly invertible (Zhu, 20 Aug 2025).

The corresponding pipeline is straightforward. Starting from ziz_i0 and ziz_i1, each stage applies one of the conditioning strategies, performs an FSQ step, updates ziz_i2, and accumulates ziz_i3. Each FSQ call also emits discrete indices for entropy coding. The training loss is applied through a shared decoder with straight-through estimators, and no extra regularization on ziz_i4 or the LayerNorm parameters is required (Zhu, 20 Aug 2025).

A practical implication is that RFSQ can be inserted into an autoencoder by replacing a single quantizer with a ziz_i5-stage residual FSQ module, adding conditioning before each FSQ stage, and summing the outputs. In the generic image-compression setting, this replacement does not require extra losses or codebook maintenance.

3. Empirical profile in neural compression

The initial RFSQ study evaluates the method on ImageNet 1K with images resized to ziz_i6 and normalized to ziz_i7. The encoder uses three convolutional layers with channels ziz_i8 and output ziz_i9, while the decoder is a symmetric transposed-convolution network that upsamples back to FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},0. All methods are compared at the same code rate of FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},1 bits and total codebook size FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},2 (Zhu, 20 Aug 2025).

Optimization is also fixed across methods: Adam with FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},3, weight decay FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},4, initial learning rate FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},5 with linear decay to zero, warmup over FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},6 of steps, batch size FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},7, training for FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},8 epochs, and gradient clipping at FSQi(zi)=round(zi(Li1)2)2Li1,\mathrm{FSQ}_i(z_i) = \mathrm{round}\Bigl(\frac{z_i(L_i-1)}{2}\Bigr)\,\frac{2}{L_i-1},9. The reconstruction objective is

ilog2Li\sum_i \log_2 L_i0

Under these conditions, the best-performing reported variant is RFSQ-4ilog2Li\sum_i \log_2 L_i11024-LayerNorm, which achieves ilog2Li\sum_i \log_2 L_i2, perceptual loss ilog2Li\sum_i \log_2 L_i3, and ilog2Li\sum_i \log_2 L_i4 dB, compared with FSQ at ilog2Li\sum_i \log_2 L_i5, perceptual loss ilog2Li\sum_i \log_2 L_i6, and ilog2Li\sum_i \log_2 L_i7 dB (Zhu, 20 Aug 2025).

Method ilog2Li\sum_i \log_2 L_i8 / Perceptual PSNR (dB)
FSQ 0.143 / 0.182 20.3
LFQ 0.241 / 0.361 16.0
VQ-EMA 0.355 / 0.489 12.7
RFSQ-4×1024-LayerNorm 0.102 / 0.100 22.9
RFSQ-4×1024-Scale 0.103 / 0.101 22.9
RFSQ-4×1024-None 0.113 / 0.121 22.2

Relative to FSQ, RFSQ-4ilog2Li\sum_i \log_2 L_i91024-LayerNorm yields a zRd\mathbf{z}\in\mathbb{R}^d0 reduction in zRd\mathbf{z}\in\mathbb{R}^d1 error and a zRd\mathbf{z}\in\mathbb{R}^d2 improvement in perceptual loss. The ablation results further report that LayerNorm adds approximately zRd\mathbf{z}\in\mathbb{R}^d3 relative zRd\mathbf{z}\in\mathbb{R}^d4 gain, zRd\mathbf{z}\in\mathbb{R}^d5 perceptual gain, and zRd\mathbf{z}\in\mathbb{R}^d6 dB PSNR over vanilla RFSQ, while scaling adds approximately zRd\mathbf{z}\in\mathbb{R}^d7 zRd\mathbf{z}\in\mathbb{R}^d8 gain and zRd\mathbf{z}\in\mathbb{R}^d9 perceptual gain. Even the “None” variant, which uses pure residual FSQ without explicit conditioning, outperforms single-stage FSQ, supporting the claim that hierarchical decomposition is useful even before the additional conditioning mechanisms are introduced (Zhu, 20 Aug 2025).

The paper also reports faster convergence, more stable training curves, and that four-stage architectures uniformly outperform two-stage ones, with {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K0–{rk}k=0K\{\mathbf{r}_k\}_{k=0}^K1 extra {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K2 reduction. These observations place RFSQ within a broader line of work that treats residual quantization not merely as a rate-allocation device but as a hierarchical approximation scheme whose later stages require active conditioning to remain useful.

4. Block-Diagonal RFSQ in AffectCodec

AffectCodec adapts residual FSQ to an emotion-preserving neural speech codec by imposing structural separation between emotion and acoustic subspaces. Let {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K3 be the concatenated codec latent and set {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K4. BD-RFSQ runs {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K5 stages, and at stage {rk}k=0K\{\mathbf{r}_k\}_{k=0}^K6 it applies a block-diagonal input projection, affine normalization and scalar quantization, inverse-affine transformation, a block-diagonal back-projection, and residual subtraction:

{rk}k=0K\{\mathbf{r}_k\}_{k=0}^K7

with

{rk}k=0K\{\mathbf{r}_k\}_{k=0}^K8

followed by

{rk}k=0K\{\mathbf{r}_k\}_{k=0}^K9

r0=z\mathbf{r}_0=\mathbf{z}0

r0=z\mathbf{r}_0=\mathbf{z}1

and the final quantized latent is

r0=z\mathbf{r}_0=\mathbf{z}2

At inference, one may truncate r0=z\mathbf{r}_0=\mathbf{z}3 stages to operate at lower bitrate (Meng et al., 22 May 2026).

The defining architectural constraint is the block-diagonal structure of the projections. Emotion and acoustic latents are first projected into partitions r0=z\mathbf{r}_0=\mathbf{z}4 and r0=z\mathbf{r}_0=\mathbf{z}5 with r0=z\mathbf{r}_0=\mathbf{z}6. Each r0=z\mathbf{r}_0=\mathbf{z}7 and r0=z\mathbf{r}_0=\mathbf{z}8 is implemented as a r0=z\mathbf{r}_0=\mathbf{z}9 convolution with weight matrix

z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.0

so that emotion dimensions only read and write emotion channels and acoustic dimensions only read and write acoustic channels. The paper states that this enforces the invariant in Proposition B.1: no cross-stream “leakage” can occur inside the quantizer (Meng et al., 22 May 2026).

A second defining property is explicit bit allocation. Each stage uses z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.1 scalar FSQ dimensions with level counts

z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.2

The per-stage codebook size is therefore

z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.3

and each stage emits a z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.4-bit index, decomposed as z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.5 bits for emotion and z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.6 bits for acoustics. At a frame rate of z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.7 Hz, z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.8 active stages yield bitrate z^=k=1Kqk.\hat{\mathbf{z}}=\sum_{k=1}^K \mathbf{q}_k.9 bps, so αk\alpha_k0 corresponds to αk\alpha_k1 kbps. The paper emphasizes that this reserves a fixed αk\alpha_k2 of bits for emotion at every stage, in contrast to standard RVQ or FSQ codecs where bit allocation emerges implicitly from the loss weighting (Meng et al., 22 May 2026).

5. Training objectives, rate control, and affect preservation

In AffectCodec, BD-RFSQ is embedded in an end-to-end pipeline that first computes acoustic features αk\alpha_k3 and frozen emotion features αk\alpha_k4, then applies Coarse-granularity Emotion Modulation (CEM), projects the acoustic and emotion branches into αk\alpha_k5 and αk\alpha_k6, concatenates αk\alpha_k7, runs the αk\alpha_k8-stage BD-RFSQ forward pass, emits the token sequence αk\alpha_k9, and decodes both the acoustic reconstruction (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.0 and the emotion slice (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.1 (Meng et al., 22 May 2026).

The CEM module uses a global emotion embedding (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.2 and FiLM on the acoustic pathway:

(qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.3

with (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.4 and (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.5. The paper describes this as multi-granularity conditioning that augments frame-level emotion signals in the dual-path front end (Meng et al., 22 May 2026).

The overall optimization objective is

(qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.6

Here (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.7 consists of multi-scale mel (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.8, time-domain (qk,_)=FSQk(αkrk1),qk=qkαk,rk=rk1qk.(\mathbf{q}_k',\_)=\mathrm{FSQ}_k(\alpha_k\,\mathbf{r}_{k-1}),\quad \mathbf{q}_k=\frac{\mathbf{q}_k'}{\alpha_k},\quad \mathbf{r}_k=\mathbf{r}_{k-1}-\mathbf{q}_k.9, and multi-scale STFT adversarial plus feature-matching losses; ziz_i00 is the commitment loss ziz_i01; ziz_i02 is an ziz_i03 loss between the reserved emotion partition decoded back into emotion2vec space and the frozen teacher features; ziz_i04 is a cosine distance between emotion2vec embeddings of the original and reconstructed waveform; and the multi-rate loss is

ziz_i05

This loss supervises intermediate quantization depths so as to ensure emotion and acoustic quality at low ziz_i06 (Meng et al., 22 May 2026).

The empirical motivation for this design is low-bitrate emotion preservation. On IEMOCAP at ziz_i07 kbps, Emotion Degradation Rate (EDR) improves from ziz_i08 for DAC (RVQ) and ziz_i09 for X-Codec to ziz_i10 for BD-RFSQ. Across IEMOCAP, CREMA-D, and ESD at ziz_i11 kbps, BD-RFSQ achieves the lowest Macro-EDR in ziz_i12 conditions and the second-best result in the remaining two conditions. The paper also reports that valence/arousal/dominance MSE corroborates the categorical EDR drops (Meng et al., 22 May 2026).

The ablation results isolate the contributions of the main components at ziz_i13 kbps on IEMOCAP. Replacing BD-RFSQ with RVQ changes MEDR from ziz_i14 to ziz_i15; removing multi-rate training yields MEDR ziz_i16; and removing CEM yields MEDR ziz_i17. The paper interprets these results as showing that block-diagonal quantization, multi-rate supervision, and multi-granularity emotion conditioning each contribute to robustness at low bitrates (Meng et al., 22 May 2026).

6. Terminological scope and relation to other robustness claims

The term “robust” in RFSQ is not uniform across the surrounding literature. In the original neural compression paper, robustness refers to overcoming residual magnitude decay in multi-stage FSQ through conditioning mechanisms that keep later residual stages effective (Zhu, 20 Aug 2025). In AffectCodec, the structurally constrained BD-RFSQ variant is robust in the sense of preserving emotion-relevant information under low-bitrate compression by guaranteeing stream-aware partitioning and preventing cross-stream leakage (Meng et al., 22 May 2026).

A distinct line of work on FSQ-based neural audio codecs studies transmission robustness. In NeuCodec, FSQ is described as naturally redundant and locally smooth because adjacent quantization levels differ by only ziz_i18 in embedding space, and the paper reports that FSQ codecs degrade gracefully under a binary-symmetric channel while RVQ codecs collapse for ziz_i19; specifically, NeuCodec’s STOI remains ziz_i20 up to ziz_i21, and intelligibility persists even at ziz_i22 (Julia et al., 11 Sep 2025). That paper also includes a final section titled “Toward a Robust-Residual FSQ (RFSQ) framework,” but it explicitly presents residual FSQ quantization, Gray-coded indices, a channel-aware training loss, parity or ECC bits, and an “error-corrector” network as possible modifications and loss terms, with preliminary experiments left for future work rather than as an implemented benchmarked method (Julia et al., 11 Sep 2025).

This suggests that RFSQ should be treated as a family of residual-FSQ designs rather than as a single canonical architecture. One instantiation is the generic conditioning framework for neural compression; another is the block-diagonal, attribute-aware realization in AffectCodec; and a third is an outlined but not yet established direction toward channel-aware residual FSQ. A common misconception is therefore to read all uses of “RFSQ” as interchangeable. The published record instead distinguishes between residual-conditioning robustness, structurally protected attribute preservation, and prospective noisy-channel hardening.

7. Significance and open directions

Within neural compression, RFSQ occupies a specific position between single-stage FSQ and more elaborate codebook-based residual quantizers. The generic framework preserves FSQ’s advantages—no learnable codebook, stable training, fewer hyperparameters, and lookup-free quantization—while making residual refinement practical through lightweight conditioning (Zhu, 20 Aug 2025). In speech coding, BD-RFSQ extends that logic by turning bit allocation from an implicit optimization outcome into an explicit architectural constraint, while maintaining a flat token interface that is compatible with downstream speech LLMs (Meng et al., 22 May 2026).

The two most developed formulations also point to complementary design principles. The first is residual conditioning: later quantization stages require normalization or scaling if they are to operate on non-degenerate signals. The second is structural partitioning: when a codec latent carries multiple attribute types, quantization can be organized so that specific dimensions are reserved for specific information streams. AffectCodec’s results suggest that structurally protected quantization is an effective principle for preserving emotion-relevant information and may provide a general route toward attribute-aware neural speech compression (Meng et al., 22 May 2026).

The open directions already articulated in the literature are narrowly specified. One is the extension of residual FSQ toward explicit noisy-channel training, including Gray coding, parity or ECC bits, and a reconstruction loss under random bit flips (Julia et al., 11 Sep 2025). Another is broader deployment of block-diagonal residual quantizers in settings where a latent has multiple semantically distinct partitions, such as emotion and acoustics. A plausible implication is that future RFSQ research will continue to separate the questions of how to stabilize residual scalar quantization, how to allocate bits across structured subspaces, and how to harden discrete representations against transmission errors, even when those questions are discussed under a shared acronym.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Robust Residual Finite Scalar Quantization (RFSQ).