arXiv:2409.02228cs.LGcs.CL2024-09被引 4

研究语言模型遗忘特定技能时的行为变化,发现遗忘效果因任务而异且难以预测。

Unforgettable Generalization in Language Models

  • 通过随机标签微调实现模型遗忘,使其对训练集样本产生近似随机输出。
  • 部分任务(如蕴含分类)遗忘可泛化到新样本,另一些任务(如科学问答)则仅影响训练数据。
  • 遗忘效果与初始预测置信度和表示变异性有关,且模型仍能被线性探测恢复技能。

当语言模型通过在随机标签上微调来遗忘某项技能时,其行为如何变化?我们研究了基于Transformer的语言模型在遗忘过程中的表现:在遗忘训练集上,模型对单个样本的预测接近随机;但在外部样本上,不同任务的表现差异显著。某些任务(如蕴含分类)的遗忘具有强泛化能力,导致模型对新实例产生无信息输出;而另一些任务(如物理常识推理和科学问答)的遗忘仅限于训练样本,模型仍能准确处理相似新样本。数据集难度无法预测遗忘是否可泛化,但初始预测置信度低和训练数据表示变异性低与更强的泛化相关。最令人意外的是,随机标签遗忘对训练集内容不敏感——即使在科学问题上用随机标签训练,模型仍能准确回答其他科学问题,却在蕴含分类任务上开始随机输出。此外,即便具有泛化性的遗忘也仅为浅层,线性探测器仍能从模型表征中可靠恢复原任务。结果表明,通过微调实现目标技能移除极难且不可预测。

原文摘要 · Abstract (English)

When language models (LMs) are trained to forget (or "unlearn'') a skill, how precisely does their behavior change? We study the behavior of transformer LMs in which tasks have been forgotten via fine-tuning on randomized labels. Such LMs learn to generate near-random predictions for individual examples in the "training'' set used for forgetting. Across tasks, however, LMs exhibit extreme variability in whether LM predictions change on examples outside the training set. In some tasks (like entailment classification), forgetting generalizes robustly, and causes models to produce uninformative predictions on new task instances; in other tasks (like physical commonsense reasoning and scientific question answering) forgetting affects only the training examples, and models continue to perform the "forgotten'' task accurately even for examples very similar to those that appeared in the training set. Dataset difficulty is not predictive of whether a behavior can be forgotten; instead, generalization in forgetting is (weakly) predicted by the confidence of LMs' initial task predictions and the variability of LM representations of training data, with low confidence and low variability both associated with greater generalization. Perhaps most surprisingly, random-label forgetting appears to be somewhat insensitive to the contents of the training set: for example, models trained on science questions with random labels continue to answer other science questions accurately, but begin to produce random labels on entailment classification tasks. Finally, we show that even generalizable forgetting is shallow: linear probes trained on LMs' representations can still perform tasks reliably after forgetting. Our results highlight the difficulty and unpredictability of performing targeted skill removal from models via fine-tuning.

语言模型遗忘机制泛化能力微调

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。