|
|
|
|
|
by quickthrower2
921 days ago
|
|
Is the type returned guaranteed to be correct, or are you relying on non-hallucinations? To be specific - to guarantee correctness you can reject logits for tokens that when used would produce an invalid JSON value returned from the LLM. For example if the string so far is { rating:
If the suggested token is something like "3Then you can reject, because the next character needs to be 0-9, and re-sample from the distribution. |
|
The return value is not guaranteed to be correct. REASON uses function calling to force the model to return a valid JSON object; however, sometimes models hallucinate.
For OpenAI models that have JSON mode, REASON uses that instead.
However, it has an internal validation step where it checks the return value, and if it's not correct, it'll throw an error (this behavior can be disabled though).
Here's more info about it: https://docs.tryreason.dev/docs/essentials/reason#will-the-l...
Your suggestion to use logits is super interesting, though! And it sparked this line of thinking: since REASON uses function calling, it has been somewhat difficult to integrate with OSS models — however, if under-the-hood we use Jsonformer, that might be the missing key for incredible OSS model support (?). What do you think?