TrialDura: Hierarchical Attention Transformer for Interpretable Clinical Trial Duration Prediction

Ling Yue, Jonathan Li, Md. Zabirul Islam, Bolun Xia, Tianfan Fu, Jintai Chen

TL;DR

The authors introduce TrialDura, a novel deep learning framework designed to predict the duration of clinical trials by analyzing multimodal data such as drug molecules, target diseases, trial phases, and unstructured eligibility criteria. By leveraging a hierarchical attention transformer and biomedical language models, TrialDura outperforms traditional machine learning baselines, offering both accurate timeline estimates and interpretable insights into which clinical protocols drive trial length.

What Problem Does This Paper Address?

Clinical trials are the bottleneck of drug development, typically spanning 7 to 11 years and costing upwards of $2 billion per trial. A major driver of these exorbitant costs is trial duration—longer trials require more staffing, medical supplies, and facility usage.

While previous machine learning research in this space has focused heavily on predicting individual patient outcomes or the overall probability of a trial's success, predicting how long a trial will actually take has been largely ignored. Accurate duration prediction is critical for pharmaceutical companies and clinical researchers to optimize resource allocation, manage budgets, and design efficient participant recruitment strategies. However, forecasting this is highly challenging because clinical trial protocols contain complex, multimodal data, including unstructured text rules for patient eligibility.

Methods

TrialDura tackles this complexity by framing duration prediction as a multimodal regression task. The model integrates four distinct data streams:

  1. Trial Phase: Encoded as a simple one-hot vector.
  2. Drug Molecules: Embedded using Bio-BERT, a language model pre-trained on massive biomedical corpora.
  3. Target Diseases: Represented by embedding their standardized ICD-10 diagnostic codes via Bio-BERT.
  4. Eligibility Criteria: This is where the core novelty lies. Patient inclusion and exclusion criteria are often long lists of unstructured text. TrialDura processes these using a Hierarchical Attention Mechanism:
  5. Lower-level attention aggregates individual word embeddings into sentence-level representations.
  6. Higher-level attention captures the relationships between different sentences (rules) to form a comprehensive paragraph embedding.

Finally, these four embeddings are concatenated into a unified feature vector and passed through a Multi-Layer Perceptron (MLP) to predict the trial duration in years.

Figure 1: Overview of our model. Our model takes phase information, disease, drug molecule and eligibility criteria as the input and predicts the trial duration. We design a hierarchical attention mechanism to model semantic features from eligibility criteria. The lower-level attention mechanism aggregates word embeddings while higher-level attention gathers sentence embeddings.

Datasets

The authors compiled a comprehensive dataset extracted directly from ClinicalTrials.gov.

  • Filtering: They focused on interventional trials lasting less than 10 years (which accounts for 98% of all available data), as extreme outliers can severely skew regression performance.
  • Size & Split: The final dataset contains 77,818 records for training/validation and 36,786 records for testing.
  • Temporal Splitting: To mimic real-world deployment, the data was split chronologically on January 1, 2019. Trials starting before this date were used for training, while trials starting after were reserved for testing, ensuring no data leakage from future trial completions.

Key Insights and Ideas

  • The Power of Hierarchy in Text: Eligibility criteria aren't just bags of words; they are structured sets of clinical rules. The hierarchical transformer design allows the model to understand not just individual medical terms, but how different inclusion and exclusion rules interact with one another to complicate a trial's timeline.
  • Unified vs. Phase-Specific Modeling: In their ablation studies, the authors found that training a single, unified model across all trial phases significantly outperformed training separate models for Phase 1, Phase 2, etc. This suggests that there are robust, underlying data patterns governing trial dynamics that transcend individual clinical phases.
  • Peeking into the Black Box: By utilizing Shapley values (a concept from game theory), the authors successfully visualized exactly which words and sentences in the eligibility criteria contributed most to the model's final prediction, providing clinicians with verifiable rationale.
Shapley Value Visualization for Interpretability

Key Results

TrialDura demonstrated superior performance across multiple standard regression metrics when compared against traditional baselines like Linear Regression, Random Forest, GBDT, and XGBoost.

  • Overall Accuracy: TrialDura achieved a Mean Absolute Error (MAE) of 1.044 years and a Root Mean Squared Error (RMSE) of 1.390 years.
  • Improvement over Baselines: Compared to the best-performing baseline method, TrialDura achieved a relative error reduction of 9% in MAE and 7% in RMSE.
  • Phase-Specific Performance: The model performed exceptionally well on Phase 1 trials, yielding an MAE of just 0.836 years.
Figure 2: Model performance comparison on prediction accuracy.

Limitations and Future Work

Despite its success, TrialDura still faces a notable limitation: its average prediction error sits at just over one year (MAE of 1.044). In the high-stakes world of pharmaceutical finance, a one-year delay can represent millions of dollars in misallocated resources. The authors attribute this remaining error to the inherent volatility of clinical trials (e.g., unexpected regulatory delays or global events) and the limited availability of granular operational datasets.

Moving forward, the authors suggest refining data processing techniques and exploring the integration of real-time data updates during ongoing trials to dynamically adjust duration predictions as real-world conditions evolve.

Summary updated

BibTeX
@inproceedings{yue2024trialdura,
  author = {Ling Yue and Jonathan Li and Md. Zabirul Islam and Bolun Xia and Tianfan Fu and Jintai Chen},
  title = {{TrialDura: Hierarchical Attention Transformer for Interpretable Clinical Trial Duration Prediction}},
  booktitle = {BCB},
  year = {2024},
}
Figure