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...