RadOncGym: An Agent-Based Framework for Radiotherapy Dose-Mimicking Optimization
Organizations: University of Southern California, USA
Abstract
AI dose-prediction models generate patient-specific 3D dose distributions from patient anatomy, providing an important intermediate representation for automated radiotherapy planning. However, an AI-predicted dose must undergo downstream optimization to produce a physically constrained treatment plan, a process that requires balancing competing planning objectives. We present RadOncGym, an agent-based framework that enables an LLM agent to iteratively tune 12 planning-objective weights for dose-mimicking optimization. To reduce iterative evaluation cost, RadOncGym incorporates a surrogate verifier that provides rapid feedback while allowing the agent to decide when to request a full planning solve within a fixed solve budget. We evaluate RadOncGym on 60 OpenKBP head-and-neck patients, each paired with 10 predictions from OpenKBP-Opt dose-prediction sets, yielding 600 patient-prediction contexts per experimental configuration. Under RadOncGym's 16-turn setting with a three-solve budget, a GPT-5.6 Sol agent reduces mean clinical-criterion violation by 0.6131 Gy and improves DVH and dose scores by 0.5986 and 0.2204 Gy relative to leaving all 12 weights fixed at 1, outperforming all evaluated non-agent weight-tuning methods under the same solve budget. It remains competitive with the 16-solve variants of these methods while requiring 75.0-77.6% less normalized runtime. RadOncGym demonstrates the potential of LLM agents as optimization planners in downstream radiotherapy plan optimization and provides a public testbed for their systematic evaluation. Code and configurations are available at https://github.com/miaot-usc/RadOncGym.
Figures & tables
| Structure | Criterion | Structure | Criterion |
|---|---|---|---|
| Brainstem | Mandible | ||
| Spinal cord | Larynx | ||
| Right parotid | PTV56 | ||
| Left parotid | PTV63 | ||
| Esophagus | PTV70 |
| Method | Tot. turns | Full solves | Clin | DVH | Dose | Min/ ctx |
|---|---|---|---|---|---|---|
| Sobol | 16 | 3 | +0.084 | +0.087 | +0.008 | 21.75 |
| CMA-ES | 16 | 3 | +0.083 | +0.259 | +0.037 | 22.39 |
| Exact-GP LogEI | 16 | 3 | +0.155 | +0.247 | +0.088 | 20.21 |
| SAAS-BO | 16 | 3 | +0.228 | -0.075 | +0.096 | 20.22 |
| Sobol | 16 | 16 | +0.350 | +0.361 | +0.088 | 110.46 |
| CMA-ES | 16 | 16 | +0.447 | +0.537 | +0.155 | 109.91 |
| Control | Tot. turns | Full solves | Clin | DVH | Dose | Min/ ctx |
|---|---|---|---|---|---|---|
| Adaptive LogEI | 16 | 3 | +0.236 | +0.070 | +0.039 | 21.65 |
| GPT-5.6 Sol (fixed, clin.) | 16 | 3 | +0.590 | +0.596 | +0.198 | 21.25 |
| Exact-GP LogEI (ext.) | 64 | 3 | +0.484 | +0.418 | +0.138 | 37.55 |
| Memory | Role | Clin | DVH | Dose |
|---|---|---|---|---|
| Lossless full history | Direct planner | +0.608 | +0.612 | +0.226 |
| Evaluator planner | +0.541 | +0.504 | +0.216 | |
| Candidate critic | +0.603 | +0.595 | +0.233 | |
| Criterion-response contrast | Direct planner | +0.610 | +0.606 | +0.220 |
| Evaluator planner | +0.533 | +0.494 | +0.210 | |
| Candidate critic | +0.613 | +0.599 | +0.220 |
| Objective | Final / | Mean final weight |
|---|---|---|
| PTV56 coverage | 69.2% / 18.8% | 1.694 |
| PTV63 coverage | 32.5% / 56.5% | 1.017 |
| PTV70 coverage | 96.2% / 0.8% | 2.941 |
| Brainstem sparing | 2.3% / 88.3% | 0.472 |
| Spinal cord sparing | 11.2% / 74.2% | 0.636 |
| Mandible sparing | 12.3% / 74.0% | 0.621 |
Appendix figures & tables22 assets
Supplementary material from the paper’s appendix.
Appendix
| Method | Settings |
|---|---|
| CMA-ES | population 11, |
| Exact-GP LogEI | initial design 4; 256 raw samples; 16 restarts; 200 GP-fitting iterations |
| SAAS-BO | initial design 4; 256 raw samples; 16 restarts; 128 NUTS warmup steps; 64 NUTS samples; thinning 4; max tree depth 6; 256 acquisition Monte Carlo samples |
| Quantity | Three-solve | 16-solve |
|---|---|---|
| Model invocations | ||
| Planner | 5,953 | 9,600 |
| Candidate critic | 2,016 | 9,600 |
| Planner revision | 358 | 6,225 |
| Total | 8,327 | 25,425 |
| Per context | 13.878 | 42.375 |
| Control family and controls | Scaled terms |
|---|---|
| Target coverage: PTV56, PTV63, PTV70 | maximum; overdose; underdose |
| Organ sparing: Brainstem, spinal cord, right parotid, left parotid, esophagus, larynx, mandible | mean; maximum; upper-tail |
| Auxiliary regions: ring falloff, posterior neck | mean; maximum; upper-tail |
| Block | Dim. | Index |
|---|---|---|
| Global anatomy and prediction summaries | 22 | 0–21 |
| Ten structures 17 features | 170 | 22–191 |
| Overlap, 7 OARs 3 PTVs 4 | 84 | 192–275 |
| Prediction-set identity | 21 | 276–296 |
| Total | 297 |
| Zero-based index | Count | Ordered objects | Ordered fields |
|---|---|---|---|
| 0–11 | 12 | Objective controls | The 12 controls in Table S3 , in table order |
| 12–17 | 6 | Global anatomy | voxel spacing ; voxel volume; possible-dose voxel count; possible-dose volume |
| 18–25 | 8 | CT within stored grid | min, mean, max, p01, p05, p50, p95, p99 |
| 26–33 | 8 | Prediction within possible-dose mask | min, mean, max, p01, p05, p50, p95, p99 |
| 34–203 | Brainstem, SpinalCord, RightParotid, LeftParotid, Esophagus, Larynx, Mandible, PTV56, PTV63, PTV70 | present; voxel count; volume; centroid fraction ; bounding-box extent ; predicted-dose min, mean, max, p01, p05, p50, p95, p99 | |
| 204–287 | Brainstem, SpinalCord, RightParotid, LeftParotid, Esophagus, Larynx, Mandible, each crossed with PTV56, PTV63, PTV70 | intersection volume; fraction of OAR; fraction of PTV; Dice coefficient |
| Loss | Learning rate | Max leaves | Min leaf | |
|---|---|---|---|---|
| Squared error | 0.03 | 31 | 30 | 3.0 |
| Squared error | 0.05 | 15 | 30 | 3.0 |
| Squared error | 0.10 | 31 | 30 | 3.0 |
| Absolute error | 0.03 | 31 | 30 | 3.0 |
| Absolute error | 0.10 | 15 | 30 | 0.3 |
| Absolute error | 0.10 | 31 | 30 | 3.0 |
| Static validation | Adaptive queries | ||
| Diagnostic | Value | Diagnostic | Value |
| Solved pairs | 1,440 | Solved pairs | 1,732 |
| MAE (Gy) | 0.216 | MAE (Gy) | 0.358 |
| Mean Spearman | 0.705 | RMSE (Gy) | 0.492 |
| Pref. accuracy | 0.780 | Mean Spearman | 0.571 |
| Top-3 retained | 58.9% | Sign agreement | 81.6% |
| Clinical-criterion violation (Gy) | DVH score (Gy) | Dose score (Gy) | ||||
|---|---|---|---|---|---|---|
| Set | Mean | 95% CI | Mean | 95% CI | Mean | 95% CI |
| 1 | 1.654 | 4.227 | 3.332 | |||
| 2 | 1.667 | 4.812 | 3.458 | |||
| 3 | 1.653 | 4.093 | 3.270 | |||
| 4 | 1.661 | 4.260 | 3.313 | |||
| 5 | 1.655 | 4.327 | 3.328 | |||
| Tercile | Baseline dose score | Clin | DVH | Dose |
|---|---|---|---|---|
| Lowest | 2.205 | 0.666 | 0.717 | 0.096 |
| Middle | 3.187 | 0.566 | 0.529 | 0.083 |
| Highest | 4.752 | 0.607 | 0.550 | 0.482 |
| Spearman | — |
| Policy | Proposal model | Observation and update |
|---|---|---|
| Sobol | Seeded scrambled low-discrepancy sequence in bounded log-weight space, anchored at the all-ones initialization. | Outcome-independent sequence; no model update. |
| CMA-ES | pycma ask/tell in normalized log-weight space. | Complete weight vectors; minimizes and updates after evaluating a population. |
| Exact-GP LogEI | All-ones-centered Sobol design, then exact Matérn-5/2 ARD GP with LogEI. | Patient-local weight/scalar pairs; maximizes log expected improvement in . |
| SAAS-BO | Sobol initialization, then fully Bayesian sparse-axis GP with qLogEI. | Weight/scalar pairs; maximizes by NUTS inference and Monte Carlo acquisition. |
| (a) Marginal improvement over the context-matched all-ones plan | |||
|---|---|---|---|
| Method | Clinical criterion, Gy | DVH score, Gy | Dose score, Gy |
| Mean [95% CI] | Mean [95% CI] | Mean [95% CI] | |
| Sobol-3 | |||
| CMA-ES-3 | |||
| Exact-GP-3 | |||
| SAAS-BO-3 | |||
| Paired difference: criterion-response contrast with candidate critic minus comparator | ||||
|---|---|---|---|---|
| Memory | Role | Clinical criterion, Gy | DVH score, Gy | Dose score, Gy |
| Mean [95% CI] | Mean [95% CI] | Mean [95% CI] | ||
| Lossless full history | Direct planner | |||
| Criterion-response contrast | Direct planner | |||
| Pareto-tradeoff | Direct planner | |||
| Lossless full history | Candidate critic | |||
| Quantity | Mean | Median | Range | |
|---|---|---|---|---|
| Turns used | 600 | 9.92 | 9 | 6–16 |
| Successful full solves | 600 | 2.89 | 3 | 0–3 |
| Stop turn | 599 | 9.91 | 9 | 6–16 |
| Control | Ever | T1 | Step | Factor | Up | Down |
|---|---|---|---|---|---|---|
| PTV56 | 100.0% | 100.0% | 41.3% | 1.19 | 69.2% | 18.8% |
| PTV63 | 100.0% | 99.0% | 22.4% | 1.14 | 32.5% | 56.5% |
| PTV70 | 100.0% | 99.7% | 32.0% | 1.10 | 96.2% | 0.8% |
| Brainstem | 99.5% | 64.3% | 33.2% | 1.21 | 2.3% | 88.3% |
| Spinal cord | 99.3% | 70.0% | 35.2% | 1.20 | 11.2% | 74.2% |
| Mandible | 99.5% | 87.0% | 31.2% | 1.16 | 12.3% | 74.0% |
| Backbone | Turns used | Successful solves | First solve turn | Second solve turn | Third solve turn |
|---|---|---|---|---|---|
| GPT-5.6 Sol | 9.92 / 9 | 2.89 / 3 | 2.29 / 2 (595) | 4.60 / 4 (586) | 8.23 / 7 (551) |
| Claude Sonnet 5 | 10.47 / 10 | 2.93 / 3 | 1.85 / 2 (596) | 3.62 / 3 (593) | 6.63 / 6 (568) |
| Qwen3.6-27B | 13.61 / 15 | 2.82 / 3 | 3.65 / 3 (580) | 5.70 / 5 (566) | 7.69 / 8 (544) |
| Backbone | Control family | Step | Factor | Final | Mean |
|---|---|---|---|---|---|
| GPT-5.6 Sol | Target coverage | 31.9% | 1.14 | 91.4% | 1.884 |
| Serial-OAR sparing | 33.2% | 1.19 | 87.5% | 0.576 | |
| Mean-dose OAR sparing | 32.8% | 1.19 | 92.9% | 1.474 | |
| Falloff / post. neck | 44.4% | 1.25 | 89.1% | 0.696 | |
| Claude Sonnet 5 | Target coverage | 23.8% | 1.05 | 81.7% | 1.840 |
| Serial-OAR sparing | 20.9% | 1.08 | 58.9% | 1.018 |
| Control | Initial proposal | Executed after critique |
|---|---|---|
| PTV56 coverage | 0.80 | 2.00 |
| Brainstem sparing | 1.00 | 1.20 |
| Right-parotid sparing | 2.80 | 3.50 |
| Left-parotid sparing | 2.80 | 3.50 |
| Mandible sparing | 0.60 | 0.80 |
| Ring falloff | 0.25 | 0.50 |
| Criterion | Previous | Revised | Change |
|---|---|---|---|
| Right parotid | 7.578 | 4.797 | |
| Left parotid | 9.556 | 9.215 | |
| PTV70 | 5.971 | 5.963 |
| Plan | Satisfied criteria | Satisfaction | Fully feasible plans | Strict feasibility |
|---|---|---|---|---|
| Expert reference | 370/502 | 73.7% | 9/60 | 15.0% |
| All ones | 3912/5020 | 77.9% | 78/600 | 13.0% |
| GPT-5.6 Sol | 4117/5020 | 82.0% | 123/600 | 20.5% |
| Criterion | All ones | Sobol-3 | CMA-ES-3 | Exact-GP-3 | SAAS-BO-3 | Adaptive | GPT | Claude | Qwen |
|---|---|---|---|---|---|---|---|---|---|
| Brainstem | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — |
| Spinal cord | 0.2 / 0.23 | 0.2 / 0.23 | 0.2 / 0.23 | 0.2 / 0.21 | 0.4 / 0.45 | 1.1 / 0.78 | 0.0 / — | 0.0 / — | 0.0 / — |
| Mandible | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — |
| Right parotid | 54.2 / 7.45 | 53.6 / 7.40 | 47.1 / 6.85 | 53.1 / 7.18 | 47.3 / 6.89 | 39.3 / 5.98 | 34.6 / 4.37 | 41.7 / 4.46 | 41.5 / 5.66 |
| Left parotid | 55.8 / 9.03 | 52.0 / 7.99 | 58.5 / 8.68 | 49.8 / 7.51 | 51.4 / 7.83 | 50.3 / 7.15 | 41.7 / 5.17 | 45.3 / 5.80 | 45.4 / 6.95 |
| Esophagus | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.0 / — | 0.4 / 0.22 | 0.0 / — | 0.0 / — | 0.0 / — |
| Criterion | Direct planner | Evaluator planner | Candidate critic |
|---|---|---|---|
| Lossless full-history memory | |||
| Brainstem | 0.0/— / — | 0.0/— / — | 0.0/— / — |
| Spinal cord | 0.0/— / — | 0.0/— / — | 0.0/— / — |
| Mandible | 0.0/— / — | 0.0/— / — | 0.0/— / — |
| Right parotid | 33.6/4.37 / 24.83 | 37.3/4.73 / 24.96 | 34.7/4.27 / 24.75 |
| Left parotid | 40.5/5.07 / 25.13 | 42.7/5.79 / 25.71 | 41.2/5.54 / 25.25 |
Large Language Model-Guided Optimization
Large Language Model-Guided Optimization uses language models to propose, steer, and refine solutions to hard search and design problems.
See all 671 papers