Manuscript Offprint

arXiv:2608.30893

ECGQuest: Benchmarking and Fine-Tuning Language Models for Electrocardiography

Mohammadsina Hassannia, Matthew A. Reyna, Reza Sameni

Mohammadsina Hassannia

Department of Biomedical Informatics

Emory University

Atlanta, GA 30322, USA

sina.hassannia@dbmi.emory.edu

Matthew A. Reyna

Department of Biomedical Informatics

Emory University

Atlanta, GA 30322, USA

matthew@dbmi.emory.edu

Reza Sameni

Department of Biomedical Engineering

Georgia Institute of Technology

and Department of Biomedical Informatics

Emory University

Atlanta, GA 30332, USA

rsameni@emory.edu

ABSTRACT

Electrocardiogram (ECG) interpretation requires knowledge of cardiology, electrophysiology, clinical diagnosis, ECG waveforms, signal acquisition, and ECG instrumentation. While large language models have proven effective for such applications, existing language-models primarily assess broad medical knowledge or the interpretation of individual ECG signals and images, rather than comprehensive context knowledge required for ECG interpretation. We built ECGQuest, a literature-grounded resource for evaluating and fine-tuning ECG-specific language models. An automated GPT-4o-based pipeline generated questions from 23 ECG references and proceedings of the Computing in Cardiology conference between 2003–2025. The final dataset contains 10,904 unique True/False questions paired with their negated form derived from the same source (21,808 Q&A in total). We evaluated three commercial and 20 open-source language models on the held-out ECGQuest test set in a zero-shot setting. We also fine-tuned five open-source models with 7–14 B parameters using Low-Rank Adaptation and included BERT and BiomedBERT as supervised encoder baselines. Generalization was evaluated using ECG-related subsets of MedMCQA and MedQA datasets converted to binary True/False questions using their official examination answer keys. Zero-shot accuracy on ECGQuest ranged from 49.5% to 74.4%, with GPT-5 achieving the highest accuracy. General-purpose models outperformed all medically specialized models, and several models showed strong directional True/False biases. Encoder baselines performed near chance. Fine-tuning improved all open-source models on ECGQuest by 6.5–14.1%. The fine-tuned DeepSeek-R1-Distill-Qwen-14 B model achieved 76.3% accuracy, and a five-model voting ensemble achieved the highest overall accuracy of 78.5%. On MedMCQA and MedQA, fine-tuning primarily benefited weak or class-biased models and did not consistently improve already strong base models. ECGQuest is a reproducible benchmark for evaluating contextual ECG knowledge in language models and demonstrates that targeted, parameter-efficient fine-tuning can make small language models competitive with substantially larger commercial models.

1 INTRODUCTION

The electrocardiogram (ECG) is among the most widely used diagnostic tools in cardiovascular medicine, routinely used across emergency, inpatient, and outpatient settings to detect arrhythmias, ischemia, conduction abnormalities, and a wide range of other cardiac conditions. Despite the broad use of the ECG, its accurate interpretation is challenging and requires substantial training and experience.

rience in cardiac electrophysiology. Moreover, even experienced ECG annotators show significant inter-rater and intra-rater variability, leading to missed diagnoses, inappropriate or unnecessary interventions, and delayed treatments (Cook et al., 2020; Rafie et al., 2021). The combination of high clinical volume and persistent interpretive challenges has motivated the development of computational systems capable of reliable and consistent ECG interpretation.

ECG interpretation is a multifaceted process rather than a binary or multiclass classification skill. It requires basic knowledge of the electrophysiology of the heart, ECG acquisition technologies, analog and digital frontend requirements, sampling and filtering specifications. It also involves quantitative measurements derived from the waveform, such as heart rate, rhythm, and interval durations including the PR, QRS, and QT intervals. Moreover, ECG diagnosis is descriptive and multi-labeled, where patterns are identified, associated with their electrophysiological mechanisms, and integrated with the clinical and personalized context to form a conclusion. The measurement component is primarily programmatic and conducted automatically via software, whereas the descriptive component relies on holistic knowledge of electrophysiology, cardiology and the subject's background.

Overall, the knowledge base required for accurate ECG diagnosis is broad and cross-disciplinary, motivating the use of methods that can integrate information across domains. LLMs have been promising in similar applications. They encode broad knowledge spanning natural sciences to engineering (Brown et al., 2020; Hendrycks et al., 2020), and have reached close to expert-level performance on similar clinical tasks (cf. Section 2). Despite this progress, current evaluations of clinical language models focus either on broad medical knowledge or on the interpretation of specific ECG anomalies. As a result, the background and contextual knowledge of the ECG, beyond specific ECG anomalies, is often not considered by existing LLMs. Therefore, it remains unclear how much a language model actually “understands” an ECG, rather than only classifying or describing patterns.

To address this gap, we made the following contributions: (i) We used commercial LLMs to parse ECG-related literature and constructed a text-only database of general ECG questions and answers comprising 10,904 True/False question pairs (21,808 questions in total). The questions were derived from 23 scientific ECG resources and specialized ECG conference proceedings, spanning various ECG-related topics such as clinical, electro-physiological, biomedical signal processing, ECG diagnosis, and ECG hardware and electronics. (ii) We evaluated a diverse set of proprietary, general-purpose, biomedical, and open-access language models on this benchmark in a zero-shot setting. (iii) We explored whether smaller models in the 7 to 14 billion parameter range can be specialized for ECG knowledge using low-rank adaptation. (iv) We extended the evaluation to external ECG-related test sets extracted from MedQA (USMLE style) (Jin et al., 2021) and MedMCQA (Pal et al., 2022), whose labels come from official examination keys and are therefore independent of our generation pipeline; this analysis is reported in Supplement B.

References (30)