Existing constrained sampling methods only focus on generating code that will be a syntactically well-formed program on its own after completion. What if we have some remaining code suffix and want the entirety to become a valid program? In this post I explore how to leverage existing tooling to create well-formed Copilot-like Fill-In-the-Middle (FIM) code […]
Category: LLMs
Proper Well-Formedness Guarantees for Finite LLM Sampling
Even under constrained sampling, LLMs can produce syntactically invalid output. In this post I explore how this can happen and how to resolve the issue using results from language theory.