News for hackers. Stuff that matters.
Re:Ask HN: Strategies to Reduce AI Hallucinations? by jumploops on Monday July 29, 2024 @02:53AM (#41098419)
1. Give examples of the format of response(s) you want

2. Explicitly call out null conditions (e.g. return { “results”: [] })

3. Use multiple prompts, one to “think”/explain and then one to transform the result

4. Don’t use function calling to get structured output, just use JSON mode

One non-obvious trick we use is to tell the LLM what it said previously as a system messages, not just as user messages, even if the LLM didn’t actually output that specific text.

There are no comments on this comment yet.