Dataset-adaptive unitary spectral codec
Implementation & benchmark of arXiv:2608.00053 — Fast Trainable Multilinear Bases for Image Compression
Source paper: Fast Trainable Multilinear Bases for Image Compression arXiv:2608.00053 ⓘ · analyzed Aug 31, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace a fixed DCT or Fourier transform in transform coding with a trainable isometric tensor-network transform whose local gates are learned once on a dataset. Retain the k coefficients with largest magnitude and reconstruct with the exact adjoint transform; the transform remains norm-preserving and fast while adapting its coefficient ordering to the data distribution.
Formulas
Mathematical statement
The paper defines a unitary transform T acting on an image x, producing coefficients Tx, retaining a coefficient subset of budget k, and reconstructing with T^{\dagger}. Unitarity means T^{\dagger}T=I, so ||Tx||_2=||x||_2 and the inverse is exact before coefficient truncation. T( heta) is represented by a tensor network of local gates, with trainable parameters heta constrained to unitary matrix manifolds. The fixed QFT topology includes controlled-phase gates M_{i,j}=\operatorname{diag}(1,1,1,e^{i\phi_{i,j}}), with \phi_{i,j}=2\pi/2^{j-i+1}, and Hadamard gates. Relaxing these gates gives trainable U(2) gates and phase gates D(\boldsymbol{ heta})=\operatorname{diag}(e^{i heta_0},e^{i heta_1},e^{i heta_2},e^{i heta_3}). The network applies in O(N\log^2N) time for N pixels. The empirical truncated reconstruction objective is L( heta)=\frac{1}{L}\sum_{\ell=1}^{L}\|x^{(\ell)}-T( heta)^\dagger P_k(T( heta)x^{(\ell)})\|_2^2, where P_k keeps the k largest-magnitude coefficients.
Implementation notes
(1) Integrate the module immediately before entropy coding in a neural image codec, or before a learned scalar or vector quantizer in a compression model. Flatten an HxW image or feature map into N=2^q channels or tokens, apply a fixed FFT/QFT-like butterfly topology, and replace selected 2x2 mixing gates and diagonal phase gates by trainable unitary gates. For real-valued networks, use real orthogonal 2x2 rotations or represent each complex value as two real channels. (2) Pseudocode: initialize T from a normalized DCT or FFT butterfly; for each minibatch x, compute z=T(theta)x; compute mask S=TopK(|z|,k); reconstruct xhat=T(theta)^* (S*z); minimize mean squared distortion plus an optional entropy-model rate estimate; for every gate U, update U <- Exp(skew-Hermitian(A))U, or use a Riemannian optimizer, so U remains unitary. (3) Compute the transform and adjoint by traversing the butterfly tensor network; estimate coefficient entropy empirically with the codec entropy model. The mathematical guarantees are exact norm preservation and invertibility, while gate values and coefficient ordering are learned. (4) First cheap experiment: train on Kodak, CLIC thumbnails, or Quick Draw at 256x256, comparing JPEG/DCT and fixed FFT at identical k or bitrate. Measure rate-distortion, wall-clock transform time, orthogonality error ||T^*T-I||, and gradient stability. Success is lower MSE or bitrate at equal k with less than 2x fixed-transform cost and orthogonality error below 1e-5.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: Inconclusive
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built and numerically verified a dataset-adaptive orthogonal top-k spectral codec MVP against an orthonormal DCT baseline. Norm preservation, exact adjoint inversion, and the discarded-energy identity matched to approximately 1e-14; held-out adaptive distortion gains increased strongly with dataset anisotropy, reaching 34.0–54.1% at anisotropy 2.0. The mechanism is real in this toy setting, but fast tensor-network complexity and bitrate benefits were not established.
- Agent confidence
- 8/10
- Baseline
- DCT-IV held-out MSE at anisotropy 2.0: 0.1399 (k=2), 0.0804 (k=4), 0.0222 (k=8).
- Idea
- Learned orthogonal held-out MSE at anisotropy 2.0: 0.0923 (k=2), 0.0413 (k=4), 0.0102 (k=8), reductions of 34.0%, 48.6%, and 54.1%. Norm error 1.78e-15; inverse error 4.00e-15; top-k identity error 3.55e-15; orthogonality error at most 2.35e-14.
Limitations: Toy N=16 synthetic vectors only; the learned transform is a dense O(N^2) matrix exponential rather than the proposed O(N log^2 N) tensor network. No real images, entropy coding, quantization, bitrate, wall-clock speed, complex gates, or parameter-count comparison was tested.
How to run: python3 codec_experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2608.00053)
No significant difference vs. the tuned baseline (+10.4%, p=0.1226, wins 3 / 8 paired seeds).
- Benchmark
- Sequence modeling
- Model
- transformer_tiny
- Paired seeds
- 8
- Baseline mean
- 0.4849
- Idea mean
- 0.5352
- Effect (Δ)
- 0.0503 (+10.4%; negative = idea better)
- Wins
- 3 / 8 paired seeds
- p-value
- 0.1226 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 0 configs
The experiment used the small standard sequence track rather than image compression, and measured task MSE only; no entropy coding, bitrate, quantization, wall-clock transform speed, tensor-network butterfly implementation, or larger image dataset was tested.
How to run: python3 spectral_codec_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Implemented and ran the full 8-seed Stage-2 protocol on the structurally matched sequence track using identical transformer_tiny systems, differing only by fixed DCT versus trainable orthogonal top-k spectral coding. The learned codec preserved norm and matched discarded-energy reconstruction quantitatively, confirming the mechanism signature, but test MSE was worse than the tuned baseline (0.5352 vs 0.4849; paired delta +0.0503; permutation p=0.12265), so there is no observed benchmark win.
- Baseline
- sequence/transformer_tiny, best lr=0.001 and k=24; 8-seed test MSE mean 0.4848945, std 0.0347294
- Idea
- trainable Householder orthogonal codec, best lr=0.001 and k=24; 8-seed test MSE mean 0.5352055, std 0.0904870; paired delta +0.0503109, p=0.12265
- Mechanism
- Observed norm-ratio max absolute error 2.98e-7, discarded-energy identity error 0.0, trained-transform orthogonality error 1.92e-6; confirmed=true
Benchmark result
No significant difference vs. the tuned baseline (+10.4%, p=0.1226, wins 3 / 8 paired seeds).
- Benchmark
- Sequence modeling
- Model
- transformer_tiny
- Paired seeds
- 8
- Baseline mean
- 0.4849
- Idea mean
- 0.5352
- Effect (Δ)
- 0.0503 (+10.4%; negative = idea better)
- Wins
- 3 / 8 paired seeds
- p-value
- 0.1226 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Confirmed ✓
- Practical effect
- Inconclusive
- Baseline tuning
- swept over 0 configs
The experiment used the small standard sequence track rather than image compression, and measured task MSE only; no entropy coding, bitrate, quantization, wall-clock transform speed, tensor-network butterfly implementation, or larger image dataset was tested.
How to run: python3 spectral_codec_bench.py
Artifacts
- REPORT.md 2.6 KB View
- bench_report.json 5.5 KB View Raw
- codec_experiment.py 4.4 KB View Raw
- report.md 1.4 KB View
- report_bench_2026-08-31T151953.md 4.6 KB View
- results.json 4.1 KB View Raw
- spectral_codec_bench.py 6.5 KB View Raw