Introduction
Electronic Health Records (EHRs) are a cornerstone of modern clinical decision support, containing a wealth of numerical data such as heart rates, glucose levels, and oxygen saturation. Traditionally, machine learning models for clinical diagnostics—such as predicting sepsis or mortality risk—ingest these "raw" numbers directly. However, the rise of Large Language Models (LLMs) has introduced a new paradigm: the use of high-dimensional vector embeddings to capture semantic context.
This paper investigates whether the "pre-trained intuition" of LLMs, which have been exposed to vast amounts of medical literature, can provide a more effective representation of numerical data than the raw digits themselves. For instance, while a raw number like "120 bpm" is just a value to a traditional classifier, an LLM might "understand" its clinical significance relative to a patient's age or condition. The researchers evaluate this hypothesis by comparing LLM-derived embeddings against standard tabular machine learning baselines.
Methodology
The study developed a comprehensive pipeline to evaluate the effectiveness of LLM embeddings in clinical prediction tasks. The workflow involved four critical stages:
- Table-to-Text Conversion (Serialization): To process tabular data, the researchers tested four serialization formats: Narratives (natural language sentences), JSON, HTML, and Markdown. This step is crucial as it determines how the LLM "reads" the structured data.
- Embedding Extraction: Vector representations were extracted from the last hidden states of the models using three pooling techniques: Max Pooling, Mean Pooling, and Last Token representation.
- Model Selection: The study utilized a diverse array of models, including general-purpose LLMs like Mistral-7B-Instruct, Llama-2 (13B/70B), and Llama-3-8B, as well as domain-specific models like Meditron-7B and ClinicalBERT.
- Hybrid Classification: Rather than relying on direct text generation (which often yields poor results in zero-shot settings), the researchers used the extracted embeddings as input features for traditional classifiers, including XGBoost, Random Forest, and Logistic Regression.
Experimental Setup and Datasets
The researchers utilized two primary datasets to benchmark performance:
- Diagnosis Dataset: A curated set of 660 patient records with 24 tabular features, focused on predicting Sepsis, Arrhythmia, and Congestive Heart Failure (CHF).
- MIMIC-III: A large-scale, public dataset of de-identified ICU records. A subset of 23,884 records was used to predict in-hospital mortality and Length of Stay (LOS).
Key Insights
The Precision of Raw Data
In nearly every experimental configuration, the "Raw Data + XGBoost" baseline proved to be the most formidable competitor. Numerical data is inherently dense and precise. The study found that converting these numbers into text-based embeddings often introduces "noise" or sacrifices the exactness required for high-stakes clinical precision. For example, in ICU mortality prediction on the MIMIC-III dataset, raw data achieved an AUROC of 92.02, while the best-performing LLM embedding (Mistral) reached 84.16.
Embeddings vs. Direct Generation
A significant finding was that using LLMs as feature extractors (embeddings) is far more effective than asking them to predict outcomes directly via text generation. Direct zero-shot generation often resulted in AUROC scores near 0.50—no better than random chance—whereas embeddings paired with traditional classifiers were highly competitive.
The Importance of Formatting
The way data is presented to the model matters. Narrative and JSON formats generally yielded superior embeddings compared to Markdown. This suggests that the semantic structure of the input significantly influences the quality of the resulting vector representation.
Clinical Context and Zero-Shot Strength
Probing experiments revealed that models like Mistral and Llama-2 possess a strong inherent understanding of "normal" medical ranges. Even without specific medical fine-tuning, zero-shot LLM embeddings significantly outperformed randomly initialized embeddings. This confirms that LLMs do provide a meaningful clinical context, even if they do not yet surpass raw numerical data in pure classification accuracy.
Performance Summary
- Sepsis Prediction: Mistral-7B embeddings paired with XGBoost achieved an AUROC of 71.12, coming remarkably close to the 71.16 achieved by raw data.
- Mortality Prediction: Raw data maintained a clear lead, with a ~8% AUROC advantage over the best LLM-based approach.
Limitations and Future Directions
Despite the promise of LLM embeddings, several hurdles remain:
- Computational Overhead: Generating embeddings from LLMs requires substantial GPU resources and time, whereas processing raw numbers is computationally negligible.
- Fine-tuning Challenges: Preliminary attempts at Parameter-Efficient Fine-Tuning (PEFT) led to performance degradation, likely due to models over-fitting to imbalanced classes in the medical datasets.
- Architectural Constraints: The study focused on the last hidden states of the models. Future research may explore intermediate layers or the development of smaller, specialized encoders designed specifically for numerical EHR data.
Conclusion
While raw numerical data remains the "gold standard" for structured medical machine learning, LLM embeddings offer a viable path for future multimodal applications. As clinical AI moves toward integrating unstructured notes with structured vitals, the ability of LLMs to provide contextually aware representations will become increasingly vital, even if raw data currently holds the edge in pure numerical tasks.
Summary updated