Neuron-Level Differentiation of Memorization and Generalization in Large Language Models

Ko-Wei Huang, Yi-Fu Fu, Ching-Yu Tsai, Yu-Chieh Tu, Tzu-Ling Cheng +6 more
12/24/2024
cs.CL

No official code found. Best implementation: ntumslab/neuron-diff-memgen-llm (0 stars, Apache-2.0, last commit 2025-09-07).

Abstract

We investigate how Large Language Models (LLMs) distinguish between memorization and generalization at the neuron level. Through carefully designed tasks, we identify distinct neuron subsets responsible for each behavior. Experiments on both a GPT-2 model trained from scratch and a pretrained LLaMA-3.2 model fine-tuned with LoRA show consistent neuron-level specialization. We further demonstrate that inference-time interventions on these neurons can steer the model's behavior toward memorization or generalization. To assess robustness, we evaluate intra-task and inter-task consistency, confirming that these neuron-behavior associations reflect generalizable patterns rather than dataset-specific artifacts. Our findings reveal modular structure in LLMs and enable controlling memorization and generalization behaviors at inference time.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Code and data for “Neuron-Level Differentiation of Memorization and Generalization in Large Language Models”

00PythonJul 26, 20251 years agoApache-2.0

Cite this paper

@article{huang2024neuronlevel,
  title  = {Neuron-Level Differentiation of Memorization and Generalization in Large Language Models},
  author = {Ko-Wei Huang and Yi-Fu Fu and Ching-Yu Tsai and Yu-Chieh Tu and Tzu-Ling Cheng and Cheng-Yu Lin and Yi-Ting Yang and Heng-Yi Liu and Keng-Te Liao and Da-Cheng Juan and Shou-De Lin},
  year   = {2024},
  eprint = {2412.18497},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.18497v2}
}

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/2412.18497.svg)](https://codeofpaper.com/paper/2412.18497)

Discussion