News for hackers. Stuff that matters.
Re:Show HN: LLMs can generate valid JSON 100% of the time by simonw on Monday August 14, 2023 @05:28PM (#37127042)
That re-prompting on error trick is what this new Microsoft library does, too: https://github.com/microsoft/TypeChat

Here's their prompt for that: https://github.com/microsoft/TypeChat/blob/c45460f4030938da3...

I think the approach using grammars (seen here, but also in things like https://github.com/ggerganov/llama.cpp/pull/1773 ) is a much more elegant solution.

Re:Show HN: LLMs can generate valid JSON 100% of the time by creatonez on Tuesday August 15, 2023 @03:57PM (#37138580)
A "repair prompt" instead of rewinding and starting back from the error seems like the wrong choice, and might only make sense with how payment for OpenAI API usage currently works.