Valid JSON Isn't Grounded: How to Add Semantic Validation to Streamed LLM Output

demirtasfurkan_ · reddit · 2026-11-22

The author argues schema enforcement only covers syntax and types; the harder failure mode is output that is syntactically valid but semantically wrong, such as a sourceid absent from the retrieved context or a score outside domain bounds.

He built a minimal zero-dependency Python prototype, neuroformatting, that separates structural checks from context-aware semantic rules on streamed chunks, and asks two engineering questions:

Original post →

More from coding & agent

coding & agent channel →