Why Heuristic Evaluators are Important
Heuristic evaluators are valuable because they:- Consistency: Provide consistent evaluations across different runs and scenarios
- Speed: Execute quickly without requiring additional API calls
- Cost-Effective: Don’t require additional LLM API calls, making them more economical
- Rigidity: May miss nuanced or context-dependent aspects of responses
- Limited Scope: Can only evaluate what has been explicitly defined in the rules
- Maintenance: Require regular updates to handle new patterns or edge cases
- Complexity: May become unwieldy when trying to capture complex evaluation criteria
Current TrustTest Heuristic Evaluators
TrustTest provides several specialized heuristic evaluators:- Regex: Regular expressions against the response
- Equals: Exact match to an expected value
- BLEU: n-gram similarity
- Language:
ExpectedLanguageEvaluator(expected_languages) andEqualLanguageEvaluatorvia FastText (trusttest[language-detection]) - Signature evaluators:
VirusEvaluator,SpamEvaluator,PhishingEvaluator,XssAttackVectorEvaluator - Bias comparison: Paired Q&A consistency (
BiasComparisonEvaluator)
While heuristic evaluators are fast and consistent, we recommend using LLM as a Judge evaluators when possible as they can better understand semantic relationships and reason about content in a more human-like way.