STT-LLM: Structural-Temporal Tokenization for Adapting LLMs to Longitudinal Clinical Profiles
Abstract
Large Language Models have shown strong generalization across natural language tasks but remain underexplored for longitudinal clinical profiles. In sports anti-doping, biological profiles are analyzed to support early detection of prohibited substance use and identification of anomalous biological patterns, both of which require joint modeling of temporal dynamics and metabolic relationships. We propose STT-LLM, a structural-temporal tokenization framework that adapts LLMs to longitudinal clinical analysis without modifying their backbone architectures. STT-LLM constructs biologically grounded structural-temporal embeddings and transforms them into LLM-compatible tokens via specialized tokenizers that explicitly encode pathway structure and temporal evolution. We evaluate STT-LLM on real-world longitudinal datasets from athletes, showing consistent improvements over native LLM tokenization strategies in sequence prediction and anomaly detection. In addition, we present a case study where STT-LLM provides contextual reasoning that aligns more closely with expert assessments compared to baseline models. These results highlight tokenization as a key bottleneck and opportunity for adapting LLMs to clinical data.
Lay Summary
Professional athletes are monitored through repeated measurements of steroid levels in urine, which can reveal patterns linked to prohibited substance use. Detecting doping this way is hard because profiles are sparse, collected at irregular intervals, and governed by complex biochemical relationships between substances in the body. Large Language Models have shown impressive reasoning abilities, but they were designed for text and cannot naturally handle this kind of structured, time-ordered biological data. When a steroid profile is simply converted into a text prompt, the model treats the numbers as arbitrary words, losing all information about how substances relate to each other biochemically and how values should evolve. We developed STT-LLM, a framework that solves this by redesigning how the data is converted into inputs for the model. Two specialised components encode i) the known biochemical relationships between steroid metabolites and ii) the temporal progression of an athlete's profile across irregular time points. This enriched representation is then passed to a standard pretrained language model without modifying it. Our approach consistently outperforms existing language models on both predicting future measurements and flagging suspicious profiles, and correctly identified all seven confirmed doping cases in a real-world case study. These results show that for structured clinical data, how you represent information to a language model matters as much as which model you choose.