Heuristic:AISecurityLab Hackagent Judge Abstention
| Knowledge Sources | |
|---|---|
| Domains | Evaluation, Judge_Panel, Error_Handling |
| Last Updated | 2026-10-29 00:00 GMT |
Overview
When a judge's LLM call fails or its reply cannot be parsed, the judge abstains rather than casting a wrong vote, preventing a broken judge from corrupting the panel verdict.
Description
In a multi-judge panel, a judge that encounters an error — a failed LLM call, a timeout, or an unparseable reply — has two options: cast a default vote (which is almost always wrong) or refuse to vote. HackAgent chooses the latter. A judge that cannot confidently read the reply retries once with a "format your answer again" prompt; if the retry still fails, the judge abstains — its JudgeVote carries an error field instead of a score.
The panel's _combine method excludes abstaining judges from the aggregation. When every judge abstains, the verdict carries an error ("All N judge(s) abstained") and is not counted as a judgement. This prevents a panel-wide outage from producing false successes (or false failures) that would corrupt campaign results.
The require_all_judges option (default false) tightens this: when enabled, any single abstaining judge makes the reply unsuccessful, useful when a missing vote should be treated as a failure rather than ignored.
= Usage
Use this heuristic whenever a judge panel evaluates target replies. It is applied automatically by Panel.aevaluate and ModelJudge.avote. Configure evaluation.require_all_judges: true in the campaign YAML when every judge must vote for a verdict to count. Leave it false (default) when you want the remaining judges to decide even if one is down.
The Insight (Rule of Thumb)
- Action: Let judges abstain on failure (default behavior). Optionally set evaluation.require_all_judges: true to fail the verdict when any judge abstains.
- Value: require_all_judges=false (default — abstaining judges are excluded from aggregation). true — any abstention makes the verdict unsuccessful.
- Trade-off: Excluding abstainers keeps the campaign running when a judge is temporarily down, but a persistent outage silently shrinks the panel. Requiring all judges gives stronger guarantees but stops the run on any single judge failure.
- Retry: An unparseable reply is retried once with a format-correction prompt before abstaining.
Reasoning
A judge panel's verdict is only as trustworthy as its votes. A judge that cannot read a reply but casts a default score (e.g., 0) would skew the mean aggregation downward and could flip a majority vote. Abstaining is safer: the panel aggregates only the votes it actually has, and when it has none, it says so explicitly rather than guessing.
The retry-then-abstain pattern handles the common case where a judge model produces a slightly malformed reply (extra prose around the score). One retry with "Answer again, following the required format exactly" recovers most of these without a second LLM call for clean replies.
Code Evidence
Judge abstention on parse failure from panel.py:73-85:
def vote(self, sample: Sample) -> JudgeVote:
prompt = self.kind.render(sample)
parsed = self._complete(prompt)
if not parsed.is_confident:
parsed = self._complete(_retry_prompt(parsed, prompt))
return self._to_vote(parsed)
def _to_vote(self, parsed: AssertionResult) -> JudgeVote:
if not parsed.is_confident:
logger.warning("Judge %s abstained: %s", self.name, parsed.explanation)
return JudgeVote(judge=self.name, error=parsed.explanation)
...
Panel excluding abstaining judges from panel.py:243-269:
def _combine(self, votes: list[JudgeVote]) -> Verdict:
normalized = []
for judge, vote in zip(self.judges, votes):
if vote.abstained:
continue
...
if not normalized:
return Verdict(
success=False, score=0.0, votes=votes,
explanation=explanation,
error=f"All {len(votes)} judge(s) abstained",
)
require_all_judges option from spec.py:257-260:
require_all_judges: bool = Field(
default=False,
description="Count a reply as unsuccessful when any judge abstains.",
)