Autogrammar: Learning Context-Free Grammars for Grammar-Constrained Decoding
A recent paper published on arXiv (2608.05493) presents Autogrammar, an innovative agent designed to autonomously acquire context-free grammars (CFGs) from both documentation and execution data. This advancement facilitates grammar-constrained decoding for language models (LMs) that work with domain-specific languages (DSLs). The study tackles the issue of LMs generating syntactically incorrect programs in low-resource DSLs, a challenge that can be addressed through grammar-constrained decoding, which necessitates syntactic constraints typically represented as CFGs. Autogrammar is conceptualized as a Kripke structure, with nondeterministic choices guided by a language model, enabling control over agent behavior through linear temporal logic (LTL) constraints. The research assesses four iterations of Autogrammar across three DSLs: Amazon CloudWatch Logs Insights, Dynatrace Query Language, and one unspecified DSL. This work contributes to the convergence of AI and software engineering by providing a means to automatically create grammars for third-party DSLs without requiring manual input. The paper is accessible on arXiv and was noted as a cross-type submission.
Key facts
- Autogrammar is an agent that learns context-free grammars from documentation and execution data.
- The research is published on arXiv with identifier 2608.05493.
- The paper addresses grammar-constrained decoding for language models.
- Autogrammar is formalized as a Kripke structure with nondeterministic choices resolved by a language model.
- The agent uses linear temporal logic constraints for declarative control.
- Four versions of Autogrammar are evaluated.
- The evaluation covers three DSLs: Amazon CloudWatch Logs Insights, Dynatrace Query Language, and another.
- The goal is to eliminate syntactically invalid programs in low-resource DSLs.
Entities
Institutions
- arXiv
- Amazon
- Dynatrace