Re:Introducing Structured Outputs in the API
by jules on Wednesday August 07, 2024 @02:16AM
(#41178690)
[delayed]
Re:Introducing Structured Outputs in the API
by orlp on Wednesday August 07, 2024 @08:37AM
(#41180747)
You don't even need that for JSON. JSON can be expressed using a LR(1) grammar, so you can do it in linear time and space.
Re:Introducing Structured Outputs in the API
by gamegoblin on Wednesday August 07, 2024 @12:36PM
(#41182998)
Yes, the llama.cpp work supports arbitrary CFGs, not just JSON
There are contrived grammars you can give it that will make it use exponential memory, but in practice most real-world grammars aren't like this.
[0] https://en.wikipedia.org/wiki/Earley_parser