mlsanityData to 13 Oct 2026

Prefix Parsing is Just Parsing

arXiv 2604.21191 ↗First posted 23 Apr 2026cs.CL cs.FLcited by 0

Not on the map. Why?

Abstract (arXiv)

Prefix parsing asks whether an input prefix can be extended to a complete string generated by a given grammar. In the weighted setting, it also provides prefix probabilities, which are central to context-free language modeling, psycholinguistic analysis, and syntactically constrained generation from large language models. We introduce the prefix grammar transformation, an efficient reduction of prefix parsing to ordinary parsing. Given a grammar, our method constructs another grammar that generates exactly the prefixes of its original strings. Prefix parsing is then solved by applying any ordinary parsing algorithm on the transformed grammar without modification. The reduction is both elegant and practical: the transformed grammar is only a small factor larger than the input, and any optimized implementation can be used directly, eliminating the need for bespoke prefix-parsing algorithms. We also present a strategy-based on algorithmic differentiation-for computing the next-token weight vector, i.e., the prefix weights of all one-token extensions, enabling efficient prediction of the next token. Together, these contributions yield a simple, general, and efficient framework for prefix parsing.

Key facts. No citing papers in the map yet (data through 13 Oct 2026). Builds on 5 of its 48 references that are in the map. First posted on arXiv 23 Apr 2026.

Builds on

5 of 48 references.

References · 5

  1. 2021Constrained Language Models Yield Few-Shot Semantic Parserscited by 163
  2. 2020Torch-Struct: Deep Structured Prediction Librarycited by 40
  3. 2022On the Intersection of Context-Free and Regular Languagescited by 3
  4. 2023SynJax: Structured Probability Distributions for JAXcited by 2
  5. 2019Marpa, A practical general parser: the recognizercited by 1

Built on by

Not cited yet.