Principle:42 evey Hermes plugins Heuristic Reflection
| Knowledge Sources | |
|---|---|
| Domains | Quality_Assessment, Self_Evaluation, Heuristics |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
A cost-free quality evaluation method that scores LLM output using heuristic signals — keyword overlap, response length, and error keyword detection — without requiring an additional LLM call.
Description
Heuristic Reflection provides a zero-cost alternative to LLM-based output validation. Instead of asking a model to rate its own output, it computes a quality score from three measurable signals:
- Keyword coverage: The fraction of task keywords (minus stopwords) that appear in the result. High overlap suggests the result addressed the task.
- Response length: Very short responses (<20 chars) indicate failure; very long (>10000) may indicate bloat; moderate length is ideal.
- Error keyword detection: Presence of words like "error", "fail", "exception", "traceback" signals problems.
Each signal adjusts a base score of 5.0, clamped to 1-10. The method is deliberately conservative — it can detect obvious failures (empty responses, error messages) but cannot assess factual accuracy or nuanced quality.
Usage
Use this principle when you need a quick, free quality check on LLM output and cannot afford the latency or cost of an LLM-based validation call. Suitable for triage (deciding whether to retry or accept). Not suitable as a sole quality gate for high-stakes decisions — pair with LLM-based validation for that.
Theoretical Basis
The scoring formula combines three independent signals:
Where:
# Abstract algorithm (NOT real implementation)
score = 5.0
if keyword_overlap >= 0.6: score += 2
elif keyword_overlap >= 0.3: score += 1
else: score -= 1
if len(result) < 20: score -= 2
elif len(result) > 10000: score -= 1
else: score += 1
if error_keywords & set(result_words): score -= 2
else: score += 1
score = clamp(score, 1, 10)