Is there a way to get rid of Azure Assistant API hallucination?

Karishma Nanda 265 Reputation points
2024-06-17T17:20:10.0033333+00:00

Hi there,
I am working with the Azure Assistant API (v2) and experiencing hallucination issues. When I attempt to ask data analytics questions while using the Code Interpreter tool, it occasionally provides incorrect answers. Even though the frequency of incorrect answers can vary, experiencing wrong responses around one in ten times is a significant concern for me. I am working on an MVP and planned to move the product to an initial preview stage, but the inconsistent answers are causing significant concerns.

I have tested this with GPT-3.5 Turbo, GPT-4, and the previous version of the Azure Assistant API. Unfortunately, the issue persists across all models and versions. Is there a way I could get rid of hallucination? Below are a few details on the context:

  • Tool: Code Interpreter
  • User query: Analytical Questions
  • Data: Structured data in CSV format
Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
3,244 questions
0 comments No comments
{count} votes

Accepted answer
  1. AshokPeddakotla-MSFT 34,701 Reputation points
    2024-06-18T06:34:59.24+00:00

    Karishma Nanda Greetings!

    To better understand the issue, could you please provide more details about the type of data analytics questions you're asking?

    Additionally, can you provide an example of a question that returned an incorrect answer?

    I would recommend cleaning up the role information around unsure part if the exact answer cannot be extracted do this - If you are unsure of an answer, you can say "I don't know" or "I'm not sure" to If the answer cannot be extracted from the retrieved documents, please respond with " I am not sure. Please visit "any of the site link" for more details". You should follow up this response with a clarifying question or a follow up question.

    Please see Azure OpenAI On Your Data for more details.

    Also, try adjusting the temperature, top_p, response_format parameters which helps you further tune responses.

    To reduce the likelihood of hallucination, you can try the following steps:

    • Increase the amount of training data: One of the most effective ways to reduce hallucination is to train the model on a larger dataset. This can help the model learn more about the relationships between the input data and the expected output.
    • Use a more diverse dataset: If the training data is too similar, the model may not be able to generalize well to new inputs. Using a more diverse dataset can help the model learn to handle a wider range of inputs.
    • In addition to these steps, it's also important to carefully evaluate the quality of the training data and the performance of the model. If the model is still producing incorrect answers, you may need to re-evaluate the quality of the training data.

    Do let me know if that helps or have any further queries.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.