Definition
LLM-based Faithfulness measures how grounded is the generated answer on the retrieved contexts.
We have two different ways of prompting the LLM to calculate faithfulness:
Classify faithfulness by statement:
classify_by_statement = TRUE
where LLM is prompted to evaluate the faithfulness of each statement in the Generated Answer and outputs a float
score:
Classify faithfulness by whole answer:
classify_by_statement = FALSE
where LLM is prompted to evaluate the whole Generated Answer and outputs a judgement of 1.0 or 0.0
Example Usage
Required data items: answer
, and retrieved_context
Sample Output
faithfulness_by_statement
output:
faithfulness_by_whole_answer
output: