Skip to content
StackDecode
LLM Library
Running and Using LLMsAnimated

Hallucinations and Safety

Why models make things up and how they are made safer.

The idea

Because a model produces likely text rather than looking facts up, it can state false things fluently. Retrieval, citations, verification and training reduce this, and safety training and guardrails limit harmful output.

Watch it work

Press play, pause, or step through. Some animations have settings you can change.

User inputInput filterLLMOutput filterResponse
  • client
  • gateway / proxy
  • service
  • cache
  • data store
  • queue / stream

Check input for prompt injection, personal data and abuse.

step:
1/4
at:
User input
1/8

The green dot is a request moving through the system.

Step by step

  1. 1Ground answers with retrieval
  2. 2Ask for sources or checks
  3. 3Filter inputs and outputs
  4. 4Measure error rates on your own data

Where it is used

Any high-stakes use of an LLM.

Watch out for

You cannot remove hallucination entirely. Design for checking.