MedDCR: Learning to Design Agentic Workflows for Medical Coding¶
🕒 Published (v1): 2025-11-17 13:30 UTC · Source: Arxiv · link
Ask a follow-up
Open an assistant pre-loaded with this paper's context.
💬 Ask ChatGPT✦ Ask Claude
TL;DR¶
MedDCR frames agentic workflow design for medical ICD coding as an optimization problem solved by a closed-loop meta-agent system: a Designer proposes workflows, a Coder compiles them into executable programs, and a Reflector scores and critiques them. A memory archive accumulates all prior designs, enabling both exploitation of top-performers and exploration via recent diversity. On MDACE and ACI-BENCH benchmarks, MedDCR outperforms all hand-crafted and general agentic baselines.
Problem¶
Existing agentic medical coding systems rely on rigid, manually crafted workflows that fix both the module definitions (tools, inference strategies) and their execution topology. This static design misses non-obvious coordination patterns (e.g., contrastive ICD-code pruning steps) and cannot adapt to the variability of clinical documentation, leaving systematic workflow optimization unexplored.
Method¶
MedDCR poses workflow search as optimization over a DAG-structured search space \(\mathcal{S}\) of feasible workflows. A workflow \(W = (G = (V, E), \phi)\) maps clinical notes to ICD code sets via \(f_W : \mathcal{X} \to 2^\mathcal{C}\). The objective balances F1 score, guideline compliance \(V_\Gamma \in [0,1]\), and cost \(C(W)\):
The Design–Execute–Reflect (DCR) loop iterates for \(T\) rounds: 1. Designer reads the memory archive \(H_t\) (top-\(k\) scoring + \(n\) most-recent entries) and proposes a new workflow plan \(\pi_t\) from a component library of tools \(\mathcal{T}\), strategy primitives \(\Sigma\), and LLM modules \(\mathcal{M}\). 2. Coder compiles \(\pi_t\) into an executable program \(W_t\); a self-fixing sub-loop auto-repairs syntax/runtime errors before retrying. 3. Reflector executes \(W_t\) on \(D_\text{val}\), produces scalar score \(s_t\) and textual critique \(r_t\) (flagging bad tool combinations, guideline violations, etc.), and appends \((π_t, W_t, s_t, r_t)\) to \(H_{t+1}\).
The archive also supports plug-and-play: external expert workflows \(W_\text{seed}\) are injected into \(H_0\) and refined like any discovered entry.
Key Contributions¶
- MedDCR: first framework to treat agentic workflow design for medical coding as a learning/search problem rather than a fixed pipeline.
- Meta-agent architecture (Designer + Coder + Reflector) with a memory archive enabling exploitation-vs-exploration balance via top-\(k\) / recent-\(n\) selection.
- Plug-and-play mode that allows existing expert-crafted workflows to be seeded and iteratively improved rather than replaced.
- State-of-the-art results on two public ICD-10 coding benchmarks with modest compute overhead.
Results¶
- MDACE: MedDCR-GPT-5 achieves Micro-F1 = 0.51; best PLM baseline (PLM-ICD) = 0.48; best prior agentic baseline (CoT-SC) = 0.41; best expert workflow (CLH) = 0.42. Improvement of ~6.2% F1 over second-best.
- ACI-BENCH: MedDCR-GPT-5 achieves F1 = 0.52; best PLM = 0.43; best prior agentic (CoT-SC) = 0.44; best expert workflow (CLH) = 0.41. Improvement of ~7.4% F1 over second-best.
- Compute cost per 100 samples per search loop: ~\(17 (MDACE) and ~\)5.72 (ACI-BENCH), executed tokens ~11.5M and ~2.2M respectively.
- Ablation (MDACE): removing top-\(k\) exemplars drops F1 from 0.47 → 0.38; removing recent-\(n\) drops to 0.34; removing text feedback drops to 0.43; removing score feedback drops to 0.47 (marginal); removing guideline in meta-prompt or exemplars in meta-prompt each drop ~0.05 F1.
- Plug-and-play: seeding with CoT-SC + all auxiliary strategies reaches F1 = 0.47, outperforming no-seed scratch search (0.44).
Limitations¶
- Search runs for a fixed budget of 100 iterations; convergence is not guaranteed and performance improvement may plateau earlier.
- Cost is non-trivial for large-scale deployment ($17/100 samples on MDACE); inference token volume scales with note length and iteration count.
- Evaluated only on ICD-10 benchmarks (MDACE, ACI-BENCH); generalization to ICD-11, CPT, or non-English coding standards is untested.
- The Coder agent's self-fixing loop has a finite retry budget; workflows that fail to compile are dropped, potentially discarding viable architectural ideas.
- Backbone is GPT-4o/GPT-5 (proprietary); reproducibility with open-weight models is unaddressed.
Relevance to Harnesses / Meta-Harnesses¶
MedDCR is a direct instantiation of a meta-harness: the system's primary job is not to solve the task directly but to discover and optimize the harnesses (agentic workflows) that solve it. The Designer–Coder–Reflector loop with a persistent memory archive is architecturally analogous to automated harness-generation systems (e.g., ADAS), but adds domain-specific tool libraries, guideline compliance scoring, and plug-and-play seeding of human-authored pipelines. For researchers tracking harnesses/meta-harnesses, MedDCR demonstrates that closed-loop meta-optimization with structured reflection and archive-based memory consistently outperforms both hand-authored and general-purpose agentic harnesses, and provides a concrete pattern for domain-grounding the search space via component libraries and compliance oracles.