MiniOpt: Dual Optimization Approaches
- MiniOpt is a term that describes two distinct optimization systems: one that generates optimization models from language input using reinforcement learning, and another that employs heuristic methods to optimize continuous functions.
- The RL-based MiniOpt uses a structured 'reasoning-to-model-and-solve' paradigm to create verifiable Pyomo code, enabling resource-efficient optimization under limited training.
- The heuristic MiniOpt leverages cascaded search stages—including swarm search, genetic recombination, and line minimization—to reliably approach global optima in multidimensional spaces.
MiniOpt is a name used in arXiv literature for two distinct optimization systems. In the 2026 usage, MiniOpt denotes a reinforcement learning framework for optimization-oriented LLMs that learns to solve optimization problems through a structured “reasoning-to-model-and-solve” paradigm under limited training resources (Zhao et al., 24 Jun 2026). In the 2017 usage, MiniOpt denotes a multi-strategy optimizer for arbitrary generic functions in multidimensional space, designed to find a likely global optimum and a set of sub-optimal points through cascaded search stages over a finite domain (Masotti, 2017). The shared label is therefore potentially misleading: the former is a language-model framework that produces optimization formulations and executable solver code from natural-language problem descriptions, whereas the latter is a direct search algorithm for continuous black-box optimization.
1. Disambiguation and conceptual scope
The two MiniOpt systems address different optimization objects and rely on different operational primitives. The 2026 framework treats optimization as a modeling-and-execution problem: a natural-language description is transformed into a structured optimization model and then into a self-contained Pyomo script whose numeric optimum can be checked automatically (Zhao et al., 24 Jun 2026). The 2017 algorithm treats optimization as multidimensional function minimization over a normalized hypercube , using repeated line minimization, swarm maintenance, genetic recombination, and local attraction heuristics (Masotti, 2017).
A common misconception is to read “MiniOpt” as a single family of methods. The record instead supports a nomenclatural bifurcation. One branch belongs to optimization-oriented LLM research, where “reasoning” is decomposed into explicit symbolic components and evaluated with executable verification. The other belongs to heuristic global optimization, where “strategy” refers to a sequence of search operators coordinated by a temperature schedule. This suggests that the common name reflects a shared concern with resource-efficient optimization, but not a shared algorithmic lineage.
2. MiniOpt as an optimization-oriented LLM framework
In the 2026 work, MiniOpt is introduced to address strong optimization generalization across diverse optimization problems while requiring limited training resources (Zhao et al., 24 Jun 2026). Its central abstraction is the “reasoning-to-model-and-solve” paradigm, which decomposes each response into two phases. The first phase, enclosed by > ..., is “Structured Modeling.” The second phase, enclosed by <answer> ... </answer>, is “Executable Code Generation.”
The structured modeling phase identifies a five-element tuple
Within this tuple, Sets define index domains such as ; Parameters provide data such as cost or capacity ; Variables define decision domains, for example or ; Objective specifies , linear or nonlinear; and Constraints encode relations such as , with examples including (Zhao et al., 24 Jun 2026). The model then selects an open-source solver from 0 based on variable types and linearity.
The executable phase emits a self-contained Pyomo script. The generated code imports pyomo.environ, declares Sets, Params, Variables, Objective, and Constraints, calls the chosen solver, and prints the numeric optimum. Because every generation is forced into the two fenced segments, outputs are described as trivially parseable and verifiable. The forward process is correspondingly simple: the natural-language description is appended to a system prompt, the model generates a completion, the <think> segment is parsed into the five-element model, and the <answer> segment is parsed into Pyomo code.
The design is significant because it constrains optimization reasoning into an explicit intermediate representation. In this formulation, “reasoning” is not an unconstrained narrative trace but a structured optimization model with a fixed schema. A plausible implication is that MiniOpt’s generalization target is partly redistributed from free-form textual reasoning to schema induction, solver selection, and code-level correctness.
3. OptReward and the OptGRPO policy optimization strategy
MiniOpt trains without expert demonstrations by using OptReward, a hierarchical reward function that jointly evaluates formulation quality and solution correctness (Zhao et al., 24 Jun 2026). The reward is composed of a formatting component and a solution component. The formatting score is
1
and the five-element completeness score is
2
where 3 if the 4-th element among Sets, Parameters, Variables, Objective, and Constraints appears in the <think> block. The solution score is
5
The total reward is
6
The work also groups the terms as 7 and 8, noting that one could write 9 with 0 in the implementation.
The policy optimizer is OptGRPO, a modification of GRPO, described as a PPO-style, group-normalized policy gradient. Its principal changes are asymmetric clipping of the policy ratio 1, with 2 clipped to 3 and 4—for example, 5 and 6—in order to encourage exploration of low-probability tokens; removal of the KL penalty by setting 7; and token-level advantage normalization, so that each generated token’s log-prob is treated incrementally (Zhao et al., 24 Jun 2026). The objective is
8
where 9 and 0 is the group-normalized advantage derived from 1.
The reported sensitivity study on reward gaps 2 and 3 states that a hierarchical structure such as 4 is critical for stable learning. This is a substantive claim about reward shaping: the framework does not merely reward success, but arranges the error landscape so that partial progress in formatting and execution remains learnable.
4. Model scale, evaluation protocol, and practical use
MiniOpt-3B and MiniOpt-7B are built on Qwen2.5-Coder architectures, described as decoder-only with a mixture of transformer layers (Zhao et al., 24 Jun 2026). The parameter counts are 3 billion and 7 billion. The rationale is that these models are small enough to fine-tune on a single 8-GPU node while remaining expressive enough to capture modeling patterns. During inference, the system uses temperature 5 and greedy decoding for <think> and code generation. The stated trade-off is that the 3B model achieves more than 59% average solving accuracy while consuming approximately 25% of the output tokens used by 671B models.
Evaluation is conducted on eight benchmarks: NL4Opt, ICML Competition, Mamo Easy/Complex, NLP4LP, ComplexOR, IndustryOR, and OptiBench (Zhao et al., 24 Jun 2026). The two principal metrics are Solving Accuracy (SA), defined as the percentage of cases where the model’s objective 6 matches ground truth 7 within 0.1 tolerance, and Execution Rate (ER), defined as the percentage of generated codes that execute without errors.
The key reported aggregate results are an average SA of 59.65% for MiniOpt-3B and 64.76% for MiniOpt-7B. For models with fewer than 10B parameters, the MiniOpt series is reported to achieve the highest average SA, and for models with more than 10B parameters, it is reported to remain competitive. The details further state that MiniOpt-3B ranks second among models below 10B parameters and outperforms GPT-5 at 57.54%, while MiniOpt-7B is reported as best overall among open-weight models except DeepSeek-R1 at 60.85% (Zhao et al., 24 Jun 2026). The ablation study on MiniOpt-3B reports average SA drops of 3.05 percentage points without SFT warm-up, 4.58 percentage points without two-stage RL, 1.69 percentage points without OptReward, and 3.11 percentage points when replacing OptGRPO with vanilla GRPO. The MiniOpt family is further placed on the empirical trade-off curve of SA versus model size.
Operationally, the framework is distributed through a GitHub repository at https://github.com/Hsiang-1/MiniOpt. The abridged structure includes data/ with train_stage1.jsonl and train_stage2.jsonl; src/ with model.py, optreward.py, rl_train.py, and inference.py; and scripts/ with mid_train.sh, rl_stage1.sh, rl_stage2.sh, and run_infer.sh (Zhao et al., 24 Jun 2026). Application to a new optimization problem consists of installing Pyomo, glpk/cbc/ipopt/scip, and PyTorch; running
9
then parsing the printed Pyomo code, executing it, and reading off the optimal value. The repository also states that a custom seed model can be fine-tuned by following the two-stage pipeline and OptReward tutorials in the README.
5. MiniOpt as a multi-strategy optimizer for arbitrary functions
The 2017 MiniOpt is an algorithm for arbitrary generic functions of several variables, designed to cope with complex, irregular, noisy behavior, steep variations, and many local sub-optimal points (Masotti, 2017). Its control structure is an outer loop over decreasing temperature levels, typically
8
and, at each temperature, 9 independent trials, usually 0. Each trial executes four cascaded stages.
Stage 1 is Swarm Search, characterized as global exploration. The algorithm maintains a swarm, or stack, of the best distinct points found so far, with stack size approximately 1. It starts from three diagonal seeds,
2
then alternates a single random unit-length direction 3 shared across the swarm, per-point steps 4, candidate formation 5, optional line minimization 6, and reinsertion of the best distinct points through a worst-in, best-out update.
Stage 2 is Genetic Improvement, described as recombine and mutate. It draws the number of parents from a truncated exponential law,
7
favoring top-ranked points. One child is built at a time by selecting, for each coordinate, a parent index from the same exponential law. With mutation probability 8, a coordinate is replaced by 9 where 0. Improved children are inserted into the stack.
Stage 3 is Proximal Search, characterized as firefly-style local pulls. For the current worst point 1 in the stack, the algorithm computes for every other point 2 an attraction score
3
with 4, then chooses the attractor with maximal attraction and calls 5. This is repeated until all stack points have been tried once.
Stage 4 is Swarm Along Axes, a coordinate-by-coordinate refinement. The optimizer draws a random permutation of the coordinate axes and, for each axis in turn and each point in the stack, calls 6 where 7 is the unit vector along axis 8. After the four stages consume their per-trial function-evaluation budget, approximately 9, the trial returns its stack. The 0 stacks are merged, the top 1 points overall are retained, and these serve as the initial swarm for the next lower temperature. At 2, the best point or points in the final stack are reported.
The staged composition is central to the method’s identity. Many ideas from known methods are explicitly re-elaborated into a coherent scheme, and line minimization is emphasized as a key primitive across most stages. A plausible implication is that the algorithm’s robustness comes less from any single heuristic than from the serial interaction between population diversity, recombination, local attraction, and axis-wise refinement.
6. One-dimensional search, parameterization, and computational profile
The 2017 MiniOpt reduces multidimensional moves to repeated one-dimensional minimizations over feasible line segments (Masotti, 2017). Let
3
be the normalized objective, assuming each parameter has been scaled to 4. Every stage performs minimizations of
5
subject to the constraint that 6. Equivalently, the algorithm computes the scalar interval 7 such that 8 remains in the unit hypercube for 9, and then minimizes 0 over that interval.
The line-minimization routine is a modified Brent-style procedure with explicit finite-domain handling and multi-minimum support. It first computes the admissible interval 1 coordinatewise, then brackets a minimum using three points 2 with 3 and 4, and then alternates parabolic interpolation with golden-section fallback when the interpolated step is inadmissible or too close to the current best point. The tolerance is approximately 5 in 6-space, stated to ensure approximately 7 accuracy in 8.
The algorithm’s parameterization is unusually explicit. The swarm-search step distribution uses the “notchTwinPeaks” family, with
9
The genetic-stage parent count uses a truncated exponential with rate 0. Mutation uses “fatTail3,” a smooth approximation of a 75%/25% mixture. The proximal-stage visibility range is sampled from a Gamma law truncated at 1. Duplicate suppression is enforced through an equivalence radius 2 that decreases linearly from a high initial value of approximately 3 to a low final value of approximately 4, using the Manhattan criterion
5
The default stack size is 6, the per-stage per-trial budget is approximately 7 function evaluations, and five temperature levels yield approximately 8 total evaluations.
The reported cost measure is the number of 9-evaluations, 0. In 11–18 dimensions, for real trading-system merit functions, the method is reported to reliably find the global minimum with 1 whereas simpler methods fail (Masotti, 2017). Serial runtime on a single i7 of the 2017 era is reported as 0.5–3 hours depending on the cost of evaluating 2. Trials are described as A-embarrassingly parallel, implying near-linear speed-up on multi-CPU systems. The implementation guidance specifies a sorted stack of pairs 3, a high-quality PRNG such as JKISS, the temperature loop over 4, and tunable settings such as 5, stage-budget allocation with approximately 30% more effort in stages 3 and 4, 6, and either linear or exponential decay of 7.
Taken together, the two MiniOpt works show that the same name has come to denote two different answers to the optimization problem. One answer is to model, generate, and verify optimization programs with reinforcement learning and structured outputs; the other is to engineer a multi-stage search process around line minimization, temperature control, and population management. The overlap lies in staged decomposition and constrained resource use, but the operative objects—language-model trajectories in one case, points in 8 in the other—remain fundamentally different.