# Эксперимент: Gramian-balanced neural SSM compression (#697) { "worked": true, "confidence": 9, "verdict": "Built a NumPy/SciPy Gramian-balanced SSM compression MVP with matrix-free factor iteration, balancing projections, Stein residual checks, frequency-response evaluation, and magnitude-pruning comparison. The mechanism manifested: finite-horizon Gramian tails matched the exact predicted formula to numerical precision, scalar Gramian scaling matched 1/(1-rho^2) across rho=0.5–0.995, and every measured balanced-truncation frequency error stayed below the 2-times-discarded-Hankel-singular-values bound. At rank 4, Gramian compression had maximum frequency error 0.0988 versus 13.02 for magnitude pruning, with an ideal transition-cost ratio of 0.111.", "metrics": { "baseline": "Magnitude state pruning, rank 4: maximum frequency-response error 13.0214; full state dimension 12; transition-cost reference 1.0.", "idea": "Gramian-balanced truncation, rank 4: maximum frequency-response error 0.09882; biorthogonality error 3.44e-15; Stein residuals 6.24e-17; factor-iteration relative errors P=7.12e-7 and Q=1.40e-7; ideal transition-cost ratio 0.1111. The rank-4 balanced-truncation bound was 0.3276 and held." }, "how_to_run": "/home/maxwelhelp/main/bin/python3 experiment.py", "files": [ "experiment.py", "results.json" ], "limitations": "Only small linear NumPy/SciPy toy systems were tested; no S4/Mamba layer, neural gates, WikiText/LRA task, fine-tuning, wall-clock latency, GPU execution, or measured activation-memory benchmark was evaluated. The cost ratio is an idealized state-transition ratio and excludes projection/implementation overhead." }