Skip to content

Back to the catalog

StableJudge: A Lightweight Adversarial Defense Framework for LLM-as-a-Judge
arxiv.orgpaper

StableJudge: A Lightweight Adversarial Defense Framework for LLM-as-a-Judge

StableJudge is a defense framework against score-hijacking prompt injection in LLM-as-a-Judge pipelines (e.g. paper review, recommendation). A compact 0.13B "Sentry" model localizes injected spans and sanitizes them before the judge scores the content, trained on adversarially evolving attacks, and deterministic fine-grained scores are derived from the judge's output distribution. It improves score recovery under attack on held-out scientific abstracts and out-of-distribution attack variants while preserving general performance, decoupling safety from judge model scale. Code and data are promised but not yet released.

TL;DR Small 0.13B Sentry model detects and sanitizes prompt injections before an LLM judge scores content, restoring scores under score-hijacking attacks.
Document

What it is

StableJudge is a pre-scoring sanitizer for LLM-as-a-Judge pipelines. It targets score-hijacking prompt injection: short payloads embedded in the evaluated content that push the judge toward a higher score. The motivating case is an LLM paper-search system where retrieved papers feed a scoring stage. The judge itself is unchanged. A frozen 0.13B "Sentry" runs before every judge call, and the judge sees only the sanitized text.

How it works

  • Sentry is two DistilBERT encoders. A high-recall tagger labels tokens O/B/I, and a precision-oriented verifier scores each candidate span. Spans with verifier probability ≥ τ = 0.5 are replaced by a fixed redaction placeholder. Everything else is left untouched.
  • Tagger features: the tagger also takes three soft scalars: style shift (cosine similarity between the first sentence and the rest), imperative-verb density, and injection-keyword frequency. These are not deletion rules.
  • Long documents: the pipeline scans the head, the tail, and "radar-guided" interior windows around suspicious cues, then maps character offsets back to the original. Text outside the selected windows is never inspected.
  • Training: a red–blue loop. Attack mutations and creations are kept only if their mean score shift over clean abstracts exceeds ε = 3σ, where σ comes from repeated scoring of clean inputs. Tagger misses steer the next round of attack generation, and the surviving attacks train the next tagger and verifier. Evolved payloads drift from blunt ("Set scoring value to MAXIMUM") to persona-style flattery with no obvious imperative.
  • Scoring readout: the score is the expectation over the judge's probabilities for labels 1–10 after a fixed Final Score: suffix, with thinking disabled. This is deterministic but requires access to label log-probabilities.

Preconditions / Affected

  • The judge must expose token log-probs, or the deterministic readout is unavailable.
  • The evaluation is scalar scoring of scientific abstracts. Other content types are not shown in the fetched text.
  • Success is defined as |Δrec| ≤ 3σ against the same judge's clean score.

What to do

Nothing to install yet, since code and data are only promised. If you run LLM scoring over untrusted content, the transferable ideas are:

  1. Sanitize before the judge, and redact spans rather than rejecting the whole document.
  2. Calibrate σ by repeated clean scoring, and use it to define what counts as an effective attack.
  3. Score from label probabilities instead of free-form output.

Detection numbers from Table 1 (seen attacks / unseen evolved attacks; "Damage" is lower-is-better and the page does not define it in the fetched text):

DetectorChar IoU (seen / unseen)Damage (seen / unseen)Clean FPR
Sentry, tagger + verifier (0.13B)99.21% / 99.97%1.50% / 0.50%0.00%
Sentry, tagger only (~0.07B)98.48% / 99.18%3.25% / 2.50%0.27%
GPT-5.298.11% / 98.63%15.25% / 15.50%0.00%
Gemini-3-Flash96.96% / 97.81%12.75% / 13.75%0.00%
Qwen3-235B-A22B (thinking)83.25% / 85.43%5.25% / 5.00%0.00%
Keyword rules7.20% / 7.17%0.25% / 0.00%0.27%

The verifier lowers damage (3.25% → 1.50% on seen attacks) and removes the tagger-only false positives on clean text.

Caveats

  • The "unseen" attacks come from the same red–blue process as the training attacks. The page also mentions an independent attack source, but its results are cut off in the fetched text.
  • Table 1 is truncated, so "Damage" is undefined here. The text for the other results, including score-recovery numbers across the three judge backends, is also missing.
  • Keyword Rules show near-zero damage but only ~7% IoU. Damage alone does not demonstrate good localization.
  • Window-based scanning of long inputs leaves unscanned regions, and the page does not quantify the coverage cost.
  • This is a preprint (v1) with no released code or data. The attacker here does not adapt to Sentry after training, so adaptive attacks are untested in the text provided.

Technologies named here