FTLResponseFaithfulness
API reference for FTLResponseFaithfulness
FTLResponseFaithfulness
Evaluator to assess response faithfulness using Fiddler’s Trust Model.
The FTLResponseFaithfulness evaluator uses Fiddler’s proprietary Trust Model to evaluate how faithful an LLM response is to the provided context. This evaluator helps ensure that responses accurately reflect the information in the source context and don’t contain hallucinated or fabricated information.
Key Features:
Faithfulness Assessment: Evaluates how well the response reflects the context
Probability-Based Scoring: Returns probability scores (0.0-1.0) for faithfulness
Context-Response Alignment: Compares response against provided context
Fiddler Trust Model: Uses Fiddler’s proprietary faithfulness evaluation model
Hallucination Detection: Identifies responses that go beyond the context
Faithfulness Categories Evaluated:
faithful_prob: Probability that the response is faithful to the context
Use Cases:
RAG Systems: Ensuring responses stay grounded in retrieved context
Document Q&A: Verifying answers are based on provided documents
Fact-Checking: Validating that responses don’t contain fabricated information
Content Validation: Ensuring responses accurately reflect source material
Hallucination Detection: Identifying responses that go beyond the context
Scoring Logic: : The faithfulness score represents the probability that the response is faithful to the context:
0.0-0.3: Low faithfulness (likely contains hallucinated information)
0.3-0.7: Medium faithfulness (some information may not be grounded)
0.7-1.0: High faithfulness (response accurately reflects context)
Parameters
response
str
✗
None
The LLM response to evaluate for faithfulness.
context
str
✗
None
The source context that the response should be faithful to.
Returns
A list of Score objects containing: : - name: The faithfulness category name (“faithful_prob”)
evaluator_name: “FTLResponseFaithfulness”
value: Probability score (0.0-1.0) for faithfulness Return type: list[Score]
Raises
ValueError – If the response or context is empty or None.
Example
name = 'ftl_response_faithfulness'
score()
Score the faithfulness of a response to its context.
Parameters
response
str
✗
None
The LLM response to evaluate for faithfulness.
context
str
✗
None
The source context that the response should be faithful to.
Returns
A Score object for faithfulness probability. Return type: Score
Last updated
Was this helpful?