Tensorized Finite Automata
- Tensorized finite automata are models that embed discrete state machines into linear, multilinear, or tensor frameworks where states become basis vectors and transitions are represented by matrices or tensors.
- They generalize DFAs, NFAs, and WFAs by replacing discrete transition rules with linear operators, enabling efficient computation via tensor contractions and Fourier-based block diagonalization.
- This framework underpins exact neural simulations and spectral learning through low-rank Hankel tensor decompositions and modular Transformer architectures.
Tensorized finite automata are formulations in which finite-state computation is embedded into linear, multilinear, or tensorial structure: states are represented by basis vectors or more general module elements, transitions by symbol-indexed matrices or higher-order tensors, and word processing by operator composition or tensor contraction. In the canonical linearization, a finite automaton with state set is realized on a vector space with basis , so that each input symbol induces a linear operator and acceptance is recovered by a terminal readout vector. Across the literature, this perspective extends to weighted finite automata, tensor-train realizations of Hankel objects, semidirect-product and Fourier-module decompositions, TQFT functors, braid-group representations, and exact neural simulations by feedforward or Transformer architectures (Zhang, 29 Apr 2025, Li et al., 2020, Gustafson et al., 2023).
1. Canonical tensorization of finite automata
For deterministic finite automata, nondeterministic finite automata, and weighted finite automata, tensorization replaces a discrete transition rule by linear action on a finite-dimensional state space. A DFA is embedded into a vector space or with basis . For each symbol , one defines a linear operator by , sets , and uses the readout vector 0. The run on 1 is then
2
This identifies a DFA with a linear finite-state machine. In a WFA, the same pattern becomes
3
with 4 and symbol matrices 5 (Zhang, 29 Apr 2025, Li et al., 2020).
The same computation can be written as contraction of a third-order transition tensor. For a DFA, one may form 6 with
7
so that processing a word is a chain of tensor contractions equivalent to multiplying transition matrices. In the WFA setting, stacking the matrices 8 into a transition tensor produces a tensor-network description in which each symbol fixes one slice, and the contraction of the resulting one-dimensional chain yields the scalar output. This is the basic sense in which automata become “tensorized”: the transition structure is not merely encoded numerically, but reorganized as a compositional multilinear object (Zhang, 29 Apr 2025, Li et al., 2020).
Tensorization also clarifies the relation between deterministic, nondeterministic, and weighted semantics. In the deterministic case, the state vector remains a basis vector. In the nondeterministic case, active-state sets can be encoded by binary vectors and propagated by linear maps followed by thresholding. In the weighted case, the same operator chain computes a rational or real-valued series. A plausible implication is that many apparently distinct automaton models differ less by their state-update architecture than by the semiring, module, or thresholding rule imposed on an otherwise similar tensorized core.
2. Syntactic monoids, semidirect products, and Fourier modules
A central algebraic refinement of tensorized finite automata proceeds through the syntactic monoid. For a language 9, the syntactic congruence induces the syntactic monoid 0, and recognizing 1 amounts to a morphism 2 together with a distinguished subset 3. In tensorized form, the monoid acts linearly through a representation 4, and one may study 5 as a module over 6. This reframes automaton structure as representation theory of the transition monoid rather than only as graph dynamics (Zhang, 29 Apr 2025).
The semidirect-product setting makes this especially explicit. Under the structural hypothesis 7, with 8 a finite additive monoid and 9 a finite group acting linearly on 0, multiplication takes the form
1
In bases aligned with this decomposition, automaton transitions can be implemented as block operators that separate “memory” and “control.” For abelian 2, the discrete Fourier transform diagonalizes additive translations; the 3-action becomes a permutation of frequency coordinates. Concretely, in modular affine systems over 4, maps 5 become 6 in the Fourier basis, with 7 diagonal and 8 a permutation matrix on frequencies (Zhang, 29 Apr 2025).
This block structure yields both structural and algorithmic consequences. Dense 9 transitions may reduce to diagonal or permutation-diagonal form, turning 0 multiplies per step into 1 or even 2 per block when characters are one-dimensional. The paper explicitly connects this to shallow Transformer implementations: Fourier blocks align naturally with attention heads, and semidirect composition admits a parallel prefix computation. The resulting viewpoint does not claim that every automaton admits such a decomposition; rather, it identifies a class of transition monoids for which tensorization exposes latent parallelism and exact shallow realizations (Zhang, 29 Apr 2025).
A common misconception is that tensorization here merely means replacing symbolic states by dense continuous embeddings. In this line of work, the significant step is instead basis selection: by choosing a basis adapted to monoid structure, especially a Fourier basis on abelian memory, one obtains invariant subspaces and sparse block forms that can change computational depth without changing language semantics. The limitation is equally explicit: for arbitrary finite monoids, 3 need not be semisimple, so complete block diagonalization may fail (Zhang, 29 Apr 2025).
3. Tensor networks, Hankel structure, and spectral learning
A second major strand identifies tensorized finite automata with tensor networks, especially tensor trains or matrix product states. For a WFA with parameters 4, the order-5 Hankel tensor
6
admits a TT decomposition of rank at most 7, where 8 is the number of WFA states. Explicit TT cores are obtained directly from WFA parameters:
9
The contraction of these cores reproduces the WFA value exactly, so the TT structure is an identity for recognizable functions rather than an approximation heuristic (Li et al., 2020).
This tensor-network viewpoint is tightly coupled to classical Hankel theory. If 0 is the Hankel matrix of a recognizable series, then for a minimal WFA with 1 states one has 2, and 3 with
4
The TT perspective refines this by showing that finite Hankel blocks are matricizations of low-TT-rank tensors. Consequently, the expensive matrix operations of spectral learning can be carried out in TT form without materializing exponentially large Hankel blocks (Li et al., 2020).
The computational payoff is explicit. In the TT formulation, pseudoinverses and matrix products required by spectral learning can be performed with cost
5
whereas the classical matrix pipeline scales as
6
The paper further proves that, under exact Hankel information and a complete basis, the TT spectral algorithm reconstructs the minimal WFA exactly. It also provides an almost-sure completeness statement for length-7 bases when 8, together with a blank-symbol workaround when fixed-length bases are not complete (Li et al., 2020).
The same article establishes a size-preserving expressive equivalence between WFAs and linear second-order RNNs on one-hot inputs. A WFA transition tensor becomes the recurrent bilinear core 9 of a linear 2-RNN, and conversely any such linear 2-RNN induces a WFA. This places tensorized automata, tensor trains, and bilinear recurrent models inside a single algebraic framework. The continuous-input extension goes further by recovering minimal linear 2-RNNs from finite Hankel tensors via least-squares estimation and TT-based recovery methods such as TIHT, TT-ALS, and TT-SGD, with noiseless exact recovery under stated rank and sampling conditions (Li et al., 2020).
4. Exact neural realizations
Tensorized automata have also been used as compilation targets for exact neural architectures. In one line of work, an 0-NFA is encoded by binary active-state vectors 1, symbol-conditioned matrices 2, and an 3-transition matrix 4. Nondeterministic branching is computed by 5 followed by exact Booleanization
6
and 7-closure is implemented as
8
The resulting feedforward ReLU simulator has three macro-layers, width 9, and depth linear in input length, while remaining strictly feedforward and exact rather than recurrent or approximate (Dhayalkar, 30 May 2025).
For DFAs, an explicit feedforward construction uses one-hot state embeddings and one-hot symbol embeddings. Transition blocks are implemented by two-layer ReLU modules whose hidden units correspond to state-symbol pairs and realize exact “AND” gates on the concatenated input. The paper also gives a compressed threshold-network variant with state codes of dimension 0, together with a Myhill–Nerode class embedding preserving state distinctness in 1 dimensions. At the same time, it states the expressivity boundary: fixed-depth, fixed-width feedforward networks cannot recognize non-regular languages such as 2 for unbounded input lengths (Dhayalkar, 16 May 2025).
A different neural route uses logic-gated time-shared feedforward networks to simulate alternating finite automata. Here the transition structure is carried by symbol-indexed binary matrices 3, while alternation is encoded by state-dependent biases 4 that implement existential 5 or universal 6 aggregation through thresholding. The forward pass
7
exactly simulates AFA reachability, including instantaneous 8-closures via monotone fixed-point iteration. Because width equals 9, the architecture inherits the exponential succinctness of AFAs relative to NFAs for suitable language families (Dhayalkar, 20 Mar 2026).
The Transformer-based constructions are algebraically different again. For modular affine automata over 0, the Fourier basis turns each symbol action into a fixed map 1, so a constant-depth Transformer of width 2 and fixed attention structure exactly simulates the automaton on arbitrary sequence length 3. For general semidirect-product automata 4, associativity permits a Blelloch-style parallel scan, yielding a Transformer with depth 5, embedding dimension 6, attention-head width 7, and MLP width 8 (Zhang, 29 Apr 2025).
Taken together, these constructions show that “tensorized” does not pick out a single neural architecture. It denotes a compilation strategy in which automaton transitions are first expressed as structured linear operators—often sparse, blockwise, or frequency-diagonal—and only then assigned to ReLU blocks, threshold circuits, logic-gated recurrences, or attention/MLP components.
5. Categorical, braid-theoretic, and linear-storage extensions
The tensorized viewpoint has also been developed outside standard matrix-chain formulations. One categorical version packages an NFA for a regular language 9 as a one-dimensional oriented TQFT with defects. The target is the category of 0-semimodules, the state space of a positively oriented point is the free 1-module 2 on the automaton state set, and each letter 3 acts by a Boolean linear operator 4. Word acceptance becomes the tensor contraction
5
while decorated circles evaluate to the Boolean trace 6. Different NFAs for the same interval language can therefore agree on decorated intervals yet differ on decorated circles, leading to a distinct “circular language” invariant (Gustafson et al., 2023).
Another extension uses braid-group representations. In that setting, the state space is a tensor power 7, and the braid generators act locally as
8
When 9 is the Hecke or quantum-group 00-operator, local moves can send basis states to linear combinations, producing a nondeterministic or superposition-like finite automaton. For rack or quandle solutions, the transition is combinatorial and deterministic. The paper further studies the 01-invariant operator 02, whose eigenstates organize canonical bases of irreducible modules appearing in 03 (Doikou, 13 Nov 2025).
Linear-storage automata provide yet another family. Real-time vector automata maintain a rational row vector and multiply it at each step by a rational matrix, with acceptance determined by state and an equality test on one vector entry. Homing vector automata instead accept when the vector returns to its initial value, either with or without mid-run tests. These models are explicitly described as linear or tensorized views of finite automata, and their product constructions can be expressed by block-diagonal matrices on concatenated vectors or by Kronecker products on tensor products of state spaces (Salehi et al., 2013, Salehi, 2019).
A more geometric use of tensorization appears in automata encodings of piecewise polynomial functions. Rather than encoding graph points by digitwise convolution—an approach under which only linear continuously differentiable functions are finite-automaton encodable—the spline framework encodes pairs consisting of coefficients and hierarchical tensor-product B-splines. Regular languages describe hierarchical meshes, basis selection, and coefficient relations on 04, yielding a finite-automaton representation of regular splines with arbitrary smoothness level determined by the spline degree (Berdinsky et al., 2021).
These examples broaden the term beyond operator chains on 05. Tensorization may mean a symmetric monoidal functor, a braid-local action on 06, a linear register with homing semantics, or an automaton presentation of tensor-product spline bases. What remains common is the replacement of purely combinatorial transition graphs by compositional algebraic objects whose combination law mirrors word concatenation or geometric composition.
6. Scope, misconceptions, and open problems
The literature does not use “tensorized finite automata” for a single canonical model. Instead, it names a family of closely related constructions in which automata are embedded into linear, multilinear, or tensorial frameworks. A common misconception is that tensorization is intrinsically approximate or quantum-mechanical. In fact, several central constructions are exact: TT representations of WFAs recover the recognized function identically, ReLU and threshold networks realize NFA and DFA transitions without approximation, the Transformer constructions in the modular affine and semidirect settings are proved exact, and the TQFT packaging of NFAs is an algebraic reformulation over the Boolean semiring (Li et al., 2020, Zhang, 29 Apr 2025, Gustafson et al., 2023).
The main limitations are structural rather than conceptual. The constant-depth Transformer theorem presently covers modular affine automata over 07; beyond that family, the paper states that extending constant depth beyond groups or affine families remains open. For arbitrary finite monoids, failure of semisimplicity in 08 can obstruct complete Fourier-like block diagonalization. In the TT and spectral-learning line, guarantees rely on linear activations and exact or well-estimated Hankel objects, and extending the theory to nonlinear RNNs remains open (Zhang, 29 Apr 2025, Li et al., 2020).
Other open questions are model-specific. In the TQFT formulation, the classification of all circular languages arising from automata recognizing a fixed regular language is posed as an open problem. In the AFA simulation framework, 09-closure can become the main computational bottleneck for dense 10-graphs, and formal sample-complexity bounds for topology and gate recovery remain open. In the braid-theoretic setting, the state-space dimension grows as 11, and the papers themselves note that acceptance semantics there are closer to quantum or probabilistic superposition than to ordinary language recognition (Gustafson et al., 2023, Dhayalkar, 20 Mar 2026, Doikou, 13 Nov 2025).
A final theme is learnability. Several papers give constructive exact simulations, but they separate representation from optimization. One paper explicitly remarks that understanding when SGD discovers Fourier or semidirect solutions is a distinct learning-theoretic question, while the TT line studies statistically grounded recovery only for linear 2-RNNs and low-rank Hankel structure. This suggests that tensorized finite automata currently function more as a structural language for analyzing automata, representations, and exact neural compilations than as a settled theory of how such structures are routinely learned from data (Zhang, 29 Apr 2025, Li et al., 2020).