Embedding Symbolic Temporal Knowledge into Deep Sequential Models

Yaqi Xie, Fan Zhou, Harold Soh

Abstract

Deep sequential models often struggle with data scarcity in domains like robotics. This paper introduces T-LEAF (Temporal-Logic Embedded Automata Framework), a framework that embeds symbolic temporal logic into continuous vector spaces using Graph Neural Networks. By translating Linear Temporal Logic (LTL) into Deterministic Finite Automata (DFA) and learning hierarchical graph embeddings, T-LEAF enables models to adhere to human-defined rules via a differentiable logic loss. Experimental results on video datasets and simulated cooking tasks demonstrate that T-LEAF improves accuracy, accelerates convergence, and enhances generalization compared to standard baselines and hard logic checkers.

1. Introduction

Deep learning has revolutionized sequence processing, yet these models remain notoriously data-hungry. In domains like robotics, where expert demonstrations are scarce, we often possess "common sense" rules (e.g., "wash vegetables before cutting") that are difficult to integrate into neural networks. While Linear Temporal Logic (LTL) can formally define these constraints, it is traditionally incompatible with the differentiable, gradient-based nature of deep learning.

To bridge this gap, researchers from the National University of Singapore propose T-LEAF. T-LEAF translates symbolic rules into continuous vector embeddings, allowing deep models to be "steerable" by formal logic through a differentiable "logic loss" during training.

2. The T-LEAF Framework

The core of T-LEAF is a pipeline that transforms abstract logic into a representation that neural networks can process.

Overview of the T-LEAF framework, illustrating the integration of task models with logic-based embeddings.

The framework operates in four primary stages:

  1. LTL to DFA Conversion: LTL formulas representing domain knowledge are converted into Deterministic Finite Automata (DFA). A DFA represents all possible ways a rule can be satisfied as a graph.
  2. Hierarchical Graph Embedding: A Graph Neural Network (GNN) processes the DFA. The authors found that the GNN's message-passing mechanism effectively mimics the traversal algorithms used in formal model checking.
  3. Embedding Space Optimization: The embedder is trained using a triplet loss, ensuring that sequences satisfying the logic are mapped close to the rule's vector, while violating sequences are pushed away in the embedding space $\mathcal{Z}$.
  4. Logic Loss Integration: During task training, the model calculates a "logic loss" ($\mathcal{L}_{logic}$) based on the distance between the predicted sequence embedding and the DFA embedding, penalizing rule violations.

3. Key Insights: Semantics over Syntax

A critical finding of this research is that embedding the meaning of a formula is more effective than embedding its literal structure. Previous methods often focused on the syntax tree of a logic formula. T-LEAF demonstrates that embedding the DFA—which captures the underlying semantics—leads to significantly better separation in the embedding space.

Comparison of embedding spaces: Syntax Tree (A) vs. DFA (B). The DFA approach provides superior clustering of satisfying sequences.

As shown in the figure above, DFA-based embeddings (B) create a clear distinction between satisfying (blue) and unsatisfying (red) trajectories, whereas syntax tree embeddings (A) result in a cluttered space. This "soft-satisfiability" allows the model to generalize across similar actions or objects, a feat impossible for traditional "true/false" logic checkers. In empirical tests, DFA embeddings outperformed syntax trees by up to 27%.

4. Experimental Evaluation

T-LEAF was evaluated across three domains: synthetic model checking, the Tasty Video Dataset (recipe sequences), and a Creative Cooking reinforcement learning simulation.

  • Performance Gains: On the Tasty Video Dataset, T-LEAF improved action recognition accuracy by 3.3% to 3.4% over standard baselines (LSTM and TCN).
  • Faster Learning: In imitation learning tasks, T-LEAF reached high performance levels significantly faster than models using standard Generative Adversarial Imitation Learning (GAIL) or non-differentiable logic checkers.
  • Robust Generalization: The framework successfully generalized to logic formulas and trajectories unseen during the embedder's training, confirming the robustness of the vector-space approach.

5. Conclusion

T-LEAF represents a significant step toward hybrid AI systems that combine the learning power of Deep Neural Networks with the reliability of symbolic logic. While currently utilizing a static embedder and focusing on finite temporal logic ($LTL_f$), future work aims to explore joint training of the embedder and task model, as well as extending the framework to infinite sequences and real-world robotic deployments.

Summary updated

BibTeX
@inproceedings{xie2021embedding,
  author = {Yaqi Xie and Fan Zhou and Harold Soh},
  title = {{Embedding Symbolic Temporal Knowledge into Deep Sequential Models}},
  booktitle = {IEEE International Conference on Robotics and Automation},
  year = {2021},
  url = {https://openreview.net/forum?id=7eC5OXsaCru},
}
Figure