Detecting RLVR Training Data via Structural Convergence of Reasoning

Hongbo Zhang, Yue Yang, Jianhao Yan, Guangsheng Bao, Yue Zhang

Abstract

Reinforcement learning with verifiable rewards (RLVR) is central to training modern reasoning models, but the undisclosed training data raises concerns about benchmark contamination. Unlike pretraining methods, which optimize models using token-level probabilities, RLVR fine-tunes models based on reward feedback from self-generated reasoning trajectories, making conventional likelihood-based detection methods less effective. We show that RLVR induces a distinctive behavioral signature: prompts encountered during RLVR training result in more rigid and similar generations, while unseen prompts retain greater diversity. We introduce Min-$k$NN Distance, a simple black-box detector that quantifies this collapse by sampling multiple completions for a given prompt and computing the average of the $k$ smallest nearest-neighbor edit distances. Min-$k$NN Distance requires no access to the reference model or token probabilities. Experiments across multiple RLVR-trained reasoning models show that Min-$k$NN Distance reliably distinguishes RL-seen examples from unseen ones and outperforms existing membership inference and RL contamination detection baselines.

Introduction

Large Language Models (LLMs) have achieved remarkable performance in mathematics and coding, largely driven by Reinforcement Learning with Verifiable Rewards (RLVR). In this paradigm, models are fine-tuned using reward feedback from self-generated reasoning trajectories, such as Chain-of-Thought, that lead to correct, verifiable answers. However, the lack of transparency regarding RL training sets has led to a significant "benchmark contamination" problem. It remains unclear whether high performance on benchmarks stems from genuine reasoning capabilities or exposure to test questions during the RLVR phase.

Traditional Membership Inference Attacks (MIAs) typically rely on token-level probabilities to detect memorization. Because RLVR optimizes rewards rather than token likelihoods, these traditional methods often fail. This paper introduces a novel black-box detection method based on the observation that RLVR induces a unique "structural collapse" in model behavior.

Methodology: Min-$k$NN Distance

The core insight of this work is that RLVR-trained models exhibit structural convergence. When presented with a prompt seen during training, the model tends to generate highly similar, rigid reasoning trajectories across multiple independent samples. In contrast, unseen prompts elicit a wider variety of reasoning paths.

Overview of structural convergence and the Min-kNN Distance metric. RLVR training causes reasoning paths to cluster into rigid structures for seen prompts, a phenomenon quantified by measuring nearest-neighbor edit distances.

To quantify this effect, we propose Min-$k$NN Distance, a black-box detector:

  1. Sampling: Generate $N$ completions (e.g., 32) for a target prompt.
  2. Distance Calculation: Compute the pairwise normalized Levenshtein edit distance between all completions.
  3. Nearest Neighbor Identification: For each completion $c_i$, identify its nearest neighbor $NN_i$ (the completion with the minimum edit distance).
  4. Scoring: The final score is the mean of the $k$ smallest $NN_i$ values. A low score indicates structural rigidity (likely a "seen" prompt), while a high score indicates diversity (likely "unseen").

Empirical Analysis of Structural Collapse

Our analysis confirms that RLVR systematically compresses the reasoning space. As models improve during the RL phase, they do not just learn the correct answer; they converge on a few highly successful, rigid structural modes for reaching that answer. This rigidity is particularly pronounced in symbolic and algebraic steps rather than boilerplate text.

Reasoning diversity vs. validation accuracy across training steps. As RLVR training progresses (increasing accuracy), diversity metrics across EAD, NLI, and Embedding spaces consistently decline, signaling structural convergence.

As shown in the experimental results, this decline in diversity is a robust signal across different RL algorithms, including GRPO and DAPO. The inverse relationship between performance and diversity provides a reliable behavioral "tell" for training data exposure.

Key Results and Discussion

  • Detection Performance: Min-$k$NN Distance achieved an average AUC of 0.70 across various models (1.5B to 32B parameters), representing a 17% relative improvement over baselines like Self-Critique and Recall.
  • Robustness to Paraphrasing: The detector is remarkably resistant to surface-level changes. Paraphrasing training prompts only reduced the AUC from 0.72 to 0.71, as the model still defaulted to its learned rigid reasoning structures.
  • Distillation Leakage: We found that structural rigidity is transferred from teacher models to student models during distillation. Min-$k$NN Distance can successfully detect prompts used to train a teacher model by auditing the student (AUC 0.76 on OpenR1-Distill-7B).

Conclusion and Limitations

Min-$k$NN Distance provides a powerful, probability-free tool for identifying benchmark contamination in reasoning models. However, the method is computationally intensive, requiring multiple samples per prompt (averaging ~6.65 seconds per item). Furthermore, its effectiveness depends on the continued presence of structural collapse in RLVR algorithms. If future RL techniques manage to optimize for both reward and reasoning diversity, the strength of this detection signal may diminish. Future work should explore mitigating these biases and preventing contamination at the source.

Summary updated

Abstract

Reinforcement learning with verifiable rewards (RLVR) is central to training modern reasoning models, but the undisclosed training data raises concerns about benchmark contamination. Unlike pretraining methods, which optimize models using token-level probabilities, RLVR fine-tunes models based on reward feedback from self-generated reasoning trajectories, making conventional likelihood-based detection methods less effective. We show that RLVR induces a distinctive behavioral signature: prompts encountered during RLVR training result in more rigid and similar generations, while unseen prompts retain greater diversity. We introduce Min-$k$NN Distance, a simple black-box detector that quantifies this collapse by sampling multiple completions for a given prompt and computing the average of the $k$ smallest nearest-neighbor edit distances. Min-$k$NN Distance requires no access to the reference model or token probabilities. Experiments across multiple RLVR-trained reasoning models show that Min-$k$NN Distance reliably distinguishes RL-seen examples from unseen ones and outperforms existing membership inference and RL contamination detection baselines.
BibTeX
@inproceedings{zhang2026detecting,
  author = {Hongbo Zhang and Yue Yang and Jianhao Yan and Guangsheng Bao and Yue Zhang and Yue Zhang},
  title = {{Detecting RLVR Training Data via Structural Convergence of Reasoning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=7iHajwYLxA},
}
Figure