DeepLog: Neurosymbolic AI Framework
- DeepLog is a neurosymbolic AI framework integrating logic and neural predicates to compile hybrid models into optimized GPU-executable arithmetic circuits.
- It offers a high-level language for model specification, automatic circuit compilation, and seamless Python/PyTorch integration for neurosymbolic modeling.
- It delivers 10–100× performance speedups with GPU acceleration and robust extensibility for emulating diverse logical paradigms such as Boolean, fuzzy, and probabilistic.
DeepLog refers to two distinct paradigms within artificial intelligence research: (1) a neurosymbolic AI framework and abstract machine, and (2) an LSTM-based log anomaly detection method. This entry concentrates on the neurosymbolic framework DeepLog, synthesizing formal definitions, software architecture, integration modes, empirical results, and extensibility, as developed in recent literature (Derkinderen et al., 19 Aug 2025, Manhaeve et al., 11 May 2026). For the sequence-modeling anomaly detection system, see the original LSTM formulation (Chen et al., 2021).
1. Foundations and Goals
DeepLog is a unifying software framework and formal machine for neurosymbolic AI (NeSy), designed to bridge logic-based and deep learning–based models by compiling mixed logical-neural specifications into efficient, GPU-executable arithmetic (algebraic) circuits (Derkinderen et al., 19 Aug 2025, Manhaeve et al., 11 May 2026). Its central goals are the abstraction over logic types (Boolean, fuzzy, probabilistic), native integration within PyTorch, and support for rapid prototyping and benchmarking across the "neurosymbolic alphabet soup" (e.g., DeepProbLog, Logic Tensor Networks).
The system offers:
- A high-level language for specifying neurosymbolic models that interleave logic and neural predicates.
- Automatic compilation of this language into optimized arithmetic circuits compatible with dense and sparse GPU evaluation.
- A modular Python/PyTorch API permitting symbolic modules, constraints, and reasoning layers to function as ordinary
nn.Modulecomponents. - Backend independence to emulate a broad range of established NeSy paradigms, lowering barriers for machine learning practitioners to incorporate logical constraints and for symbolic AI researchers to build and compare hybrid integrations (Manhaeve et al., 11 May 2026).
2. Formal Language and Logic Abstraction
Algebraic Structures and Syntax
DeepLog operates at an intermediate level combining grounded first-order logic with neural annotation, parameterizing semantics using algebraic structures. An algebraic structure is a triple
where is the value set (e.g., ), unary operations, and binary operations. The logic type (Boolean, fuzzy, probabilistic) is specified by choosing .
A DeepLog formula over is constructed from algebraic atoms , unary and binary connectives, aggregations, and optional transformations between algebraic domains (Derkinderen et al., 19 Aug 2025).
Semantics and Inference
Interpretations map ground atoms to truth values. The semantics are determined by recursive labelling: atomic labels (neural or parameterized), connectives, aggregations ( over groundings or variable assignments), and structure-shifting transformations. By merely swapping , a single formula can instantiate as classical probabilistic logic, fuzzy logic (with user-supplied t-norms), or hybrids.
Example:
- Boolean: 0
- Probabilistic: 1
- Fuzzy: 2
This abstraction allows DeepLog to emulate systems such as DeepProbLog and Logic Tensor Networks by altering only algebraic structure and labelling (Derkinderen et al., 19 Aug 2025).
3. Compilation to Arithmetic Circuits and Architecture
System Pipeline
- Specification: The user defines a neurosymbolic model by combining logic (e.g., in Prolog, DIMACS, or Python) with neural predicates.
- Compilation: DeepLogModuleFactory parses the specification, compiles logic into an arithmetic circuit 3 via backends (KLay, SDD), and emits a composite DeepLogModule (Manhaeve et al., 11 May 2026).
- Circuit Evaluation: 4 is a DAG where internal nodes are sums or products, and leaves are neural outputs or symbolic constants. Full GPU-native evaluation is realized by expressing 5 in terms of PyTorch tensors and custom CUDA kernels.
- Runtime: Neural components yield scores, which propagate through the arithmetic circuit to yield symbolic-logic–aware outputs (Manhaeve et al., 11 May 2026).
Arithmetic Circuit Formal Definition
6
where 7 are weights (fixed or learnable), 8 are input features (neural predicate outputs or subcircuit values), and 9 index sum/product structure as defined by the compiled logic (Manhaeve et al., 11 May 2026).
Integration Modes
- Logic in the architecture: Compiles the logic directly into the computational graph, ensuring logical constraints are hard-enforced by construction. Typically yields strong inductive bias and is reflected in the executable PyTorch module.
- Logic as loss: Logic is applied as a semantic-logic penalty in the loss function, enabling softer enforcement but with weaker guarantees at inference (Derkinderen et al., 19 Aug 2025).
4. Modular API and System Emulation
Python/PyTorch API
DeepLog provides:
- SymTensor: extends
torch.Tensorto carry symbolic annotations. - DeepLogModule: subclass of
nn.Moduleimplementing.forward(SymTensor), executes neural and symbolic logic in-line. - DeepLogModuleFactory: orchestrates predicate definition, logical connectives (
and,or,not,exists,forall), and outputs the integrated DeepLogModule.
Modules for parsing (e.g., parse_dimacs_to_module, parse_prolog), node construction, and reshaping inputs are provided. Integration into the PyTorch workflow is seamless; symbolic constraints can be backpropagated through in the standard optimizer/training loop (Manhaeve et al., 11 May 2026).
System Emulation
By composing custom structures and predicates, DeepLog emulates existing NeSy architectures:
- DeepProbLog: probabilistic logic semantics, with neural predicates mapping inputs to distributions (e.g., CNN→softmax), simulated using appropriate connectives and Prolog-style clauses.
- Logic Tensor Networks: fuzzy semantics, t-norm connectives, with neural predicates as continuous-valued logic functions, existential aggregation, and fuzzy quantification implemented natively (Manhaeve et al., 11 May 2026).
5. Empirical Benchmarks and Optimization
Performance
Representative results on hybrid tasks include MNIST-Addition and Visual 4×4 Sudoku. Logic-in-architecture (especially with probabilistic or product t-norm semantics) yields near-perfect accuracy (0 on Sudoku) and dramatically outperforms logic-as-loss and pure neural baselines.
Inference Time
| Digits | DeepProbLog CPU | DeepLog CPU | DeepLog GPU |
|---|---|---|---|
| 1 | 1 s | 2 s | 3 s |
| 2 | 4 s | 5 s | 6 s |
| 3 | 7 s | 8 s | 9 s |
| 4 | – | 0 s | 1 s |
DeepLog achieves 10–100× speedups over CPU-based probabilistic logic frameworks when run on GPU (Manhaeve et al., 11 May 2026).
Optimization Strategies
- GPU-accelerated circuit execution (KLay backend).
- Circuit simplification (dead-node removal, subcircuit memoization).
- Exploiting PyTorch’s asynchronous execution for compute interleaving.
- Backend selection (SDD/decomposable DNNF/KLay) conditional on logic semantics.
Probabilistic and product t-norm semantics perform similarly on most tasks; certain t-norm choices (G\"odel/Łukasiewicz) may suffer from vanishing gradients (Derkinderen et al., 19 Aug 2025).
6. Extensibility, Limitations, and Future Work
DeepLog is designed for extensibility and declarative model design:
- New algebraic structures or logical paradigms can be instantiated by specifying operations and labelling functions, without altering underlying software.
- Planned extensions include deeper circuit-level rewriting, automated inference backend selection, dynamic circuit support (streaming logic), broader front-end language coverage (e.g., ASP, higher-order logic), and structure learning for discovering logical modules (Manhaeve et al., 11 May 2026).
Practical limitations include potential circuit growth for highly expressive logic, integration challenges with OOV (out-of-vocabulary) symbols in symbolic front-ends, and the need for backend-specific optimizations to maintain runtime efficiency.
This summary focuses on the neurosymbolic DeepLog line. For the LSTM-based anomaly detection DeepLog used in large-scale log analysis, see (Chen et al., 2021).
References
- (Manhaeve et al., 11 May 2026) DeepLog: A Software Framework for Modular Neurosymbolic AI
- (Derkinderen et al., 19 Aug 2025) The DeepLog Neurosymbolic Machine
- (Chen et al., 2021) Experience Report: Deep Learning-based System Log Analysis for Anomaly Detection