Generalization v.s. Memorization: Tracing Language Models' Capabilities Back to Pretraining Data

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Wang, Xinyi, Antoniades, Antonis, Elazar, Yanai, Amayuelas, Alfonso, Albalak, Alon, Zhang, Kexun, Wang, William Yang
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866915177938550784
author Wang, Xinyi
Antoniades, Antonis
Elazar, Yanai
Amayuelas, Alfonso
Albalak, Alon
Zhang, Kexun
Wang, William Yang
author_facet Wang, Xinyi
Antoniades, Antonis
Elazar, Yanai
Amayuelas, Alfonso
Albalak, Alon
Zhang, Kexun
Wang, William Yang
contents The impressive capabilities of large language models (LLMs) have sparked debate over whether these models genuinely generalize to unseen tasks or predominantly rely on memorizing vast amounts of pretraining data. To explore this issue, we introduce an extended concept of memorization, distributional memorization, which measures the correlation between the LLM output probabilities and the pretraining data frequency. To effectively capture task-specific pretraining data frequency, we propose a novel task-gram language model, which is built by counting the co-occurrence of semantically related $n$-gram pairs from task inputs and outputs in the pretraining corpus. Using the Pythia models trained on the Pile dataset, we evaluate four distinct tasks: machine translation, factual question answering, world knowledge understanding, and math reasoning. Our findings reveal varying levels of memorization, with the strongest effect observed in factual question answering. Furthermore, while model performance improves across all tasks as LLM size increases, only factual question answering shows an increase in memorization, whereas machine translation and reasoning tasks exhibit greater generalization, producing more novel outputs. This study demonstrates that memorization plays a larger role in simpler, knowledge-intensive tasks, while generalization is the key for harder, reasoning-based tasks, providing a scalable method for analyzing large pretraining corpora in greater depth.
format Preprint
id arxiv_https___arxiv_org_abs_2407_14985
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Generalization v.s. Memorization: Tracing Language Models' Capabilities Back to Pretraining Data
Wang, Xinyi
Antoniades, Antonis
Elazar, Yanai
Amayuelas, Alfonso
Albalak, Alon
Zhang, Kexun
Wang, William Yang
Computation and Language
Artificial Intelligence
Machine Learning
The impressive capabilities of large language models (LLMs) have sparked debate over whether these models genuinely generalize to unseen tasks or predominantly rely on memorizing vast amounts of pretraining data. To explore this issue, we introduce an extended concept of memorization, distributional memorization, which measures the correlation between the LLM output probabilities and the pretraining data frequency. To effectively capture task-specific pretraining data frequency, we propose a novel task-gram language model, which is built by counting the co-occurrence of semantically related $n$-gram pairs from task inputs and outputs in the pretraining corpus. Using the Pythia models trained on the Pile dataset, we evaluate four distinct tasks: machine translation, factual question answering, world knowledge understanding, and math reasoning. Our findings reveal varying levels of memorization, with the strongest effect observed in factual question answering. Furthermore, while model performance improves across all tasks as LLM size increases, only factual question answering shows an increase in memorization, whereas machine translation and reasoning tasks exhibit greater generalization, producing more novel outputs. This study demonstrates that memorization plays a larger role in simpler, knowledge-intensive tasks, while generalization is the key for harder, reasoning-based tasks, providing a scalable method for analyzing large pretraining corpora in greater depth.
title Generalization v.s. Memorization: Tracing Language Models' Capabilities Back to Pretraining Data
topic Computation and Language
Artificial Intelligence
Machine Learning
url https://arxiv.org/abs/2407.14985