Neural Datalog Through Time: Informed Temporal Modeling via Logical Specification

Hongyuan Mei, Guanghui Qin, Minjie Xu, Jason Eisner

Introduction

Predicting the timing and nature of future events is a fundamental challenge in machine learning, with applications ranging from user behavior modeling to robotics. While deep learning models like LSTMs and Neural Hawkes Processes (NHP) have shown promise, they are typically "unrestricted." They assume that any historical event can influence any future event, which often leads to overfitting on spurious correlations in high-dimensional event spaces. For example, a model might incorrectly associate unrelated global events simply due to temporal proximity. Furthermore, these models struggle to generalize across similar entities without explicit structural guidance.

The Neural Datalog Through Time (NDTT) Framework

To address these limitations, we introduce Neural Datalog Through Time (NDTT), a neuro-symbolic framework that allows domain experts to encode structural constraints using logical rules. NDTT combines the symbolic reasoning of Datalog with the representational power of deep neural networks.

Logical Specification and Dynamic Architecture

In NDTT, users define the model's structure using two types of Datalog rules:

  • Deductive Rules (:-): These rules define how new facts are derived from existing ones at a specific timestamp. Neurally, these are implemented as feed-forward layers where the embedding of a "head" fact is computed from its "body" facts.
  • Update Rules (<-): These rules specify how events modify the state of the database over time. They function similarly to LSTM updates, allowing fact embeddings to evolve based on the history of observed events.

Unlike static neural networks, the topology of an NDTT model is dynamically constructed based on the logic program and the sequence of events that actually occur. This ensures that the model's internal state transitions strictly adhere to domain-specific logic.

Experimental Evaluation

We evaluated NDTT across three diverse domains:

  • Synthetic Superposition: A controlled environment designed to test the model's ability to isolate independent processes.
  • IPTV Dataset: Real-world television viewing data where genre and release information provide structural priors.
  • RoboCup Soccer: A highly dynamic environment where physical constraints (e.g., possession of the ball) dictate possible future actions.

Results and Key Insights

The primary advantage of NDTT is its data efficiency. By using domain knowledge as an architectural prior, the model prunes the search space of possible interactions. In synthetic experiments, the structured model (referred to as "structured NHP" in comparative plots) achieved a log-likelihood comparable to the "oracle" with significantly less data than an unrestricted NHP.

Log-likelihood per event vs. number of training sequences for M=8 and M=16 synthetic domains.

As shown in the figure above, for the $M=16$ domain, the structured model requires only 125 training sequences to outperform the standard NHP trained on 2,000 sequences—a 16x improvement in data efficiency.

Beyond efficiency, NDTT demonstrated superior accuracy on real-world datasets, outperforming baselines like Know-Evolve and DyRep in predicting both event types (measured by error rate) and timestamps (measured by RMSE). The use of variables in Datalog rules also enables better generalization, as the model learns parameters for logical rules rather than specific entity instances.

Conclusion

Neural Datalog Through Time represents a significant step toward integrating symbolic logic with deep temporal modeling. By allowing experts to specify "what matters" through Datalog, NDTT creates models that are more robust, data-efficient, and capable of respecting hard logical constraints. Future work will focus on automating rule discovery and optimizing the computational overhead of dynamic topology updates.

Summary updated

BibTeX
@inproceedings{mei2020neural,
  author = {Hongyuan Mei and Guanghui Qin and Minjie Xu and Jason Eisner},
  title = {{Neural Datalog Through Time: Informed Temporal Modeling via Logical Specification}},
  booktitle = {International Conference on Machine Learning},
  year = {2020},
  url = {https://openreview.net/forum?id=JgAEHDfhWR},
}
Figure