cd /news/artificial-intelligence/the-parser-already-knows-lightweight… · home topics artificial-intelligence article
[ARTICLE · art-93000] src=arxiv.org ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

The Parser Already Knows: Lightweight Bias Correction in Constrained Decoding

Researchers propose a lightweight, offline-trained logit correction for Grammar Constrained Decoding (GCD) that uses the parser and lexer states already computed during incremental parsing to restore the language model's true probability distribution, closing the gap between masked and true distributions while adding negligible overhead. The method outperforms both standard masking and online sampling across several grammars, with even its lightest variant matching or exceeding both baselines.

read1 min views1 publishedAug 12, 2026

arXiv:2608.10137v1 Announce Type: new Abstract: Grammar Constrained Decoding (GCD) forces Language Models (LMs) to produce syntactically valid outputs by masking out non-conforming tokens at each step. However, rigid masking distorts the model's underlying probability distribution, often biasing generation toward valid but suboptimal outputs. While online sampling restores this distribution, it requires computationally expensive iterative resampling. As a result, existing methods force a compromise between output quality and inference latency. Our key insight is that the internal parser and lexer states inherently maintained during incremental parsing already encode future grammatical validity -- exactly the information required to restore the LM's true distribution. We propose a lightweight, offline-trained logit correction conditioned on this syntactic and lexical state together with candidate next tokens. Because these states are already computed as a necessary part of incremental parsing for masking, extracting them adds negligible overhead while leaving the base LM's weights completely untouched. Across several grammars, this correction substantially closes the gap between the masked distribution and the LM's true distribution, consistently outperforming both masking and online sampling. Even its lightest variant, which relies on the candidate next token alone, still matches or exceeds both baselines: the next token itself carries an implicit lookahead, much like how parsers commonly use a lookahead token to resolve ambiguous decisions. By restoring the probability mass that masking removes, it reconciles the LM's probabilistic integrity with grammar conformance.

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @arxiv 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-parser-already-k…] indexed:0 read:1min 2026-08-12 ·