So to explain this another way:
After each token generated by the LLM you update the logit bias “mask” to only allow the next token to be a valid json token?
Very slick!
After each token generated by the LLM you update the logit bias “mask” to only allow the next token to be a valid json token?
Very slick!
Not sure how this can really guarantee 100%
It's not great but after some timeout you can just set the mask to only include closing brackets.
{"this": "is valid json so farrrrrrrrrrrrrr
But yeah the general idea makes sense. Once you hit a timeout, change the mask to things that will close existing open things in a valid manner (}, ), ], ")
edit: They describe this more carefully in the paper.