Skip to content

Toward Inferring Accurate Context-free Grammars for Big Languages in a Black-box Setting

Jul 2026 · arXiv.org · Vol abs/2607.08959 · 0 citations · 37 references
Computer Science

TL;DR

In an empirical comparison that avoids several pitfalls of recent studies, XVada improves on the highest-scoring competitor (TreeVada) both in grammar accuracy and grammar compactness and finds a CVE in the widely used Python Liquid engine.

Abstract

Black-box context-free grammar inference is crucial for program analysis, reverse engineering, program understanding, fuzzing, and security. But existing approaches such as Arvada, TreeVada, Kedavra, and Cucio struggle with scalability, accuracy, and grammar readability, especially on larger languages. To address this challenge, we introduce XVada with several new techniques for deterministic inference of context-free grammars. In an empirical comparison that avoids several pitfalls of recent studies, XVada improves on the highest-scoring competitor (TreeVada) both in grammar accuracy and grammar compactness. XVada also found a CVE in the widely used Python Liquid engine. Fuzzing based on the XVada-inferred grammar found five more bugs, which the Python Liquid developers fixed based on our bug reports. XVada and all experimental data and scripts are freely available.

View source

Similar papers

Book Open access Oct 2026

SwiftGram: Dynamic Lexical Forking for Precise and Efficient Grammar-Constrained Decoding

Large Language Models (LLMs) must strictly adhere to grammatical constraints for reliable structured generation in agentic workflows, code synthesis, and domain-specific language (DSL) generation. Grammar-Constrained Decoding (GCD) enforces this by masking out tokens incompatible with the target grammar at each decodin...

Shu-Yi Ling, Liang-Yi Kang, Jie Liu et al. · 0 citations
Book Open access Oct 2026

Reliable Generation of Feature Models in the Universal Variability Language using Constrained LLMs

Modern software systems are increasingly variant-rich, and feature models capture this variability formally. The Universal Variability Language (UVL) has emerged as a community-driven standard for expressing such models, but creating and maintaining UVL artifacts remains a manual, expert-driven task. Large Language Mod...

Johannes Stümpfle, Fethiye Tunç, N. Jazdi et al. · 0 citations
#machine learning Preprint Oct 2026

Constraint-Aware Training

When generating programs with language models, constrained decoding can apply program analyses to exclude tokens that violate syntax, scope, or typing rules. However, there is a duplication: standard training already teaches the model to suppress the tokens rejected by these analyses. This duplication leads to the ques...

Jinwoo Kim · 0 citations
Preprint Sep 2026

Where the LLM Ends and Reliable Decisions Begin

The ANVIL compiler architecture is proposed, where ANVIL performs exceptionally well on leading benchmarks by using language models purely where they are effective, rather than as a catch-all tool.

Priyadarshan Patil, A. Basu, Vikas Reddy et al. · 0 citations
Open access Oct 2026

Self-Adaptive Code Representation: Grammar-Guided or Token-Based?

Recent advances in code intelligence are largely driven by large language models (LLMs), which represent code as token sequences and achieve strong results on many software engineering tasks. However, standard token-based approaches often struggle to capture the inherent structural regularities of programming languages...

Qing-Lin Liang, Zhao Zhang, Chen Liu et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.