Context-free denoiser with analytic quadratic score injection
Implementation & benchmark of arXiv:2607.19680 — Nuclear Quantum Effects as a Denoising Problem
Source paper: Nuclear Quantum Effects as a Denoising Problem arXiv:2607.19680 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Train one denoiser only for the nonquadratic residual distribution, then modify the diffusion sampler using an analytically computed quadratic Gaussian context. Changing $K$ at inference changes the target distribution without retraining the denoiser, enabling transfer across temperatures, masses, coupling strengths, and boundary conditions whenever those changes remain quadratic.
Formulas
Mathematical statement
The paper factors the target density as $\pi(\mathbf{x})\propto\exp[-\frac12\mathbf{x}^{\top}K\mathbf{x}]\exp[-U(\mathbf{x})]$, where $\mathbf{x}\in\mathbb{R}^{dNP}$ is the concatenated configuration over $P$ replicas, $K\succeq0$ is a known quadratic-context matrix, and $U(\mathbf{x})=\tau\sum_{k=1}^{P}V(\mathbf{x}_k)$ is the residual potential with $\tau=\beta/P$. The exact zero-noise score of this target is $\nabla_{\mathbf{x}}\log\pi(\mathbf{x})=-K\mathbf{x}-\nabla U(\mathbf{x})$. The transferable construction is to estimate the residual score $s_U(\mathbf{x})\approx-\nabla U(\mathbf{x})$ with a denoiser and compute the context contribution $s_K(\mathbf{x})=-K\mathbf{x}$ analytically. For Gaussian perturbation $y=x+\sigma\epsilon$, with $\epsilon\sim\mathcal{N}(0,I)$, a denoiser $D_\sigma(y)\approx\mathbb{E}[x\mid y]$ gives the residual noisy score $s_{U,\sigma}(y)=(D_\sigma(y)-y)/\sigma^2$ by Tweedie’s identity. The simple finite-noise composition $s_{U,\sigma}(y)-Ky$ is an approximation because Gaussian smoothing does not generally preserve products; the paper’s exactness claim applies when the training noise is matched to the intrinsic Gaussian uncertainty of the quadratic target. This approximation and the matched version should therefore be tested separately.
Implementation notes
1. Integration point: modify the score evaluation inside a DDPM, score-SDE, or annealed Langevin sampler. Let the neural network receive the noisy state $y\in\mathbb{R}^{dNP}$ and noise level $\sigma$, but do not provide $K$ as an input. Train it on samples from the residual density $p_U(x)\propto\exp[-U(x)]$ with Gaussian corruption, using the denoising objective $\mathbb{E}\|D_\sigma(x+\sigma\epsilon)-x\|^2$. At sampling time, choose any valid positive-semidefinite context matrix $K$ and add its action analytically. 2. Pseudocode: for sigma in noise_schedule: for step in range(n_steps[sigma]): eps=randn_like(y); D=denoiser(y,sigma); s_res=(D-y)/sigma**2; s=s_res-matvec(K,y); y=y+dt*s+sqrt(2*dt)*eps. For a ring polymer, implement matvec(K,y) without materializing $K$: the cyclic finite-difference contribution at slice $k$ is proportional to $M(2y_k-y_{k-1}-y_{k+1})/(\hbar^2\tau)$, where $M$ is the particle mass matrix and periodic indexing is used. 3. Compute from the paper’s mathematics: the quadratic score $-Ky$, the eigenvalues of $K$, and the intrinsic uncertainty scale represented by the pseudoinverse $K^\dagger$; estimate the residual score empirically from the denoiser. If $K$ has a nullspace, project it out or use $K+\lambda I$ with a small ridge. Also implement a matched Gaussian variant: for each diffusion noise level, analytically propagate the quadratic Gaussian factor through the noise kernel and use its exact Gaussian score rather than simply $-Ky$. 4. First experiment: use a 2D or 4D double-well or coupled-quartic potential, train one small MLP denoiser on $p_U$, and compare (a) an unconditioned diffusion model, (b) a separately trained model for each $K$, and (c) one shared denoiser with analytic $K$ injection. Evaluate grid-reference KL divergence, energy histograms, covariance, replica correlations, and sampling time. Sweep temperature, mass, and cyclic versus open finite-difference matrices. Success means the shared model matches separately trained models at similar sample quality while requiring zero retraining and correctly changing covariance and path correlations.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not reproduced ✗
Stage 2 · Practical benchmark result: Significant win ✓
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
How to read this: The implementation beat the baseline, but the claimed mechanism did not reproduce at benchmark scale. The gain may come from another effect; treat the cause as unresolved.
Stage 1 — Mechanism check agent confidence 8/10
Built a residual double-well denoiser with inference-time quadratic score injection, including naive -Ky and matched Gaussian -k y/(1+k sigma^2) variants. The mechanism checks passed: predicted Gaussian score coefficients matched measured values to numerical precision (for example k=4,sigma=.7: 1.35135 vs 1.35135), and the Euler OU stability boundary appeared at dt·k=2.1 while dt·k=1.8 remained stable, with observed variances close to theory. In the toy sampler, analytic transfer was competitive with separately trained models (KL 0.373 vs 0.379 at k=2), but was worse at k=.5 (0.579 matched / 0.595 naive vs 0.566 separate), so this is a mechanism validation rather than a demonstrated universal quality win.
- Agent confidence
- 8/10
- Baseline
- Separately trained denoiser: k=0.5 KL=0.5660, covariance=0.7533; k=2.0 KL=0.3789, covariance=0.3840.
- Idea
- Shared residual denoiser with naive analytic injection: k=0.5 KL=0.5948, covariance=0.7354; k=2.0 KL=0.3733, covariance=0.4358. Matched Gaussian injection: k=0.5 KL=0.5796, covariance=0.7345; k=2.0 KL=0.3955, covariance=0.4714. Reference covariances were 0.8425 and 0.4794 respectively.
Limitations: Only a 2D double-well, one residual potential, two scalar quadratic contexts, one fixed noise-level sampling setup, and small MLPs were tested. No ring-polymer matrix-free implementation, nullspace handling, temperature/mass/boundary sweep, uncertainty calibration, FLOP-normalized training comparison, or high-dimensional diffusion schedule was evaluated; the reference and denoiser training chains are also approximate.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.19680)
Beats the tuned baseline by -0.0535 metric points (p=0.0081, wins 8 / 8 paired seeds; metric: lower is better).
- Benchmark
- Quadratic_context_multitoken
- Model
- local_mlp
- Paired seeds
- 8
- Baseline mean
- 0
- Idea mean
- 0
- Effect (Δ)
- -0.0535 (n/a; negative = idea better)
- Wins
- 8 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Helps
- Baseline tuning
- swept over 0 configs
The experiment did not use a full iterative DDPM/score-SDE sampler, did not test matched versus naive finite-noise score injection, and did not sweep context matrices, temperatures, masses, boundary conditions, or nullspaces. The custom proxy's target construction also makes the large MSE gap less conclusive than a genuine sampling-quality comparison; the mechanism signature is explicitly unconfirmed.
How to run: python3 context_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Worked ✓
Agent confidence: 4/10
Built a local custom multitoken quadratic-context denoising track and paired baseline/idea systems using the same MLP, three shared learning rates, and eight seeds. The idea achieved significantly lower test MSE (delta_mean=-0.05349, permutation p=0.0081, all 8 pairs improved), so the benchmark verdict is idea better (significant). However, the trained-model mechanism signature did not confirm the predicted quadratic shrinkage (predicted 0.4 versus observed 0.9695), and the custom benchmark is a supervised denoising proxy rather than a full multi-step diffusion sampler; therefore confidence is limited.
- Baseline
- Best lr=0.003; mean test MSE=0.0542125 over 8 seeds.
- Idea
- Best lr=0.009; mean test MSE=0.000726807 over 8 seeds; paired delta=-0.0534857, p=0.0081, 8/8 wins.
- Mechanism signature
- map[confirmed:false observed_nn_output_ratio:0.9694892540574074 predicted_shrink:0.4 relative_error:1.4237231351435182]
Benchmark result
Beats the tuned baseline by -0.0535 metric points (p=0.0081, wins 8 / 8 paired seeds; metric: lower is better).
- Benchmark
- Quadratic_context_multitoken
- Model
- local_mlp
- Paired seeds
- 8
- Baseline mean
- 0
- Idea mean
- 0
- Effect (Δ)
- -0.0535 (n/a; negative = idea better)
- Wins
- 8 / 8 paired seeds
- p-value
- 0.0081 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- n/a
- Mechanism
- Not confirmed ✗
- Practical effect
- Helps
- Baseline tuning
- swept over 0 configs
The experiment did not use a full iterative DDPM/score-SDE sampler, did not test matched versus naive finite-noise score injection, and did not sweep context matrices, temperatures, masses, boundary conditions, or nullspaces. The custom proxy's target construction also makes the large MSE gap less conclusive than a genuine sampling-quality comparison; the mechanism signature is explicitly unconfirmed.
How to run: python3 context_bench.py
Artifacts
- bench_report.json 6.4 KB View Raw
- context_bench.py 6.1 KB View Raw
- experiment.py 5.8 KB View Raw
- quadratic_context_track.py 0.9 KB View Raw
- report.md 1.8 KB View
- report_bench_2026-08-31T124024.md 2.8 KB View
- results.json 4.6 KB View Raw