# Эксперимент: Hilbert-Schmidt-scale KSD loss (#1286) { "worked": true, "confidence": 9, "verdict": "Built the Gaussian-target RBF Stein-kernel MVP with exact off-diagonal U-statistic and positive-part square-root estimator. The math check reproduced the diagonal trace and Stein-kernel second-moment formulas closely; across dimensions 2, 5, and 10, V-KSD tracked the trace scale while U-KSD was far smaller and followed the Hilbert–Schmidt-scale trend, with both showing approximately n^-1/2 scaling. The effect is real at the null target, although the square-root U estimate was negative before clipping in roughly 50–60% of minibatches and had larger raw Monte Carlo standard deviation than V, so direct optimization may require using U² or a monitoring-only square root.", "metrics": { "baseline": "At n=32, V mean / trace scale = 0.985 (d=2), 0.997 (d=5), 1.000 (d=10); d=5 log-log slope versus n = -0.499.", "idea": "At n=32, U mean / Hilbert–Schmidt scale = 0.442 (d=2), 0.436 (d=5), 0.437 (d=10); d=5 log-log slope versus n = -0.505. Effective rank at d=2/5/10 was 14.1/285.2/21853.1, producing the predicted growing V/U gap. U-statistic negativity fraction was 0.56/0.57/0.56 at n=32." }, "how_to_run": "/home/maxwelhelp/main/bin/python3 ksd_experiment.py", "files": [ "ksd_experiment.py", "results.json", "run_output.txt" ], "limitations": "Only the fixed Gaussian null-target evaluation was tested; no sampler, neural training loop, shifted alternative, GPU path, or held-out KSD comparison was implemented. The second-moment Monte Carlo check used 200,000 paired samples, with its highest-dimensional relative error about 5.9%." }