# Asymptotic-preserving terminal completion

- ID: 259
- Canonical URL: https://synthcore.org/idea/259/asymptotic-preserving-terminal-completion
- API JSON: https://synthcore.org/api/idea/259.json
- API Markdown: https://synthcore.org/api/idea/259.md
- Verification status: audited
- Source: [arXiv:2607.04113](https://arxiv.org/abs/2607.04113)
- Category: sampling
- Solves: speedup, accuracy, stability
- ML areas: diffusion-sampling, diffusion, inference-speedup
- Math tags: numerical-analysis, dynamical-systems, geometry, approximation-theory
- Ratings: usefulness 8/10; difficulty 4/10; novelty 6/10

## Idea description

Replace the final sequence of diffusion-sampler steps below a positive switching noise scale a with a single analytic normal-mode completion map. Run the existing solver only on [a, sigma_max], then use the denoiser at scale a to extrapolate to the requested terminal floor epsilon. This prevents the step count from growing like log(sigma_max/epsilon) and should preserve the base solver's order when a is coupled to the discretization size.

## Mathematical statement

The paper defines asymptotic preservation (AP) as stable, consistent zero-noise discretization with a number of updates bounded independently of the terminal noise floor epsilon. With bounded local log-noise steps and no terminal map, the required number of updates satisfies N >= c log(sigma_max/epsilon), where sigma_max is the starting noise scale, epsilon is the requested terminal scale, and c depends on the step-size bound. The proposed positive-scale completion uses a denoiser D(x,sigma), where x is the current noisy state and D estimates the clean/data component. The adapted normal-mode map is T_{a,epsilon}(x) = D(x,a) + (epsilon/a)(x-D(x,a)); it keeps the estimated clean component fixed and scales the residual normal component linearly from amplitude a to epsilon. On a smooth compact boundaryless data manifold, the exact-input terminal error is O(a^2-epsilon^2), with sharp zero-floor behavior Theta(a^2). If the base solver has a floor-uniform order-p endpoint error O(h^p) on [a,sigma_max], choosing a = O(h^(p/2)) makes the terminal error O(h^p), provided the terminal transfer factor remains bounded. Here h is the base solver resolution and p is its convergence order.

## Key formulas

- $$N\gtrsim \log\!\left(\frac{\sigma_{\max}}{\varepsilon}\right)$$
- $$T_{a,\varepsilon}(x)=D(x,a)+\frac{\varepsilon}{a}\bigl(x-D(x,a)\bigr)$$
- $$\left\|T_{a,\varepsilon}(x(a))-x(\varepsilon)\right\|_{W_2}=O(a^2-\varepsilon^2),\qquad \text{and at }\varepsilon=0:\ \Theta(a^2)$$
- $$a=O\!\left(h^{p/2}\right)\quad\Longrightarrow\quad O(a^2)+O(h^p)=O(h^p)$$

## Implementation notes

1. Integration point: modify the sampler's final denoising segment, not the neural network weights. Given a pretrained diffusion model with denoiser output D_theta(x,sigma), choose a switching scale a larger than the requested terminal scale epsilon. Integrate the existing Euler, Heun, DPM-Solver, or flow-matching solver only down to sigma=a, then perform one terminal completion call. For a VE/EDM-style parameterization, use the residual r=x_a-D_theta(x_a,a) and return x_epsilon=D_theta(x_a,a)+(epsilon/a)r. For a sampler whose model predicts score or noise rather than x0, first convert that prediction to the equivalent denoiser D_theta using the model's standard preconditioning formulas.

2. Pseudocode:
```
input x, sigma_max, epsilon, base_resolution h, solver order p
choose a = clip(C_a * h**(p/2), epsilon, sigma_max)
while sigma > a:
    sigma_next = base_grid_step(sigma, h)
    x = base_solver_step(x, sigma, sigma_next, model)
D = denoiser(model, x, a)
x = D + (epsilon/a) * (x-D)
return x
```
If epsilon=0, return D directly. The formula above is the normal-mode terminal map; the O(a^2) estimate is the geometric truncation error on smooth compact boundaryless manifolds.

3. Compute versus estimate: the terminal map and cutoff scaling are prescribed mathematically. Estimate the unknown constant C_a and the bounded transfer factor empirically on a calibration batch by sweeping a; estimate the actual convergence order from endpoint errors at h, h/2, and h/4 using identical random seeds. Do not let a fall below epsilon.

4. First experiment: use CIFAR-10 or ImageNet-64 with a small EDM checkpoint, comparing the original sampler against Euler or Heun plus this completion at equal FID and equal same-seed endpoint error. Sweep NFE and epsilon, recording FID, reconstruction or Wasserstein proxy, and function evaluations. The falsifiable target is that NFE becomes essentially independent of epsilon, while log-log endpoint error versus h retains the baseline slope p and the terminal residual scales approximately quadratically with a.

## Verification

- Status: audited
- Mechanism evidence: yes
- Mechanism confirmed: no
- Verdict: Built and tested the asymptotic-preserving terminal completion map using a synthetic curved-manifold diffusion trajectory and nearest-manifold denoiser. The zero-floor error had log-log slope 1.95, residual gain was below 1, and completion reduced updates by about 9.5x at epsilon=1e-6 while improving endpoint error in this controlled test. This is a promising numerical signal, not validation on a learned image diffusion model.

### Mechanism check

- Verdict: Built and tested the asymptotic-preserving terminal completion map using a synthetic curved-manifold diffusion trajectory and nearest-manifold denoiser. The zero-floor error had log-log slope 1.95, residual gain was below 1, and completion reduced updates by about 9.5x at epsilon=1e-6 while improving endpoint error in this controlled test. This is a promising numerical signal, not validation on a learned image diffusion model.
- Confidence: 8/10
- Limitations: The test uses a synthetic unit-circle trajectory, an ideal nearest-circle denoiser, and a known vector field rather than a trained neural diffusion model or image dataset. It does not measure FID, wall-clock GPU speed, denoiser-call overhead, Heun or DPM-Solver behavior, learned-denoiser errors, or robustness when the residual transfer factor is not bounded.

## Artifacts

- [report.md](https://synthcore.org/code/39/report.md)
- [report_super_2026-08-30T102145.md](https://synthcore.org/code/39/report_super_2026-08-30T102145.md)
- [results.json](https://synthcore.org/code/39/results.json)
- [supercheck_mnist.py](https://synthcore.org/code/39/supercheck_mnist.py)
- [supercheck_report.md](https://synthcore.org/code/39/supercheck_report.md)
- [supercheck_results.json](https://synthcore.org/code/39/supercheck_results.json)
- [terminal_completion_experiment.py](https://synthcore.org/code/39/terminal_completion_experiment.py)
- [Download all files as ZIP](https://synthcore.org/download/39)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
