Skip to content

Commit eaf7cac

Browse files
committed
Initial commit: Code and experiments for 'Rethinking Tokenization for Clinical Time Series'
1 parent f984aa4 commit eaf7cac

3 files changed

Lines changed: 9 additions & 99 deletions

File tree

.github/workflows/code-quality-main.yaml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/tests.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 9 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,21 @@
11
# Rethinking Tokenization for Clinical Time Series (ML4H Findings 2025)
22

33
## Acknowledgements
4-
This repository contains the code for the experiments in our paper, "Rethinking Tokenization for Clinical Time Series: When Less is More." The codebase is adapted from the `meds-torch` library. We thank the original authors for their foundational work. For the maintained, production-ready version of the library, please see the official `meds-torch` repository.
4+
This repository contains the code for the experiments in our paper, "Rethinking Tokenization for Clinical Time Series: When Less is More." The codebase is adapted from the [`meds-torch` library](https://github.com/Oufattole/meds-torch). We thank the original authors for their foundational work. For the maintained, production-ready version of the library, please see the official repository.
55

66
---
77

88
## Overview
9+
This work presents a systematic evaluation of tokenization approaches for clinical time series modeling. We compare Triplet and TextCode strategies across four prediction tasks on MIMIC-IV to investigate the roles of time, value, and code representations. Our findings suggest that for transformer-based models, tokenization can often be simplified without sacrificing performance.
910

10-
This work presents a systematic evaluation of tokenization approaches for clinical time series modeling, comparing Triplet and TextCode tokenization strategies across four clinical prediction tasks using the MIMIC-IV dataset.
11+
## Key Findings Summary
1112

12-
## Key Research Contributions
13-
14-
### 1. Triplet Tokenization Ablations
15-
- **Time2Vec Implementation**: Advanced time encoding using sinusoidal basis functions
16-
- **LeTE Implementation**: Learnable time embeddings with Fourier and spline components
17-
- **Component Ablations**: Systematic removal of time and value features to isolate predictive signals
18-
- **Code-only Variants**: Minimal tokenization using only medical codes
19-
20-
### 2. TextCode Tokenization Improvements
21-
- **Flexible TextCode Encoder**: Support for both trainable and frozen language model encoders
22-
- **Enhanced Code Mappings**: Complete coverage of medical code descriptions (100% vs 25% baseline)
23-
- **Multi-scale Encoders**: Evaluation across 15M to 600M parameter language models
24-
- **Domain Comparison**: Clinical vs general-domain pretrained encoders
25-
26-
### 3. Experimental Framework
27-
- **Controlled Comparisons**: Systematic variation along mapping coverage, training approach, encoder scale, and domain axes
28-
- **Statistical Rigor**: Paired Wilcoxon tests with Bonferroni correction across 10 random seeds
29-
- **Reproducible Pipeline**: Standardized MEDS-Torch framework with transformer encoders
13+
| Component | Finding | Implication |
14+
| -------------------- | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
15+
| **Time Features** | Explicit time encodings showed no statistically significant benefit. | Sequence order in transformers may be sufficient for the tasks studied. |
16+
| **Value Features** | Importance is task-dependent (critical for mortality, less so for readmission). | Code sequences alone can carry significant predictive signal for some tasks. |
17+
| **Frozen Encoders** | Dramatically outperform trainable encoders with far fewer parameters. | Pretrained knowledge acts as a powerful, regularized feature extractor. |
18+
| **Code Information** | Emerges as the most critical predictive signal across all experiments. | The quality of code representations is paramount for model performance. |
3019

3120
## Repository Structure
3221

@@ -47,24 +36,13 @@ This work presents a systematic evaluation of tokenization approaches for clinic
4736
- `experiment_no_value.sh` - No-value ablation experiments
4837
- `experiment_flexible_textcode.sh` - TextCode optimization experiments
4938

50-
## Key Findings
51-
52-
1. **Time Features**: Explicit time encodings provide no consistent statistically significant benefit across clinical tasks
53-
2. **Value Features**: Show task-dependent importance, affecting mortality but not readmission prediction
54-
3. **Frozen Encoders**: Dramatically outperform trainable counterparts while requiring fewer parameters
55-
4. **Code Information**: Emerges as the most critical predictive signal in clinical time series
56-
5739
## Dataset and Framework
5840

5941
- **Dataset**: MIMIC-IV processed into MEDS format
6042
- **Tasks**: In-hospital mortality, ICU mortality, post-discharge mortality, 30-day readmission
6143
- **Framework**: MEDS-Torch with transformer encoders
6244
- **Evaluation**: AUROC with 10 random seeds, statistical significance testing
6345

64-
## Reproducibility
65-
66-
All experiments use the standardized MEDS-Torch pipeline with consistent hyperparameters and evaluation protocols. The code preserves the original research branches as separate implementations to enable direct comparison of different tokenization approaches.
67-
6846
---
6947

7048
*This research demonstrates that simpler, more parameter-efficient tokenization approaches can achieve competitive performance in clinical time series modeling, challenging assumptions about the necessity of complex temporal encodings while clarifying the task-dependent role of value features.*

0 commit comments

Comments
 (0)