GxP-Agent: Process-DAG Topology for Reliable Clinical Trial Programming with LLM Agents
Clinical trial programming turns study protocols into analysis‑ready datasets that must obey CDISC standards, a step that often adds weeks to regulatory filings. Recent tests show that even the largest language models cannot produce a valid subject‑level dataset in a single try, failing on all 11 attempts across five frontier models. This shortfall motivated the […]
Clinical trial programming turns study protocols into analysis‑ready datasets that must obey CDISC standards, a step that often adds weeks to regulatory filings. Recent tests show that even the largest language models cannot produce a valid subject‑level dataset in a single try, failing on all 11 attempts across five frontier models. This shortfall motivated the authors to design a system that respects the ordered, regulatory nature of the work.
What You Need to Know
The paper introduces GxP‑Agent, a multi‑agent framework that represents the clinical‑trial programming workflow as a directed acyclic graph (DAG). The DAG breaks the monolithic task into 15 domain‑specific nodes, such as data import, variable derivation, and quality‑check steps. Each node is handled by a worker agent that has been given pharmaverse‑specific context—essentially a prompt library that knows CDISC terminology, SDTM variables, and typical validation rules.
After an agent produces code, a validation gate checks the output against the ground‑truth dataset; if the check fails, the agent can retry conditionally, adjusting its prompt or falling back to a simpler template. The system was evaluated on CDISC‑Bench, a new execution‑based benchmark derived from the FDA’s CDISCPilot01 submission, which contains 254 subjects and 49 ground‑truth datasets.
Why It Matters
Clinical trial programming is a known bottleneck; manual programming consumes weeks of statistician time and introduces variability that can affect regulatory review. By automating the generation of analysis‑ready datasets while enforcing the required process order, GxP‑Agent can reduce turnaround time and improve reproducibility.
The validation‑gate mechanism also provides a safety net: only code that passes predefined checks proceeds, lowering the risk of submitting non‑compliant datasets to agencies like the FDA or EMA. In settings where sponsor teams lack deep CDISC expertise, the agent‑based approach offers a reproducible baseline that can be inspected and adjusted by human reviewers.
Key Details
- DAG topology encodes 15 sequential and parallel processing nodes derived from the SDTM‑ADaM mapping guide.
- Worker agents receive pharmaverse skill context, a curated set of examples covering common variable derivations, date handling, and laboratory unit conversions.
- Each node includes a validation gate that runs automated checks (e.g., variable name compliance, value‑level constraints) before allowing the workflow to advance.
- Conditional retry allows an agent to reformulate its prompt up to three times, falling back to a rule‑based template if LLM generation repeatedly fails.
- On CDISC‑Bench, GxP‑Agent produced a valid subject‑level analysis dataset for 92 % of the 49 ground‑truth cases, compared with 0 % for single‑shot LLM attempts.
- Average runtime per subject was ~4.3 seconds, indicating that the overhead of agent coordination and validation is modest for typical trial sizes.
What’s Next
The authors plan to extend GxP‑Agent to handle adaptive trial designs and to integrate with real‑time data capture systems
📌 Source: Arxiv Ai
Related Articles
Proactive Road Safety Intervention in Australia: Predicting Risky Driving Hotspots from Connected Vehicle Data
Transport agencies in Australia have long depended on crash reports to spot dangerous roads, a method that only reveals problems
A decodability criterion predicts when hidden-state selection beats majority voting in large language models
When a language model generates several answers to the same prompt, the usual way to pick a final response is
DiSCO: Defending text-to-image generation through distribution-guided contrastive prompt optimization
Recent advances in text‑to‑image models have unlocked impressive creative capabilities, but they also open the door to unsafe outputs such