# Shifted-Hermite Gaussian-tail primitive

- ID: 1458
- Canonical URL: https://synthcore.org/idea/1458/shifted-hermite-gaussian-tail-primitive
- API JSON: https://synthcore.org/api/idea/1458.json
- API Markdown: https://synthcore.org/api/idea/1458.md
- Verification status: unverified
- Source: [arXiv:2607.26636](https://arxiv.org/abs/2607.26636)
- Category: other
- Solves: speedup, stability
- ML areas: loss, diffusion-sampling, inference-speedup
- Math tags: approximation-theory, probability, numerical-analysis, algebra
- Ratings: usefulness 5/10; difficulty 3/10; novelty 6/10

## Idea description

Replace repeated evaluations of a Gaussian tail or Mills ratio in a neural loss or sampler with a short shifted-Hermite expansion. Choose a positive reference threshold x and represent the actual threshold as x+t; the same expansion then handles a whole batch of different shifts t using recursively generated Hermite coefficients.

## Mathematical statement

The paper uses the Borel-Laplace representation L_A(x)=\int_0^\infty e^{-xs}A(-s)\,\mathrm{d}s. For the Gaussian kernel A(-s)=e^{-s^2/2}, define the Mills-type function M(y)=\int_0^\infty e^{-ys-s^2/2}\,\mathrm{d}s for y>0. Its shifted asymptotic expansion is M(x+t)\sim\sum_{n\ge 0}(-1)^n\mathrm{He}_n(t)x^{-n-1}, where x>0 is the large reference threshold, t is the shift, and \mathrm{He}_n is the probabilists' Hermite polynomial. The Hermite sequence is generated by \mathrm{He}_0(t)=1, \mathrm{He}_1(t)=t, and \mathrm{He}_{n+1}(t)=t\mathrm{He}_n(t)-n\mathrm{He}_{n-1}(t). The first terms are M(x+t)\approx x^{-1}-t x^{-2}+(t^2-1)x^{-3}-(t^3-3t)x^{-4}. For a normalized Gaussian tail, \bar\Phi(y)=\phi(y)M(y), where \phi(y)=(2\pi)^{-1/2}e^{-y^2/2}; hence log-tail evaluation can use \log\bar\Phi(x+t)=-    frac12(x+t)^2-    frac12\log(2\pi)+\log M(x+t). The expansion is asymptotic, so it should only be used when x is sufficiently large and |t| is bounded, with an exact or rational fallback elsewhere.

## Key formulas

- $$L_A(x)=\int_{0}^{\infty}e^{-xs}A(-s)\,\mathrm{d}s$$
- $$M(x+t)=\int_{0}^{\infty}e^{-(x+t)s-s^{2}/2}\,\mathrm{d}s\sim\sum_{n\geq 0}(-1)^n\mathrm{He}_{n}(t)x^{-n-1}$$
- $$\mathrm{He}_0(t)=1,\qquad \mathrm{He}_1(t)=t,\qquad \mathrm{He}_{n+1}(t)=t\,\mathrm{He}_n(t)-n\,\mathrm{He}_{n-1}(t)$$
- $$M(x+t)\approx \frac1x-\frac{t}{x^2}+\frac{t^2-1}{x^3}-\frac{t^3-3t}{x^4}+\frac{t^4-6t^2+3}{x^5}$$

## Implementation notes

Integrate this at the Gaussian-tail operation in a probit, censored-regression, diffusion-guidance, or rare-event classification loss, specifically where the network produces a standardized threshold y=(a-\mu)/\sigma and the code evaluates log\bar\Phi(y) or the Mills ratio. During each batch, choose a positive reference x and shift t so that y=x+t; for example set x=max(y-T,x_min), t=y-x, with x_min=8 and T=2. For K=4 or K=6, compute Hermite values by the recurrence and accumulate S=sum_{n=0}^{K}(-1)^n He_n(t)x^{-n-1}. Pseudocode: `y=(a-mu)/sigma; x=max(y-T,xmin); t=y-x; h0=1; h1=t; S=h0/x-h1/x**2; for n in 1..K-1: h2=t*h1-n*h0; S += (-1)**(n+1)*h2/x**(n+2); h0,h1=h1,h2; use Hermite result if y>=yswitch and abs(t)<=T else exact_log_ndtr(y)`. Evaluate log M as log(max(S,epsilon)) and combine it with log phi(y)=-y^2/2-log(2pi)/2. The mathematical quantities are the integral representation, Hermite recurrence, and asymptotic coefficients; x_min, T, K, y_switch, and epsilon are empirical safeguards. First test on a small MLP trained with a probit binary loss on synthetic imbalanced Gaussian data, comparing exact log_ndtr and a rational approximation at equal batch size. Measure maximum absolute tail error, derivative error by finite differences or autodiff, kernel latency, and end-to-end throughput. A successful result is at least 1.5x faster tail evaluation, relative probability error below 1e-5 for y>=8, stable gradients, and unchanged validation likelihood. If S becomes negative or gradients become unstable, reduce K or immediately use the exact fallback.

## Disclaimer

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