Tasks
The input to every task is the entire protocol PDF, not a pre-selected excerpt. Protocols in TrialPD-Bench run to a median of 122 pages and up to 368, and finding the few pages that hold the answer is part of the task. Each example below marks where the answer sits in the PDF, shows that page, and gives the reference output; long outputs are shortened for display.
Find the disease or condition the study investigates and return it in the protocol's own wording, keeping qualifiers such as severity or stage.
Input the entire protocol PDF

Output indications.json · reference annotation
{
"descriptions": [
"Wilson disease"
]
}Locate the detailed eligibility section and transcribe every numbered inclusion and exclusion criterion verbatim, one item per criterion, with sub-points kept inside it as HTML.
Input the entire protocol PDF

Output criteria.json · reference annotation
{
"criteria": [
{
"category": "Inclusion",
"name": "IN01",
"text": "<p>Subjects previously participated in Study A3921096 who either:</p>\n<ul>\n<li><p>completed 52-week maintenance treatment in Study A3921096, or</p></l…"
},
{
"category": "Inclusion",
"name": "IN04",
"text": "<p>Women of childbearing potential must have a negative pregnancy test prior to study enrollment.</p>"
},
{
"category": "Exclusion",
"name": "EX02",
"text": "<p>Presence of indeterminate colitis, microscopic colitis, ischemic colitis, infectious colitis, or clinical findings suggestive of Crohn’s disease.</p>"
}
// … 15 more criteria (6 inclusion, 12 exclusion in total)
]
}Extract every objective with its level and attach the endpoints that measure it. An endpoint's level is read from its own heading, so it can differ from its objective's level.
Input the entire protocol PDF

Output objectives.json · reference annotation
{
"objectives": [
{
"objectiveId": "OBJ1",
"objectiveLevel": "PRIMARY",
"levelVerbatim": "Primary",
"objectiveText": "To assess the safety and tolerability of long-term tofacitinib therapy in subjects with UC.",
"endpoints": [
{
"endpointId": "END1",
"endpointLevel": "SECONDARY",
"endpointText": "Incidence and severity of adverse events (AEs)."
},
{
"endpointId": "END2",
"endpointLevel": "SECONDARY",
"endpointText": "Incidence of serious infections."
}
]
},
{
"objectiveId": "OBJ2",
"objectiveLevel": "SECONDARY",
"levelVerbatim": "Secondary",
"objectiveText": "To evaluate the efficacy of long-term tofacitinib therapy in subjects with UC.",
"endpoints": [
{
"endpointId": "END9",
"endpointLevel": "SECONDARY",
"endpointText": "The proportion of subjects in remission at Month 2, Month 12, Month 24 and Month 36. Remission in this study is defined as a Mayo score ≤2 with no individual subscore >1, and rectal bleeding subscore of 0."
}
]
}
// … 3 objectives and 13 endpoints in total
]
}Find the SoA pages in the protocol and transcribe each SoA table into HTML, resolving merged cells and multi-level visit headers and keeping footnote markers as superscripts.
Input the entire protocol PDF
The agent receives the whole PDF and must find all six SoA pages before transcribing them.

Output p11.html · reference annotation
| Study Procedure | Baseline | Open Label Treatment Period | |||||
|---|---|---|---|---|---|---|---|
| Day 11 | Month 1 (± 5 days) | Month 2 (± 5 days) | Month 4 (± 5 days) | Month 6 (± 5 days) | Month 9 (± 5 days) | Month 12 (± 5 days) / ET2 | |
| Visit Number | 1 | 2 | 3 | 4 | 5 | 6 | 7 or ET2 |
| Informed Consent | X | ||||||
| Medical History3 | IND or MNT1 | ||||||
<table>
<tr><th rowspan="2">Study Procedure</th><th>Baseline<br></th><th colspan="6">Open Label Treatment Period</th></tr>
<tr><td>Day 1<sup>1</sup></td><td>Month 1<br>(± 5 days)</td><td>Month 2<br>(± 5 days)</td><td>Month 4<br>(± 5 days)</td><td>Month 6<br>(± 5 days)</td><td>Month 9<br>(± 5 days)</td><td>Month 12<br>(± 5 days) / ET<sup>2</sup></td></tr>
<tr><td><strong>Visit Number</strong></td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7 or ET<sup>2</sup></td></tr>
<tr><td>Informed Consent</td><td>X</td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
<tr><td>Medical History<sup>3</sup></td><td>IND or MNT<sup>1</sup></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
<!-- … 11 more rows -->
</table>Recover the study's epochs in order, its encounters with their USDM type and contact modes, and its activities.
Input the entire protocol PDF

Output timeline.json · reference annotation
{
"studyDesignEpochs": [
{
"type": "SCREENING"
},
{
"type": "TREATMENT"
},
{
"type": "TREATMENT"
},
{
"type": "TREATMENT"
},
{
"type": "FOLLOW-UP"
}
],
"studyDesignEncounters": [
{
"label": "Screening 1",
"description": "Screening encounter",
"type": "Visit",
"contactModes": "In Person"
},
{
"label": "Screening 2",
"description": "Screening encounter - Ambulatory ECG Placement",
"type": "Visit",
"contactModes": "In Person"
}
],
"studyDesignActivities": [
{
"label": "Informed consent"
},
{
"label": "Inclusion and exclusion criteria"
},
{
"label": "Patient number assigned"
}
// … 36 activities in total
]
}Abstract
Clinical trial protocols serve as the source of truth for study design, but they are mostly written and used as unstructured PDF documents. Digitizing protocols turns static content into structured, machine-readable data that clinical software can analyze, validate, and execute. Ultimately, protocol digitization transforms protocols from readable documents into actionable digital assets that streamline trial execution. Coding agents, which select tools, execute code, and revise their approach as they work, are increasingly applied to such long-document tasks, yet it remains unclear how reliably they turn complete documents into accurate structured outputs. We study this question using protocol digitization as a testbed. We introduce TrialPD-Bench, an expert-annotated benchmark of 150 publicly available protocol PDFs spanning four task categories. Beyond final-answer performance, our evaluation measures evidence recall from agent traces, agent behavior, and cost. Across nine proprietary and open-weight models in five coding-agent harnesses, even the strongest agents do not fully solve protocol digitization. Our study further sheds light on where coding agents fall short on long documents: agents usually locate the required evidence but fail in the last mile of transcribing and structuring it. Building on these findings, we develop TrialScribe, a domain-specific harness that equips coding agents with task skills and a verification loop. TrialScribe improves a locally served open-weight model by 6.2–59.4 points across eight metrics, enabling it to match or surpass proprietary models such as GPT-5.6-Sol.
TrialPD-Bench
Every task starts from a complete protocol PDF from ClinicalTrials.gov, so locating the relevant section is part of the task. Sponsors organize protocols differently: a Schedule of Activities (SoA) table may appear near the beginning or in an appendix, with its own arrangement of study periods, visit windows, multi-level headers, and footnotes. Five experts in the clinical trial domain produced the reference annotations, and output schemas follow the CDISC Unified Study Definitions Model (USDM).
| Task | Input | Samples | Reference annotations | Main metrics |
|---|---|---|---|---|
| Disease indication | Protocol PDF | 40 | 41 indication descriptions; 1–2 per sample | Indication F1 |
| Eligibility criteria | Protocol PDF | 134 | 3,974 criteria (1,337 inclusion, 2,637 exclusion) | Eligibility criteria F1 |
| Objectives and endpoints | Protocol PDF | 89 | 665 objectives, 1,484 endpoints; 60 objectives without endpoints | Objective, endpoint, objective-linked endpoint F1 |
| SoA tables | Protocol PDF | 37 | 70 tables; 10 protocols with multiple SoA pages | Activity–Visit F1, Sub/sup F1 |
| Structured timeline | Protocol PDF | 3 | 14 epochs, 69 encounters, 115 activities | Epoch accuracy, activity and encounter recall |
Test-split statistics; the development protocols used to build TrialScribe are held out.
Overview of TrialPD-Bench: source documents and the four task categories, therapeutic-area coverage, document-length distribution (median 122 pages), and study counts across 106 sponsors.
Text-based and scanned PDFs
The protocols come as they were posted. Some have a usable text layer. Others are scans, or their text layer drops or garbles characters, so the content can be read only from the rendered pages or with OCR; 16 of the 150 documents have no extractable text at all. We call a PDF vision-required for a task when the content that task needs cannot be recovered from the text layer.
What the Tasks Require
Protocol digitization combines five capabilities. Our failure analysis groups agent errors into the same five categories, and the dominant one differs by task: transcription fidelity for eligibility criteria, relational structure for SoA tables, and domain concept grounding for disease indication and structured timelines.
Copy the source text exactly, including numbers, units, and comparison operators.
e.g., “≥ 100 meters” written as “> 100 meters”
Find every relevant passage in a protocol of a hundred pages or more, across sections and page breaks.
e.g., 9 of 11 objectives missed on one protocol
Rebuild how items relate: marks in the right SoA cells, endpoints under the right objective, epochs in order.
e.g., one misresolved merged cell shifts every mark after it
Pick the clinical entity, category, or controlled term the standard asks for.
e.g., “Non-Valvular Atrial Fibrillation” for a study of recurrent embolic stroke
Finish the multi-step run and write a complete, valid output file.
e.g., missing, empty, or unparseable output
Main Results
- Even the strongest coding agents do not fully solve protocol digitization. The best agents reach 87.8 eligibility criteria F1 and 86.8 SoA Activity–Visit F1, but only 67.4 endpoint F1, 58.7 objective-linked endpoint F1, and 23.2 encounter recall. The largest gaps lie in the relational structure of a protocol rather than in its surface content.
- Locating the evidence is not the main bottleneck. Except for Kimi-K3 on objectives and endpoints, the seven frontier agents visit at least 84.8% of the required evidence pages on every task, yet higher evidence recall does not translate into better extraction. On structured timelines, every agent visits at least 98.3% of the evidence pages while encounter recall stays at or below 23.2. Agents fail in the last mile of transcribing and structuring the evidence.
- Tool errors and interaction turns scale with task complexity. Averaged over the nine agents, SoA table extraction takes 39.8 turns per run, against 7.1 for indication extraction, and weaker models incur more tool errors and use visual evidence less often when it is required. Longer trajectories do not produce better answers.
- Similar accuracy can come at very different costs. On eligibility criteria, the seven frontier agents lie within 1.4 F1 points of each other while the cost per run ranges from $0.40 to $1.35; DeepSeek-V4-Flash reaches 80.2 F1 at $0.04 per run.
Main results (%) on TrialPD-Bench. Each task reports its final-answer metrics followed by evidence recall (ER), the recall of the required evidence pages visited in the agent trace.
SoA Activity–Visit F1 on complete protocols against model release date. Hollow markers denote open-weight models.
Single SoA pages: coding agents against OCR and document-understanding baselines.
Failure Analysis
We classify the failures in each failing agent run into five main categories: transcription fidelity, long-document localization and coverage, relational structure reconstruction, domain concept grounding, and execution reliability. The dominant category differs by task. Transcription fidelity accounts for 88.0% of failing eligibility-criteria runs: agents read the right section but do not reproduce it exactly, and among near-verbatim criteria, 167 alter a comparison operator and 308 alter a number. Relational structure accounts for 58.9% of failing SoA runs, most often because scheduling marks land in the wrong cells. Domain concept grounding dominates disease indication and structured timelines, while execution reliability accounts for at most 3.6% of failing runs in any task.
(a) Distribution of failure categories within each task. (b) Examples of the five categories, with incorrect or missing predictions in red.
TrialScribe
Protocols are often confidential, which favors compact open-weight models that run locally, and most failures arise after the evidence is found. TrialScribe is a domain-specific harness layer that equips an existing coding agent with task skills, which supply domain knowledge and output conventions, and a verification loop, in which a fresh agent session audits the draft against the protocol and the agent applies minimal source-supported fixes. We run it with Qwen3.8-27B in the Pi harness, served locally on two NVIDIA A100 GPUs.
With TrialScribe, the local model surpasses GPT-5.6-Sol on endpoint extraction (65.5 vs. 63.6) and comes within 1.9 points of Opus 5. On structured timelines, it exceeds both proprietary agents on activity recall (88.6 vs. 88.1 and 87.2) and encounter recall (65.2 vs. 23.2 and 0.0). Verification helps most where transcription fidelity dominates, raising eligibility criteria F1 from 72.2 to 82.3. On SoA tables, TrialScribe reaches 75.1 Activity–Visit F1 but still trails GPT-5.6-Sol and Opus 5 (83.7 and 86.0).
Qwen3.8-27B with TrialScribe, the same model without it, Opus 5, and GPT-5.6-Sol. The span above each Qwen bar gives the gain in points.

