Skip to main content
QUICK REVIEW

[论文解读] Mechanistically analyzing the effects of fine-tuning on procedurally defined tasks

Samyak Jain, Robert Kirk|arXiv (Cornell University)|Nov 21, 2023
Explainable Artificial Intelligence (XAI)被引用 4
一句话总结

该论文通过基于Tracr的变换器和PCFGs,使用合成的、程序化定义的任务,对微调如何改变预训练模型能力进行了机制性分析。研究发现,微调通常仅在现有能力之上学习一个最小的'包装器'变换,而非修改这些能力本身;并且这些底层能力可通过剪枝迅速恢复,暗示微调可能无意中禁用了安全机制。

ABSTRACT

Fine-tuning large pre-trained models has become the de facto strategy for developing both task-specific and general-purpose machine learning systems, including developing models that are safe to deploy. Despite its clear importance, there has been minimal work that explains how fine-tuning alters the underlying capabilities learned by a model during pretraining: does fine-tuning yield entirely novel capabilities or does it just modulate existing ones? We address this question empirically in synthetic, controlled settings where we can use mechanistic interpretability tools (e.g., network pruning and probing) to understand how the model's underlying capabilities are changing. We perform an extensive analysis of the effects of fine-tuning in these settings, and show that: (i) fine-tuning rarely alters the underlying model capabilities; (ii) a minimal transformation, which we call a 'wrapper', is typically learned on top of the underlying model capabilities, creating the illusion that they have been modified; and (iii) further fine-tuning on a task where such hidden capabilities are relevant leads to sample-efficient 'revival' of the capability, i.e., the model begins reusing these capability after only a few gradient steps. This indicates that practitioners can unintentionally remove a model's safety wrapper merely by fine-tuning it on a, e.g., superficially unrelated, downstream task. We additionally perform analysis on language models trained on the TinyStories dataset to support our claims in a more realistic setup.

研究动机与目标

  • 理解微调如何改变预训练模型的底层能力,特别是在安全与对齐背景下的影响。
  • 调查微调是否修改了预存在的模型能力,还是仅在之上添加了一层新的变换。
  • 评估在未显式重新训练的情况下,预训练能力是否可在微调后被恢复。
  • 评估微调模型对结构干预(如剪枝和探针)的鲁棒性。
  • 考察微调对具有弱相关性或强相关性预训练能力的模型的影响。

提出的方法

  • 使用基于Tracr的模型,通过概率上下文无关文法(PCFGs)生成程序化任务,构建可解释的合成环境。
  • 采用网络剪枝技术,识别并隔离微调所引起的最小结构变化。
  • 应用线性探针,测量微调后预训练能力的保留程度与可访问性。
  • 比较不同微调超参数(包括初始学习率以及下游数据集中虚假相关性存在与否)下的模型行为。
  • 分析在预训练能力对下游目标强相关或弱相关的任务上微调的模型。
  • 在受控环境下隔离微调对特定能力(如计数或首次出现位置)的影响。

实验结果

研究问题

  • RQ1微调是否从根本上改变了预训练期间学习到的底层能力,还是仅增加了一层变换?
  • RQ2微调后,预训练能力在多大程度上得以保留或被抑制?
  • RQ3是否可通过剪枝等结构干预手段,在微调后恢复预训练能力?
  • RQ4预训练能力的相关性(强相关 vs. 弱相关)如何影响微调后模型的结构?
  • RQ5微调数据中的虚假相关性在抑制性包装器出现过程中起什么作用?

主要发现

  • 微调很少改变底层模型能力;相反,它通常仅在现有能力之上学习一个最小的变换,称为'包装器'。
  • 包装器高度局部化,如剪枝所示:仅移除少数神经元或权重即可恢复原始预训练能力。
  • 微调后,预训练能力可被迅速恢复,仅需几次梯度更新步骤即可重新激活,表明其结构仍保持完整。
  • 在预训练能力与下游任务弱相关的任务上微调的模型,仍保留执行预训练任务的能力,经探针和剪枝验证。
  • 当使用低学习率微调时,模型可能学习到一种'抑制剂',以抑制预训练能力,但可通过剪枝逆转此效果。
  • 探针结果表明,使用高学习率微调的模型会失去对预训练能力的访问(如计数'a'的数量),而使用低学习率的模型则能保留这些能力,尤其当预训练能力与任务强相关时。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。