# Horizontal oblique reflection for constrained diffusion

- ID: 1093
- Canonical URL: https://synthcore.org/idea/1093/horizontal-oblique-reflection-for-constrained-diffusion
- API JSON: https://synthcore.org/api/idea/1093.json
- API Markdown: https://synthcore.org/api/idea/1093.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2607.17904](https://arxiv.org/abs/2607.17904)
- Category: geometry
- Solves: stability, accuracy, sample-efficiency
- ML areas: diffusion-sampling, diffusion, geometry
- Math tags: differential-geometry, stochastic-processes, linear-algebra
- Ratings: usefulness 8/10; difficulty 4/10; novelty 7/10

## Idea description

Modify a diffusion or score-based sampler so that boundary reflection is aligned with the model's admissible noise and control directions instead of using the Euclidean normal. At a boundary hit, reflect through the sub-Riemannian diffusion Gram matrix, preserving the anisotropic dynamics and preventing constraint corrections from injecting motion into inaccessible directions.

## Mathematical statement

The domain is \(\mathcal X=\{x\in\mathbb R^d:\xi(x)>0\}\), with inward Euclidean unit normal \(n(x)=\nabla\xi(x)/\|\nabla\xi(x)\|\) on \(\partial\mathcal X\). The admissible horizontal distribution is \(\mathrm D(x)=\operatorname{span}\{g_1(x),\ldots,g_m(x)\}\), and its positive-semidefinite Gram matrix is \(G(x)=\sum_{i=1}^m g_i(x)g_i(x)^\top\). The intrinsic reflection direction is \(r(x)=G(x)n(x)/(n(x)^\top G(x)n(x))\), assuming the non-characteristic boundary condition \(n(x)^\top G(x)n(x)>0\). It satisfies \(n(x)^\top r(x)=1\), so it removes outward normal displacement, while \(r(x)\in\mathrm D(x)\), so the correction is generated by admissible directions. The associated backward boundary condition is the oblique Neumann condition \(r(x)^\top\nabla u(x)=0\). In the paper's torus example, \(g_1=(1,0,-2\alpha x_2)^\top\), \(g_2=(0,1,2\alpha x_1)^\top\), and \(G(x)\) is the displayed rank-two horizontal Gram matrix.

## Key formulas

- $$\mathcal X=\{x\in\mathbb R^d:\xi(x)>0\},\qquad n(x)=\frac{\nabla\xi(x)}{\|\nabla\xi(x)\|}\quad (x\in\partial\mathcal X).$$
- $$\mathrm D(x)=\operatorname{span}\{g_1(x),\dots,g_m(x)\},\qquad G(x)=\sum_{i=1}^m g_i(x)g_i(x)^\top.$$
- $$r(x)=\frac{G(x)n(x)}{n(x)^\top G(x)n(x)},\qquad n(x)^\top r(x)=1,\qquad r(x)^\top\nabla u(x)=0\ \text{on }\partial\mathcal X.$$$
- $$G(x)=\begin{pmatrix}1&0&-2\alpha x_2\\0&1&2\alpha x_1\\-2\alpha x_2&2\alpha x_1&4\alpha^2(x_1^2+x_2^2)\end{pmatrix}.$$

## Implementation notes

Integrate this at the state-update step of a score-based diffusion sampler, probability-flow ODE, or learned controlled diffusion. Represent the valid domain with a differentiable signed function \(\xi(x)\), positive inside, and expose the model's noise or control vectors \(g_i(x)\); if the model currently uses anisotropic covariance, set \(G=\sum_i g_i g_i^\top\) from its actual diffusion factor. For each Euler-Maruyama step, compute the unconstrained proposal \(y=x+b_\theta(x,t)\Delta t+\sum_i g_i(x)\sqrt{\Delta t}z_i\). If \(\xi(y)\geq0\), accept it. If \(\xi(y)<0\), project to the boundary by Newton iterations \(y\leftarrow y-\xi(y)\nabla\xi(y)/\|\nabla\xi(y)\|^2\), compute \(n=\nabla\xi/\|\nabla\xi\|\), \(r=Gn/(n^\top Gn+\varepsilon)\), and add the inward correction \(y\leftarrow y-\xi(y)r\); repeat until the point is inside. A closer reflected-process discretization records the signed outward displacement \(\delta=\min(0,\xi(y))\) and applies \(y\leftarrow y-\delta r\). Estimate \(G\) from the supplied vector fields; the reflection formula and oblique boundary condition are the mathematical components transplanted from the paper. First test on a 2D annulus or 3D torus with a small score model, comparing Euclidean reflection, rejection, and horizontal reflection. Measure boundary violation probability, endpoint likelihood or sliced Wasserstein error, and score loss near the boundary. Success means lower constraint violation and better endpoint matching at equal function evaluations, particularly when \(G\) is strongly anisotropic or rank deficient.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: inconclusive
- Verdict: Built and ran a constrained diffusion toy experiment comparing horizontal oblique and Euclidean reflection. The core predictions were confirmed: n^T r=1 to machine precision (<1.4e-15), r lies in range(G) to machine precision (<1.4e-15), and the measured tangent/normal ratios exactly matched 1/k for k in {0.05,0.1,0.25,0.5,1,2,4}; oblique inaccessible correction was ~1e-18 while Euclidean correction was nonzero. The promised mechanism manifested clearly, although this is not evidence of improved sample quality in a learned diffusion model.

### Mechanism check

- Verdict: Built and ran a constrained diffusion toy experiment comparing horizontal oblique and Euclidean reflection. The core predictions were confirmed: n^T r=1 to machine precision (<1.4e-15), r lies in range(G) to machine precision (<1.4e-15), and the measured tangent/normal ratios exactly matched 1/k for k in {0.05,0.1,0.25,0.5,1,2,4}; oblique inaccessible correction was ~1e-18 while Euclidean correction was nonzero. The promised mechanism manifested clearly, although this is not evidence of improved sample quality in a learned diffusion model.
- Confidence: 9/10
- Limitations: Only a half-space Euler toy diffusion was tested, with analytically supplied vector fields and exact linear boundary correction. No score network, annulus/torus geometry, endpoint likelihood, sliced Wasserstein distance, convergence rate, runtime/FLOP comparison, or finite-step curved-boundary Newton projection was evaluated.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.13285
- Paired wins: 4/8
- Benchmark verdict: no significant win

## Artifacts

- [bench_report.json](https://synthcore.org/code/197/bench_report.json)
- [oblique_reflection_experiment.py](https://synthcore.org/code/197/oblique_reflection_experiment.py)
- [report.md](https://synthcore.org/code/197/report.md)
- [report_bench_2026-08-30T195705.md](https://synthcore.org/code/197/report_bench_2026-08-30T195705.md)
- [results.json](https://synthcore.org/code/197/results.json)
- [stage2_bench.py](https://synthcore.org/code/197/stage2_bench.py)
- [Download all files as ZIP](https://synthcore.org/download/197)

## Disclaimer

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