Abstract
Automated electrocardiogram (ECG) interpretation has advanced, yet most systems remain narrow classifiers that emit fixed labels rather than the narratives or endpoint-specific answers clinicians need. Generative approaches could instead produce rich narratives, but are constrained by the gap between continuous biosignals and discrete language tokens. Here we present DeepECG-Tok, which reframes ECG interpretation as a unified instruction-following problem. A residual vector-quantization tokenizer (QINCo) maps 12-lead waveforms to language-model-compatible tokens. Its frozen embeddings achieved a macro-averaged area under the receiver operating characteristic curve (AUROC) of 0.96 for 77-condition classification, outperforming supervised and self-supervised baselines. Aligned with a large language model, a single instruction-tuned model performed ECG interpretation, structured reporting and clinical endpoint prediction, including left ventricular ejection fraction, structural heart disease and atrial fibrillation risk, using 7.27 million question–answer pairs. Frozen-tokenizer diagnostic classification transferred without retraining to two external cohorts, retaining macro-averaged AUROCs of 0.88–0.90, and clinical-endpoint prediction transferred to two further cohorts (external LVEF ≤40% AUROC 0.74–0.76). Evaluated end to end using an ontology-grounded large language model as a judge, which achieved a mean agreement (Cohen’s κ) of 0.82 against two cardiologists, the unified instruction-tuned model scored 0.71 internally and 0.50–0.53 in the same external cohorts. In a blinded reader study, board-certified cardiologists and residents rated its free-text reports comparably to reference clinician reports, with a paired win–tie–loss distribution of 32:35:33 and a forced-choice preference of 0.53 among decided cases, with no significant difference between the model and reference reports in either comparison. These findings establish discrete ECG tokenization as a foundation for general-purpose models that generate clinically useful interpretations and answer diverse questions directly from cardiac waveforms.
Competing Interest Statement
Guillaume Marquis-Gravel has received speaker honoraria or advisory board fees from Novartis, Amgen, Novo Nordisk, Boston Scientific, HLS Therapeutics, Metapharm, and JAMP. Robert Avram, MD, MSc: Spiralis Medical Inc. (stock option), Divoco AI (stock), FrontRx (co-founder and equity holder), Abbott (speaker fee), Boston Scientific (speaker fee), Boehringer Ingelheim (speaker fee), Novartis (speaker fee), Bristol Myers Squibb (investigator-initiated research grant), co-inventor on pending patent application WO 2022/261641 A1 (Method and System for Automated Analysis of Coronary Angiograms). The other authors declare no competing interests.
Author Declarations
I confirm all relevant ethical guidelines have been followed, and any necessary IRB and/or ethics committee approvals have been obtained.
Yes
The details of the IRB/oversight body that provided approval or exemption for the research described are given below:
This retrospective study was reviewed by the Ethics Board of the Montreal Heart Institute (MHI) (Project #2023-3160) which approved the protocol and waived the need for informed consent as the study represents secondary analysis of data.
I confirm that all necessary patient/participant consent has been obtained and the appropriate institutional forms have been archived, and that any patient/participant/sample identifiers included were not known to anyone (e.g., hospital staff, patients or participants themselves) outside the research group so cannot be used to identify individuals.
Yes
I understand that all clinical trials and any other prospective interventional studies must be registered with an ICMJE-approved registry, such as ClinicalTrials.gov. I confirm that any such study reported in the manuscript has been registered and the trial registration ID is provided (note: if posting a prospective study registered retrospectively, please provide a statement in the trial ID field explaining why the study was not registered in advance).
Yes
I have followed all appropriate research reporting guidelines, such as any relevant EQUATOR Network research reporting checklist(s) and other pertinent material, if applicable.
Yes
Data Availability
The anonymized ECG dataset supporting the LLM-as-a-judge findings of this study will be made publicly available on PhysioNet (https://physionet.org/) Upon Peer Review Publication. The dataset comprises 25,000 twelve-lead ECGs selected from the DeepECG biobank at the Montreal Heart Institute (2006–2023), including raw signal files (NumPy .npy, 12 leads, 2,500 samples/lead at 250 Hz), standardized ECG images (PNG), and clinically validated question–answer pairs. Access requires PhysioNet credentialing, completion of CITI Data or Specimens Only Research training, and a signed data use agreement. Data are available from the Canadian Longitudinal Study on Aging (www.clsa-elcv.ca) for researchers who meet the criteria for access to de-identified CLSA data.





