multivariateGPT: a decoder-only transformer for multivariate categorical and numeric data

Andrew J. Loza, Jun Yup Kim, Shangzheng Song, Yihang Liu, Joseph J. Y. Sung, R. Andrew Taylor, Dennis L. ShungarXiv 2025 · DOI

Abstract

multivariateGPT is a novel decoder-only transformer architecture designed to natively process mixed categorical and numeric multivariate sequences. By replacing traditional discretization with a joint likelihood loss function that predicts both token classes and continuous values, the model overcomes the precision loss and noise accumulation inherent in standard LLM-based tokenization. Evaluated on complex time-series tasks including sepsis prediction and ECG reconstruction, multivariateGPT demonstrates significant performance gains over state-of-the-art Neural ODEs and discretized transformers, achieving up to a 60% reduction in Mean Squared Error in clinical settings.

Introduction

Real-world multivariate data, particularly in high-stakes fields like healthcare, is inherently heterogeneous. It consists of categorical labels (e.g., a "Sepsis" diagnosis) and numeric values (e.g., a heart rate of 115 bpm) recorded at irregular intervals. Existing modeling approaches typically fall into two categories: tokenization-based models (LLMs) that discretize numbers into bins, and continuous models (Neural ODEs) that struggle with categorical data and the "informative sampling" patterns of clinical practice.

Discretization often leads to "noise accumulation," where models lose precision over long-term predictions. Conversely, continuous models often fail to capture the significance of when a test is ordered. multivariateGPT addresses these flaws by treating text, categories, and continuous numbers as first-class citizens within a unified transformer backbone.

Methodology

The core innovation of multivariateGPT lies in its representation and prediction of data through a hybrid framework. Every observation is decomposed into a tuple: {class, value}. This includes temporal information, where the time elapsed between measurements ($\tau$) is treated as a specific class with a corresponding numeric value.

The multivariateGPT architecture featuring hybrid embeddings and a joint likelihood loss function.

As shown in Figure 1, the model utilizes Hybrid Embeddings, creating a vector by summing a learned class-specific vector with a projected numeric value. The architecture employs a Joint Likelihood Loss via two specialized heads:

  1. Class Head: A standard softmax layer predicting the probability of the next token's category ($P(c_i)$).
  2. Value Head: A layer predicting the mean ($\mu$) and variance ($\sigma$) of a Gaussian distribution for the continuous value ($P(v_i | c_i)$).

This approach allows the model to maintain the efficiency and autoregressive nature of modern transformers while natively handling continuous distributions.

Experimental Evaluation

The authors evaluated multivariateGPT across four distinct domains:

  • Simple Harmonic Oscillators: Testing the ability to learn second-order dynamics and handle crossing trajectories.
  • eICU Sepsis Data: Real-world clinical data from 3,362 patients with irregularly sampled vitals.
  • MIMIC-IV ECG Data: Over 89,000 electrocardiograms used for lead voltage infilling.
  • Physionet ICU Data: Sparse records for 65,000 patients across 36 measurement classes.

Key Results

In sepsis prediction tasks, multivariateGPT achieved a 40% to 60% reduction in Mean Squared Error (MSE) compared to TFM-ODE, the previous state-of-the-art. Furthermore, when predicting the timing of future measurements, the model outperformed discrete-token baselines by 78% to 99%. In ECG reconstruction, the model produced smooth, accurate trajectories, whereas discrete transformers often generated jittery or noisy outputs.

Discussion: The Cost of Discretization

A primary insight of this research is that discretization is a "precision killer." Binning numeric data—even into 100 bins—prevents transformers from generalizing underlying physical laws, leading to memorization rather than understanding.

Comparison of multivariateGPT (continuous) versus discretized baselines (n=10 and n=100 bins) in trajectory prediction.

As illustrated in Figure 6, the multivariate approach (left) accurately captures the underlying dynamics of the system. In contrast, discretized models (center and right) struggle to maintain trajectory coherence, particularly as the number of bins increases and the vocabulary becomes sparse. By using a continuous value head, multivariateGPT provides built-in uncertainty quantification through its predicted variance ($\sigma$), which is critical for high-stakes ICU monitoring.

Conclusion and Future Work

multivariateGPT demonstrates that a unified transformer architecture can effectively bridge the gap between categorical and continuous data. While currently limited by a single-Gaussian assumption for numeric values and quadratic scaling of the context window, it sets a new benchmark for multivariate time-series analysis. Future work may explore Mixture Density Networks to handle multi-modal distributions and scaling the architecture to the "Foundation Model" level.

Summary updated

BibTeX
@misc{loza2025multivariategpt,
  author = {Andrew J. Loza and Jun Yup Kim and Shangzheng Song and Yihang Liu and Joseph J. Y. Sung and R. Andrew Taylor and Dennis L. Shung},
  title = {{multivariateGPT: a decoder-only transformer for multivariate categorical and numeric data}},
  year = {2025},
  eprint = {2505.21680},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.21680},
}
Figure