Manuscript Offprint

arXiv:2610.16814

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

Anning Hu, Yangyu Li, Yuqi Huang, Shengchao Hu, Junchi Yan

Abstract

Large language models (LLMs) are increasingly used as judges to assign scalar scores that drive downstream decision-making, including tasks such as paper review and recommendation. However, LLM-as-a-Judge pipelines are vulnerable to score-hijacking prompt injection embedded in evaluated content, which corrupts scoring signals and distorts induced rankings. Existing defenses often enforce robustness by modifying the judge model itself, making safety dependent on a specific model's scale and training and requiring repeated effort when the judge is updated or replaced. We propose StableJudge, a lightweight defense framework that externalizes prompt-injection mitigation as a reusable pre-scoring capability. StableJudge centers on a compact 0.13B Sentry that localizes injected spans and performs targeted sanitization prior to evaluation, and is trained using adversarially evolving attacks to improve robustness beyond a fixed prompt set. To stabilize measurement, StableJudge derives deterministic, fine-grained scalar scores from the judge's output distribution. Across held-out scientific abstracts and out-of-distribution attack variants, StableJudge improves score recovery under attack while largely preserving general-purpose performance, demonstrating that robust LLM-based judging can be achieved by decoupling safety from judge scale via reusable defense capabilities. Code and data will be released.

1 Introduction

Large language models (LLMs) are increasingly deployed as judges that assign scores for academic screening, recommendation, and automated evaluation (Zhuang et al., 2025; Zheng et al., 2023; Liu et al., 2023a; Dubois et al., 2024). Because downstream rankings are often induced by sorting these scores, scoring integrity is central to system reliability under untrusted inputs. Our motivation comes from an LLM-based paper-search system, where retrieved papers become inputs to a scoring stage: the content being evaluated is also an entry point for instructions that target the evaluator.

However, LLM-as-a-Judge pipelines are vulnerable to prompt injection: adversarial instructions embedded in evaluated content that aim to override the judge’s intended protocol (Perez and Ribeiro, 2022; Greshake et al., 2023). We focus on score-hijacking injections, where short directives coerce inflated scores and corrupt the scoring signal before ranking or downstream decisions.

Existing mitigations include secure prompting, fine-tuning, preference optimization, and guardrails (Suri and McCrae, 2025; Xu and Parhi, 2025). When defense is tied to a judge’s weights or behavior, changing the backend entails renewed adaptation or validation (Liu et al., 2023b; Tan et al., 2026; Wee et al., 2025). We propose StableJudge, which externalizes prompt-injection mitigation as a compact callable capability. The central design choice is to remove adversarial instructions while retaining the evidence for evaluation, so that a trained defense can be reused when the judge changes.

StableJudge follows a simple protocol: sanitize before scoring. Its 0.13B Sentry localizes injected spans and produces minimally modified text, which the judge evaluates using a continuous logit-based score readout. Sentry is trained through mutual red–blue evolution: detector feedback guides attack generation, and the resulting effective attacks improve the detector. After training, the same frozen Sentry is reused across judge backends.

The main contributions of this work are as follows:

  1. We externalize score-hijacking defense as a reusable pre-scoring tool. A fixed-input eval-

∗^{*}Corresponding author: yanjunchi@sjtu.edu.cn.

Figure

Figure 1: Overview of StableJudge for LLM-as-a-Judge. (A) Illustrative score-hijacking example. (B) Mutual red–blue training: localization misses guide new attacks, and effective attacks train Sentry. (C) Deployment: the same frozen Sentry sanitizes inputs across judge backends, aiming to recover each unchanged judge’s clean-input score.

uation across three judge backends tests score recovery with the same frozen Sentry and sanitized texts.

  1. We introduce the StableJudge Sentry, a compact (0.13B) tagger–verifier that localizes and sanitizes injected instructions, with bounded-window scanning for long documents.

  2. We develop mutual red–blue evolution through miss-guided attack generation and score-impact filtering, and evaluate the resulting defense on held-out attacks and an independent attack source.

References (20)