Abstract
Current medical AI agents often rely on static, manually designed workflows that struggle with the complexity of clinical practice. This paper introduces a novel framework for the automated design of medical agent architectures. By conceptualizing agent workflows as a searchable graph-based space, the system iteratively evolves its structure—adding nodes, logic loops, and parallel reasoning paths. Evaluated on dermatological benchmarks, the evolved agents demonstrate significant improvements in diagnostic accuracy and robustness, outperforming traditional static baselines.
Introduction
Large Language Model (LLM) agents in medicine typically operate within "static" architectures where developers manually define a fixed sequence of steps. While functional for straightforward tasks, these rigid workflows lack the flexibility required for the interdisciplinary and often ambiguous nature of clinical medicine. Redesigning these workflows manually for every new tool or edge case is inefficient. This research explores whether LLMs can autonomously search for and construct the most effective medical agent architecture for a specific task, effectively "learning" the optimal diagnostic workflow.
Methods: Workflow Evolution
The proposed framework applies principles from Neural Architecture Search (NAS) to agentic workflows. The "Workflow Evolution" process is driven by three core components:
1. Hierarchical Search Space
The system can modify the agent at three distinct levels, allowing for both granular and high-level architectural changes:
- Node-level: Operations to add, remove, or modify individual "Basic" (LLM-based) or "Tool" (API-based) nodes.
- Structural-level: Introduction of logic such as conditional branches, iterative loops for refinement, and parallel execution for consensus-building.
- Framework-level: Adoption of established reasoning patterns like Chain-of-Thought or "Round Table" discussions.
2. Process Perception and Iteration
The evolution is an iterative loop. The system analyzes its own performance, specifically identifying "Image Understanding Errors" versus "Diagnostic Errors." Based on this error analysis, an LLM acting as an "architect" generates structural and prompt-level suggestions. These suggestions are then used to update the workflow, which is validated and deployed for the next iteration.
Experimental Evaluation
The framework was tested on two challenging dermatological datasets: Skin Concepts (3,230 images with 48 clinical annotations) and Augmented Skin Conditions (2,394 images covering six major conditions). Dermatology was selected as the primary testbed because it demands a high degree of both visual perception and integrative reasoning.
Key Results
The evolved agents consistently outperformed state-of-the-art baselines across various models, including GPT-4o and Claude 3.5 Sonnet.
- Accuracy Improvements: On the Skin Concepts dataset, the evolved GPT-4o agent achieved a 29.28% Top-1 accuracy, compared to only 20.27% for a standard input-output baseline.
- Structural Complexity: Over six iterations, workflows evolved from simple linear sequences into complex graphs, averaging 11 nodes and 5 branches. This indicates the system actively identifies and implements sophisticated reasoning paths.
- Robustness: The evolved workflows demonstrated higher consistency (cons@64 scores), suggesting that automated design leads to more reliable diagnostic behavior.
Discussion and Future Work
This research demonstrates that LLMs can effectively optimize their own operational structures. A key insight is that structural optimization often yields greater performance gains than simple prompt engineering. However, challenges remain regarding the computational cost of iterative evolution and the inherent "black box" nature of the LLM's architectural decisions. Future research will focus on expanding the framework to handle multi-modal clinical data and improving the efficiency of the search algorithm.
Summary updated