Hacker News new | ask | show | jobs
by apalmer 1144 days ago
Trying to understand why this is necessary? LLMs cannot reliably generate valid Jason?
3 comments

Two ways in which it is useful over existing techniques:

- It is guaranteed to match your schema

- It is much lighter weight

Also, it costs tokens to ask a model to do something, and it may choose not to do it re: constraints

You can force it by banning the vocabulary which violates a constraint for free.

There are typically two issues:

* Occasionally, random junk will get tossed in alongside valid JSON. If you're a human, it's easy to identify and fix. Programmatically, it can be much harder to fix.

* Context lengths can create issues.

Yes, but Mike on the other hand....