CLOct 30, 2024

On Memorization of Large Language Models in Logical Reasoning

arXiv:2410.23123v2127 citationsh-index: 22Has CodeIJCNLP-AACL
Originality Incremental advance
AI Analysis

This addresses the problem of understanding LLM reasoning mechanisms for researchers, showing that memorization and reasoning coexist, which is incremental but clarifies a key debate.

The paper investigates whether LLMs' high performance on reasoning benchmarks stems from memorization, using a dynamic logical puzzle dataset, and finds that fine-tuning leads to both memorization and improved generalization, with models developing reasoning skills alongside memorization.

Large language models (LLMs) achieve good performance on challenging reasoning benchmarks, yet could also make basic reasoning mistakes. This contrasting behavior is puzzling when it comes to understanding the mechanisms behind LLMs' reasoning capabilities. One hypothesis is that the increasingly high and nearly saturated performance on common reasoning benchmarks could be due to the memorization of similar problems. In this paper, we systematically investigate this hypothesis with a quantitative measurement of memorization in reasoning tasks, using a dynamically generated logical reasoning benchmark based on Knights and Knaves (K&K) puzzles. We find that LLMs could interpolate and memorize the training puzzles (achieving near-perfect accuracy) after fine-tuning, yet they struggle with slight variations of these puzzles. On the other hand, we show that while fine-tuning leads to heavy memorization, it also consistently improves generalization performance. Through in-depth analyses with perturbation tests, cross difficulty-level transferability, probing model internals, and fine-tuning with wrong answers, we establish that LLMs develop reasoning skills on K&K puzzles alongside memorization. Finally, our analysis based on a per-sample memorization score sheds light on how LLMs switch between reasoning and memorization when solving logical puzzles. Our code and data are available at https://memkklogic.github.io.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes