Launch Week 3: Five days of launches

Turn Faithfulness

Turn Faithfulness is a multi-turn metric to evaluate RAG generators at each turn

Overview

The turn faithfulness metric is a multi-turn RAG metric that uses LLM-as-a-judge to evaluate whether your chatbot's answers stay grounded in the context retrieved at each turn of the conversation.

Required Parameters

These are the parameters you must supply in your test case to run evaluations for turn faithfulness metric:

turnslist of TurnRequired

A list of Turns as exchanges between user and assistant.

Parameters of Turn:

roleuser | assistantRequired

The role of the person speaking, it's either user or assistant

contentstringRequired

The content provided by the role for the turn

retrieval_contextlist of stringRequired

The retrieved context your retriever outputs for the turn sorted by their rank

How Is It Calculated?

The turn faithfulness metric slides a window over the turns, extracts the truths from the retrieval context and the claims from the assistant content in each window using an LLM, then uses the same LLM to check how many of those claims the truths support.


Turn Faithfulness=Turn Faithfulness ScoresTotal Number of Assistant Turns\text{Turn Faithfulness} = \frac{\sum \text{Turn Faithfulness Scores}}{\text{Total Number of Assistant Turns}}

The final score is the average of the faithfulness scores of every assistant turn in the conversation.

Usage

To run the turn faithfulness metric on Confident AI, add it to a multi-turn metric collection. This will allow you to use turn faithfulness metric for:

  • Multi-turn E2E testing
  • Online and offline evals for traces and spans

Last updated on

Built byConfident AI