Stereotactic radiosurgery plan optimization with a human-in-the-loop reasoning large language model agent
Abstract
Large language model agents can adjust optimization parameters in a treatment planning system under natural-language instruction, but no study has tested a model post-trained for extended reasoning against a general-purpose model in stereotactic radiosurgery. We compared a reasoning-optimized model (QwQ-32B) with a general-purpose model (Llama 3.1-70B) within SAGE, a locally hosted agent that adjusts optimization-objective priorities in Eclipse, which performs all optimization and dose calculation. Each configuration optimized 41 retrospective single-target brain metastasis cases (18 Gy, single fraction) with fixed clinical beam geometry; plans failing the clinical conformity standard (all but two) then received one standardized physicist instruction. The reasoning-optimized configuration produced a lower conformity ratio (median difference −0.20, 95% CI −0.48 to −0.10; $$q<0.001$$ ; lower in 36 of 41 cases) and lower normal-brain V12Gy ( $$q<0.001$$ ), improved conformity more after the instruction (difference in change −0.28, $$p<0.001$$ ), exceeded 21.6 Gy maximum dose less often (5 versus 12 plans), and produced fewer unparseable outputs (25 versus 122). Against clinical plans it showed no significant difference in PTV coverage, maximum dose, conformity ratio, or gradient index, and its right-cochlear maximum dose was lower, a clinically negligible difference.