Balanced State-Order Compression
Implementation & benchmark of arXiv:2607.05457 — Empirical Minimal-Realisation Compression of Deep Neural Networks via Controllability-Observability Tests
Source paper: Empirical Minimal-Realisation Compression of Deep Neural Networks via Controllability-Observability Tests arXiv:2607.05457 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Compress each hidden layer by retaining directions that are simultaneously reachable from the observed input distribution and observable at the network output. Unlike PCA or SVD, the retained subspace is weighted by downstream task sensitivity, so high-variance but output-irrelevant directions can be removed while low-variance predictive directions are preserved.
Formulas
Mathematical statement
The network is treated as the depth-indexed nonlinear system $h_{\ell+1}=f_{\ell}(h_{\ell})$ and $z=g(h_L)$, where $h_{\ell}\in\mathbb{R}^{n_\ell}$ is the hidden state at layer $\ell$ and $z\in\mathbb{R}^{d_z}$ is the output. For centered hidden snapshots $x_i=h_\ell^{(i)}-\bar h_\ell$, the empirical reachability Gramian is $W_c=\frac{1}{N}\sum_{i=1}^{N}x_i x_i^\top$, measuring which state directions are excited by data. With $J_i=\partial z/\partial h_\ell\vert_{h_\ell^{(i)}}\in\mathbb{R}^{d_z\times n_\ell}$, the empirical observability Gramian is $W_o=\frac{1}{N}\sum_{i=1}^{N}J_i^\top J_i$, measuring which hidden perturbations change the output. Form $M=W_c^{1/2}W_oW_c^{1/2}=U\operatorname{diag}(\sigma_1,\ldots,\sigma_{n_\ell})U^\top$, where $\sigma_1\geq\cdots\geq\sigma_{n_\ell}\geq0$ are balanced energies. Select the smallest $r$ satisfying $\sum_{j=1}^{r}\sigma_j/\sum_{j=1}^{n_\ell}\sigma_j\geq\rho$, and retain $V_r=W_c^{1/2}U_{:,1:r}$ after QR orthonormalization.
Implementation notes
Integrate this as an offline compression pass for every wide hidden layer of an MLP or Transformer feed-forward block; do not compute the Gramians during ordinary training. First train a baseline model and collect $N$ representative deployment-distribution samples. Run the model while saving the activation tensor $h_\ell^{(i)}$ at each candidate layer, compute its mean $\bar h_\ell$, and estimate $W_c$ from centered outer products. Estimate observability by computing Jacobian-vector products of the output logits with respect to $h_\ell$. For small models, materialize $J_i$ directly. For larger models, sample Rademacher vectors $q_k\in\mathbb{R}^{d_z}$ and accumulate $(J_i^\top q_k)(J_i^\top q_k)^\top$; its expectation is $J_i^\top J_i$. Add $\epsilon I$ before taking matrix square roots. Compute leading eigenvectors of $M=W_c^{1/2}W_oW_c^{1/2}$ with randomized Lanczos, choose $r$ using $\rho\in\{0.99,0.995,0.999\}$, and set $V_r=W_c^{1/2}U_{:,1:r}$ followed by QR. Replace the state by $\tilde h_\ell=V_r^\top(h_\ell-\bar h_\ell)$. If the following linear map is $Wh+b$, replace it with $WV_r\tilde h+(b+W\bar h)$. For nonlinear blocks, insert the projection after the activation and adjust adjacent layers, then fine-tune for 1--5 epochs using task loss plus a baseline-logit distillation loss. The mathematics supplies the Gramians, balanced matrix, eigenvalue ranking, and projection; sample selection, Jacobian approximation, $\epsilon$, $\rho$, and fine-tuning are empirical. Start with a four-layer SiLU MNIST MLP and compare balanced truncation against PCA/SVD and unstructured pruning at equal parameter count. Measure accuracy, parameter count, activation memory, and GPU latency. A successful result is 50--70% parameter reduction with less than 0.5 percentage-point accuracy loss and lower inference latency.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 9/10
Built an offline balanced-Gramian compression pass with toy verification and a small digits MLP benchmark. The mechanism manifested exactly: balanced ordering followed the reachability-observability product rather than PCA variance, the predicted mode transition occurred at alpha=0.1, and observability scaling changed total balanced energy linearly while preserving rank. In the benchmark, balanced rank-32 retained baseline accuracy (0.9622 vs 0.9622), but it did not produce a practical win: estimated parameters fell about 11% and measured latency increased (0.632 ms vs 0.310 ms).
- Agent confidence
- 9/10
- Baseline
- Accuracy 0.9622; 9,610 parameters; batch-128 latency 0.310 ms
- Idea
- Balanced rank-32 accuracy 0.9622; estimated 8,522 parameters; logit MSE 0.0682; batch-128 latency 0.632 ms. Toy ordering, transition, and scaling predictions all matched exactly.
Limitations: Only one hidden layer, one fixed random seed, and the sklearn digits dataset were tested. No fine-tuning, transformer blocks, Jacobian-vector approximation, multi-layer end-to-end replacement, repeated statistical trials, or realistic deployment benchmark was evaluated; the reported compressed parameter count excludes any separately materialized projection cost.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 10/10
Implemented Balanced State-Order Compression on the built-in tabular Friedman#1 track with mlp_med, chosen because the idea is offline hidden-layer compression for an MLP. The idea did not significantly beat the tuned baseline: paired delta=-0.00005175 and permutation p=0.9682. The NN-scale mechanism check also failed to transfer because PCA had lower output-logit reconstruction error at every tested rank, and rho=0.995 retained full rank.
- Baseline
- mean MSE 2.0771105886, std 0.2167544386, best lr 0.003, epochs 20
- Idea
- mean MSE 2.0770588368, std 0.2159366055, rho 0.995, 5/8 wins, delta -0.0000517517, p 0.9682
Only tabular was tested; vision, sequence, and dynamics were not tested. Only the final hidden state was compressed, with no fine-tuning, latency benchmark, or parameter-count benchmark. The selected rho retained full rank, so practical deployment compression was not demonstrated.
How to run: python3 bench_experiment.py
Artifacts
- bench_experiment.py 5.5 KB View Raw
- bench_report.json 2.5 KB View Raw
- experiment.py 7.2 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-08-30T121851.md 3.8 KB View
- results.json 4.9 KB View Raw