How do you detect and measure hallucinations in LLM outputs?
Hallucination is output that's fluent but unsupported or false. To measure it, define it against a source: in RAG, check faithfulness — is every claim grounded in the retrieved context? You can score this with an LLM-judge (or NLI model) that flags claims not entailed by the sources. Where a reference or knowledge base exists, verify facts against it. Other signals: self-consistency (sample several answers; wide disagreement suggests the model is guessing), and asking the model to cite sources you can automatically check. Report a hallucination rate on a labelled evaluation set and track it over time. Reduce it with grounding, lower temperature, and an explicit 'say you don't know' instruction — but you can't drive it to zero, so keep human verification for high-stakes facts.