大規模言語モデルの記憶に関する論理推論
On Memorization of Large Language Models in Logical Reasoning
October 30, 2024
著者: Chulin Xie, Yangsibo Huang, Chiyuan Zhang, Da Yu, Xinyun Chen, Bill Yuchen Lin, Bo Li, Badih Ghazi, Ravi Kumar
cs.AI
要旨
大規模言語モデル(LLMs)は、困難な推論ベンチマークで優れたパフォーマンスを達成していますが、基本的な推論ミスも起こり得ます。LLMsの推論能力のメカニズムを理解する際に、この対照的な振る舞いは疑問を呼びます。1つの仮説は、一般的な推論ベンチマークでのますます高くほぼ飽和したパフォーマンスが、類似の問題の記憶に起因する可能性があるというものです。本論文では、ナイトとニーブ(K&K)のパズルに基づいた動的生成論理推論ベンチマークを使用し、推論タスクにおける記憶の定量的測定を行い、この仮説を系統的に調査します。私たちは、LLMsがトレーニングパズルを補正後に補間できること(ほぼ完璧な精度を達成)を発見しましたが、これらのパズルがわずかに変更された場合に失敗することから、モデルがこれらのトレーニングパズルを解決するために記憶に大きく依存していることを示唆しています。一方、ファインチューニングは記憶を強化する一方で、一貫して汎化パフォーマンスを向上させることを示します。パーティクルテスト、難易度レベル間の転送可能性、モデル内部の探査、誤った回答を用いたファインチューニングを伴う詳細な分析により、LLMsがトレーニングデータの記憶にもかかわらずK&Kパズルで推論を学ぶことが示されます。この現象は、LLMsが記憶と真の推論能力の間で複雑な相互作用を示していることを示しています。最後に、サンプルごとの記憶スコアを用いた分析により、LLMsが論理パズルを解決する際に推論と記憶の間をどのように切り替えるかが明らかになります。私たちのコードとデータは、https://memkklogic.github.io で入手可能です。
English
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 found that LLMs could interpolate
the training puzzles (achieving near-perfect accuracy) after fine-tuning, yet
fail when those puzzles are slightly perturbed, suggesting that the models
heavily rely on memorization to solve those training puzzles. On the other
hand, we show that while fine-tuning leads to heavy memorization, it also
consistently improves generalization performance. In-depth analyses with
perturbation tests, cross difficulty-level transferability, probing model
internals, and fine-tuning with wrong answers suggest that the LLMs learn to
reason on K&K puzzles despite training data memorization. This phenomenon
indicates that LLMs exhibit a complex interplay between memorization and
genuine reasoning abilities. Finally, our analysis with per-sample memorization
score sheds light on how LLMs switch between reasoning and memorization in
solving logical puzzles. Our code and data are available at
https://memkklogic.github.io.Summary
AI-Generated Summary