GxP-Agent: Process-DAG Topology for Reliable Clinical Trial Programming with LLM Agents

GxP-Agent: Process-DAG Topology for Reliable Clinical Trial Programming with LLM Agents

GxP-Agent:用于可靠临床试验编程的流程有向无环图(DAG)拓扑与大模型智能体

Abstract: Clinical trial programming — transforming study protocols into analysis-ready datasets under CDISC standards — is a bottleneck in regulatory submissions, yet LLM-based code generation fails catastrophically on this task: across 11 single-shot attempts with five frontier models, none produces a valid subject-level analysis dataset.

摘要: 临床试验编程(即在 CDISC 标准下将研究方案转化为可分析数据集的过程)是监管申报中的一个瓶颈,然而基于大模型(LLM)的代码生成在此任务上表现极其糟糕:在对五个前沿模型进行的 11 次单次尝试中,没有一个模型能生成有效的主体级分析数据集。

We introduce GxP-Agent, a multi-agent system that encodes regulatory process ordering as a directed acyclic graph (DAG), decomposing monolithic dataset generation into 15 domain-specific nodes executed by worker agents with pharmaverse skill context, validation gates, and conditional retry.

我们引入了 GxP-Agent,这是一个将监管流程顺序编码为有向无环图(DAG)的多智能体系统。它将庞大的数据集生成任务分解为 15 个特定领域的节点,由具备 pharmaverse 技能背景、验证门控和条件重试机制的执行智能体来完成。

On CDISC-Bench, a new execution-based benchmark built from the FDA pilot submission CDISCPilot01 (254 subjects, 49 ground-truth ADSL variables), GxP-Agent with Claude Sonnet 4.6 achieves 100% structural match (49/49 variables, 254 correct records) across three independent runs, compared to 59.2% for the best retrieval-augmented baseline and 0% for all single-agent and flat multi-agent approaches.

在基于 FDA 试点申报 CDISCPilot01(包含 254 名受试者、49 个基准 ADSL 变量)构建的全新执行基准测试 CDISC-Bench 上,搭载 Claude Sonnet 4.6 的 GxP-Agent 在三次独立运行中均实现了 100% 的结构匹配(49/49 个变量,254 条记录完全正确);相比之下,最佳的检索增强基线模型仅达到 59.2%,而所有单智能体和平铺式多智能体方法均为 0%。

The DAG topology also enables weaker models: GPT-4.1 achieves 59.2% mean structural match under the same DAG, where it scores 0% under every other architecture. The approach generalizes to ADAE (adverse events; 9-node branching DAG, 55 variables, 1,191 records), achieving 100% structural match on the first attempt.

DAG 拓扑结构也使得较弱的模型能够发挥作用:GPT-4.1 在相同的 DAG 下实现了 59.2% 的平均结构匹配率,而在其他任何架构下其得分均为 0%。该方法还推广到了 ADAE(不良事件;9 节点分支 DAG,55 个变量,1,191 条记录)任务中,并在首次尝试时就实现了 100% 的结构匹配。

These results demonstrate that encoding domain process knowledge as graph topology — rather than relying on LLM reasoning alone — is a key enabler for reliable, GxP-compliant clinical trial programming.

这些结果表明,将领域流程知识编码为图拓扑结构——而不是仅仅依赖大模型的推理能力——是实现可靠且符合 GxP 标准的临床试验编程的关键推动因素。