MemLens: Uncovering Memorization in LLMs with Activation Trajectories

Zirui He, Haiyan Zhao, Ali Payani, Mengnan du
9/25/2025
cs.CL

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) are commonly evaluated on challenging benchmarks such as AIME and Math500, which are susceptible to contamination and risk of being memorized. Existing detection methods, which primarily rely on surface-level lexical overlap and perplexity, demonstrate low generalization and degrade significantly when encountering implicitly contaminated data. In this paper, we propose MemLens (An Activation Lens for Memorization Detection) to detect memorization by analyzing the probability trajectories of numeric tokens during generation. Our method reveals that contaminated samples exhibit ``shortcut'' behaviors, locking onto an answer with high confidence in the model's early layers, whereas clean samples show more gradual evidence accumulation across the model's full depth. We observe that contaminated and clean samples exhibit distinct and well-separated reasoning trajectories. To further validate this, we inject carefully designed samples into the model through LoRA fine-tuning and observe the same trajectory patterns as in naturally contaminated data. These results provide strong evidence that MemLens captures genuine signals of memorization rather than spurious correlations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{he2025memlens,
  title  = {MemLens: Uncovering Memorization in LLMs with Activation Trajectories},
  author = {Zirui He and Haiyan Zhao and Ali Payani and Mengnan du},
  year   = {2025},
  eprint = {2509.20909},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.20909v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.20909.svg)](https://codeofpaper.com/paper/2509.20909)

Discussion