猜测还是回忆?训练卷积神经网络对大语言模型中的记忆进行分类与定位
Guess or Recall? Training CNNs to Classify and Localize Memorization in LLMs
AI总结:
本文针对大语言模型逐字记忆的机制分类问题,基于注意力权重训练CNN评估现有分类体系,提出新的三类记忆分类法,同时开发视觉可解释技术定位对应注意力区域。
摘要:
大语言模型(LLMs)中的逐字记忆是一种涉及多种底层机制的多面现象。本文提出了一种分析现有分类体系所描述的不同记忆形式的新方法,具体而言,我们在LLM的注意力权重上训练卷积神经网络(CNNs),评估该分类体系与解码过程中涉及的注意力权重之间的一致性。我们发现现有分类体系表现不佳,无法反映注意力块内的不同机制。本文提出了一种与注意力权重一致性最大化的新分类体系,包含三类:借助语言建模能力猜测得到的记忆样本、因训练集中高重复率而回忆得到的记忆样本,以及非记忆样本。研究结果显示,少样本逐字记忆并不对应独特的注意力机制。我们还发现,很大比例的可提取样本实际上是模型猜测得到的,因此应单独开展研究。最后,我们开发了定制化的视觉可解释性技术,用于定位每种记忆形式所涉及的注意力权重区域。
英文摘要:
Verbatim memorization in Large Language Models (LLMs) is a multifaceted phenomenon involving distinct underlying mechanisms. We introduce a novel method to analyze the different forms of memorization described by the existing taxonomy. Specifically, we train Convolutional Neural Networks (CNNs) on the attention weights of the LLM and evaluate the alignment between this taxonomy and the attention weights involved in decoding. We find that the existing taxonomy performs poorly and fails to reflect distinct mechanisms within the attention blocks. We propose a new taxonomy that maximizes alignment with the attention weights, consisting of three categories: memorized samples that are guessed using language modeling abilities, memorized samples that are recalled due to high duplication in the training set, and non-memorized samples. Our results reveal that few-shot verbatim memorization does not correspond to a distinct attention mechanism. We also show that a significant proportion of extractable samples are in fact guessed by the model and should therefore be studied separately. Finally, we develop a custom visual interpretability technique to localize the regions of the attention weights involved in each form of memorization.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。