
Grammar-constrained code generation with a tiny GPT
A developer used a from-scratch GPT implementation to generate programs in the Pebble language, adding a parser that vetoed tokens that could not lead to syntactically valid code. Constrained decoding increased the measured parse rate from 4% to 100%, althoug…
Generate valid Pebble source code character by character while preventing syntactically invalid continuations.
PyLLM with a hand-written Pebble parser
Across 20 seeds, unconstrained generation produced parsable code for 4% of 27 programs, while parser-constrained decodi…
Source contextRob Cox









