Neural Markov Jump Processes

Patrick Seifner, Ramsés J. Sánchez

Abstract Markov jump processes (MJPs) are continuous-time stochastic processes with widespread applications across the natural and social sciences. Despite their utility, performing inference on these models—especially from noisy, irregularly sampled data—is notoriously difficult. Traditional methods like Monte Carlo or expectation-maximization often struggle with scalability and high-dimensional observations. To address this, researchers have introduced NeuralMJP, a novel variational inference framework that leverages Neural Ordinary Differential Equations (Neural ODEs) to model MJPs. By encoding data into the parameters of a master equation, NeuralMJP enables scalable, end-to-end learning of continuous-time dynamics without relying on manual time-discretization.

The Challenge of Continuous-Time Inference

Many dynamic systems—from chemical reactions and population dynamics to financial markets—are best described as MJPs. These systems stay in a discrete state for a random amount of time before "jumping" to another.

While MJPs are mathematically elegant, determining their transition rates from raw data is highly non-trivial. With a perfect, continuous record of every jump, inference is straightforward. In reality, however, observations are typically noisy, irregularly spaced snapshots. Classical methods like Markov Chain Monte Carlo (MCMC) fail to scale to large datasets, and Expectation-Maximization (EM) often struggles with complex observations or yields only point estimates rather than a full distribution of possible dynamics.

The NeuralMJP Methodology

NeuralMJP treats inference as a variational problem solved through deep learning. The architecture consists of several innovative components:

  1. The Encoder (ODE-RNN): To handle irregular sampling, the model employs an ODE-RNN to process observations backward in time. This generates a latent representation that captures the entire history of the signal.
  2. The Master Equation Solver: The core of an MJP is the "master equation," a differential equation describing the flow of probability between states. NeuralMJP uses a Neural ODE to solve this equation forward in time, yielding the instantaneous probability of occupying any given state.
  3. Variational Posterior: The model learns an inhomogeneous (time-dependent) posterior MJP tailored to fit the specific observed data sequence.
  4. Implicit Prior (The GAN Trick): Learning global, time-independent transition rates (the "prior") directly is often unstable. To mitigate this, the authors utilize a generator network—conceptually similar to Generative Adversarial Networks (GANs)—that maps random noise to transition rates. This implicit distribution is significantly more stable during training than directly optimizing a rate matrix.
  5. Two-Step Optimization: Training proceeds by first optimizing the encoder-decoder to find the best posterior fit, and subsequently updating the prior to match that posterior.

Experimental Validation and Key Insights

The researchers evaluated NeuralMJP across a diverse suite of challenges, including synthetic datasets (Discrete Flashing Ratchet, Lotka-Volterra), real-world experimental data (Switching Ion Channels), and high-dimensional molecular dynamics simulations (Alanine Dipeptide).

Key Findings

  • Eliminating "Lag Time": In fields like molecular dynamics, researchers typically must select an arbitrary "lag time" to discretize continuous data into a Markov chain, which inherently lowers resolution. NeuralMJP operates entirely in continuous time, bypassing this hyperparameter.
  • Inference as ODE Solving: By framing the MJP master equation as a Neural ODE, the framework leverages modern adjoint methods and hardware acceleration, achieving scalability that far surpasses classical MCMC. For instance, NeuralMJP successfully processed a full ion channel dataset of approximately 167,000 observations—a scale that typically overwhelms traditional methods.
  • Information in Irregularity: Counterintuitively, the model performed best on irregularly sampled data. The authors hypothesize that irregular sampling intervals may capture more information about the underlying continuous-time process than a rigid, fixed grid.
  • Accurate Parameter Recovery: In Lotka-Volterra experiments, NeuralMJP recovered ground-truth parameters with significantly higher accuracy than classical variational baselines. Where baselines overestimated certain parameters by nearly 300%, NeuralMJP remained within 10% of the true value.
  • Metastable State Identification: On the Alanine Dipeptide dataset, the model automatically identified the six known metastable molecular conformations, producing stationary distributions that rivaled state-of-the-art specialized models like VAMPnets.

Limitations and Future Directions

While NeuralMJP represents a significant step forward, the authors note a few limitations. The model exhibits a "fast-scale bias," occasionally underestimating the longest relaxation times (slow dynamics). This is likely because the KL-divergence term in the objective function inherently favors larger transition rates. Additionally, in highly complex molecular systems, the model sometimes struggles to consistently separate rare states from more common ones across different random initializations.

Future work will likely focus on refining the KL-divergence evaluation to correct the time-scale bias and exploring more complex, coupled MJP structures to further expand the framework's applicability.

Summary updated

BibTeX
@inproceedings{seifner2023neural,
  author = {Patrick Seifner and Ramsés J. Sánchez},
  title = {{Neural Markov Jump Processes}},
  booktitle = {International Conference on Machine Learning},
  year = {2023},
  url = {https://openreview.net/forum?id=ZtvnhohkVk},
}
Figure