Skip to content

How does it handle unexpected answers from LLMs under the hood? #250

Answered by brandonwillard
gornostal asked this question in Q&A
Discussion options

You must be logged in to vote

We explain the approach in our paper, and it does not involve retries.

Simply put, we construct regular expressions for the JSON specs, convert those to finite state machines, and use an index constructed from the states of the finite state machines to get the LLM tokens that could come next. The indexing is akin to standard string search algorithms (e.g. Aho-Corasick) and regex-based indexing approaches.

The approach was designed to be adaptable to existing regular expressions parsing/matching approaches and software, but we're currently using a simple DFA library called interegular (based on greenery). We plan to extract the necessary state information from existing regex libraries so t…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@gornostal
Comment options

@rlouf
Comment options

Answer selected by gornostal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants