LaRA: Layer-wise Representation Analysis for Detecting Data Contamination in RL Post-Training

Yonsei University · Seoul National University · Georgia Institute of Technology

Findings of EMNLP 2026

TL;DR

How do model internals change in RL-trained models?

LaRA detects contamination by examining how internal representations change across layers. Its key hypothesis: memorization leaves geometric fingerprints in hidden representations.

Output-level detection can suffer from miscalibrated token probabilities. Layer-level detection instead compares hidden representations of initial and perturbed questions through magnitude, direction, and variance.
Why look inside the model? LaRA examines changes in hidden representations to address the limitations of output-level detection. View original PDF.

Abstract

Reinforcement learning (RL) post-training has shown to improve reasoning in large language models (LLMs). However, there has been little exploration on the problem of data contamination in RL post-training, potentially undermining generalization and evaluation reliability of the training process itself.

Existing detection methods primarily rely on output-level signals such as likelihood or entropy, which become unreliable for RL-trained models since RL shapes behavior through trajectory-level rewards rather than token likelihoods. We propose LaRA, a layer-wise representation analysis framework for detecting contamination in RL post-trained LLMs.

LaRA introduces three complementary metrics, measuring perturbation sensitivity, directional collapse, and local representation rigidity under controlled perturbations. We find that contamination produces progressive geometric deviations across layers, including amplified perturbation sensitivity, stronger directional collapse, and enhanced local rigidity. Based on our findings, we also develop a contamination detection protocol that aggregates representation-level deviations across layers and metrics.

Experiments on RL-trained reasoning models show that our protocol outperforms existing output-level baselines for contamination detection.

Source: LaRA, arXiv v2, licensed under CC BY 4.0.

Layer-wise representation analysis

Output-level detectors examine statistics such as likelihood and entropy. RL optimizes trajectory-level rewards rather than token likelihood, motivating a closer look at the model's hidden representations.

LaRA removes key information from a question, creates semantic-preserving local variants, and measures representation shift, directional collapse, and rigidity at each layer. The aggregated score separates clean and contaminated samples.
Overview of LaRA: controlled perturbations reveal representation geometry, which is aggregated into a layer-wise contamination profile. Higher scores indicate a greater likelihood of contamination. View original PDF.

LaRA removes key information from a question and generates semantic-preserving local variants. Three complementary metrics track the resulting geometry across transformer layers:

RSM

Representation Shift Magnitude

How much does the representation move?

Measures sensitivity to removing key information from the original question.

DC

Directional Collapse

Where does it move?

Examines the directional alignment of representation shifts among semantically related questions.

RSI

Representation Stability Index

How stable is the representation?

Measures local variability under semantic-preserving perturbations to characterize representation rigidity.

Three layer-wise plots compare contaminated samples in red with clean samples in blue for RSM, DC, and RSI. Their profiles diverge across layers, with particularly clear separation in the DC plot.
Representation geometry in an RL model: clean and contaminated samples exhibit distinct layer-wise profiles across the three metrics.

Contamination detection protocol

  1. Clean-reference robust standardization. Normalize each metric at each layer using the clean-reference median and a robust scale of 1.4826 times the median absolute deviation (MAD).
  2. Metric-specific anomaly alignment. Retain the standardized RSM and DC scores and negate the standardized RSI score to align the anomaly directions.
  3. Layer-wise aggregation. Average the aligned scores across the selected metrics and layers to obtain the final LaRA contamination score.

Higher LaRA score more likely contaminated. Lower score more likely clean.

Results & analysis

The poster compares LaRA with output-level baselines across Eurus, LIMR, and OLMO, and across training checkpoints. The results show that representation-level signals can improve detection and complement output-level metrics, with gains varying by model and checkpoint.

0.80 AUCLaRA on LIMR at the initial checkpoint, compared with 0.73 for PPL.
0.81 AUCLaRA on LIMR at E2, compared with 0.74 for PPL.
0.79 AUCSC + LaRA on Eurus at E2, compared with 0.78 for SC alone.
Poster results tables reporting AUC and TPR for output-level baselines, LaRA, and SC plus LaRA across Eurus, LIMR, and OLMO, including initial, E1, and E2 checkpoints for Eurus and LIMR.
Detection results reproduced from the poster. Select any figure to view it at full size.

Robustness to perturbations

The poster evaluates different numbers of blanks and several perturbation types: information removal, number replacement, variable renaming, and distractor insertion. Detection performance varies across these settings, supporting the analysis of robustness to perturbation choices.

Robustness plots show AUC and TPR at 5 percent FPR for one to four blanks, and compare detection performance for information removal, number replacement, variable renaming, and distractor insertion.
Effects of the number of blanks and the perturbation type on LaRA detection.

Metric ablations

Ablation table compares individual metrics and their combinations across initial, E1, and E2 checkpoints. Combining RSM, DC, and RSI achieves AUC values of 0.80, 0.72, and 0.81, respectively.
Metric ablations across RL training epochs.

The poster highlights DC as the strongest standalone detection signal and emphasizes the complementary role of all three metrics.

Combining RSM, DC, and RSI yields AUC values of 0.80, 0.72, and 0.81 at the initial, E1, and E2 checkpoints, respectively.

Key takeaways

  • Look inside the model. Hidden representations provide a useful lens for detecting contamination in RL post-training.
  • Memorization leaves geometric signatures. Controlled perturbations reveal differences between clean and contaminated samples across layers.
  • Combine complementary signals. LaRA brings together shift magnitude, directional collapse, and local stability as a framework for studying post-training.

The motivation and method overview figures are available as original PDFs above. Results and analysis figures are reproduced from the LaRA poster. See the full paper for the complete method, experimental setup, and limitations.

BibTeX

@misc{gwak2026lara,
  title={LaRA: Layer-wise Representation Analysis for Detecting Data Contamination in RL Post-Training},
  author={Minju Gwak and Minseo Kwak and Dongseok Lee and Guijin Son and Alan Ritter and Jaehyung Kim},
  year={2026},
  eprint={2605.29888},
  archivePrefix={arXiv},
  primaryClass={cs.LG},
  doi={10.48550/arXiv.2605.29888},
  url={https://arxiv.org/abs/2605.29888}
}