CDPR: Counterfactual Advantage-based Credit Assignment for Cost-Aware Sequential Medical Diagnosis

Qi Peng, Yi Cai, Changmeng Zheng, Xin Wu, Jiayuan Xie, Qing LiarXiv 2026

TL;DR

The paper introduces CDPR (Counterfactual Diagnostic Process Reward), an annotation-free reinforcement learning framework that trains AI agents to perform cost-aware, sequential medical diagnosis. By evaluating an agent's choices against alternative "counterfactual" actions at critical decision points, CDPR solves the sparse credit assignment problem, enabling a lightweight 4B parameter model to outperform models many times its size at a fraction of the medical examination cost.

What Problem Does This Paper Address?

In real-world clinical settings, making a diagnosis is a step-by-step, cost-aware journey. A physician starts with initial symptoms, selectively orders tests based on their financial and physical costs versus their informational value, and iteratively refines their hypothesis.

However, most medical large language models (LLMs) treat diagnosis as a static, one-pass classification task where the entire patient record—including irrelevant or highly expensive test results—is provided upfront.

While some recent methods attempt to model diagnosis as a sequential decision process using Reinforcement Learning (RL), they face a severe credit assignment problem. Because the only reliable reward signal occurs at the very end of a long trajectory (whether the final diagnosis is right or wrong), a wasteful, bloated medical workup receives the exact same reward as an elegant, highly efficient one. Creating dense "process rewards" to fix this typically requires exhaustive, expensive human annotations from clinicians, which are difficult to scale and highly subjective.

Methods

The authors propose CDPR (Counterfactual Diagnostic Process Reward), a method that provides dense, step-by-step supervision without requiring human labels or a learned critic model. It operates via four key mechanisms:

  1. Uncertainty-Guided State Selection: Instead of running expensive evaluations at every single step of a diagnostic trajectory, CDPR calculates the entropy of the model's action distribution. It isolates "decision-critical" states where the model genuinely hesitates between multiple options.
  2. Counterfactual Action Candidates: At these critical states, the framework samples the top alternative actions the model would plausibly consider.
  3. Short-Horizon Rollouts & Utility Function: The framework executes short-horizon Monte Carlo rollouts for the chosen action and its counterfactual alternatives. These rollouts are scored using an environment-aware utility function that penalizes the number of tests, monetary costs, and invalid test requests while rewarding diagnostic correctness.
  4. Rollout Cache: To prevent compute costs from skyrocketing, CDPR introduces a cache that reuses trajectories already generated within the same training batch.

The calculated advantage of the chosen action over its counterfactual alternatives forms the process reward, which is seamlessly integrated into Group Relative Policy Optimization (GRPO) to update the model.

Figure 2: The overview of the framework. (a) We reformulate medical diagnosis as a sequential decision process in which the agent interleaves examination and diagnosis actions. (b) For each trajectory, we identify decision-critical states using the action uncertainty of the current actor. (c) On the selected states, we estimate a counterfactual process reward by rolling out alternative actions and reusing prior trajectories through a rollout cache. (d) The process reward is integrated with the outcome reward to train the policy under the GRPO objective.

Datasets

The framework was trained and evaluated across three distinct datasets to test both in-domain and out-of-domain generalization:

  • MIMIC-IV (In-domain): A massive, public critical-care database. The authors used 23,377 cases for training and held out 750 cases for testing.
  • ClinicalBench (Out-of-domain): An end-to-end diagnostic benchmark containing 1,500 real-world cases spanning 24 clinical departments and 150 diseases.
  • Private Dataset (Out-of-domain): A dataset of 952 inpatient cases collected from a partner hospital, featuring a long-tailed disease distribution to evaluate performance on complex, heterogeneous conditions.

Key Insights and Ideas

  • Value is Relative, Not Absolute: An action in a sequential process shouldn't be judged in a vacuum. By evaluating an action counterfactually against what the model would have otherwise done, the reward signal becomes highly targeted and informative.
  • Selective Supervision Maximizes Efficiency: Densely rewarding an agent at every routine step is wasteful. Focusing the compute budget on high-entropy "hesitation" states provides the most impactful credit redistribution.
  • Medical Pre-training $\neq$ Active Strategy: The authors observed that models heavily pre-trained on static medical text (like Huatuo-o1) perform poorly in sequential environments. Actively ordering tests under strict cost constraints requires explicit reinforcement learning loops rather than just static knowledge retrieval.

Key Results

  • Outperforming the Giants: Built on a modest 4B parameter backbone (Qwen3-4B), CDPR-4B achieved a cross-dataset average accuracy of 47.42%, outperforming closed-source models like GPT-5.4 (45.30%), larger general models like Qwen3-32B (42.24%), and specialized medical agents like DiagAgent-14B (42.10%).
  • Massive Cost Reductions: CDPR-4B achieved the lowest average examination cost ($23.52 USD) across all datasets. Compared to a static diagnosis baseline, CDPR matched or exceeded accuracy while slashing total examination costs by 90.7%.
  • Clinically Sound Trajectories: In a blinded study, three board-certified physicians rated intermediate decisions from various models on a 1–5 Likert scale. CDPR led across all five clinical dimensions, showing the highest margins in Diagnostic Gain and Cost-effectiveness.
Figure 3: Training efficiency comparison on Qwen3-4B. We track diagnostic accuracy on the MIMIC-IV validation split as a function of wall-clock training time (Hours).

Limitations and Future Work

  • The Complexity Trade-off: On the highly complex Private Dataset, CDPR-4B's accuracy (30.06%) was slightly lower than DiagAgent-14B (34.24%). DiagAgent's aggressive, brute-force test-ordering behavior paid off in coverage for rare, multi-organ conditions, though it cost roughly 16 times more than CDPR. Future work could focus on adaptively loosening cost constraints for highly complex cases.
  • LLM-as-a-Judge Dependency: The framework relies on an external LLM judge (GPT-5.4) to evaluate final diagnostic correctness during training rollouts, which introduces potential API dependencies and evaluation biases.

Summary updated

BibTeX
@misc{peng2026cdpr,
  author = {Qi Peng and Yi Cai and Changmeng Zheng and Xin Wu and Jiayuan Xie and Qing Li},
  title = {{CDPR: Counterfactual Advantage-based Credit Assignment for Cost-Aware Sequential Medical Diagnosis}},
  year = {2026},
  eprint = {2608.28599},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.28599},
}
Figure