What Comes Next and Why: Interpretable Next-Event Prediction with Neuro-Symbolic Rules

Tim Nico Bauerschmidt, Isabel Valera, Jilles VreekenNeurIPS 2026

TL;DR

When predicting the next event in a sequence—like a patient’s next clinical event or a shopper’s next purchase—modern neural networks give great answers without ever telling you why. This paper introduces RULES, a neural network whose hidden layers physically transform into human-readable, time-aware "if-then" rules during training, and RUNES, a hybrid architecture that pairs those rules with a Transformer to mop up remaining errors. Together, they deliver near-black-box accuracy while letting you read the exact logical reasoning behind predictions.

What Problem Does This Paper Address?

Imagine an e-commerce system noticing a customer bought a computer case 10 days ago and a processor 5 days ago, and predicting they will buy a motherboard next. Deep sequence models (like Transformers) make these predictions effortlessly, but their internal states are inscrutable matrices—a dealbreaker in regulated fields like healthcare or finance.

Conversely, traditional symbolic rule-mining algorithms find human-readable patterns, but rely on clunky combinatorial searches, ignore precise timing intervals, and lack a clean way to combine multiple rules into a single probability distribution. Meanwhile, existing "neuro-symbolic" methods (which blend neural nets with logic) mostly work on flat tabular data; flattening event sequences into tables creates sparse, high-dimensional nightmares. We need a model that natively learns temporal rules via gradient descent and predicts what comes next.

Methods

The authors first define Temporal Conjunctive Prediction Rules: human-readable rules where the "if" part (antecedent) checks whether specific events happened within specific past time windows (e.g., Event X occurred 2–21 days ago), and the "then" part (consequent) outputs prediction scores (logits) for the next event.

Figure 1: Architecture overview of RUNES. (a) RUNES is trained in two phases: RULES first learns sequential rules, after which a residual network is trained with the RULES network frozen. (b) RULES represents rules in its layers: Neurons in the first layer encode event-time predicates. Neurons in the second layer select a subset of these predicates and combine them into conjunctions (antecedents). The output layer sums the softmax logits of all active rules to produce the final prediction.

They learn these rules end-to-end using a two-phase architecture:

  • Phase 1: RULES (The Symbolic Network). RULES is a 3-layer neural network designed to crystallize into discrete logic. Layer 1 learns event-time predicates using differentiable soft-matching for event types and soft-binning for time delays. Layer 2 combines these predicates into logical ANDs (conjunctions). During training, the authors apply temperature annealing—gradually cooling down smooth sigmoid and softmax functions until they snap into strict binary 0s and 1s. Layer 3 simply sums the output logits of all active rules.
  • Phase 2: RUNES (Adding a Residual Network). Real-world data rarely follows pure logic. Once RULES finishes training, its weights are frozen and converted to exact symbolic rules. A standard black-box sequence model (here, a RoPE Transformer) is trained alongside it to output additive residual logits, learning only to correct the mistakes RULES makes.

Datasets

  • Synthetic Benchmarks: Newly generated sequence datasets built from 20 ground-truth rules (vocabulary of 128, sequence lengths 96–128) with tunable signal-to-noise knobs—varying both random gap-filling noise and how reliably consequents follow antecedents.
  • Real-World Datasets: Five diverse sequential benchmarks: Holidays, Chorales (musical compositions), Commits, Rolling Mill (industrial process logs), and Amazon (e-commerce purchase histories).

Key Insights and Ideas

  • Continuous search beats combinatorial explosion: By relaxing discrete events and time intervals into continuous, differentiable functions and annealing them, RULES navigates a super-exponential rule space using standard backpropagation.
  • Zero spurious rules on pure noise: In a sanity check on 10 purely random datasets, RULES cleanly extracted zero rules—showing the output bias term effectively absorbs random noise rather than hallucinating patterns.
  • The black-box acts as a polite safety net: Because RUNES adds rule logits and Transformer logits directly, you can audit every prediction. Crucially, when rules activate, the residual network rarely overturns a correct rule prediction (only 3% of cases), instead spending its capacity fixing errors (17% of cases).
  • Unsupervised trust signals: Measuring the divergence (symmetric KL) between RULES and RUNES tells you when to trust the rules. Small shifts usually mean the Transformer is making noisy tweaks (trust the interpretable rule); massive shifts mean the rule is likely wrong (trust the Transformer).

Key Results

Synthetic test accuracy across varying signal-to-noise ratios

Synthetic test accuracy across varying signal-to-noise ratios
  • Synthetic Recovery: RULES faithfully maps onto ground-truth rules across noise levels and even outperforms CatBoost and the black-box Transformer in high-noise regimes.
  • Real-World Accuracy: RUNES ranks 2nd overall (average rank 2.4), nipping at the heels of the full black-box Transformer (rank 1.0) and beating XGBoost (2.8), PPM Markov models (3.6), and CatBoost (4.0). On Amazon, RULES alone gets 6.53% accuracy, which jumps to 17.55% in RUNES (matching the Transformer's 17.61%). On Holidays (97.57%) and Commits (19.60%), RULES alone nearly matches the Transformer (100% and 20.10%).
  • Extreme Compactness: RULES needs only 26 to 77 rules (with 1–5 conditions each) per dataset. To reach similar accuracy on Amazon, CatBoost requires 13,123 leaf regions, and XGBoost builds 5,149,683 distinct symbolic paths. Furthermore, at least one symbolic rule is active for 64% of real-world test predictions on average.

Limitations and Future Work

  • Prediction time is required: Because rules check time offsets relative to the next event, inference on irregularly sampled sequences requires knowing when the next event will happen (either as a user query or estimated via a separate temporal point process).
  • Optimization variance: Trading combinatorial search for gradient descent introduces sensitivity to random seeds, layer sizes, and annealing schedules—meaning extracted rule sets can vary across runs.
  • Expressiveness: The architecture currently assumes one categorical event per timestamp and strictly learns conjunctive ("AND") rules. Extending this differentiable machinery to multi-modal events or richer temporal logic patterns remains open territory.

Summary updated

BibTeX
@inproceedings{bauerschmidt2026what,
  author = {Tim Nico Bauerschmidt and Isabel Valera and Jilles Vreeken},
  title = {{What Comes Next and Why: Interpretable Next-Event Prediction with Neuro-Symbolic Rules}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=8zAngnuSAi},
}
Figure