Back to feed
AR
arXiv CS.AI
7/15/2026
GRID: Grammar-Railed Decoding for Enterprise SQL Generation

GRID: Grammar-Railed Decoding for Enterprise SQL Generation

Short summary

GRID is a grammar-constrained decoding engine for enterprise SQL generation that uses LALR(1) parser configurations as next-token masks, guaranteeing syntactic validity, RBAC enforcement, and near-constant per-token cost. Rust kernels achieve 3.6-6.7µs median per-token mask time with zero false rejects, and constrained decoding adds +13 execution-accuracy points on Spider for a 0.5B model. A hash-chained audit trail replays bit-identically with 100% tamper detection, and one repair pass lifts a 7B model to 94.5% executable accuracy.

  • Grammar-constrained decoding using LALR(1) parser states as token masks guarantees valid SQL with RBAC enforcement
  • Rust kernels achieve 3.6-6.7µs per-token mask cost, outperforming llguidance at p50 and p90 with zero false rejects
  • Hash-chained audit trail provides 100% tamper detection; one repair pass lifts 7B model to 94.5% executable on Spider

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more