Strategies for Preventing Hallucinations in Responses Generated by the Assistant API

Hello everyone,

I’m working on a project that uses the Assistant API, and I’ve encountered the challenge of hallucinations — instances where the API generates convincing but incorrect or unverifiable fact-based responses. I would like to know if anyone has experience or recommended strategies to minimize this behavior.

In particular, I’m interested in:

Validation and Verification Strategies: Once I have a generated response, how can I automate the verification of its accuracy? Has anyone implemented effective fact-checking systems or post-processing techniques?

Use of Complementary Technologies: Are there any additional tools or APIs you would recommend to help validate or enrich the responses generated by the API?

Any advice, shared experiences, or resources you could recommend would be greatly appreciated. I am particularly interested in practical solutions that have been proven effective in real projects.

Thank you in advance for your help.

Hell there! Welcome to the forum!

There’s no clear-cut way to handle verification, and since you’re using the API, you have quite a bit of choices.

Right off the bat, this company seems like it has verification capabilities.

I wonder too, and this is just a thought, if you could leverage another API call that takes information from a website and compares it to the LLM’s original output to determine accuracy. However, it’s likely not quite that simple.

There are definitely strategies to deal with this, but I don’t know if assistants alone are the best framework for doing it.

Like anything, just need to model your verification process as a workflow:

  1. extract claims
  2. make claim packs: claim + context
  3. search your fact repository
  4. validate fact retrievals, ensure that you have at least 1 100% match per claim
  5. annotate the claims in your initial document or classify it.

There are some products that do this, but I don’t know of any publicly available ones that I’d trust/recommend.

1 Like