Papers
Topics
Authors
Recent
Search
2000 character limit reached

Rational Stochastic Languages

Updated 7 July 2026
  • Rational stochastic languages are finite-state quantitative models that compute nonnegative word probabilities via weighted automata and CRAs.
  • They leverage spectral normalization to ensure convergence and decide stochasticity using polynomial-time matrix methods.
  • Their algebraic characterization with convex combinations and discounted Kleene star facilitates approximation, asymptotic analysis, and identity testing.

Rational stochastic languages are probability distributions on words that are realized by finite-state quantitative devices with nonnegative weights. In the formulation developed in "Stochastic Languages at Sub-stochastic Cost" (Agarwal et al., 22 Oct 2025), they are exactly the stochastic quantitative languages f:Σ∗→R≥0f:\Sigma^*\to \mathbb R_{\ge 0} computed by weighted finite automata, equivalently by linear cost-register automata (CRAs), and they admit both a spectral normalization theory and an algebraic Kleene–Schützenberger characterization. The topic sits at the intersection of weighted automata, probabilistic automata, formal power series, and distributional analysis on infinite discrete domains, with later work connecting the class to limit laws for random word generation and to identity testing over string distributions (Goldwurm et al., 2021, Agarwal et al., 5 Aug 2025).

1. Formal definition and equivalent presentations

A quantitative language over an alphabet Σ\Sigma is any function f:Σ∗→Rf:\Sigma^*\to\mathbb R. Its total mass is

mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),

when the sum converges. Such an ff is stochastic if f(w)≥0f(w)\ge 0 for all ww and mass(f)=1\mathrm{mass}(f)=1 (Agarwal et al., 22 Oct 2025).

A real-weighted finite automaton is a tuple

W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)

with initial vector λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}, nonnegative transition matrices Σ\Sigma0, and final vector Σ\Sigma1. Its semantics is the series

Σ\Sigma2

The class of rational stochastic languages is

Σ\Sigma3

The same class is captured by linear CRAs over Σ\Sigma4. In that presentation, a transition Σ\Sigma5 updates the register vector Σ\Sigma6 by a nonnegative linear map Σ\Sigma7. The fully linear fragment is equivalent to weighted automata: every linear CRA can be flattened into an equivalent weighted automaton with state space Σ\Sigma8, and conversely every weighted automaton arises as a linear CRA (Agarwal et al., 22 Oct 2025).

A related convention appears in "Identity Testing for Stochastic Languages" (Agarwal et al., 5 Aug 2025), which writes Σ\Sigma9 for stochastic languages over f:Σ∗→Rf:\Sigma^*\to\mathbb R0, i.e. nonempty strings. This is a notational difference in presentation rather than a distinct automata-theoretic mechanism.

2. Spectral normalization and the stochasticity problem

The central technical question is when a deterministic quantitative model actually defines a probability distribution. For weighted automata and CRAs this is the stochasticity problem. The general CRA setting is undecidable, but the fully linear fragment admits a complete and tractable theory (Agarwal et al., 22 Oct 2025).

For a weighted automaton with transition matrices f:Σ∗→Rf:\Sigma^*\to\mathbb R1, define

f:Σ∗→Rf:\Sigma^*\to\mathbb R2

Then

f:Σ∗→Rf:\Sigma^*\to\mathbb R3

and the total mass is the Neumann series

f:Σ∗→Rf:\Sigma^*\to\mathbb R4

where f:Σ∗→Rf:\Sigma^*\to\mathbb R5 is the spectral radius. By Perron–Frobenius one computes f:Σ∗→Rf:\Sigma^*\to\mathbb R6 in f:Σ∗→Rf:\Sigma^*\to\mathbb R7, checks f:Σ∗→Rf:\Sigma^*\to\mathbb R8, and if so inverts f:Σ∗→Rf:\Sigma^*\to\mathbb R9 in mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),0. Consequently, for linear CRAs, equivalently weighted automata over mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),1 with affine output, one can decide in polynomial time whether the total mass converges and compute it as mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),2 (Agarwal et al., 22 Oct 2025).

This result separates two levels of difficulty. Global stochasticity is undecidable for CRAs in general, but becomes polynomial-time decidable in the linear setting. A plausible implication is that linearity is not merely a technical convenience; it is the boundary at which the semantic normalization problem becomes algebraically analyzable by matrix methods.

A later formulation in (Agarwal et al., 5 Aug 2025) expresses the same verification problem as a linear system. If mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),3 denotes the total continuation mass from state mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),4, then

mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),5

and Gaussian elimination yields an mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),6 validity test for nonnegative weighted automata.

3. Algebraic characterization of the class

The algebraic core of the theory is a Kleene–Schützenberger theorem specialized to normalized nonnegative series. The class of rational stochastic languages is the smallest class of quantitative languages mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),7 that contains all Dirac distributions mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),8 for mass(f)  =  ∑w∈Σ∗f(w),\mathrm{mass}(f)\;=\;\sum_{w\in \Sigma^*} f(w),9 and is closed under convex combinations, Cauchy product, and discounted Kleene star (Agarwal et al., 22 Oct 2025).

The operators are given explicitly. For ff0 and ff1,

ff2

For the Cauchy product,

ff3

For ff4, the discounted Kleene star is

ff5

These operations preserve nonnegativity and total mass ff6. Convex combination preserves normalization by direct summation. The Cauchy product preserves normalization because

ff7

For the discounted star, the geometric law on the number of factors yields total mass ff8 (Agarwal et al., 22 Oct 2025).

The proof of the characterization has two directions. In the automata-to-algebra direction, one first normalizes any stochastic weighted automaton to be locally sub-stochastic and then applies a state-elimination construction. Eliminating a state ff9 with total outgoing weight f(w)≥0f(w)\ge 00 produces a star operator with discount f(w)≥0f(w)\ge 01, while finite path concatenations become Cauchy products. In the algebra-to-automata direction, every stochastic regular expression built from Dirac distributions, convex combination, product, and discounted star yields a locally stochastic weighted automaton whose semantics is the desired distribution (Agarwal et al., 22 Oct 2025).

This characterization sharpens a classical fact from weighted automata theory. "On the Theory of Stochastic Automata" states that a series f(w)≥0f(w)\ge 02 is rational over f(w)≥0f(w)\ge 03 if and only if there exists a finite stochastic automaton f(w)≥0f(w)\ge 04 such that f(w)≥0f(w)\ge 05, with rational series closed under finite sums, Cauchy product, and star (Cakir et al., 2021). The normalized stochastic-language version replaces arbitrary finite sums by convex combinations and ordinary star by discounted Kleene star so that total mass remains f(w)≥0f(w)\ge 06.

4. Local sub-stochasticity and stochastic regular expressions

A weighted automaton is locally sub-stochastic if for every state f(w)≥0f(w)\ge 07,

f(w)≥0f(w)\ge 08

This is a local, per-state condition, in contrast to the global condition f(w)≥0f(w)\ge 09. One of the principal results of (Agarwal et al., 22 Oct 2025) is that whenever the global matrix ww0 satisfies ww1, there exists a positive diagonal matrix ww2 such that ww3 has each row sum ww4. Conjugating each ww5, as well as the initial and final vectors, yields an equivalent automaton whose transitions are locally sub-stochastic.

In the CRA view, this becomes a syntactic criterion: ww6 The significance is twofold. First, it provides a local characterization of a global semantic property. Second, it is the normalization step that supports the state-elimination proof of the Kleene–Schützenberger theorem (Agarwal et al., 22 Oct 2025).

The same paper introduces stochastic regular expressions (SREs) as a complete grammar for rational stochastic languages: ww7 where ww8 and ww9. Their semantics is defined by the closure equations above, and every SRE denotes a stochastic language. Conversely, every rational stochastic language arises from an SRE (Agarwal et al., 22 Oct 2025).

A worked example in (Agarwal et al., 22 Oct 2025) starts from a two-state linear CRA over mass(f)=1\mathrm{mass}(f)=10. Its equivalent weighted automaton satisfies

mass(f)=1\mathrm{mass}(f)=11

After Perron–Frobenius normalization to a sub-stochastic automaton, state elimination yields the SRE

mass(f)=1\mathrm{mass}(f)=12

whose semantics coincides with the original CRA.

5. Relation to stochastic automata and structural theory

Rational stochastic languages are closely related to the older theory of stochastic automata. In that setting, a discrete-time stochastic automaton is a 5-tuple

mass(f)=1\mathrm{mass}(f)=13

with transition probabilities mass(f)=1\mathrm{mass}(f)=14, initial distribution mass(f)=1\mathrm{mass}(f)=15, and accepting probabilities mass(f)=1\mathrm{mass}(f)=16. For each mass(f)=1\mathrm{mass}(f)=17, one defines a matrix mass(f)=1\mathrm{mass}(f)=18 by mass(f)=1\mathrm{mass}(f)=19, and for a word W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)0,

W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)1

The recognized stochastic series is

W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)2

yielding a function W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)3 (Cakir et al., 2021).

The classical equivalence theorem states that a series W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)4 is rational over W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)5 if and only if there exists a finite stochastic automaton W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)6 such that W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)7 (Cakir et al., 2021). This theorem is attributed there to Schützenberger, Rabin, and Fliess. It situates rational stochastic languages within the broader landscape of rational series and stochastic finite-state devices.

The same source develops structural notions that parallel classical automata theory. Equivalence of underlying series is decidable in polynomial time. For cut-point languages

W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)8

emptiness with general rational W=(Σ,Q,λ,{Mσ}σ∈Σ,μ)\mathcal{W}=(\Sigma,Q,\lambda,\{M_\sigma\}_{\sigma\in\Sigma},\mu)9 is PSPACE-complete in the size of λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}0 and the bit-length of λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}1, while Rabin’s theorem implies that if λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}2 is isolated then λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}3 is regular (Cakir et al., 2021).

Canonical forms are likewise available. Reduction merges states with identical result vectors; minimization removes states that are convex combinations of others; strong reduction yields a unique minimal linear representation of dimension equal to the Hankel rank; and observability or determinism may be enforced, though determinization can incur exponential blow-up (Cakir et al., 2021). These results concern the broader stochastic-automata framework rather than normalized distributions specifically, but they provide the ambient representation theory in which rational stochastic languages are naturally embedded.

6. Statistical behavior, approximation, and testing

Once a rational stochastic language is used as a model for random word generation, one can study statistics conditioned on word length. For a rational series λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}4 with linear representation λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}5, (Goldwurm et al., 2021) defines a probability measure on λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}6 by

λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}7

and studies the random variable λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}8. Writing

λ∈R≥0Q\lambda\in\mathbb R^Q_{\ge 0}9

one obtains exact mean and variance from derivatives at Σ\Sigma00. If Σ\Sigma01 is primitive and an aperiodicity condition holds, then

Σ\Sigma02

and there is a Gaussian local limit with uniform Σ\Sigma03 error (Goldwurm et al., 2021).

In bicomponent models, the limiting law depends on spectral and perturbative parameters of the two primitive blocks. The regimes reported in (Goldwurm et al., 2021) are as follows.

Model regime Local limit law
Single primitive, aperiodic Gaussian Σ\Sigma04 with Σ\Sigma05 error
Communicating bicomponent, Σ\Sigma06 Gaussian driven by component Σ\Sigma07
Communicating bicomponent, Σ\Sigma08, Σ\Sigma09 Uniform law on Σ\Sigma10
Communicating bicomponent, Σ\Sigma11, Σ\Sigma12 Mixture over a variance interval
Sum bicomponent, Σ\Sigma13 Convex combination of two Gaussians

A detailed example in the communicating equipotent case uses Σ\Sigma14 and yields Σ\Sigma15, Σ\Sigma16, Σ\Sigma17, so Σ\Sigma18 converges locally to the uniform density on Σ\Sigma19 with rate Σ\Sigma20 (Goldwurm et al., 2021).

Algorithmic developments extend beyond representation and asymptotics. "Identity Testing for Stochastic Languages" proves that a nonnegative weighted automaton can be checked in polynomial time for being a stochastic language, shows that convex mixtures of geometric distributions are dense in Σ\Sigma21 under Σ\Sigma22, and develops a truncation-based identity tester for a known rational reference distribution against an unknown distribution (Agarwal et al., 5 Aug 2025). The geometric subclass is defined by

Σ\Sigma23

and for every stochastic language Σ\Sigma24 and Σ\Sigma25, there exist geometric distributions Σ\Sigma26 and convex weights Σ\Sigma27 such that

Σ\Sigma28

(Agarwal et al., 5 Aug 2025).

For identity testing, the key observation is that rational languages have exponential decay: Σ\Sigma29 for computable Σ\Sigma30. Truncating at length Σ\Sigma31 reduces the problem to a finite domain Σ\Sigma32. Using the tolerant identity tester of Canonne et al. with thresholds Σ\Sigma33 and Σ\Sigma34, one obtains sample complexity

Σ\Sigma35

or, in the abstract’s notation,

Σ\Sigma36

where Σ\Sigma37 is the size of the truncated support (Agarwal et al., 5 Aug 2025). The paper states completeness if Σ\Sigma38, soundness if Σ\Sigma39, both with probability at least Σ\Sigma40.

Taken together, these results position rational stochastic languages as a finite-state class of distributions over strings with three distinctive features: exact automata-theoretic realization, a normalization theory based on spectral or linear-system methods, and enough regularity to support asymptotic analysis, approximation, and testing on infinite discrete domains.

Definition Search Book Streamline Icon: https://streamlinehq.com
References (4)

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 Rational Stochastic Languages.