Papers
Topics
Authors
Recent
Search
2000 character limit reached

Finite Automata as Graphical Models

Updated 14 July 2026
  • Finite automata are abstract machines defined by a finite set of states and transitions that form the basis for structured graphical models.
  • They enable efficient inference and learning by organizing computations over token sequences and graph components with dynamic programming techniques.
  • Their applications span constrained decoding, graph-distributed processing, and diagrammatic semantics, showcasing versatility in computational modeling.

Finite automata as graphical models denotes a cluster of formalisms in which an automaton is treated not only as a language recognizer but also as a structured graph supporting inference, factorization, distributed computation, or compositional reasoning. In the cited literature, this viewpoint appears in several distinct forms: finite automata can induce a chain-structured graphical model over token sequences for exact constrained inference in diffusion LLMs, serve as context-specific graphical models for discrete longitudinal data, generalize from words to arbitrary labeled graphs or graph alphabets, and be reinterpreted as two-dimensional string diagrams with a complete equational theory for language equivalence (Dang et al., 8 Jul 2026, Edwards et al., 2013, Reiter, 2014, Piedeleu et al., 2020).

1. Core interpretations of the automaton graph

At the most elementary level, a deterministic finite automaton is a 5-tuple A=(Q,Σ,δ,q0,F)A=(Q,\Sigma,\delta,q_0,F), and a nondeterministic finite automaton has δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q. In graph-theoretic terms, states are nodes, transitions are directed edges labeled by symbols, the initial state is indicated by a distinct incoming arrow or an “initial” mark, and accepting states are drawn with double circles. A string is accepted if there exists a path in the labeled digraph from q0q_0 to any accepting state whose edge labels spell the string; for NFAs, ϵ\epsilon-edges may be taken without consuming input (May et al., 2024).

That path-centric interpretation is preserved but substantially generalized in later work. One line treats the automaton as a chain over hidden states and observed symbols, so that regular-language support becomes a tractable factor graph. Another line lifts finite automata from words and trees to arbitrary labeled graphs, where computation is distributed across vertices rather than along a single head position. A third line replaces the free monoid alphabet by a graph alphabet, so that words become paths and concatenation becomes partial rather than total. A fourth line reinterprets the state-transition picture itself as a two-dimensional syntax of string diagrams, with copying, merging, caps, cups, and action nodes as primitive graphical operations (Dang et al., 8 Jul 2026, Reiter, 2014, Bazille et al., 10 Feb 2026, Piedeleu et al., 2022).

Across these interpretations, the automaton remains finite-state, but the meaning of “graphical model” changes. In some settings it means a probabilistic graphical model in the narrow sense of sum–product inference over a factor graph; in others it means a graph-structured computational model on which finite-state updates are performed; in still others it means a compositional diagrammatic syntax. The shared feature is that automaton structure is used as an explicit graph on which semantic or algorithmic operations are carried out.

2. Probabilistic and statistical graphical models built from automata

The most direct probabilistic interpretation appears in constrained decoding for diffusion LLMs. Let A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F) be a finite automaton, possibly nondeterministic, and let a diffusion LM predict a fully-factorized mean-field distribution

q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).

The constrained posterior is

p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),

with partition function

Z=xΣT1[xL(A)]tqt(xt).Z=\sum_{x\in \Sigma^T}1[x\in L(A)]\cdot \prod_t q_t(x_t).

The key observation is that the indicator 1[xL(A)]1[x\in L(A)] is exactly the support of a chain-structured graphical model: the automaton induces an HMM-like chain over hidden states s0,,sTs_0,\dots,s_T and observed tokens δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q0, with transition factors encoding state–token–state compatibility via δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q1 and acceptance enforced by the final-state indicator δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q2. This yields exact dynamic programming for partition functions, token marginals, greedy decoding, and exact sampling, with sequential complexity δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q3, and a depth-reduced divide-and-conquer sampler with δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q4 work in δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q5 depth. The reported empirical effect is substantial: on BFCL-Live, greedy decoding accuracy for Dream-7B improves from δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q6 to δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q7, stochastic sampling accuracy improves from δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q8 to δ:Q×(Σ{ϵ})2Q\delta:Q\times(\Sigma\cup\{\epsilon\})\to 2^Q9, and the method incurs “under 5% wall-clock overhead” (Dang et al., 8 Jul 2026).

A different probabilistic use of finite automata appears in acyclic probabilistic finite automata for discrete longitudinal data. Here a probabilistic finite automaton is a directed multigraph with edge probabilities, and an APFA imposes a level structure so that all root-to-sink paths have the same length q0q_00. The model represents a q0q_01-dimensional discrete random vector q0q_02, and the joint probability of a sequence q0q_03 factorizes pathwise as

q0q_04

where q0q_05 is the unique path corresponding to the sequence. The crucial graphical-model content is context-specific conditional independence: if the process is at state q0q_06 on level q0q_07, then q0q_08, equivalently q0q_09. Model selection is based on product-multinomial likelihoods, likelihood-ratio tests built from standard contingency tables, and penalized criteria

ϵ\epsilon0

with ϵ\epsilon1 for AIC and ϵ\epsilon2 for BIC. Under “property Q,” an APFA is equivalent to a DAG or an undirected graphical model; without property Q, the APFA expresses genuinely context-specific structure beyond a single global DAG or undirected graph (Edwards et al., 2013).

These two constructions share a common mechanism: the automaton state functions as a compact sufficient context. In diffusion-LM decoding, it gates the support of a posterior distribution. In APFA, it encodes which past histories are statistically equivalent for predicting the future. In both cases, graphical-model tractability comes from finite-state structure and the linear-chain topology induced by the automaton.

3. Automata distributed over graphs and over graph alphabets

A second major research direction generalizes automata from strings to arbitrary graphs. Distributed graph automata are defined over finite directed ϵ\epsilon3-graphs with node labels in ϵ\epsilon4. An alternating distributed graph automaton has the form ϵ\epsilon5, where ϵ\epsilon6. Each node updates synchronously from its current state and the sets of states observed among its incoming neighbors, grouped by edge label. Existential and universal levels induce branching, permanent states are sinks, and acceptance is a global predicate on the set of permanent states reached in every branch. The central expressiveness theorem is exact: alternating distributed graph automata recognize precisely the graph languages definable in monadic second-order logic. The hierarchy is strict,

ϵ\epsilon7

ADGAs are effectively closed under complement, union, intersection, and projection, and emptiness is undecidable for ADGAs but decidable for NDGAs and DDGAs (Reiter, 2014, Reiter, 2014).

Another generalization changes the alphabet rather than the input carrier. In automata on graph alphabets, the alphabet itself is a directed graph ϵ\epsilon8, words are finite paths ϵ\epsilon9 with A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)0, and concatenation is defined only when endpoints match. Languages are subsets of the free category A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)1, not subsets of a free monoid. This setting admits a Kleene theorem, A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)2, and a Myhill–Nerode theorem stating that a language is regular iff it has finite prefix or suffix quotient. Determinization and minimization exist, but “regular languages are not stable by complementation” on infinite graph alphabets, whereas complementation can be recovered for complete deterministic automata on finite graphs (Bazille et al., 10 Feb 2026).

A third graph-oriented construction arises in the hyperedge-replacement setting. Finite automata over typed graph symbols process graphs by consuming atoms and blanks at front and rear interfaces. Determinization requires a modified powerset construction that tracks blank closure and rear-interface ambiguity. Efficient recognition without backtracking is obtained under two sufficient conditions, the Transition Selection property and the Free Edge Choice property; when these hold, graph membership can be decided in linear time in the size of the input graph (Drewes et al., 2024).

These models move the automaton away from a single linear input tape. In DGAs, finite-state control is spatially distributed over vertices. In graph alphabets, the input language itself has typed path structure. In finite graph automata for hyperedge-replacement interpretations, recognition is performed by local consumption of typed graph atoms. The result is a family of graph-native automata theories rather than a mere encoding of graphs as strings.

4. Learning, optimization, and exact inference with automata-based structures

Finite automata also appear as trainable or compilable computational layers inside larger inference systems. The Graph Finite-State Automaton layer defines relations between graph nodes by paths accepted by a finite-state controller operating on a graph-based POMDP. The controller maintains memory A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)3, acts through a soft policy A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)4, and induces an absorbing Markov chain over product states. The exact absorbing probabilities are

A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)5

and the GFSA layer outputs a weighted adjacency

A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)6

This construction allows end-to-end learning by implicit differentiation. Reported results include grid-world layouts in which average steps on held-out layouts drop from A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)7 to A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)8, near-perfect F1 on several static-analysis edge-prediction tasks on Python programs, and improved performance on the variable misuse task relative to hand-engineered semantic edges and several learned-edge baselines (Johnson et al., 2020).

A different learning result connects closed signal flow graphs and weighted finite automata on a singleton alphabet. Rational streams are represented by weighted stream automata with companion-like transition structure, and the Hankel rank of the target stream determines the minimal number of states or registers. The learning algorithm uses membership queries A=(S,Σ,δ,s0,F)A=(S,\Sigma,\delta,s_0,F)9, equivalence queries q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).0, a closedness test on an observation table, and reconstruction of a weighted stream automaton and corresponding cSFG. The stated complexity is q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).1, with an optional improvement to q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).2, and the paper emphasizes that this improves over several q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).3-dependent baselines for learning weighted automata restricted to q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).4 (Piotrovskaya et al., 2024).

For exact probabilistic inference in programs, weighted automata are used as probability generating automata. In matrix form, a weighted automaton is q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).5 over an q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).6-continuous semiring, with semantics

q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).7

Program constructs are mapped to automata operations: disjoint union gives PGF addition, concatenation gives PGF multiplication, and product with an evidence automaton yields conditioning. The forward equation q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).8 provides exact dynamic programming for the recognized series, and loops allow exact representation of infinite-support distributions such as geometric laws (Geißler et al., 15 Dec 2025).

In exact combinatorial inference, deterministic acyclic finite-state automata can represent local factor values inside Bucket Elimination. FABE stores a function q(x)=t=1Tqt(xt).q(x)=\prod_{t=1}^{T} q_t(x_t).9 as a set of value-labeled DAFSAs p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),0, aligns variable orders with AddLevels, combines factors by automata intersection and semiring arithmetic on the associated values, and projects variables by RemoveLevel followed by determinization, subtraction, and minimization. On most probable explanation and weighted constraint satisfaction benchmarks, FABE “often outperforms the state of the art,” with “up to 5 orders of magnitude” runtime improvement on some WCSP instances (Bistaffa, 2021).

5. Compositional and diagrammatic formulations

Another influential interpretation treats automata themselves as diagrams. In the string-diagrammatic approach, the usual state-transition picture is reinterpreted as a two-dimensional syntax in a symmetric monoidal category. Black generators encode copy, merge, delete, and generate operations on language wires; caps and cups provide compact closed structure; letter-labeled action boxes represent transitions; and automata become traced matrix-diagrams. The main theorem gives a complete equational theory for language equivalence in the automata fragment, and one of its two notable features is that “the Kleene star is a derived concept” rather than a primitive operation. The same line of work states that a “finite axiomatisation” is possible in the two-dimensional setting although it is “provably impossible to obtain for the one-dimensional syntax of regular expressions” (Piedeleu et al., 2022, Piedeleu et al., 2020).

Mixed Automata push compositionality in a probabilistic direction. A Mixed System is p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),1, where p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),2 is a discrete probability space, p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),3 is a finite set of variables, and p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),4 is a relation. Sampling is two-stage: first sample p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),5 according to a conditioned probability, then nondeterministically select a compatible valuation p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),6. Parallel composition of Mixed Systems induces a factor graph, tree-structured factor graphs support message passing, and Mixed Automata p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),7 take transitions into Mixed Systems rather than directly into states. This framework subsumes nondeterministic automata, Segala’s probabilistic automata, Markov decision processes, hidden Markov models, and factor-graph or Bayesian-network specifications, while preserving simulation and enabling message-passing algorithms inherited from graphical probabilistic models (Benveniste et al., 2022).

These diagrammatic and mixed constructions shift attention from language recognition to compositional semantics. The automaton becomes a reusable algebraic block: a diagram that can be copied, composed, traced, dualized, or embedded into a larger probabilistic structure.

6. Boundaries, misconceptions, and recurring themes

The literature places sharp boundaries on what finite automata can express efficiently. In constrained decoding for diffusion LLMs, tractability depends on regular-language constraints and on the mean-field form p(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),8; richer constraints such as context-free grammars require different dynamic programs and generally lose the linear-chain complexity of automata-based inference (Dang et al., 8 Jul 2026). In distributed graph automata, alternation raises expressive power to full MSO over finite graphs, but emptiness becomes undecidable; restricting to nondeterministic or deterministic variants regains decidability at the cost of expressiveness (Reiter, 2014). In automata on graph alphabets, determinization and minimization survive, but complement closure fails on infinite graph alphabets (Bazille et al., 10 Feb 2026).

The phrase “graphical model” is therefore not uniform across this body of work. In APFA and Mixed Automata it refers directly to probabilistic or factor-graph semantics. In the diffusion-LM setting it refers to a chain-structured factor graph obtained by multiplying an automaton support indicator with local token probabilities. In DGAs and graph alphabets it refers instead to graph-structured computation or graph-structured alphabets. A plausible implication is that the phrase should be read relationally: the automaton is graphical because its state space, transitions, or compositions are treated as an explicit graph on which one performs inference, logic, or learning, not because every construction is a probabilistic graphical model in the narrow statistical sense.

The representational boundary can also be moved by changing the encoding. Under the classical convolution-and-acceptance model for geometric figures, “the only continuously differentiable (Cp(xA)1[xL(A)]t=1Tqt(xt),p(x\mid A)\propto 1[x\in L(A)]\cdot \prod_{t=1}^{T} q_t(x_t),9) functions whose graphs are encodable are linear.” A different encoding based on hierarchical tensor-product B-splines instead represents a function through FA-recognizable relations between basis-function barycentres and coefficients, which enables the encoding of “piecewise polynomial functions with arbitrary degrees of smoothness” and supports unbounded domains through regular hierarchical meshes (Berdinsky et al., 2021).

Taken together, these results show that finite automata act as compact graphical devices for support restriction, context partitioning, typed path composition, distributed local computation, algebraic normalization, and exact inference. Their continuing relevance comes from the same source in each case: finite-state structure is restrictive enough to admit exact algorithms, yet flexible enough to organize nontrivial graphical semantics across probability, logic, learning, and symbolic computation.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Finite Automata as Graphical Models.