Latent Bayesian Discovery of Symbolic Optimizers
Implementation & benchmark of arXiv:2607.01552 — Symbolic Discovery of Iterative Algorithms: A Continuous Latent Space Bayesian Optimization Framework
Source paper: Symbolic Discovery of Iterative Algorithms: A Continuous Latent Space Bayesian Optimization Framework arXiv:2607.01552 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Search for a compact symbolic optimizer instead of selecting among fixed AdamW-like formulas. Encode optimizer programs as token sequences, learn a continuous variational representation of those sequences, and use a Gaussian-process Bayesian optimizer to propose promising update rules based on short neural-network training rollouts.
Formulas
Mathematical statement
The paper formulates algorithm discovery as minimizing the expected finite-horizon performance of an update function: $g$ is the candidate update rule, $F$ is an objective sampled from the distribution $\mathbb{P}_{F}$, $\mathbf{x}_0$ is an initial point sampled from $\mathbb{P}_{x_0}$, $N_{it}$ is the rollout length, and $\phi$ is the terminal performance measure. For neural optimization, let $\theta_t$ be model parameters, $s_t$ be optimizer state, and $\ell_D(\theta)$ be training loss on task $D$; the candidate program computes $(\theta_{t+1},s_{t+1})=g(\theta_t,s_t,\nabla\ell_D(\theta_t),t)$. The black-box score is $J(g)=\mathbb{E}_{D,\theta_0}[\phi(g,D,\theta_0)]$, with a practical estimator given by $\hat J(g)=M^{-1}\sum_{m=1}^{M}\ell_{D_m}^{val}(\theta_T^{(m)})$ after $T$ optimizer steps. A VAE maps a discrete program $z$ to a continuous latent vector $h\in\mathbb{R}^{d}$: $q_\varphi(h\mid z)=\mathcal{N}(\mu_\varphi(z),\operatorname{diag}(\sigma_\varphi^2(z)))$, with reconstruction/KL objective $\mathcal{L}_{VAE}=\mathbb{E}_{q_\varphi(h\mid z)}[-\log p_\psi(z\mid h)]+\beta D_{KL}(q_\varphi(h\mid z)\|\mathcal{N}(0,I))$. A Gaussian process surrogate predicts $J$ from latent points, $J(h)\sim\mathcal{GP}(m(h),k(h,h'))$, and lower-confidence-bound acquisition chooses $h_{next}=\arg\min_h[\mu(h)-\kappa\sigma(h)]$ for minimization, where $\mu(h)$ and $\sigma(h)$ are the posterior mean and standard deviation and $\kappa>0$ controls exploration. The mathematical contribution being transferred is the composition of discrete symbolic search, continuous latent relaxation, and finite-horizon expected-performance evaluation.
Implementation notes
(1) Integration point: replace the optimizer-update block in a small PyTorch training loop. Represent each candidate as a fixed-length program with tokens such as grad, momentum, square, sqrt, add, mul, div, neg, scalar constants, and state assignments. Restrict the grammar so every program returns an update tensor and uses numerically safe operations; clamp denominators by $\epsilon=10^{-8}$, bound scalar constants, and reject programs with undefined state references. The program receives parameter $\theta_t$, gradient $g_t$, state tensors, and step index $t$, and returns $\Delta_t$ and next state, with $\theta_{t+1}=\theta_t+\Delta_t$. (2) Pseudocode: sample an initial library of valid token programs $z_i$; train the VAE on these programs using the stated reconstruction-plus-KL loss; encode each program to $h_i=\mu_\varphi(z_i)$; run each optimizer for $T$ steps on several training tasks and compute $\hat J(z_i)=M^{-1}\sum_m\ell^{val}_{D_m}(\theta_T^{(m)})$; fit a GP to $(h_i,\hat J_i)$; select $h_{new}=\arg\min_h[\mu(h)-\kappa\sigma(h)]$; decode $h_{new}$ to a token program, repair invalid syntax, evaluate it, append the result, and refit the GP. Repeat for 50--200 proposals, then retrain the best programs from scratch. (3) Computed from the paper's machinery: the finite-horizon expected objective, VAE latent encoding, and GP acquisition. Estimated empirically: validation scores, GP hyperparameters, and the task distribution; use 8--16 random seeds and 4--8 small tasks per candidate to reduce noisy rankings. (4) First experiment: use CIFAR-10 with a 2-layer MLP and a tiny ResNet, compare against SGD, momentum SGD, Adam, and AdamW under equal 100-step rollout budgets. Search first with width 256 and 32 channels, then evaluate the best symbolic rules on larger widths and unseen seeds. Success means lower median validation loss at 100 and 500 steps, fewer NaN or divergence events, and competitive final accuracy; report discovery compute separately and require the discovered rule to beat AdamW on held-out tasks rather than only on search rollouts.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Not tested
Stage 2 · Practical benchmark result: Not run
Methodology: Toy-system gate first; the benchmark stage runs only after a pass. How verification works
Stage 1 — Mechanism check agent confidence 7/10
Built a compact MVP combining grammar-constrained symbolic optimizer programs, a VAE latent embedding, an RBF-GP surrogate, and LCB candidate selection. The GP sanity check passed: observations interpolate, distant points retain high uncertainty, and LCB favors the lower-loss region. On fixed-seed quadratic tasks, the discovered momentum_fast rule reached mean test loss 3.74e-06 versus 1.26e-05 for momentum, 3.48e-04 for AdamW-like Adam, and 2.63e-02 for SGD, indicating a real but narrowly demonstrated toy-task win.
- Agent confidence
- 7/10
- Baseline
- SGD: 2.6281e-02; Momentum: 1.2580e-05; AdamW-like: 3.4769e-04 mean terminal loss over 8 test seeds
- Idea
- Discovered momentum_fast: 3.7421e-06 mean terminal loss over 8 test seeds; GP/VAE search used 5 initial candidates plus 8 LCB proposals; math check passed
Limitations: This is not a CIFAR-10 or neural-network experiment: tasks are small synthetic positive-definite quadratics, the candidate library is hand-designed rather than fully decoded from VAE samples, and the AdamW baseline omits explicit decoupled weight decay. The VAE is only lightly tested, GP kernel hyperparameters are fixed, and no statistical significance, FLOP accounting, long-horizon 500-step result, or larger/unseen neural architectures were evaluated.
How to run: python3 experiment.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Artifacts
- experiment.py 7.4 KB View Raw
- report.md 1.5 KB View
- results.json 1.3 KB View Raw