Related work¶
Scope statement¶
rhscope is a library for activation probes targeting reward hacking. The compute / accuracy / interpretability corner of the detector space - cheap at inference, interpretable as a single direction in hidden-state space, bound to a specific base model - is underserved by existing tooling, and that is the corner rhscope occupies.
What rhscope deliberately does not ship:
LLM-as-judge detectors. Every provider SDK (OpenAI, Anthropic, the OpenAI-compatible protocol used by Ollama, vLLM, LM Studio, TGI) already exposes a simpler API for prompting a judge model than anything we would write on top. Users who want to compose a judge with a probe can wrap their own call in
CallableDetectorand plug it intoCompositeDetector.Heuristic / regex / AST detectors. These are short to write for a user’s specific hacking pattern, and shipping a generic set encourages treating them as more reliable than they are.
Both families are perfectly usable as external baselines; they are just not in the library’s scope.
Activation-probe literature¶
Linear probes on hidden states have a long history in interpretability (Alain and Bengio, 2016; Belinkov, 2022). For safety applications, Marks and Tegmark (2023) and the ActAdd / representation-engineering line (Zou et al., 2023) showed that simple linear directions capture concepts like truthfulness, refusal, and harmful intent with substantially higher signal than output-based judges on the same budget.
Difference-of-means probes are the simplest member of that family and (per Marks and Tegmark) often match more complex classifiers for binary safety concepts. rhscope’s
DoMProbeis this construction, with optional ZCA whitening.Logistic probes trained via L-BFGS are the standard stronger baseline. rhscope’s
LogisticProbeis a plain L2-regularised logistic regression, torch-native, no scikit-learn dependency at scoring time.Non-linear probes. Debate about whether a non-linear probe tells you something a linear probe does not is an ongoing thread in the interpretability literature. rhscope ships
MLPProbe(a shallow two-layer tanh network with early stopping) so users can run the comparison on their own data without reimplementing it.
What rhscope adds. Probes are a research primitive; rhscope wraps
them in production ergonomics: (a) a ProbeMetadata Pydantic
schema binding every probe to its base model / layer / pooling /
category, (b) SafeTensors + JSON sidecar persistence with
content-addressed training-data hashes, (c) Hub publish / resolve
helpers, (d) training + scoring pipelines, and (e) the drift and
evasion detection work below. The novelty is at the system level - a
single library where a post-training engineer can train, evaluate,
publish, and apply a probe end to end, with first-class hooks for TRL
and verl and a first-class story for monitor evasion.
Monitor evasion / obfuscation¶
Training against a monitor as an optimisation pressure. Hubinger et al. (2024, Sleeper Agents) and the monitor-gaming thread in the Anthropic alignment papers argue that if a monitor’s output enters the reward, the policy will learn to game the monitor as much as the reward. Experimental confirmations show LLM policies trained with a CoT monitor learn to hide reasoning from it.
Probe-specific obfuscation. Workshop papers from 2025-2026 demonstrate that under sufficient pressure, policies trained against a linear probe for a concept keep producing the concept but rotate activations off the probe’s direction. The scalar monitor output drops to chance while the underlying behaviour continues.
What rhscope adds. rhscope.research.EvasionDetector is
the only open-source implementation we are aware of that
operationalises the probe-subspace-drift idea as a running-time check.
At each eval step it (i) fits a fresh DoM direction on freshly-
labelled activations, (ii) measures the subspace angle between fresh
and baseline direction, and (iii) scores both directions on a
held-out validation half of that step’s data. Its
EvasionVerdict distinguishes reforming (hacking genuinely
gone) from obfuscating (signal rotated out of the baseline subspace)
from stable (monitor working) from undecided (not enough signal).
Reference-model-delta scoring¶
rhscope’s rhscope.RefDeltaDetector computes
s(prompt, response) = log P_policy(response | prompt)
- log P_reference(response | prompt)
averaged over response tokens. High s means the trained policy is
unusually eager to emit this response relative to the pre-RL baseline.
It is a cheap, model-agnostic signal that uses both models already
loaded for the KL penalty. On its own it flags drift (not
necessarily hacking), but combined with a probe it adds a second
axis. Validated as a complementary detector; not yet as a standalone
hacking detector in its own right.
Reward-hacking benchmarks¶
MBPP (Austin et al., 2021) is a classic small-task Python coding benchmark. Its tests are known to be incomplete, which makes it a natural source of reward-hackable tasks: hardcoded return of the single visible test’s expected value satisfies the grader without implementing the function.
No widely-published unified reward-hacking benchmark exists at the time of writing. Comparison across papers is apples-to-oranges.
What rhscope adds. RHDetectBench.load_jsonl() and
RHDetectBench.load_hub() let users assemble a labelled,
sandbox-verified benchmark from any MBPP-style dataset (pair the
reference solution against a hardcoded-return exploit; verify each
side against the weak + strong test split).
Where rhscope does not innovate¶
The probe constructions themselves (DoM, logistic, shallow MLP) are standard.
The sandbox (subprocess + rlimit, Docker option) is standard.
The TRL and verl reward-function surfaces use each framework’s existing primitives; no new RL algorithmic contribution.
The novelty is at the system level: a focused library that lets a post-training engineer at any lab, on any base model, (a) train a probe in one call, (b) use it as a drop-in reward-penalty in TRL or verl, and (c) tell reform from obfuscation when they train against it.