Atoms and Grammar of the Heart: Geometry-Aligned Discrete Tokenization for ECG Language Modeling

Zirui Wang, Qiuling Yang, Pang Wu, Peng Wang, Zhenfeng Li, Xianxiang Chen, Lidong Du, Zhen Fang


Abstract
Extending discrete tokenization and autoregressive modeling to signals whose latent states follow continuous trajectories introduces phase–morphology ambiguity. Similar local shapes can occur at distinct trajectory positions, while the same position can vary across instances. Standard vector quantization (VQ) may therefore merge contextually different patches and split corresponding ones. We trace this behavior to radial-to-tangential gradient leakage under the straight-through estimator and propose **Geometry Alignment Quantization (GAQ)**. GAQ combines a learned Mahalanobis reshaping of the codebook with a Householder backward map. The map exactly cancels the leakage in the idealized setting, while the numerical stabilization used in practice introduces a bounded deviation. We instantiate GAQ on ECG as **AtomECG**, a tokenizer of sub-waveform atoms composed by a GPT grammar. Atom sequences show long-context scaling from perplexity 488 to 24, split-replicated motif enrichment yields auditable clinical hypotheses, and AtomECG outperforms eight eSSL baselines on more than ten diagnostic tasks. A known-phase limit cycle and PPG results further support GAQ on phase-like signals beyond ECG.
Anthology ID:
2026.findings-emnlp.685
Volume:
Findings of the Association for Computational Linguistics: EMNLP 2026
Month:
October
Year:
2026
Address:
Budapest, Hungary
Editors:
Hung-Yi Lee, Sunipa Dev, Jessy Li, Desmond Elliott
Venue:
Findings
SIG:
SIGDAT
Publisher:
Association for Computational Linguistics
Note:
Pages:
14369–14393
Language:
URL:
https://aclanthology.org/2026.findings-emnlp.685/
DOI:
Bibkey:
Cite (ACL):
Zirui Wang, Qiuling Yang, Pang Wu, Peng Wang, Zhenfeng Li, Xianxiang Chen, Lidong Du, and Zhen Fang. 2026. Atoms and Grammar of the Heart: Geometry-Aligned Discrete Tokenization for ECG Language Modeling. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 14369–14393, Budapest, Hungary. Association for Computational Linguistics.
Cite (Informal):
Atoms and Grammar of the Heart: Geometry-Aligned Discrete Tokenization for ECG Language Modeling (Wang et al., Findings 2026)
Copy Citation:
PDF:
https://aclanthology.org/2026.findings-emnlp.685.pdf