Tool-Augmented Agent for Closed-loop Optimization,Simulation,and Modeling Orchestration

Liyuan Deng, Shujian Deng, Yongkang Chen, Yongkang Dai, Zhihang Zhong, Linyang Li, Xiao Sun, Yilei Shi, Huaxi Huang

TL;DR

COSMO-Agent bridges the gap between industrial design (CAD) and engineering simulation (CAE) by training an LLM via reinforcement learning to act as a closed-loop controller. By orchestrating external tools and iteratively refining geometric parameters based on physics feedback, it achieves higher success rates and efficiency in satisfying complex engineering constraints than much larger open- and closed-source models.

What Problem Does This Paper Address?

In modern manufacturing, designing a functional component is a tedious game of tug-of-war between Computer-Aided Design (CAD) and Computer-Aided Engineering (CAE). An engineer creates a parametric geometry in CAD, runs a physics simulation in CAE (like finite element analysis to check stress or displacement), and then must manually figure out how to tweak the CAD parameters based on the simulation's high-dimensional feedback.

This loop suffers from a severe semantic gap: translating physics failures back into valid, history-consistent CAD edits is incredibly difficult to automate. Furthermore, real-world engineering toolchains are brittle; meshing errors, regeneration breakdowns, and solver non-convergence frequently crash automated scripts. While Large Language Models (LLMs) excel at tool use, standard prompting strategies fall apart when faced with these long-horizon, trial-and-error optimization tasks and stochastic tool failures.

Methods

The authors introduce COSMO-Agent (Closed-loop Optimization, Simulation, and Modeling Orchestration), casting the CAD-CAE optimization loop as an interactive reinforcement learning (RL) environment.

COSMO-Agent framework and tool design

Key components of the methodology include:

  • Model Context Protocol (MCP) Tool Set: The agent interacts with a unified interface managing four distinct tools: a CAD Generator (using CadQuery), a CAE Solver (using FreeCAD and CalculiX), a Result Extractor (to pull max displacement and von Mises stress), and a Cost Calculator.
  • RL Fine-Tuning: Built on a Qwen3-8B backbone, the model is trained using Generalized Reinforcement Policy Optimization (GRPO) to learn optimal parameter-tuning strategies over multi-round interactions (up to 15 turns).
  • Multi-Constraint Reward Design: To prevent the model from "reward hacking" (e.g., outputting un-executable but numerically favorable designs), the reward function explicitly balances three objectives:
  • Constraint Reward ($R_{cons}$): Piecewise rewards based on how many engineering targets (stress, displacement, cost) are met.
  • Feasible-Then-Stop Reward ($R_{stop}$): Penalizes unnecessary tool calls after a valid design is achieved to maximize efficiency.
  • Format Consistency Reward ($R_{fmt}$): Ensures the final output is a perfectly structured, parsable JSON object.

Datasets

Because no comprehensive benchmark existed for this specific closed-loop task, the authors constructed a new industry-aligned dataset:

  • Scale and Scope: ~20,000 executable CAD-CAE tasks spanning 25 common industrial component categories (e.g., flat plate flanges, triangular brackets, I-beams).
  • Train/Test Split: 20 categories were used for training and testing, while 5 entirely unseen categories were held out exclusively to evaluate the agent's ability to generalize to new geometric templates.
  • Task Generation: Targets were created using a randomized reduction strategy (cutting baseline displacement or cost metrics by 5% to 30%) to ensure the optimization goals were challenging but physically feasible.

Key Insights and Ideas

  • Learning to Iterate: Instead of trying to guess the perfect design in one shot, the RL training explicitly teaches the LLM a "call tools, read feedback, and iterate" loop.
  • The Danger of Final-Verification Rewards: A key insight from the paper's ablation studies showed that rewarding an agent based only on its final output causes it to cheat. Without intermediate rollout-log rewards, the model simply stops calling the simulation tools entirely and outputs a "guessed" JSON to avoid tool-use penalties, causing the success rate to plummet.
  • Robustness to Failure: By exposing the LLM to actual toolchain failures (like meshing errors) during RL rollouts, the agent learns how to recover from pipeline crashes rather than breaking down.

Key Results

COSMO-Agent (8B) achieved remarkable performance, handily beating models many times its size:

Visualized inference case showing iterative refinement
  • Full Success Rate (FSR): COSMO-Agent achieved a 74.5% FSR on the test set, outperforming the strongest open-source baseline (Intern-S1, 236B) which only managed 32.0%. It also surpassed the top closed-source model, Gemini-3-Flash (67.5%).
  • Efficiency: The agent required an average of only 6.72 tool calls per task, compared to Gemini's 9.32 and Claude-Sonnet-4.5's 11.25, demonstrating superior interaction efficiency.
  • Generalization: On the 5 completely unseen component categories, COSMO-Agent maintained a 75.0% FSR and a 100% format extraction success rate, proving its capability to adapt to entirely new engineering tasks.

Limitations and Future Work

While highly effective, the authors note several areas for expansion:

  • Geometry Complexity: The current framework focuses on single-part optimization. Future work will target multi-part assemblies, which introduce complex contact mechanics.
  • Advanced Physics: The simulation environment is currently restricted to linear static analysis. Real-world engineering frequently demands non-linear materials and multi-physics coupling (e.g., thermal-structural interactions).
  • Action Space Scale: The authors plan to scale the agent to handle larger geometric action spaces and tighter optimization budgets.

Summary updated

Abstract

Iterative industrial design-simulation optimization is bottlenecked by the CAD-CAE semantic gap: translating simulation feedback into valid geometric edits under diverse, coupled constraints. To fill this gap, we propose COSMO-Agent (Closed-loop Optimization, Simulation, and Modeling Orchestration), a tool-augmented reinforcement learning (RL) framework that teaches LLMs to complete the closed-loop CAD-CAE process. Specifically, we cast CAD generation, CAE solving, result parsing, and geometry revision as an interactive RL environment, where an LLM learns to orchestrate external tools and revise parametric geometries until constraints are satisfied. To make this learning stable and industrially usable, we design a multi-constraint reward that jointly encourages feasibility, toolchain robustness, and structured output validity. In addition, we contribute an industry-aligned dataset that covers 25 component categories with executable CAD-CAE tasks to support realistic training and evaluation. Experiments show that COSMO-Agent training substantially improves small open-source LLMs for constraint-driven design, exceeding large open-source and strong closed-source models in feasibility, efficiency, and stability.
BibTeX
@misc{deng2026tool,
  author = {Liyuan Deng and Shujian Deng and Yongkang Chen and Yongkang Dai and Zhihang Zhong and Linyang Li and Xiao Sun and Yilei Shi and Huaxi Huang},
  title = {{Tool-Augmented Agent for Closed-loop Optimization,Simulation,and Modeling Orchestration}},
  year = {2026},
  eprint = {2604.05547},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2604.05547},
}
Figure