Shayan Hajhashemi

Research note · Draft · September 29, 2026

OIL tuning and learning meta flows for zero-shot optimization

If I have already solved thousands of inverse problems, what should the next solver remember? It could learn a useful starting point. It could also learn how to move between guesses.

Those possibilities led us from optimizer-in-the-loop training (OIL) to a broader project we called OIL-matching: learning from optimization trajectories, connecting that learning to flow matching, and eventually asking how to improve the decisions around a local optimizer.

We developed our optimizer-field derivations before encountering the related gradient-flow-matching literature. Discovering afterward that a closely related idea was already being explored for neural-network optimization was a surprise!!!

Black arrows follow local optimizer steps across a loss landscape. Blue arrows show imagined learned proposals.
Conceptual sketch. Black arrows follow local optimization. Blue arrows suggest learned moves across the loss landscape.

An inverse problem asks which parameters could produce the observations. A close parameter estimate can still give a poor simulated trajectory.

Learning a start

OIL trains a network to predict a starting point for a numerical solver. During training, the prediction passes through five differentiable optimization steps:

\[\theta^{(0)}=g_\psi(y),\qquad \theta^{(5)}=U_{\mathrm{train}}^5\!\left(\theta^{(0)};y\right).\]

Here \(y\) is the observed trajectory. The training loss reaches the network through those steps. At inference, a separate L-BFGS-B solve refines its prediction.

Learning the flow

The solver's intermediate states offer another source of training data. I explored whether a neural field could learn useful moves between parameter guesses.

In flow matching, a learned velocity moves an initial guess \(u_0\) towards a target \(u_1\). The target can be a parameter estimate from a long solver run.

\[\begin{gathered} u_t=(1-t)u_0+tu_1,\qquad t\sim\mathcal{U}(0,1), \\[0.8em] \mathcal{L}_{\mathrm{flow}}= \mathbb{E}\!\left[\left\lVert v_\psi(u_t,t,y,u_0)-(u_1-u_0)\right\rVert_2^2\right]. \end{gathered}\]

Integrating the learned field gives a new guess for refinement.

In the matched-target experiments, direct endpoint predictors used one neural call. The flows used 20 calls and generally gave worse median parameter recovery.