The electrocardiogram (ECG) records cardiac electrical activity across multiple leads and is used for detecting cardiac abnormalities. Recent ECG-language models enable large language models (LLMs) to interpret cardiac signals and answer clinically relevant questions. However, existing ECG-language models typically encode the ECG independently of the clinical question, forcing the ECG representation to retain broad and potentially irrelevant signal information. Moreover, these models often aggregate information across leads which can obscure lead-specific details needed for a particular question. To tackle these limitations, we introduce LEAP-LLM, an ECG-LLM architecture for Lead-aware ECG Alignment with Prompt conditioning. LEAP-LLM uses the clinical question to guide ECG feature extraction while preserving explicit lead and temporal structure. Task-trained instruction representations distill information from the question and guide two complementary branches. The Lead branch captures question-relevant temporal patterns within each ECG lead, while the Temporal branch summarizes relevant information across leads at each temporal position. Together, they provide the LLM with compact, question-relevant ECG information while preserving lead and temporal structure. LEAP-LLM reduces modality-token count by 89.0% and prefill FLOPs by 7.2x on average relative to other ECG-LLMs baselines. Across four ECG benchmarks, LEAP-LLM achieves better performance, including a 3.4-percentage-point improvement in G12EC over the strongest prior ECG-specific method. We further show that the model adaptively emphasizes the clinically relevant anatomical lead groups for different cardiac abnormalities, with lead importance patterns consistent with established diagnostic knowledge, providing interpretable evidence that the predictions are supported by clinically meaningful ECG structure.
Figures & tables
Figure 1: Electrode placement for 12-lead ECG acquisition. Ten electrodes generate the 12 ECG leads.
Figure 2: Overview of LEAP-LLM . (a) A multi-lead ECG and clinical query are encoded separately. Task-trained instruction tokens condition a dual-axis alignment module to produce compact structured tokens for the LLM. (b) The ECG is represented as lead-specific temporal tokens augmented with structural embeddings. Question-derived instruction tokens guide two complementary cross-attention branches: the Lead Branch , which summarizes temporal evidence within each lead, and the Temporal Branch , which summarizes cross-lead evidence at each temporal location. The resulting tokens are concatenated and projected into the LLM embedding space.
Model
PTB-XL
CODE-15%
G12EC
CSN
F1 ↑
AUC ↑
HL ↓
F1 ↑
AUC ↑
HL ↓
Acc. ↑
Acc. ↑
Random
33.2
50.3
50.1
15.0
48.8
32.1
12.1
11.6
General-purpose MLLMs
InternVL2-8B
14.3
50.6
27.8
16.1
55.8
17.7
37.5
47.7
Qwen2-VL-7B
22.4
51.3
30.8
24.8
60.7
20.5
32.9
25.5
Qwen2.5-VL-7B Instruct
16.8
51.5
27.6
26.2
57.9
19.5
13.8
12.2
Table 1: ECG-Bench abnormality detection results. Best results are shown in bold , and second-best results are underlined .
Method
LLM Backbone
ECG Tokens
Prefill FLOPs (T)
Prefill Latency (ms)
TTFT (ms)
HeartLLM
LLaMA-3.2-3B
313
2.74 †
108.0
138.0
GEM
Vicuna-7B
676
10.73
65.8
90.7
PULSE
Vicuna-7B
2,879
43.66
242.7
270.9
ECG-R1
Qwen3-8B
862
13.52
145.9
149.1
LEAP-LLM
Vicuna-7B
111
3.13
33.1
43.6
Table 2: Inference efficiency comparison with ECG-LLM baselines.
Variant
S
Q
P
CSN Acc ↑
G12 Acc ↑
(a)
78.2
71.2
(b)
✓
82.3 (+4.1)
74.2 (+3.0)
(c)
✓
✓
85.4 (+3.1)
78.0 (+3.8)
(d) LEAP-LLM
✓
✓
✓
90.6 (+5.2)
85.16 (+7.16)
Table 3: Contribution of lead-time structure (S), question conditioning (Q), and positional embeddings (P). Accuracy (%) and gains over the preceding row are reported.
Dataset
Metric
Lead Only
Temporal Only
Full
PTB-XL
F1
51.68
42.43
76.20
CODE-15
F1
65.08
77.59
87.20
CSN
Acc.
74.30
82.25
90.60
G12EC
Acc.
56.01
64.52
85.16
Table 4: Architectural ablation of LEAP-LLM LlaVA across ECG-Bench datasets.
Figure 3: LEAP-LLM attention patterns in myocardial infarction groups. Inferior MI shows higher attention in inferior leads, while anterior MI shows higher attention in anterior leads. Attention peaks near clinically relevant QRS and ST-segment regions.
Figure 4: Reduction in the likelihood of the correct answer for different patients after replacing lead-specific tokens with their dataset-mean representations.
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Class
AUROC ↑
Normal ECG
0.989
First-degree AV block
0.983
RBBB
0.988
LBBB
0.992
Sinus bradycardia
0.995
Sinus tachycardia
0.998
Appendix
Table 5: Frozen-encoder linear-probe AUROC on the sampled CODE-15% cohort of 840 test examinations.
Setting
Stage 0
Stage I
Stage II
Encoder Pretraining
Alignment
Fine-tuning
ECG encoder
Trainable
Frozen
Frozen
ECG-LLM interface
–
Trainable
Trainable
Language model
–
Frozen
Trainable
Training objective
Masked reconstruction
Answer generation
Answer generation
Optimizer
AdamW
AdamW
AdamW
Appendix
Table 6: Optimization settings for ECG encoder pretraining and the two ECG-language training stages.
Dataset
Class
LEAP-LLM LlaVA
GEM
PULSE
PTB-XL
NORM
0.8914
0.8199
0.7614
MI
0.9290
0.8313
0.6415
STTC
0.9377
0.8735
0.8404
CD
0.8657
0.8095
0.7955
HYP
0.8515
0.7701
0.7677
Macro
0.8951
0.8208
0.7613
Appendix
Table 7: Per-class linear probing ROC-AUC on PTB-XL and CODE-15%. The best result for each class is shown in bold.
PTB-XL
CODE-15%
Model
F1 ↑
AUROC ↑
HL ↓
F1 ↑
AUROC ↑
HL ↓
ITFormer-3B
12.3
50.0
28.1
26.5
61.7
21.5
OpenTSLM-3B
21.6
50.9
30.7
14.5
52.9
16.3
LEAP-LLM -3B
71.2
80.4
12.7
83.5
88.7
5.8
Appendix
Table 8: Comparison with ITFormer and OpenTSLM at the 3B scale. All metrics are reported as percentages. HL denotes Hamming loss.
Method
Non-LLM
Modality
Prefill
Prefill
Decode
Total
Prefill
TTFT
E2E
Peak VRAM
Params (M)
Tokens
Tokens
FLOPs (T)
FLOPs (T)
FLOPs (T)
(ms)
(ms)
(ms)
(MB)
HeartLLM †
0.03 †
313
457
2.74 †
1.75 †
4.49 †
108.0
138.0
21,896
2,468
GEM
411
676
802
10.73
3.51
14.23
65.8
90.7
8,678
14,787
PULSE
324
2,879
3,005
43.66
3.80
47.46
242.7
270.9
8,972
16,993
ECG-R1
682
862
936
13.52
4.04
17.56
145.9
149.1
14,200
17,389
LEAP-LLM
235
111
239
3.13
3.43
6.56
33.1
43.6
8,344
13,585
Appendix
Table 9: Detailed inference-cost comparison. All latency measurements use batch size 1 on an NVIDIA A100-SXM4-40GB. FLOPs correspond to LLM computation; end-to-end measurements generate exactly 256 tokens.
Figure 5: Inference cost for multiple questions per ECG. Cumulative prefill FLOPs (left) and latency (right) as the number of questions per recording increases.
Group
ECGs
Normal
925
Abnormal, without MI
644
Inferior MI
224
Anterior MI
160
Lateral MI
23
Multiple-territory MI
106
Appendix
Table 10: PTB-XL cohort used for the question-swap analysis.
Question About
Inferior leads
Anterior leads
Inferior MI
79.8
7.7
Anterior MI
9.1
78.4
Appendix
Table 11: Attention share (%) assigned to each lead group when the queried MI territory changes while the ECG is held fixed.
Figure 6: Question-dependent lead attention for PTB-XL recording 6925. Changing the queried MI territory shifts attention toward the corresponding lead group while the ECG remains unchanged.
Tokens replaced
Inferior MI
Anterior MI
All leads
73.5% [71.3, 75.5]
80.7% [78.3, 82.7]
Inferior leads
50.5% [46.1, 54.4]
5.5% [1.6, 9.4]
Anterior leads
6.8% [3.2, 11.0]
55.0% [49.9, 59.5]
Random three leads
17.2% [13.6, 20.8]
17.6% [11.8, 23.4]
Random 12 temporal tokens
−0.2 % [ −0.5 , 0.1]
−0.2 % [ −0.6 , 0.1]
Appendix
Table 12: Full lead-token intervention results. Values report the reduction in gold-answer likelihood, D=1−R , with 95% bootstrap confidence intervals. Higher values indicate greater dependence on the replaced representations. Bold values denote the anatomically matched territory-specific interventions.
Electrocardiograms (ECGs) are among the most widely available clinical signals and play a central role in cardiovascular diagnosis. While recent foundation models (FMs) have shown promise for learning transferable ECG representations, most existing pretraining approaches treat leads as independent channels and fail to explicitly leverage their strong structural redundancy. We introduce the latent attention masked autoencoder (LAMAE) FM that directly exploits this structure by learning cross-lead connection mechanisms during self-supervised pretraining. Our approach models higher-order interactions across leads through latent attention, enabling permutation-invariant aggregation and adaptive weighting of lead-specific representations. We provide empirical evidence on the Mimic-IV-ECG database that leveraging the cross-lead connection constitutes an effective form of structural supervision, improving representation quality and transferability. Our method shows strong performance in predicting ICD-10 codes, outperforming independent-lead masked modeling and alignment-based baselines.
Moritz Vandenhirtz, Samuel Ruipérez-Campillo, Simon Böhi +6
Department of Computer Science, ETH Zurich, Switzerland · Department of Biomedical Engineering, University of Basel, Switzerland
ECG-Language Models (ELMs) extend recent advances in Multimodal Large Language Models (MLLMs) to automated ECG interpretation. However, most existing ELMs inherit Vision-Language Model (VLM) design choices and rely on pretrained ECG encoders, introducing substantial architectural and training complexity. Inspired by encoder-free VLMs, we introduce ELF, a family of three encoder-free ELMs that remain competitive with, and often outperform, prior state-of-the-art ELMs across two datasets despite substantially simpler architectures and training pipelines. All code and data are available at github.com/ELM-Research/ECG-Language-Models.
William Han, Tony Chen, Chaojing Duan +6
Carnegie Mellon University, USA · Allegheny Health Network, USA · University of California, Los Angeles, USA +1
Clinical interpretation of a 12-lead electrocardiogram (ECG) often requires answering targeted diagnostic questions with clear, quantifiable decisions. We introduce ECGJev, the first ECG framework built on a decision decoder, a pretrained language model trained to return a probability for every listed option. A question-conditioned bridge compresses frozen waveform and spectrogram features into 16 ECG tokens, and a two-stage procedure adapts the bridge and low-rank adapters on the decoder's native option readout using diagnostic labels alone, scoring all options for a question in one forward pass. Evaluated across four ECG benchmarks, ECGJev achieves the highest macro-F1 on CPSC2018 (80.46%), PTB-XL (71.68%) and Chapman (96.86%), and generalizes competitively to the small-sample PTB cohort. Concept probes and perturbation analyses further show that its predictions rely directly on the ECG input, remain stable under option-order and wording variations, and transfer zero-shot to unseen waveform concepts. Our code is available at https://github.com/zhuoyuanli-lab/ECGJev.
Zhuoyuan Li, Xidong Wu, Hanyu Cui +4
The Chinese University of Hong Kong, Hong Kong SAR · University of Dundee, Scotland, UK · Northeastern University, Shenyang, China +1