A formal approach for understanding the behavior of constrained language models
Resumen:
We study language models under explicit formal constraints by treating common operations, such as prompting, masking, temperature scaling, and vocabulary translation, as composable transformations, in particular those that preserve the set of generable sequences and/or its probability distribution. We focus on constraints that disable tokens, potentially leading to dead-ends during generation. Moreover, we formalize bounded-length and safe decoding procedures. The theoretical results enable the algorithmic approximation of the probability of subsets (properties) of the generable language, as well as active learning of automata representations, such as DFA o Moore machines. We evaluate the approach to analyze the behavior of several state-of-the-art large language models.
| 2026 | |
| Agencia Nacional de Investigación e Innovación | |
|
Artificial Intelligence Language Models Constrained Decoding Formal Languages Ciencias Naturales y Exactas Ciencias de la Computación e Información |
|
| Inglés | |
| Agencia Nacional de Investigación e Innovación | |
| REDI | |
| https://hdl.handle.net/20.500.12381/5635 | |
| Acceso abierto | |
| Reconocimiento 4.0 Internacional. (CC BY) |
| Sumario: | We study language models under explicit formal constraints by treating common operations, such as prompting, masking, temperature scaling, and vocabulary translation, as composable transformations, in particular those that preserve the set of generable sequences and/or its probability distribution. We focus on constraints that disable tokens, potentially leading to dead-ends during generation. Moreover, we formalize bounded-length and safe decoding procedures. The theoretical results enable the algorithmic approximation of the probability of subsets (properties) of the generable language, as well as active learning of automata representations, such as DFA o Moore machines. We evaluate the approach to analyze the behavior of several state-of-the-art large language models. |
|---|