ResearchLLM Evaluation

An Actor-Critic Approach to Reduce Hallucinations

We share a method to reduce hallucinations in RAG systems by combining answer generation with a hallucination checker, making Fin safer and more reliable without compromising latency or performance.

Fedor Parfenov10 April 2025
An Actor-Critic Approach to Reduce Hallucinations

Unset

Consider the following sources used to generate the answer:

{sources_text}

And the following conversation history:

<conversation_history>

{conversation_history}

</conversation_history>

And this customer query:

<query>

{query}

</query>

Given the following generated answer:

<answer>

{answer_text}

</answer>

Go through the answer line by line and evaluate each sentence against the provided sources, looking for contradictions, misinterpretations, conflation,  inaccuracies, fabrications, made up suggestions, hallucinations and false inference.

Pay particular attention to any case where the generated answer is trying to bend the meaning of the sources in order to answer the question.

It is ok if the answer doesn't directly address the query, the most important thing is that for every answer sentence: any facts, suggestions, steps or solutions proposed in the answer are fully grounded in the information provided in the resources.

Severity level definition: 

* "NONE" means no hallucinations

* "LOW" means super minor extrapolations or extremely reasonable assumptions

* "HIGH" means any statements not supported by the sources

Think hard about how severe the problems are (my job depends on it!) and answer with a VALID JSON output:

(When quoting or listing sentences, remove all single or double quotes to prevent JSON parsing errors)

{{

    "general_thoughts":  str, # Your general thoughts about how grounded the answer is in the sources

    "problematic_sentences": [[str]], # List of lists, each sublist being 3 strs [sentence, reason, severity_level]: Quote any sentences you think are problematic and state why alongside a severity level of "HIGH", "LOW", or "NONE", empty list if none.

    "severity_level": str # Overall hallucination severity, must be one of "HIGH", "LOW", or "NONE" (if one problematic sentence is "HIGH", this should be "HIGH")

}}
Unset

[...]

Make sure not to repeat the mistakes committed by <previous_answer> to avoid <failed_checks>:

    <failed_checks>

        List of quality checks that the previously generated answer (in <previous_answer>) failed and the reason why.

        Make sure that the generated answer follows the instructions from the failed checks to avoid failing them again.

    </failed_checks>

    <previous_answer>

        This is a previous answer provided with this prompt that has failed in one or several quality checks.

        Make sure to write the <answer> so that remarks in <failed_checks> are respected.

    </previous_answer>

[...]

<previous_answer>{previous_answer}</previous_answer>

<failed_checks>

<ungrounded_sentence>

    The following sentence is ungrounded:

    <sentence>

        {sentence1}

    </sentence>

    Here is the reasoning:

    <reason>

        {reason1}

    </reason>

    Do not repeat this mistake. This is important to avoid quality checks to fail again.

</ungrounded_sentence>

<ungrounded_sentence>

    The following sentence is ungrounded:

    <sentence>

        {sentence2}

    </sentence>

    Here is the reasoning:

    <reason>

        {reason2}

    </reason>

    Do not repeat this mistake. This is important to avoid quality checks to fail again.

</ungrounded_sentence>

</failed_checks>

[...]