DiffTernLGN
Polynomial surrogate training for differentiable ternary logic gate networks in JAX and Equinox
A JAX/Equinox framework for training networks of learnable ternary logic gates using continuous polynomial surrogates. Each neuron is a degree-(2,2) polynomial in two inputs that is discretized at inference time to one of 19,683 possible 2-input ternary gates.
Standard differentiable logic gate networks learn a softmax distribution over a curated set of gates. PST-DTLGN instead parameterizes each neuron as a 9-coefficient polynomial that naturally spans the full space of ternary gates. A ternary commitment regularizer progressively drives the continuous polynomial toward a discrete gate during training; no gate vocabulary restriction is needed. Training uses continuous polynomial neurons and gradient-based optimization via JAX autodiff; inference is a discretized ternary truth-table lookup, integer indexing with no arithmetic.
The target application is learning Signal Temporal Logic (STL) specifications from trajectory data. The core library is application-agnostic.
- Code: sdamera95/DiffTernLGN
- Paper: International Conference on Neuro-symbolic Systems (NeuS) 2026, arXiv:2603.00302