# Loop-memory optimizer

- ID: 1947
- Canonical URL: https://synthcore.org/idea/1947/loop-memory-optimizer
- API JSON: https://synthcore.org/api/idea/1947.json
- API Markdown: https://synthcore.org/api/idea/1947.md
- Verification status: mech_ok_no_baseline
- Source: [arXiv:2608.07448](https://arxiv.org/abs/2608.07448)
- Category: dynamics
- Solves: stability, accuracy, sample-efficiency
- ML areas: optimizer, training-dynamics, scheduler
- Math tags: stochastic-processes, dynamical-systems, statistical-mechanics, control-theory, spectral-theory
- Ratings: usefulness 7/10; difficulty 6/10; novelty 7/10

## Idea description

Replace independent optimizer noise with a generalized-Langevin memory state and a slowly rotating active force. The memory state preserves useful gradient correlations, while the rotational force creates bounded parameter-space loops that can escape shallow basins without producing unbounded random walks. Apply the mechanism either to parameter updates or to the latent state of a diffusion sampler.

## Mathematical statement

Represent the generalized-Langevin mechanism with velocity v(t), mass m, damping gamma, memory kernel K(t), deterministic force F(x,t), and colored noise xi(t): m times dv/dt equals minus gamma v minus the convolution of K with v plus F plus xi. Approximate the kernel by K(t) = sum over k of (c_k divided by tau_k) times exp(-t divided by tau_k), where c_k is a nonnegative friction weight and tau_k is a positive memory time. Introduce auxiliary states h_k satisfying dh_k/dt = -h_k divided by tau_k plus v divided by tau_k, so the memory friction becomes sum over k of c_k h_k. For neural optimization, x is the parameter vector, F is minus the gradient of the loss, and an active two-dimensional force a evolves according to da/dt = omega J a minus lambda a plus sigma_a times Gaussian white noise. Here J is the two-dimensional rotation matrix, omega is angular frequency, lambda is active-force decay, and sigma_a is noise intensity. The augmented linearized discrete update is stable when every eigenvalue of its transition matrix has modulus below one; the loop regime is identified by a complex-conjugate pair with nonzero imaginary part. The predicted search signature is an intermediate-time mean-square displacement proportional to Delta raised to alpha, with 1 less than alpha less than 2, followed by bounded or ordinary diffusive growth.

## Key formulas

- $$m\frac{dv(t)}{dt}=-\gamma v(t)-\int_0^t K(t-s)v(s)\,ds+F(x,t)+\xi(t),\qquad K(t)=\sum_{k=1}^{q}\frac{c_k}{\tau_k}e^{-t/\tau_k}.$$
- $$\frac{dh_k(t)}{dt}=-\frac{1}{\tau_k}h_k(t)+\frac{1}{\tau_k}v(t),\qquad m\frac{dv(t)}{dt}=-\gamma v(t)-\sum_{k=1}^{q}c_kh_k(t)-\nabla L(x(t))+a(t).$$
- $$\frac{da(t)}{dt}=\omega J a(t)-\lambda a(t)+\sigma_a\varepsilon(t),\qquad J=\begin{bmatrix}0&-1\\1&0\end{bmatrix},\qquad \rho(A_{\mathrm{aug}})<1.$$
- $$\mathrm{MSD}(\Delta)=\mathbb{E}\left[\left\|x(t+\Delta)-x(t)\right\|^2\right]\propto\Delta^{\alpha},\qquad 1<\alpha<2\ \text{in the loop-memory regime}.$$

## Implementation notes

First, integrate the mechanism into an SGD or momentum-SGD replacement. For a cheap prototype, apply it independently to two-dimensional parameter blocks, while preserving the full gradient as the deterministic force. Maintain one memory variable h_k per selected time scale and a two-dimensional active state a for each block, or use one shared active state across all blocks in the first experiment. At each minibatch, compute gradient g. For each memory state, update h_k using h_k <- exp(-dt/tau_k) h_k + (1 - exp(-dt/tau_k)) v. Update the active force with a <- exp(-lambda dt) R(omega dt) a + sigma_a sqrt(dt) epsilon, where R is the two-dimensional rotation matrix and epsilon is standard two-dimensional Gaussian noise. Then update v <- v + dt times [-(gamma/m)v - sum_k(c_k/m)h_k - g/m + a/m], followed by x <- x + dt v. Estimate the memory coefficients c_k and time constants tau_k by fitting a nonnegative sum of exponentials to the velocity autocorrelation from ordinary optimizer runs. Estimate omega from the dominant nonzero spectral peak and select lambda from the desired loop lifetime. Estimate the largest eigenvalues of the local Hessian with Hessian-vector products, construct the corresponding augmented linearized transition matrix, and reduce dt or gamma whenever its spectral radius approaches one. The first cheap experiment should train an MLP on MNIST using SGD, momentum SGD, and this optimizer at matched parameter-update norms and compute. Log loss, parameter-displacement mean-square displacement, velocity autocorrelation, and the largest estimated spectral radius. The quantitative prediction is that useful settings exhibit an intermediate log-log MSD slope alpha greater than one and an oscillatory or negative velocity-autocorrelation lobe near lag pi divided by twice omega. Divergence should begin when the measured spectral radius crosses one, with the observed boundary matching the linear prediction within 20 percent. Ablate memory and rotation separately to verify that the effect requires the proposed combination.

## Verification

- Status: mech_ok_no_baseline
- Mechanism evidence: yes
- Mechanism confirmed: yes
- Practical verdict: harms
- Verdict: Built a generalized-Langevin loop-memory optimizer prototype with exponential memory states and rotating active-force states, together with numerical checks and a small CUDA MLP experiment. The active-state modulus and angle matched prediction exactly, the measured stability boundary matched the spectral-radius boundary at dt≈1.011, and rotating memory produced intermediate MSD scaling alpha≈1.20 versus ≈1.98 without rotation, with a negative autocorrelation lobe. The mechanism manifested in toy dynamics, but it did not beat momentum SGD on two-moons: final loss was 0.292 for loop versus 0.214 for momentum.

### Mechanism check

- Verdict: Built a generalized-Langevin loop-memory optimizer prototype with exponential memory states and rotating active-force states, together with numerical checks and a small CUDA MLP experiment. The active-state modulus and angle matched prediction exactly, the measured stability boundary matched the spectral-radius boundary at dt≈1.011, and rotating memory produced intermediate MSD scaling alpha≈1.20 versus ≈1.98 without rotation, with a negative autocorrelation lobe. The mechanism manifested in toy dynamics, but it did not beat momentum SGD on two-moons: final loss was 0.292 for loop versus 0.214 for momentum.
- Confidence: 7/10
- Limitations: The neural test used a small noisy two-moons MLP rather than MNIST, one seed, and did not rigorously match optimizer update norms or FLOPs. The stability boundary comparison uses the same discrete transition matrix for prediction and rollout, so it validates implementation consistency more than an independent empirical boundary; no Hessian-vector-product estimation or fitted autocorrelation kernel was performed.

### 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/744/bench_report.json)
- [bench_run.py](https://synthcore.org/code/744/bench_run.py)
- [bench_stdout.json](https://synthcore.org/code/744/bench_stdout.json)
- [experiment.py](https://synthcore.org/code/744/experiment.py)
- [report.md](https://synthcore.org/code/744/report.md)
- [report_bench_2026-09-01T021306.md](https://synthcore.org/code/744/report_bench_2026-09-01T021306.md)
- [results.json](https://synthcore.org/code/744/results.json)
- [Download all files as ZIP](https://synthcore.org/download/744)

## Disclaimer

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