|
|
|
|
|
by simonw
335 days ago
|
|
The structured data JSON output thing is a special case: it works by interacting directly with the "select next token" mechanism, restricting the LLM to only picking from a token that would be valid given the specified schema. This makes invalid output (as far as the JSON schema goes) impossible, with one exception: if the model runs out of output tokens the output could be an incomplete JSON object. Most of the other things that people call "guardrails" offer far weaker protection - they tend to use additional models which can often be tricked in other ways. |
|