arXiv:2610.29129cs.LGOct 2026

Manuscript Offprint

arXiv:2610.29129

Mitigating Reward Hacking in Realistic Scenarios Through Representation Engineering

Austin Meek, Kyle Cox, Matthew Nguyen, Austin J. Brockmeier, Steven Basart

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Reward hacking is a major problem in current production machine learning systems, resulting in costly and dangerous failures. Here we study how to monitor for and mitigate reward hacking in realistic settings, including tool calls and long contexts. We apply a dynamic intervention to steering directions obtained by three different methods: difference-in-means vectors from labeled rollouts, gradient optimization-based vectors, and vectors extracted when models reference an anti-reward-hacking model spec. This dynamic intervention perturbs model representations less than uniform steering vector addition to the residual stream, allowing for more precise edits. We find that we are able to cheaply and significantly reduce reward hacking without correspondingly significant costs to model coherence or capability, and that steering vectors originally extracted from coding environments also generalize to reducing reward hacking in other domains. Our results pave the way towards latent space monitoring and control over realistic production systems.

1 INTRODUCTION

Reward hacking is a well known failure mode in machine learning systems, where models learn to increase reward on a proxy objective in ways that model developers don’t intend. This can lead to many safety issues when those models go into downstream production (MacDiarmid et al., 2025). This is no longer a theoretical concern. Recent events involving an agent swarm penetrating HuggingFace’s infrastructure were due in large part to misconfigured training environments which the agent hacked to increase its reward (METR, 2026). As agents continue to grow in prevalence and capability, this failure mode will correspondingly become much more important than its current state. We propose inference time techniques for monitoring and mitigating reward hacking in realistic agentic coding environments over long contexts.

Inference time interventions work well only when the behavior can be cheaply detected and mitigated against. We find that this is the case in our setting. A small number of labeled rollouts is sufficient to identify a direction that is useful not only for monitoring, but also for dynamic steering via representation engineering (Turner et al., 2023; Zou et al., 2023). We use activation capping from Lu et al. (2026) to suppress reward hacking by intervening only when activations exceed some threshold along the hacking direction, minimizing collateral effects on other capabilities. This allows model developers to be more confident in applying this technique, as it will minimally alter representations and only in a small, predictable fraction of a model's rollouts.

As a baseline, we also provide a model specification (model spec), which instructs the model to act according to a list of principles opposing reward hacking. This acts as a smaller, domain-specific

*Correspondence to: ajmeek@udel.edu.

Code at github.com/ajmeek/mitigating_reward_hacking.

Project page at ajmeek.github.io/mitigating_reward_hacking_website.

Figure

Figure 1: We test four different interventions to reduce reward hacking in agentic coding environments. A small number of labeled rollouts is enough to provide latent space interventions that minimally perturb model representations. An anti-reward hacking model specification, or model spec, is also effective, and with a small number of rollouts we can use spec steering vectors to reduce misaligned behavior. Additionally, steering vectors from coding environments transfer to natural language domains.

form of constitutional alignment (Bai et al., 2022). We find this works well, but expect that prompting baselines will likely degrade over long contexts due to compaction, context rot, and multi-agent swarm dynamics where many agents may be given contradicting instructions. Extending this, we train model spec vectors that steer towards references to the model spec and similarly are implemented dynamically.

We study these techniques on Qwen3.5-27B (Team, 2026) using agentic rollouts on ImpossibleBench (Zhong et al., 2025) from the MisTrace dataset (Meek et al., 2026). Our contributions are:

• Latent space monitoring for reward hacking using cheap linear probes and investigation of projection behavior during misaligned reasoning, which motivates our dynamic steering interventions.

• Dynamic steering across three methods to mitigate reward hacking at inference time, while minimizing negative effects on capabilities. We test difference-in-means vectors, optimization vectors, and steering vectors extracted from a model’s references to an anti-reward hacking model spec.

• Generalization between domains by showing that steering vectors from coding environments transfer to natural language reward hacking environments, similarly without negative effects to model capabilities.