arXiv Machine Learning By Vincenzo Collura, Karim Tit, Eleonora Giunchiglia, Mike Papadakis, Maxime Cordy

Stay Within Your Bounds: Distance-Guided Decoding for Guaranteed Context-Free Grammar Compliance

Read the original on arXiv Machine Learning →

The paper introduces a distance‑guided decoding framework that guarantees context‑free grammar compliance for large language models. By precomputing bounded pushdown summaries with reachability labels and upper‑bound distances to acceptance, the decoder performs horizon‑aware pruning and beam search during generation. Experiments on JSON, SQL, and Linear Temporal Logic demonstrate consistent syntactic validity and improved completion quality compared to existing baselines.

Machine-generated by The Flow from the publisher's headline and feed description — not written or checked by a human. The full article lives at arXiv Machine Learning.