OptSkills: Archetype-Centric Optimization System
- OptSkills is an archetype-centric skill learning system that transforms natural language optimization problems into mathematical models and executable solver code.
- It employs structural extraction, embedding fusion with DBSCAN clustering, and workflow-level skill distillation to generalize across diverse problem descriptions.
- Empirical results demonstrate that clustering and continual skill learning significantly improve retrieval metrics and solution accuracy across multiple optimization benchmarks.
OptSkills is an archetype-centric skill learning and reasoning system for automatically formulating and solving optimization problems from natural-language descriptions. It is designed for settings in which a textual problem statement must be converted into a mathematical formulation, executable solver code, and a verified numerical answer. Its defining premise is that reusable optimization knowledge should be organized around problem archetypes—canonical structural patterns of objectives, variables, and constraints—rather than around superficial narrative similarity or individual solved cases. In this formulation, the primary reusable artifact is a workflow-level skill distilled from successful and failed trajectories within an archetype cluster, then refined or expanded as new tasks are encountered (Yang et al., 28 May 2026).
1. Conceptual definition and scope
OptSkills addresses automated optimization from natural language. The target task is end-to-end: a system receives a textual optimization problem, identifies its structural type, formulates the optimization model, generates solver code, executes a solver, and returns the correct numerical result. The paper places this setting within mathematical programming and combinatorial optimization, including LP, MILP, IP, NLP, and SOCP, and in out-of-distribution evaluation also broader categories such as routing, scheduling, packing, assignment, graph optimization, and facility-location-style tasks (Yang et al., 28 May 2026).
The system is motivated by three limitations in prior LLM-based optimization pipelines. First, they are sensitive to narrative variation: two problems with the same mathematical structure may be phrased in unrelated domains. Second, they tend to reuse experience at the case level rather than the structural level. Third, they have limited capacity to adapt when problem distributions shift or when new archetypes appear. OptSkills responds by treating the archetype as the basic unit of organization and the skill as the basic unit of reuse (Yang et al., 28 May 2026).
The paper formalizes an archetype as a canonical optimization structure abstracted from application stories, and represents a concrete natural-language instance as a verbalization of that archetype,
where denotes the scenario-specific verbalization process. The manuscript further intends that the induced optimization model be invariant to this verbalization. This implies that the same archetype may underlie scheduling, allocation, routing, or facility narratives that differ lexically but not structurally (Yang et al., 28 May 2026).
A central distinction follows from this design. OptSkills does not treat a prior solved instance as the main reusable object. Instead, it defines a skill as
where is metadata, is a workflow for modeling and solving, and is a set of common pitfalls. This means reuse occurs at the level of generalized modeling-and-solving procedures rather than at the level of exemplars or demonstrations (Yang et al., 28 May 2026).
2. Archetype representation and clustering
The first technical stage in OptSkills is the construction of an archetype-oriented representation for each training problem. For every problem , an LLM extractor produces two structural views: optimization ingredients , which are scenario-agnostic keywords about variables, constraints, and objectives, and an edited problem , which rewrites the original statement to remove scenario-specific entities while preserving mathematical content (Yang et al., 28 May 2026).
These two views are embedded separately and fused into a normalized archetype embedding: 0 where 1 is the embedding of 2, 3 is the embedding of 4, and 5 controls the trade-off. In the reported implementation, the embedding model is Qwen3-Embedding-v3 and the fusion weight is 6 (Yang et al., 28 May 2026).
Problems are then clustered with DBSCAN: 7 using cosine distance over normalized embeddings. The main setting uses 8 and 9. Each resulting cluster is treated as a set of problems sharing a similar archetype (Yang et al., 28 May 2026).
The paper provides direct evidence that archetype-oriented representations are materially different from raw problem-text embeddings. In KNN retrieval diagnostics on Nano-CO, archetype embeddings outperform raw-text embeddings on every reported metric: Hit@1 rises from 0.416 to 0.820, Hit@3 from 0.690 to 0.939, Hit@5 from 0.8080 to 0.971, Precision@5 from 0.344 to 0.596, Recall@5 from 0.430 to 0.745, MRR from 0.582 to 0.885, and MAP@5 from 0.318 to 0.679 (Yang et al., 28 May 2026).
This clustering stage also functions as a form of library compression. In the ablations, a non-clustered skill-distillation regime yields 129 skills, of which 81 skills (62.8%) are never invoked during inference. By contrast, cluster-based distillation yields 46 skills, with only 7 unused (15.2%). This suggests that clustering suppresses redundant, instance-specific skills and increases retrieval utility (Yang et al., 28 May 2026).
3. Cluster-based distillation and workflow-level skills
Once training problems are grouped by archetype, OptSkills explores multiple modeling and solver configurations within each problem. It uses a solver portfolio rollout in which an LLM-based selector chooses the top-0 solver configurations from a solver pool 1, with top-2 in the reported setup. For each selected solver 3, the system generates a formulation, iteratively writes and executes solver code, and continues until a feasible solution is found or the loop terminates; the maximum number of agent-loop turns is 12 (Yang et al., 28 May 2026).
A trajectory for problem 4 under solver/paradigm 5 is defined as
6
and the set of trajectories for that problem is
7
Trajectories are labeled positive if the final answer 8 matches the ground-truth answer 9, and negative otherwise (Yang et al., 28 May 2026).
An LLM-based analyst then converts the positive and negative trajectory sets into a reusable analysis,
0
where 1 denotes reusable SOPs extracted from successful trajectories and 2 denotes common pitfalls extracted from failed trajectories. Distillation occurs at the cluster level, not the individual-instance level: 3 and the initial skill library is
4
The resulting skills are explicitly structured markdown documents with metadata, multiple workflows, modeling-stage guidance, solving-stage guidance, and pitfalls (Yang et al., 28 May 2026).
This architecture makes “workflow-level skill” a precise term. A demonstration is a raw trajectory for one instance; an exemplar is a retrieved solved case; a workflow-level skill is a distilled procedural document encoding recurring modeling patterns, solver choices, debugging practices, and failure warnings across structurally similar instances. The builder prompt enforces a format with a name, a one-sentence description, alternative workflows, formulation templates, code usage guidance, and common pitfalls (Yang et al., 28 May 2026).
A misconception that the paper explicitly rejects is that more skills necessarily imply better reuse. The non-clustered ablation improves some datasets over a pure tool-call agent, but its per-sample skill extraction creates overlapping, instance-specific skills with weak transferability. Cluster-based distillation improves on that regime across most reported benchmarks, which suggests that archetype aggregation is not merely a storage optimization but part of the generalization mechanism (Yang et al., 28 May 2026).
4. Skill learning, refinement, and expansion
After the initial library 5 is built, OptSkills enters a continual skill-learning stage. For a new problem 6, the system again extracts optimization ingredients and an edited problem, then uses an LLM-based selector and judge to determine whether an existing skill is structurally appropriate. The judge is instructed to approve reuse only if the candidate skill matches the same canonical optimization type, rather than merely sharing keywords or domain surface form (Yang et al., 28 May 2026).
If an existing skill 7 is selected, it is injected into the solving process. The resulting trajectory is then analyzed. Positive trajectories reinforce and clarify successful SOP content in the workflow portion of the skill; negative trajectories contribute to the pitfall portion. The refiner is constrained to preserve the skill’s identity and document skeleton and to make only minimal evidence-based edits (Yang et al., 28 May 2026).
If no suitable skill exists, the problem is treated as a candidate new archetype. OptSkills performs the same solver portfolio rollout and trajectory analysis. Library expansion occurs only if at least one positive trajectory is found; then a new skill is built as
8
and added to the library: 9 This rule prevents unsupported skill creation from purely failed evidence (Yang et al., 28 May 2026).
The paper frames these two operations—refinement of an existing skill and expansion of the library with a new skill—as the mechanism for out-of-distribution adaptation. This distinguishes OptSkills from systems that build a static skill library once and only use it at inference time. A plausible implication is that the framework treats structural novelty as a first-class event: not every failure is a reason to retry harder; some are evidence that the current archetype inventory is incomplete.
5. Test-time reasoning and optimization workflow
At inference time, the skill library is fixed. For each new natural-language optimization problem, OptSkills performs structural extraction, retrieves the most relevant skill, and injects it into the executor. The executor first produces a structured formulation in JSON with fields such as sets, parameters, decision variables, objective, and constraints, then generates solver code in packages such as ortools or pyomo, and uses solver backends including gurobi, clp, glpk, ipopt, highs, cbc, scip, and mindtpy (Yang et al., 28 May 2026).
The executor operates in an iterative repair loop. Tool feedback is used to diagnose code or modeling issues, and the agent retries within the turn budget until an optimal or otherwise accepted verified value is obtained. The prompts require parseable numerical output and persistent temporary best values. The final response is returned in numeric form (Yang et al., 28 May 2026).
The workflow therefore has a two-stage internal structure. The first stage is modeling, which converts the problem into an explicit optimization representation. The second is solving, which maps that representation to executable code and solver calls. The learned skill mediates both stages by shaping variable design, objective construction, constraint families, solver choice, and debugging practice (Yang et al., 28 May 2026).
This matters because OptSkills is not just a retrieval front-end for a code generator. Its skills are intended to influence how the optimization problem is conceptualized before code is written. The appendix case study on a cardinality-constrained pairwise selection problem is presented precisely to show that skill guidance can prevent semantic modeling errors that remain plausible in a no-skill trajectory (Yang et al., 28 May 2026).
6. Empirical performance, related frameworks, and limitations
OptSkills is evaluated on five main benchmarks: OptiBench, Mamo.C, OptMATH-Bench, IndustryOR, and ComplexOR. In the main reported configuration, OptSkills-D, which uses DeepSeek-V3.2 (non-thinking mode) as the backbone, achieves Macro-Avg. 62.04 and Micro-Avg. 68.27. Per benchmark, it reports 77.02 on OptiBench, 63.51 on Mamo.C, 61.45 on OptMATH, 36.00 on IndustryOR, and 72.22 on ComplexOR. The strongest overall baseline in the reported table is Trace2Skill with Macro-Avg. 56.97 and Micro-Avg. 63.46, so the micro-average gain is 4.81 percentage points (Yang et al., 28 May 2026).
On MIPLIB-NL, described as a highly challenging large-scale and high-dimensional benchmark, OptSkills achieves 26.91%, exceeding DeepSeek-V3.2-Thinking’s 22.38% by 4.53 percentage points. The paper further notes that among correctly solved instances, the dimensionality of decision variables reaches 87,482, which indicates competitiveness on large-scale formulations as well as on benchmark-scale tasks (Yang et al., 28 May 2026).
The out-of-distribution experiment uses Nano-CO as an adaptation dataset and evaluates on NLCO. On NLCO, the reported numbers are 62.60 for a Tool-Call Agent, 68.56 before learning, and 72.79 after learning on Nano-CO. Thus the initial skill library already improves over the baseline, and continued skill learning yields a further increase (Yang et al., 28 May 2026).
The ablation sequence clarifies the contribution of each stage. A pure tool-call agent yields 73.22 / 53.08 / 54.21 / 34.00 / 66.67 across OptiBench, Mamo.C, OptMATH, IndustryOR, and ComplexOR. Adding non-clustered skill distillation changes this to 69.75 / 56.40 / 59.64 / 32.00 / 66.67. Adding cluster-based distillation raises it to 74.71 / 59.24 / 60.84 / 35.00 / 72.22. The full system with skill learning reaches 77.02 / 63.51 / 61.45 / 36.00 / 72.22. This progression indicates that clustering and continued learning are both necessary to obtain the full reported gain (Yang et al., 28 May 2026).
In the broader 2026 literature, OptSkills sits within a larger movement that treats skills as explicit, reusable artifacts rather than latent side effects of prompting. SkillOpt treats a single skill document as trainable external state optimized by bounded patch edits and held-out validation (Yang et al., 22 May 2026). SkillOS treats skill curation as a long-horizon RL problem over an external repository updated by insert, update, and delete operations (Ouyang et al., 7 May 2026). MOCHA formulates structured agent skills as multi-objective artifacts under correctness and compliance constraints (Tanjim et al., 19 May 2026). These frameworks operate in different domains, but they share the assumption that skill quality depends on explicit representation, controlled updates, and deployment-aware reuse.
OptSkills has explicit limitations. The paper notes dependence on LLM-generated intermediate abstractions, so errors in ingredient extraction or problem editing can propagate into clustering and skill selection. It also notes sensitivity to clustering granularity: over-fragmentation yields redundant skills, while over-merging mixes distinct archetypes. Future directions proposed in the paper include adaptive clustering, skill merging, and skill pruning (Yang et al., 28 May 2026). This suggests that OptSkills, despite its archetype-centric design, still leaves library management as an open systems problem rather than a solved component.