Improving Clinical Question Answering with Multi-Task Learning: A Joint Approach for Answer Extraction and Medical Categorization

Priyaranjan Pattnayak, Hitesh Laxmichand Patel, Amit Agarwal, Bhargava Kumar, Srikant Panda, Tejaswini KumararXiv 2025 · DOI

Abstract

Clinical Question Answering (CQA) often focuses solely on text extraction, leaving the extracted information unstructured and difficult to integrate into clinical workflows. This paper presents a Multi-Task Learning (MTL) framework that jointly performs answer extraction and medical categorization. By leveraging a shared ClinicalBERT backbone with task-specific adaptation layers, the proposed model achieves an 81.7% F1-score in extraction and 90.7% accuracy in classification. Our results demonstrate that joint training not only provides structured context for extracted answers but also improves the performance of the primary extraction task through cross-task regularization.

Introduction

Electronic Medical Records (EMRs) contain vast amounts of critical patient data stored as unstructured free-text notes. While existing language models like BioBERT can identify answer spans for clinical queries, they lack the semantic understanding to categorize these answers into actionable medical domains (e.g., distinguishing a medication from a symptom). This limitation hinders the integration of CQA systems into structured databases. We address this by introducing "Clinical QA 2.0," a framework designed to extract and simultaneously classify medical entities, transforming raw text into structured insights.

Methodology

The architecture is built upon ClinicalBERT, pre-trained on the MIMIC-III corpus. The model employs a Multi-Task Learning (MTL) strategy to balance general clinical language understanding with task-specific requirements.

Multi-Task Learning architecture for joint answer extraction and medical categorization.

The first six layers of the Transformer encoder are shared across both tasks to capture robust clinical representations. The upper six layers utilize task-specific adaptation to specialize for two distinct heads:

  1. Answer Extraction Head: A two-layer fully connected network that identifies the start and end indices of the answer span within the clinical text.
  2. Entity Classification Head: A three-layer fully connected network that categorizes the extracted span into one of five domains: Diagnosis, Medication, Symptoms, Procedure, or Lab Reports.

To handle potential multi-label scenarios where a term might belong to multiple categories, the classification head utilizes soft labels via sigmoid activation.

Dataset and Preprocessing

The model was evaluated using the emrQA dataset, which comprises over 455,000 QA pairs. Since the original dataset lacked categorical labels, we developed a preprocessing pipeline using SciSpacy and the Unified Medical Language System (UMLS) to automatically annotate ground truth answers. The data was split into training (80%), validation (10%), and test (10%) sets to ensure rigorous evaluation.

Results

The MTL framework consistently outperformed single-task baselines and general biomedical models. As shown in the table below, the joint approach yielded a 2.2% improvement in extraction F1-score and a 6.2% boost in classification accuracy compared to a standard ClinicalBERT model.

Metric BioBERT (Single) ClinicalBERT (Single) ClinicalBERT (MTL)
Answer Extraction (F1) 76.3% 79.5% 81.7%
Classification Accuracy 82.4% 84.5% 90.7%
Exact Match (EM) 64.2% 68.1% 69.5%

A detailed breakdown of the classification performance reveals high precision across most categories, particularly for Diagnoses and Medications.

Class-wise performance of the entity classification head across medical domains.

While performance was strong overall, the model faced challenges with "Lab Reports," likely due to the high variability and inconsistent naming conventions found in clinical documentation.

Discussion

Our findings highlight the benefits of MTL as a regularizer. Training on auxiliary classification tasks provides contextual cues that enhance the model's ability to locate answer spans. Furthermore, the task-specific adaptation in the upper layers successfully mitigated "negative transfer," ensuring that classification gradients did not degrade extraction logic. This approach enables "Structured EMR Search," allowing clinicians to filter patient histories by specific medical categories—a capability currently missing in standard QA systems.

Limitations and Future Work

Despite its success, the model encountered errors in 28.3% of cases due to "Ambiguous Answers" where multiple valid spans existed. Additionally, rare medical terminology (Out-of-Vocabulary terms) remains a challenge. Future research will explore integrating Retrieval-Augmented Generation (RAG) to incorporate external medical knowledge and extending the framework to multilingual clinical settings to broaden its global utility.

Summary updated

BibTeX
@misc{pattnayak2025improving,
  author = {Priyaranjan Pattnayak and Hitesh Laxmichand Patel and Amit Agarwal and Bhargava Kumar and Srikant Panda and Tejaswini Kumar},
  title = {{Improving Clinical Question Answering with Multi-Task Learning: A Joint Approach for Answer Extraction and Medical Categorization}},
  year = {2025},
  eprint = {2502.13108},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.13108},
}
Figure