# Doob barrier consolidation

- ID: 503
- Canonical URL: https://synthcore.org/idea/503/doob-barrier-consolidation
- API JSON: https://synthcore.org/api/idea/503.json
- API Markdown: https://synthcore.org/api/idea/503.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2607.06924](https://arxiv.org/abs/2607.06924)
- Category: regularization
- Solves: stability, accuracy, generalization
- ML areas: optimizer, training-dynamics
- Math tags: stochastic-processes, probability, dynamical-systems
- Ratings: usefulness 8/10; difficulty 4/10; novelty 8/10

## Idea description

Add a Doob-transformed barrier drift to parameters during sequential-task training, conditioning each noisy parameter trajectory to remain within an interval around its previous-task anchor. The correction is weak at the anchor, grows toward the barriers, and increases with the injected noise variance, providing state-dependent protection that quadratic anchoring does not provide.

## Mathematical statement

The paper uses the stochastic differential equation $dw_i=[-\partial_{w_i}\mathcal{L}_{\mathrm{task}}-s_i(w_i-\mu_i)+\sigma_i^2\partial_{w_i}\log h_i(w_i)]dt+\sigma_i dW_i$. Here $w_i$ is parameter $i$, $\mathcal{L}_{\mathrm{task}}$ is the current-task loss, $\mu_i$ is the parameter value stored after the previous task, $s_i\geq 0$ is an importance coefficient such as an online diagonal Fisher estimate, $\sigma_i\geq 0$ is the noise scale, and $W_i$ is standard Brownian motion. The parameter is constrained to the interval $I_i=(\mu_i-b_i,\mu_i+b_i)$, where $b_i>0$ is the barrier half-width. For Brownian motion killed at the endpoints, the ground-state h-function is $h_i(w)=\cos(\pi(w-\mu_i)/(2b_i))$. Its logarithmic derivative is $\partial_w\log h_i(w)=-(\pi/(2b_i))\tan(\pi(w-\mu_i)/(2b_i))$. Consequently, the additional drift is $-\sigma_i^2[\pi/(2b_i)]\tan(\pi(w_i-\mu_i)/(2b_i))$. It is zero at $w_i=\mu_i$, points toward the anchor on both sides, and diverges as $w_i$ approaches either barrier. The ordinary $-s_i(w_i-\mu_i)$ term is standard EWC-like anchoring; the transferable mechanism is the variance-scaled logarithmic derivative of the h-function.

## Key formulas

- $$dw_i=\Big[-\partial_{w_i}\mathcal{L}_{\mathrm{task}}-s_i(w_i-\mu_i)+\sigma_i^2\partial_{w_i}\log h_i(w_i)\Big]dt+\sigma_i\,dW_i.$$
- $$I_i=(\mu_i-b_i,\mu_i+b_i),\qquad h_i(w)=\cos\!\left(\frac{\pi(w-\mu_i)}{2b_i}\right),\qquad \partial_w\log h_i(w)=-\frac{\pi}{2b_i}\tan\!\left(\frac{\pi(w-\mu_i)}{2b_i}\right).$$
- $$w_i^{k+1}=w_i^k+\eta\left[-g_i^k-s_i(w_i^k-\mu_i)-\sigma_i^2\frac{\pi}{2b_i}\tan\!\left(\frac{\pi(w_i^k-\mu_i)}{2b_i}\right)\right]+\sqrt{\eta}\,\sigma_i\varepsilon_i^k,\quad \varepsilon_i^k\sim\mathcal{N}(0,1).$$

## Implementation notes

Integrate the rule into the optimizer update for parameters that should retain previous-task knowledge. At the end of task t, copy each protected parameter into an anchor tensor mu, estimate an importance tensor s using the diagonal Fisher or an online-EWC running sum, and set a positive barrier-width tensor b. A practical initialization is b_i=clip(c/(sqrt(s_i)+epsilon), b_min, b_max), with c selected on a validation stream. For each minibatch, compute the current gradient g, choose step size eta, and sample epsilon from a standard normal distribution. For every protected parameter, calculate z=clip((w-mu)/b, -1+delta, 1-delta), then calculate the Doob correction r=-(sigma^2*pi/(2*b))*tan(pi*z/2). Apply either the direct Euler-Maruyama update w=w+eta*(-g-s*(w-mu)+r)+sqrt(eta)*sigma*epsilon, or add eta*r and the stochastic term to an AdamW update while keeping the baseline optimizer identical across comparisons. The clipping delta, for example 1e-4, avoids floating-point overflow near the barriers. Track the maximum absolute normalized displacement |z|, the percentage of coordinates with |z| above 0.95, current-task accuracy, and prior-task accuracy. Reduce eta or sigma if discrete updates frequently jump across the interval. The paper-derived quantities are the cosine ground state, its logarithmic derivative, and the sigma-squared scaling; s, b, sigma, and the discrete-step stabilization policy are empirical choices. First run a small MLP on rehearsal-free Split-MNIST, comparing SGD, noisy SGD, EWC, OU-style quadratic anchoring, and the Doob rule at equal injected noise. Sweep sigma over {0, 0.005, 0.01, 0.02, 0.04, 0.08} and sweep barrier widths. The key success signal is an inverted-U prior-task retention curve with a significant interior optimum, improved retention over matched EWC at equal current-task accuracy, and fewer large parameter excursions. A failure is monotone degradation with sigma or no advantage over the matched unconditioned noisy anchor.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: harms
- Verdict: Built a NumPy Doob-barrier diffusion module and matched noisy OU toy comparison. The core mechanism manifested quantitatively: sigma-squared stiffness scaling relative error was 2.85e-11, inverse-barrier-width-squared scaling error was 0, tangent boundary ratios matched to 1.84e-16, and the numerical log-h derivative error was 1.72e-10. In the toy task, Doob exactly matched OU at sigma=0 and constrained normalized displacement to approximately 1.0 for nonzero noise, but it did not show the paper's claimed inverted-U retention curve and sacrificed current-task plasticity, so no benchmark win is claimed.

### Mechanism check

- Verdict: Built a NumPy Doob-barrier diffusion module and matched noisy OU toy comparison. The core mechanism manifested quantitatively: sigma-squared stiffness scaling relative error was 2.85e-11, inverse-barrier-width-squared scaling error was 0, tangent boundary ratios matched to 1.84e-16, and the numerical log-h derivative error was 1.72e-10. In the toy task, Doob exactly matched OU at sigma=0 and constrained normalized displacement to approximately 1.0 for nonzero noise, but it did not show the paper's claimed inverted-U retention curve and sacrificed current-task plasticity, so no benchmark win is claimed.
- Confidence: 9/10
- Limitations: Only a small one-dimensional-per-coordinate quadratic continual-learning toy was tested, with one seed and finite-step clipping; no MLP, Split-MNIST, Fisher estimation, multi-task stream, statistical significance, Adam/SGD comparison, or hardware-faithful noise model was evaluated.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0081
- Paired wins: 0/8
- Benchmark verdict: idea worse (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/98/bench_report.json)
- [doob_experiment.py](https://synthcore.org/code/98/doob_experiment.py)
- [report.md](https://synthcore.org/code/98/report.md)
- [report_bench_2026-08-30T140456.md](https://synthcore.org/code/98/report_bench_2026-08-30T140456.md)
- [results.json](https://synthcore.org/code/98/results.json)
- [run_bench.py](https://synthcore.org/code/98/run_bench.py)
- [Download all files as ZIP](https://synthcore.org/download/98)

## Disclaimer

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