Re:Show HN: LLMs can generate valid JSON 100% of the time
by dwattttt on Monday August 14, 2023 @07:41PM
(#37128262)
If you're choosing the next token based on a list of valid next tokens, a uniform random distribution can always generate valid JSON too!
[ Parent
| on HN ]
Re:Show HN: LLMs can generate valid JSON 100% of the time
by quickthrower2 on Monday August 14, 2023 @07:54PM
(#37128365)
Yep. So can this:
fun generate_valid_json(seed):
return "{}"
Re:Show HN: LLMs can generate valid JSON 100% of the time
by neoncontrails on Monday August 14, 2023 @09:04PM
(#37128874)
But that's not what an LLM does.
Re:Show HN: LLMs can generate valid JSON 100% of the time
by antonvs on Monday August 14, 2023 @09:55PM
(#37129229)
The point is that if you're "choosing the next token based on a list of valid next tokens," it's not surprising that you'll only generate valid output, since absolutely any choice mechanism will suffice.