How Should Transformers Encode Numeric Values in Electronic Health Records?
Not on the map. Why?
Abstract (arXiv)
How do we encode numeric values in transformer-based sequence processing, particularly in electronic health record (EHR) data? We systematically compare discrete, continuous, and hybrid value encoding strategies using synthetic arithmetic tasks embedded within real-world EHR data, as well as real-world clinical prediction tasks. Our study reveals trade-offs between numeric precision, optimisation stability, and architectural flexibility. We find that approaches that explicitly model value-concept interactions perform best on precision-sensitive arithmetic tasks when architectural constraints permit. Hybrid token-based approaches that retain numeric values but apply binning prior to projection provide a more robust and broadly applicable alternative, with the optimal number of bins following a simple empirically derived power-law in dataset size. Across tasks, models consistently exhibit reliable "good enough" numeric computation rather than exact arithmetic, while clinical gains from incorporating laboratory values are task-dependent. This suggests that robustness and deployability often outweigh maximal numeric precision in practice, motivating hybrid token-based approaches as a practical default.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 21 of its 31 references that are in the map. First posted on arXiv 1 Jul 2026.
Builds on
21 of 31 references.
References · 21
- 2017Attention Is All You Needcited by 60,361
- 2017FiLM: Visual Reasoning with a General Conditioning Layercited by 2,333
- 2021Revisiting Deep Learning Models for Tabular Datacited by 740
- 2024Smarter, Better, Faster, Longer: A Modern Bidirectional Encoder for Fast, Memory Efficient, and Long Context Finetuning and Inferencecited by 554
- 2020TabTransformer: Tabular Data Modeling Using Contextual Embeddingscited by 409
- 2020Med-BERT: pre-trained contextualized embeddings on large-scale structured electronic health records for disease predictioncited by 373
- 2021SAINT: Improved Neural Networks for Tabular Data via Row Attention and Contrastive Pre-Trainingcited by 319
- 2019BEHRT: Transformer for Electronic Health Recordscited by 263
- 2021Investigating the Limitations of Transformers with Simple Arithmetic Taskscited by 139
- 2023MOTOR: A Time-To-Event Foundation Model For Structured Medical Recordscited by 78
- 2024Transformers Can Do Arithmetic with the Right Embeddingscited by 78
- 2024Zero Shot Health Trajectory Prediction Using Transformercited by 77
9 more
- 2021CEHR-BERT: Incorporating temporal information from structured EHR data to improve prediction taskscited by 76
- 2017Adaptive Huber Regressioncited by 60
- 2024Context Clues: Evaluating Long Context Models for Clinical Prediction Tasks on EHRscited by 39
- 2024CORE-BEHRT: A Carefully Optimized and Rigorously Evaluated BEHRTcited by 20
- 2024Arithmetic Transformers Can Length-Generalize in Both Operand Length and Countcited by 18
- 2023A step towards understanding why classification helps regressioncited by 15
- 2023Labrador: Exploring the Limits of Masked Language Modeling for Laboratory Datacited by 9
- 2026Tokenization Tradeoffs in Structured EHR Foundation Modelscited by 6
- 2019Evaluation of Embeddings of Laboratory Test Codes for Patients at a Cancer Centercited by 2
Built on by
Not cited yet.