Papers
Topics
Authors
Recent
Search
2000 character limit reached

Optimize-then-Discretize Framework

Updated 14 July 2026
  • Optimize-then-Discretize is a framework that defines optimization in continuous or infinite-dimensional spaces before introducing any discretization, preserving the inherent problem geometry.
  • It is applied in diverse contexts such as black-box optimization, scientific machine learning, and neural ODE training, enabling resolution-controlled discretization and tailored numerical methods.
  • The approach highlights trade-offs between preserving continuous structure and achieving computational efficiency, influencing convergence behavior and the emergence of spurious minima or stability issues.

Searching arXiv for the specified papers and closely related optimize-then-discretize work. Searching (Thomaser et al., 2023). Searching (Müller et al., 2024). Optimize-then-Discretize denotes a family of optimization paradigms in which the optimization problem, update rule, or search dynamics are formulated first in a continuous, infinite-dimensional, or nominally real-valued setting and only afterward discretized for computation or finite-resolution evaluation. In the cited literature, the term covers at least three distinct but structurally related constructions: explicit discretization of continuous black-box domains into grid-based or integer encodings (Thomaser et al., 2023), derivation of optimization methods in Hilbert or function spaces before projection onto finite-dimensional parametrizations in scientific machine learning (Müller et al., 2024), and continuous-time optimal-control formulations in neural ODEs or linear-quadratic control whose adjoint or Hamiltonian systems are discretized only at the numerical-solver stage (Onken et al., 2020, Zhao et al., 6 Oct 2025). The shared premise is that discretization is not treated as the primary mathematical object, but as a secondary approximation layer imposed on a problem whose geometry is specified first.

1. Core idea and scope

The literature uses the phrase in more than one technical sense. In black-box optimization, the framework makes finite precision explicit by starting from a continuous problem

minf(x)over x[lb,ub]n,\min f(x)\quad \text{over } x\in[lb,ub]^n,

and then introducing a user-controlled resolution so that each real variable is projected onto a finite grid (Thomaser et al., 2023). In scientific machine learning, the starting point is an infinite-dimensional optimization problem on a Hilbert space H\mathcal H, with a Fréchet-differentiable functional J:HRJ:\mathcal H\to\mathbb R, and the discretization step consists of fitting the continuous update into a finite-dimensional tangent space associated with a parametric manifold M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H (Müller et al., 2024). In neural ODEs, training is posed as an optimal-control problem in continuous time, and the adjoint equations are derived before any time integrator is selected (Onken et al., 2020). In continuous-time linear-quadratic optimal control, Pontryagin’s Minimum Principle is first derived, and only the resulting Hamiltonian boundary-value subproblems are discretized (Zhao et al., 6 Oct 2025).

Setting Continuous object specified first Discretization imposed afterward
Black-box optimization f(x)f(x) on x[lb,ub]nx\in[lb,ub]^n Grid with plateau size ρ\rho or integer encoding
SciML in function space J:HRJ:\mathcal H\to\mathbb R, metric TuT_u Tangent-space Gramian update in parameter space
Neural ODE training Continuous optimal-control problem and adjoint Time integrator for state and adjoint ODEs
Linear-quadratic OCP PMP Hamiltonian system in continuous time Numerical integration of local two-point BVPs

This suggests that Optimize-then-Discretize is less a single algorithm than a methodological orientation. The invariant feature is that the optimization principle is defined in the continuous model before being represented on a grid, in a basis, or in a time-stepping scheme.

2. Resolution-controlled discretization of continuous black-box problems

In the black-box setting, the framework introduces discretization through a plateau size ρ>0\rho>0, equivalently a resolution parameter H\mathcal H0 (Thomaser et al., 2023). The component-wise plateau mapping is

H\mathcal H1

and, to ensure that the known global optimum H\mathcal H2 remains feasible, the grid is shifted by its residue modulo H\mathcal H3: H\mathcal H4 followed by clamping to H\mathcal H5. The resulting discretized objective is

H\mathcal H6

An equivalent integer view defines H\mathcal H7 by

H\mathcal H8

so that

H\mathcal H9

This equivalence permits continuous optimizers and integer-based solvers to evaluate exactly the same underlying real-valued function on the induced grid (Thomaser et al., 2023). The source presents explicit pseudocode for evaluating any candidate J:HRJ:\mathcal H\to\mathbb R0 under plateau size J:HRJ:\mathcal H\to\mathbb R1, and for integer-based solvers it specifies that one maintains J:HRJ:\mathcal H\to\mathbb R2, proposes mutations on J:HRJ:\mathcal H\to\mathbb R3, and then sets J:HRJ:\mathcal H\to\mathbb R4 before calling J:HRJ:\mathcal H\to\mathbb R5.

The landscape consequences are central. Each point J:HRJ:\mathcal H\to\mathbb R6 maps to a plateau of side length J:HRJ:\mathcal H\to\mathbb R7 on which J:HRJ:\mathcal H\to\mathbb R8 is constant. These plateaus introduce flat regions where continuous step-size adaptation may over-shrink J:HRJ:\mathcal H\to\mathbb R9, preventing further progress. On non-convex or non-separable landscapes such as Rosenbrock, discretization can create spurious local minima, and one observes a transition from unimodality to multimodality as M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H0 grows (Thomaser et al., 2023). The source also states an informal step-size stagnation theorem: if a Gaussian-mutation strategy adapts M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H1 such that M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H2, then the probability of leaving the current plateau tends to M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H3 as M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H4, so the algorithm almost surely stagnates. No closed-form complexity bounds are available for general black-box functions, but the expected time to escape a plateau of radius M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H5 can be lower-bounded by the inverse probability of a mutation exceeding M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H6 in any coordinate.

The empirical comparison in dimension M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H7, averaged over 100 runs, focuses on the canonical M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H8-CMA-ES on BBOB F1 (Sphere) and F8 (Rosenbrock) (Thomaser et al., 2023). On Sphere, the continuous case M={uθ:θRp}H\mathcal M=\{u_\theta:\theta\in\mathbb R^p\}\subset\mathcal H9 attains median hitting time f(x)f(x)0 evaluations to f(x)f(x)1 with f(x)f(x)2 success; at f(x)f(x)3, the median is f(x)f(x)4 and success drops to f(x)f(x)5; at f(x)f(x)6, about half the runs succeed quickly at f(x)f(x)7 evaluations and half stagnate permanently, yielding overall success f(x)f(x)8. On Rosenbrock, the continuous case needs f(x)f(x)9 evaluations with x[lb,ub]nx\in[lb,ub]^n0 success; x[lb,ub]nx\in[lb,ub]^n1 yields success x[lb,ub]nx\in[lb,ub]^n2 with median x[lb,ub]nx\in[lb,ub]^n3; x[lb,ub]nx\in[lb,ub]^n4 yields success x[lb,ub]nx\in[lb,ub]^n5 with median x[lb,ub]nx\in[lb,ub]^n6, because the largest plateau smooths the curved valley; and x[lb,ub]nx\in[lb,ub]^n7 introduces multiple spurious minima, reducing success to x[lb,ub]nx\in[lb,ub]^n8 with median x[lb,ub]nx\in[lb,ub]^n9. Empirical CDF plots over a budget up to ρ\rho0 evaluations confirm that for intermediate ρ\rho1 the difficulty peaks due to multimodality, whereas very coarse grids can sometimes simplify the search on highly non-convex ridges.

A key failure mode of standard CMA-ES under discretization is over-shrinkage of ρ\rho2: once mutations become smaller than ρ\rho3, the method remains trapped on one plateau (Thomaser et al., 2023). A second failure mode is covariance adaptation locking into a suboptimal region created by spurious local minima. The remedy discussed in the source is CMA-ES with Margin, which inserts a diagonal margin matrix ρ\rho4 so that the mutation distribution becomes

ρ\rho5

and is chosen to satisfy

ρ\rho6

for each axis ρ\rho7, with ρ\rho8 typically set to ρ\rho9. In the reported experiments, CMA-ESwM with J:HRJ:\mathcal H\to\mathbb R0 restored nearly full success on all tested plateau sizes without degrading performance on the continuous problems (Thomaser et al., 2023). The same source gives a practical rule of thumb for choosing J:HRJ:\mathcal H\to\mathbb R1: set J:HRJ:\mathcal H\to\mathbb R2 so that J:HRJ:\mathcal H\to\mathbb R3 is not smaller than the minimal meaningful step size one expects to explore, and ensure J:HRJ:\mathcal H\to\mathbb R4.

3. Function-space geometry and tangent-space discretization in SciML

In scientific machine learning, Optimize-then-Discretize is formulated as an infinite-dimensional optimization procedure on a real Hilbert space J:HRJ:\mathcal H\to\mathbb R5, such as J:HRJ:\mathcal H\to\mathbb R6, J:HRJ:\mathcal H\to\mathbb R7, or a product thereof (Müller et al., 2024). The objective is a Fréchet-differentiable functional

J:HRJ:\mathcal H\to\mathbb R8

Its derivative J:HRJ:\mathcal H\to\mathbb R9 lies in the dual space TuT_u0, and the Riesz isomorphism TuT_u1, TuT_u2, defines the gradient

TuT_u3

with dual norm TuT_u4. More generally, the framework allows a state-dependent inner product induced by a symmetric positive-definite operator TuT_u5,

TuT_u6

which defines a Riemannian metric on TuT_u7 and acts as a function-space preconditioner.

The generic continuous update is

TuT_u8

Steepest descent corresponds to TuT_u9, while Newton’s method corresponds to ρ>0\rho>00 (Müller et al., 2024). The source notes that standard line-search or trust-region machinery can be carried out directly in ρ>0\rho>01, including an Armijo-type rule and a trust-region subproblem.

Discretization enters only after the continuous direction has been defined. One approximates ρ>0\rho>02 by a finite-dimensional parametric manifold

ρ>0\rho>03

with smooth parametrization ρ>0\rho>04 and tangent space

ρ>0\rho>05

The parameter increment ρ>0\rho>06 is chosen to best fit the continuous direction ρ>0\rho>07 in the ρ>0\rho>08-norm via

ρ>0\rho>09

The normal equations produce the Gramian

H\mathcal H00

and the discrete update

H\mathcal H01

where H\mathcal H02 (Müller et al., 2024). In practice, one often adds a damping term H\mathcal H03 and uses H\mathcal H04.

The special-case identifications are one of the central contributions of the framework. For variational Monte Carlo in H\mathcal H05, H\mathcal H06 yields a Gramian

H\mathcal H07

and the discretization is exactly the standard natural gradient descent in VMC, commonly solved via K-FAC (Müller et al., 2024). For Deep Ritz with Newton in H\mathcal H08, the tangent-space Gramian

H\mathcal H09

coincides with the “energy natural gradient descent” of Müller–Zeinhofer and with a generalized Gauss-Newton in parameter space. For constrained PDE problems, discretization of the Lagrange-Newton system with networks H\mathcal H10 leads to the block Gram matrix

H\mathcal H11

which reproduces Competitive Gradient Descent and the CPINN formulation. For PINNs with residual H\mathcal H12 and objective H\mathcal H13, choosing H\mathcal H14 yields a Gramian based on residual Jacobians, and with the same quadrature used to define the finite-point PINN loss, one recovers the ordinary Gauss-Newton step in parameter space (Müller et al., 2024).

The main theoretical statement, Theorem 2.3, asserts that when each H\mathcal H15 is symmetric positive-definite, the discretized dynamics recover the continuous-space update within H\mathcal H16 up to an H\mathcal H17 error (Müller et al., 2024). For non-symmetric or indefinite H\mathcal H18, the source gives Céa-type quasi-optimality estimates of the form

H\mathcal H19

provided suitable inf-sup conditions hold, as in mixed finite-element theory. The stated advantages relative to discretize-then-optimize are discretization-invariance or mesh-independence, natural preconditioning through the choice of H\mathcal H20, robustness against ad hoc scaling or weighting of loss terms in PINNs, and a unified view that places K-FAC, CPINNs, energy NG, and Gauss-Newton under a common infinite-dimensional origin (Müller et al., 2024).

4. Continuous adjoints, neural ODE training, and the Opt-Disc versus Disc-Opt distinction

For neural ODEs, Optimize-then-Discretize is presented as the direct continuous-time optimal-control approach (Onken et al., 2020). The state H\mathcal H21 evolves under a time-dependent control H\mathcal H22 according to

H\mathcal H23

and the reduced objective is

H\mathcal H24

Introducing an adjoint variable H\mathcal H25 and forming the Lagrangian leads, after integration by parts and stationarity, to the continuous adjoint equations

H\mathcal H26

and gradient formula

H\mathcal H27

These equations define the Opt-Disc procedure: at each training iteration one solves the forward ODE, solves the backward-in-time adjoint, and forms the gradient from the continuous formula (Onken et al., 2020).

The source contrasts this with Discretize-then-Optimize, where one first chooses a numerical integrator, writes out the discrete updates, and differentiates them directly, often by automatic differentiation. Forward Euler, classical Runge–Kutta 4, and adaptive Runge–Kutta methods such as dopri5 are explicitly discussed (Onken et al., 2020). Although the Opt-Disc and Disc-Opt gradients collapse to the same continuous limit as H\mathcal H28, for finite H\mathcal H29 they differ unless H\mathcal H30 is very small. A Taylor-expansion test yields

H\mathcal H31

and the reported numerical tests show that Disc-Opt achieves the expected H\mathcal H32 derivative-check behavior, whereas the Opt-Disc adjoint can be severely degraded if solver tolerances or step sizes are not sufficiently small (Onken et al., 2020).

The computational trade-off is explicit. Across seven benchmark problems—one time-series regression problem and six continuous normalizing flows—Disc-Opt reduced training time by H\mathcal H33 to H\mathcal H34, with an average approximately H\mathcal H35 speedup in CNFs and approximately H\mathcal H36 in the toy 2D time-series problem (Onken et al., 2020). In one BSDS300 run, Opt-Disc required approximately nine days of GPU time while Disc-Opt finished in under 14 hours. Function-evaluation counts are predetermined by H\mathcal H37 in Disc-Opt but adaptive and generally larger in Opt-Disc. On memory, Opt-Disc can avoid full state storage by recomputation or checkpointing, though recomputation is prone to instability, while Disc-Opt relies on standard backpropagation and is described as numerically stable and straightforward to implement.

Continuous-time structure nonetheless matters for task-specific constraints. In CNFs, the mapping H\mathcal H38 is bijective in continuous time by construction, but a naive discrete solver in Disc-Opt can violate invertibility if the step size is too coarse (Onken et al., 2020). The source notes that RK4 with H\mathcal H39 can produce a low training loss while yielding a discrete flow that is not one-to-one, with visual holes in the density and large inverse errors. The proposed remedies are to choose H\mathcal H40 small enough, to re-discretize at inference using a finer integrator or smaller H\mathcal H41, or to adopt multilevel training that starts on a coarse grid and switches to a finer grid mid-training. The practical recommendations distinguish regimes where Disc-Opt is preferable—fast training, data noisiness coarser than ODE-solver tolerances, availability of state storage or checkpointing—from regimes where Opt-Disc is preferable—strict adherence to continuous-time properties or highly sensitive dynamics where small discretization errors break invertibility (Onken et al., 2020).

5. Continuous-time optimal control and overlapping Schwarz decomposition

In continuous-time linear-quadratic optimal control, Optimize-then-Discretize is used to derive and decompose the Pontryagin system before any time discretization is chosen (Zhao et al., 6 Oct 2025). The Bolza-type problem on H\mathcal H42 is

H\mathcal H43

subject to

H\mathcal H44

Pontryagin’s Minimum Principle introduces a costate H\mathcal H45 and Hamiltonian H\mathcal H46, yielding first-order necessary and sufficient conditions: the state equation, the adjoint equation

H\mathcal H47

and the optimal control law

H\mathcal H48

(Zhao et al., 6 Oct 2025).

The paper then introduces a modified overlapping Schwarz decomposition in time. Given a partition

H\mathcal H49

with backward and forward overlaps H\mathcal H50, extended subintervals H\mathcal H51 are defined by

H\mathcal H52

On each subinterval, a local parameterized subproblem is solved with boundary data H\mathcal H53, using a terminal penalty

H\mathcal H54

The Schwarz iteration updates

H\mathcal H55

solves the local PMP boundary-value problems in parallel, and reassembles the global iterate from the unique subdomain covering each time point (Zhao et al., 6 Oct 2025).

The convergence analysis rests on an exponential decay of sensitivity property. Under Uniform Complete Controllability and coercivity, the shifted-system Riccati matrix H\mathcal H56 satisfies uniform bounds

H\mathcal H57

and the closed-loop generator

H\mathcal H58

obeys the exponential stability estimate

H\mathcal H59

(Zhao et al., 6 Oct 2025). The paper proves EDS estimates both for point perturbations and for boundary perturbations, and uses them to derive the main Schwarz contraction theorem: H\mathcal H60 a linear contraction in the sup-norm when the minimal overlap H\mathcal H61 exceeds a threshold. The stated interpretation is that the convergence rate improves exponentially with overlap and is independent of the full horizon.

The contrast with discretize-then-optimize is explicit. In the latter, one first discretizes the ODE or PDE, producing a finite-dimensional nonlinear program to be solved by methods such as SQP or interior-point algorithms. In the optimize-then-discretize formulation, one derives the continuous-time first-order conditions first, decomposes the Hamiltonian boundary-value problem in time, and discretizes only during subproblem solves (Zhao et al., 6 Oct 2025). This permits explicit, implicit, symplectic, or adaptive time-stepping per subproblem, preserves continuous-time structure such as symplecticity and turnpike behavior, and yields a naturally parallel-in-time method.

The numerical experiment considers a linearization of a constrained nonlinear OCP with H\mathcal H62 subdomains and overlaps H\mathcal H63 of subinterval length (Zhao et al., 6 Oct 2025). Gradient descent is applied to the Hamiltonian boundary-value subproblems using Forward Euler, Backward Euler, RK45, and adaptive MATLAB ode23. All overlap sizes yield linear convergence in Schwarz iterations; larger overlap produces a faster drop; empirical contraction rates fit H\mathcal H64; higher-order integrators reduce subproblem error per iteration; and in the stiff regime H\mathcal H65, fixed-step FE may become unstable whereas adaptive ode23 remains robust and efficient.

6. Comparative principles, misconceptions, and design implications

A recurring misconception is that Optimize-then-Discretize admits a uniform ranking over discretize-then-optimize or over native discrete methods. The cited literature does not support such a ranking. In function-space SciML, the optimize-then-discretize viewpoint is advocated because the quality of the update is governed by the continuous geometry, leading to mesh-independence, natural preconditioning, and a direct route to line-search, trust-region globalizations, and error estimates (Müller et al., 2024). In neural ODE training, however, discretize-then-optimize can achieve similar inference performance with drastically reduced training costs, provided that numerical treatment is careful and that continuous-time constraints such as invertibility are restored by finer inference discretization or multilevel training (Onken et al., 2020). In black-box search, large plateau sizes can make classical discrete optimizers such as an integer-EA or GA outperform continuous ES, whereas as H\mathcal H66 continuous methods regain their advantage because int-EA or GA suffer from high branching factors (Thomaser et al., 2023).

Another misconception is that discretization is merely an implementation detail. The black-box framework explicitly argues that finite precision is a fundamental problem feature that can and often should influence algorithm choice and design (Thomaser et al., 2023). The SciML position paper makes a parallel argument at the level of geometry: if optimization is formulated directly in parameter space without reference to the ambient function space, one may lose the problem-specific metric structure encoded by the Riesz map, Hessian, Fisher operator, or residual Jacobian (Müller et al., 2024). The linear-quadratic control work extends the same logic to decomposition and solver design: deriving the PMP system first permits adaptive-time integrators and overlap-based parallelism that are not naturally visible in a fixed finite-dimensional NLP formulation (Zhao et al., 6 Oct 2025).

Across the surveyed domains, a common design pattern emerges. One first identifies the continuous optimization principle—gradient descent, Newton, Gauss-Newton, natural gradient, Lagrange-Newton, or PMP-based Hamiltonian dynamics—then chooses the operator or metric that defines the appropriate geometry, and only afterward selects the discretization mechanism: a plateau size H\mathcal H67, an integer encoding, a tangent-space Gramian, a time integrator, or a domain decomposition (Thomaser et al., 2023, Müller et al., 2024, Onken et al., 2020, Zhao et al., 6 Oct 2025). This suggests that the central question is not whether to discretize, but at what stage discretization should enter the modeling and algorithmic pipeline.

The open questions listed in the black-box work reinforce this interpretation. They include systematic landscape characterization of discretized problems, online adaptation of H\mathcal H68 or hybrid continuous-discrete search strategies, and extension to multi-objective and constrained black-box settings (Thomaser et al., 2023). The continuous-time Schwarz paper similarly points to extensions to nonlinear and PDE-constrained OCPs, second-order subproblem solvers using second-order adjoints, and multilevel or space-time Schwarz variants (Zhao et al., 6 Oct 2025). Taken together, these directions indicate that Optimize-then-Discretize functions as a general research program for preserving continuous structure while exposing, rather than hiding, the consequences of finite representation.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Optimize-then-Discretize Framework.