Abstract
Predicting the outcomes of interventions in complex longitudinal systems, such as patient health trajectories or cellular development, is a fundamental challenge in precision medicine. We present CLEF (ControLlable sequence Editing Framework), a novel architecture designed to precisely modify time-series data by controlling the timing and scope of interventions. By learning "temporal concepts" that represent rates of change, CLEF enables targeted editing of specific variables at arbitrary future time points. Our framework demonstrates significant improvements over state-of-the-art models, particularly in delayed editing and zero-shot counterfactual generation across biological and clinical datasets.
Introduction
A central goal of "virtual patient" and "virtual cell" modeling is the ability to simulate "what-if" scenarios: how would a system evolve if a specific intervention occurred at a specific time? However, existing generative models often struggle with two critical dimensions: timing and scope. Standard methods frequently assume that an intervention affects all variables simultaneously or require step-by-step autoregressive generation, which leads to compounding errors over long horizons.
In real-world clinical settings, an intervention like a drug administration might only affect blood glucose levels starting several hours later, while other vitals remain stable. Controllable sequence editing aims to preserve historical data and unaffected variables while precisely projecting the impact of time-sensitive interventions.
Methods: The CLEF Framework
CLEF treats sequence editing as a targeted modification rather than a total regeneration of the data. The architecture is composed of four modular components that allow it to "skip ahead" to future time points without intermediate steps:
- Sequence Encoder ($F$): Extracts features from historical data ($x_{t_0:t_i}$). It is backbone-agnostic, supporting Transformers, xLSTM, or pretrained models like MOMENT.
- Condition Adapter ($H$): Maps categorical interventions (e.g., ICD codes or genetic perturbations) into a shared latent space ($z_s$).
- Concept Encoder ($E$): The core module that learns temporal concepts ($c$). These vectors represent the predicted trajectory or "rate of change" for every variable in the sequence relative to the intervention and target time.
- Concept Decoder ($G$): Employs a simple multiplicative operation ($\hat{x} = c \odot x_{t_i}$). By multiplying the last known state by the learned concept, CLEF applies the edit in a single step.
This design allows the model to perform both immediate and delayed sequence editing. By learning a multiplier rather than raw values, the model inherently captures how a system changes, enhancing both interpretability and robustness against compounding errors.
Experimental Evaluation
CLEF was evaluated across eight diverse datasets, including new benchmarks for single-cell transcriptomics (WOT & WOT-CF) and real-world clinical trajectories (eICU & MIMIC-IV).
Key Results
- Accuracy: CLEF improved immediate sequence editing accuracy by an average of 16.28% (MAE) over non-CLEF baselines.
- Delayed Editing: In scenarios predicting far-future effects, the model outperformed baselines by 26.73% (MAE), demonstrating the advantage of its single-step projection.
- Zero-Shot Counterfactuals: The framework showed a 62.84% improvement in generating counterfactual trajectories for conditions not seen in specific contexts during training.
- Clinical Utility: In a case study of Type 1 Diabetes, CLEF successfully identified interventions that shifted pathological trajectories toward healthy states, with the learned temporal concepts aligning with established medical knowledge regarding glucose and white blood cell interactions.
Discussion and Future Work
CLEF represents a significant advancement toward reliable digital twins in healthcare. Its ability to perform zero-shot counterfactual generation suggests that it captures fundamental "concepts" of interventions that generalize across different initial states.
However, the current framework relies on a multiplicative decoder, which may struggle with highly non-linear or chaotic systems. Furthermore, while temporal concepts are currently defined per-variable, future iterations could incorporate hierarchical structures to better capture inter-variable dependencies (e.g., the relationship between blood pressure and renal function). Despite these limitations, CLEF provides a scalable and interpretable foundation for controllable longitudinal data editing.
Summary updated