Overview
It’s challenging to use large language models in applications where the structure of the output matters — generating JSON for API requests, for instance, or generating code so language models can interact with other systems.
It’s possible to solve this by constraining the output of the language model to any arbitrary language. Information about that language can come from a formal grammar, a state machine (such as regex), or protocols such as the Language Server Protocol, which is what VS Code uses for IntelliSense.
We pursued all of these avenues for generating syntactically valid output, to let large language models interact with other systems more reliably even with conventionally weaker models.
Difficulty — Intermediate
Milestones
October 1 — Architecture setup. Set up abstractions for language models and probability distributions, and define possible operations on distributions.
November 1 — Regex. Successfully constrain the outputs of arbitrary language models on a regex pattern, and obtain possible paths from the Language Server Protocol.
December 1 — LSP constraining. Get reliable code generation while constraining with the Language Server Protocol.
Team split
Three to four members with no subteams. Each member owned a task, starting with setting up abstractions for models, constructing state machines from a regex pattern and randomly generating sequences, and experimenting with the Language Server Protocol. Team meetings once a week with rolling asynchronous updates.