mlsanityData to 14 Oct 2026

Measuring memorization in RLHF for code completion

arXiv 2406.11715 ↗First posted 17 Jun 2024cs.LG cs.CL cs.SEcited by 13

On the map: LLM alignment / RLHF / preference optimisation → Reward modeling and RLHF

Abstract (arXiv)

Reinforcement learning with human feedback (RLHF) has become the dominant method to align large models to user preferences. Unlike fine-tuning, for which there are many studies regarding training data memorization, it is not clear how memorization is affected by or introduced in the RLHF alignment process. Understanding this relationship is important as real user data may be collected and used to align large models; if user data is memorized during RLHF and later regurgitated, this could raise privacy concerns. In addition to RLHF, other methods such as Direct Preference Optimization (DPO) and PsiPO have gained popularity for learning directly from human preferences, removing the need for optimizing intermediary reward models with reinforcement learning. In this work, we analyze how training data memorization can surface and propagate through each phase of RLHF and direct preference learning. We focus our study on code completion models, as code completion is one of the most popular use cases for large language models. We find that RLHF significantly decreases the chance that data used for reward modeling and reinforcement learning is memorized in comparison to directly fine-tuning on this data, but that examples already memorized during the fine-tuning stage of RLHF, will, in the majority of cases, remain memorized after RLHF. In contrast, we find that aligning by learning directly from human preference data via a special case of PsiPO, Identity Preference Optimization (IPO), increases the likelihood that training data is regurgitated compared to RLHF. Our work suggests that RLHF, as opposed to direct preference learning, is a safer way to mitigate the risk of regurgitating sensitive preference data when aligning large language models. We find our conclusions are robust across multiple code completion datasets, tasks, and model scales.

Key facts. Cited by 13 papers in the map (data through 14 Oct 2026). Placed in Reward modeling and RLHF, one of 10 directions in LLM alignment / RLHF / preference optimisation. Builds on 30 of its 48 references that are in the map. First posted on arXiv 17 Jun 2024.

Builds on

30 of 48 references.

Closest ancestors · 3

Same direction, newest first

  1. 2023Direct Preference Optimization: Your Language Model is Secretly a Reward Model29 May
  2. 2022Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback12 Apr
  3. 2017Deep reinforcement learning from human preferences12 Jun

Other references · 27

  1. 2022Training language models to follow instructions with human feedbackcited by 15,971
  2. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  3. 2021Evaluating Large Language Models Trained on Codecited by 8,320
  4. 2019The Curious Case of Neural Text Degenerationcited by 2,916
  5. 2020Learning to summarize from human feedbackcited by 2,588
  6. 2020Extracting Training Data from Large Language Modelscited by 2,189
  7. 2018Hierarchical Neural Story Generationcited by 1,193
  8. 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
  9. 2023A General Theoretical Paradigm to Understand Learning from Human Preferencescited by 912
  10. 2022Quantifying Memorization Across Neural Language Modelscited by 763
  11. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
  12. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 498
15 more
  1. 2023Scalable Extraction of Training Data from (Production) Language Modelscited by 434
  2. 2023Detecting Pretraining Data from Large Language Modelscited by 387
  3. 2022Efficient Training of Language Models to Fill in the Middlecited by 255
  4. 2024Do Membership Inference Attacks Work on Large Language Models?cited by 195
  5. 2023Beyond Memorization: Violating Privacy Via Inference with Large Language Modelscited by 175
  6. 2021Counterfactual Memorization in Neural Language Modelscited by 156
  7. 2023Emergent and Predictable Memorization in Large Language Modelscited by 148
  8. 2018Learning to Write with Cooperative Discriminatorscited by 119
  9. 2020Trading Off Diversity and Quality in Natural Language Generationcited by 96
  10. 2019Analyzing Information Leakage of Updates to Natural Language Modelscited by 90
  11. 2023Exploring Memorization in Fine-tuned Language Modelscited by 45
  12. 2024Elephants Never Forget: Memorization and Learning of Tabular Data in Large Language Modelscited by 36
  13. 2024Alpaca against Vicuna: Using LLMs to Uncover Memorization of LLMscited by 33
  14. 2023Identifying and Mitigating Privacy Risks Stemming from Language Models: A Surveycited by 30
  15. 2023Assessing Privacy Risks in Language Models: A Case Study on Summarization Taskscited by 8

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2025: 8; 2026: 5.

13 papers.

Sort:

By area:

Similar, not cited

Close in wording, no citation either way

  1. 2024Secrets of RLHF in Large Language Models Part II: Reward Modeling
  2. 2024Understanding and Alleviating Memory Consumption in RLHF for LLMs
  3. 2024Does RLHF Scale? Exploring the Impacts From Data, Model, and Method
  4. 2024How to Evaluate Reward Models for RLHF
  5. 2024RLHF Deciphered: A Critical Analysis of Reinforcement Learning from Human Feedback for LLMs
  6. 2026Reinforcement Learning from Human Feedback: A Statistical Perspective
  7. 2024Towards Data-Centric RLHF: Simple Metrics for Preference Dataset Comparison
  8. 2026Generalisation of RLHF under Reward Shift and Clipped KL Regularisation