Live data from Hacker News

Ask HN: Strategies to Reduce AI Hallucinations?

news.ycombinator.com

11–20 of 27 posts

Re: Ask HN: Strategies to Reduce AI Hallucinations?

#11

One strategy(not directly related to ChatGPT) is to use two models, one for extraction/generation and the other "challenger" to verify the extracted answer. Refer: https://docs.unstract.com/editions/cloud_edition#llmchalleng...

I use the same strategy. More like an interview. Many AI related tricks can be automated.

Re: Ask HN: Strategies to Reduce AI Hallucinations?

#13
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.

Re: Ask HN: Strategies to Reduce AI Hallucinations?

#15
post #8

Explicitly allow it the option to be unsure, e.g. "If you do not know the answer, respond with 'none'" or "If you are unsure of the answer, just say that", etc. Otherwise it does what humans do when asked interview questions, they bullshit because if you bullshit is a 20% chance of landing the job, whereas if you say "I don't know" there is a 0% chance of landing the job. The kind of RLHF training that was put into C…

This assumes the it “knows” what it knows ahead of time which isn’t true. It’s why models struggle to tell you how many Rs are in strawberry or why it can’t tell you how many words are in its response. Also doesn’t really have a concept of certainty beyond perhaps logprobs which are flimsy indicators at best and the model isn’t inherently aware of them

Re: Ask HN: Strategies to Reduce AI Hallucinations?

#16
There are various methods that work at lessening the amount of hallucinations, but in general I think it’s much more productive to use a Generate then Verify approach. If the information you’re creating is both important and novel to you (I.e., you can’t tell if it’s correct or not on your own) then you need the verification step.

Re: Ask HN: Strategies to Reduce AI Hallucinations?

#17
post #15
post #8

Explicitly allow it the option to be unsure, e.g. "If you do not know the answer, respond with 'none'" or "If you are unsure of the answer, just say that", etc. Otherwise it does what humans do when asked interview questions, they bullshit because if you bullshit is a 20% chance of landing the job, whereas if you say "I don't know" there is a 0% chance of landing the job. The kind of RLHF training that was put into C…

This assumes the it “knows” what it knows ahead of time which isn’t true. It’s why models struggle to tell you how many Rs are in strawberry or why it can’t tell you how many words are in its response. Also doesn’t really have a concept of certainty beyond perhaps logprobs which are flimsy indicators at best and the model isn’t inherently aware of them

I think you're overthinking this.

If you tell it that it can be unsure, the likelihood that an answer is correct increases. Make of that philosophically what you will. If it works it works.

Re: Ask HN: Strategies to Reduce AI Hallucinations?

#19

My longtime favorite prompt to trigger a hallucination was "Did King Henry VIII have any grandchildren?" Famously, he did not, but almost every model, till quite recently, would answer yes, often with the most bizarre reasoning. The way to resolve it on most models over a certain size is a common tactic used with LLMs: ask the LLM to "think through your answer first". For example, you have a system prompt akin to: "B…

Cool, just tried it on a few:

Llama3-8b-8192, Gemma2-9b-lt, Llama-3.1-70b-Versatile - All Said Yes

Llama-3.1-8b-Instant:

King Henry VIII had three children who survived to adulthood: Mary I (Mary Tudor, also known as Bloody Mary), Elizabeth I, and Edward VI.

Mary I had one child, a son named Edward VI, who became King of England at the age of 9 after Henry VIII's death. Edward VI died at the age of 15, so he did not have any children.

Elizabeth I never married and did not have any children.

Therefore, King Henry VIII did not have any grandchildren.

???!

Llama3-70b-8192: Also similar to above.

Of course if I ask again I may get a different answer!

Post reply on HN