Fooling LLM graders into giving better grades through neural activity guided adversarial prompting
Atsushi Yamamura, Surya Ganguli
TL;DR
The paper tackles biases in LLM-based evaluators by proposing a systematic method to uncover hidden neural representations that predict scoring. It first identifies a cognitive state in the model via linear readouts trained on residual activations and then crafts adversarial suffixes with a gradient-based search to amplify that state, producing high scores in automated grading. The method demonstrates strong cross-model transfer and reveals a consistent 'magic word' bias tied to chat templates, which can be mitigated by a simple change in the prompting template. Overall, the work highlights the need for bias-aware design and template-aware defenses to improve the safety, fairness, and robustness of LLM-powered evaluation systems.
Abstract
The deployment of artificial intelligence (AI) in critical decision-making and evaluation processes raises concerns about inherent biases that malicious actors could exploit to distort decision outcomes. We propose a systematic method to reveal such biases in AI evaluation systems and apply it to automated essay grading as an example. Our approach first identifies hidden neural activity patterns that predict distorted decision outcomes and then optimizes an adversarial input suffix to amplify such patterns. We demonstrate that this combination can effectively fool large language model (LLM) graders into assigning much higher grades than humans would. We further show that this white-box attack transfers to black-box attacks on other models, including commercial closed-source models like Gemini. They further reveal the existence of a "magic word" that plays a pivotal role in the efficacy of the attack. We trace the origin of this magic word bias to the structure of commonly-used chat templates for supervised fine-tuning of LLMs and show that a minor change in the template can drastically reduce the bias. This work not only uncovers vulnerabilities in current LLMs but also proposes a systematic method to identify and remove hidden biases, contributing to the goal of ensuring AI safety and security.
