PaperScope
LIVE · 2026-10-06 05:40 UTC

From Transformers to Weighted Automata: Towards the Verification of Large Language Models

Smayan Agarwal, Aslah Ahmad Faizi, Shobhit Singh, Aalok Thakkar

Latestcs.CLcs.LGcs.AIcs.CV
arXiv ID
2610.04569 v1
Category
Submitted
2026-10-03

Abstract

Large language models (LLMs) are increasingly deployed in safety-critical settings, yet their black-box nature makes it difficult to provide formal guaranties about their behavior. Existing verification approaches rely primarily on empirical probing and testing, leaving open the question of how to reason rigorously about general-purpose trans- former architectures. In this work, we establish a principled bridge between transformers and weighted automata, a classical model from formal language theory. This connection enables us to transfer verification tools from automata the- ory to the analysis of LLMs. Our contributions are twofold: First, we develop a formal correspondence between transformer architectures and weighted automata over reals, showing how distributional properties of LLMs can be captured within this framework. Second, we introduce an identity testing algorithm for weighted automata that provides a statis- tical method for distinguishing whether two stochastic models define the same distribution up to a tolerance threshold. This work provides the first formal bridge between modern neural se- quence models and classical automata theory, clarifying both the poten- tial and the computational challenges for rigorous LLM verification.

Journal: DATAMOD 2025

arXiv abs page · PDF · same-day batch