rhscope.probes.dom¶
Difference-of-means (DoM) probe.
Given pooled activations labeled as hack vs clean, the DoM probe stores a single direction:
direction = (mean_hack - mean_clean) / ||mean_hack - mean_clean||
Score of a new activation x is the signed projection direction · x.
Higher = more hack-like.
Optionally, the probe can store a whitened direction computed from the pooled within-class covariance (ZCA-style). This often improves separability when class covariances are similar but highly anisotropic.
References
Arxiv 2609.19101 - “Monitoring and Discovering Reward Hacking with Internal Representations”. The core difference-of-means construction is from this paper.
- class rhscope.probes.dom.DoMProbe(metadata, *, whiten=False)[source]¶
Bases:
ProbeDifference-of-means probe over pooled activations.
- Variables:
probe_type (ClassVar[str]) – Discriminator used by the
Proberegistry.whiten – If True, compute the direction from whitened activations. This information is stored in metadata.extra so
loadcan round-trip it faithfully.
- Parameters:
metadata (ProbeMetadata)
whiten (bool)
- fit(hack_activations, clean_activations)[source]¶
Fit by taking the normalized difference of class means.
- Parameters:
- Raises:
ValueError – If either tensor is empty, has the wrong rank, or has hidden dimension different from the probe’s metadata.
- Return type:
None