arXiv:2502.16722cs.CLcs.AI2025-02被引 4

解析BERT微调时各层特征演化,发现从通用到专用的渐进式转变。

Layer-Wise Evolution of Representations in Fine-Tuned Transformers: Insights from Sparse AutoEncoders

  • 通过稀疏自编码器分析激活相似性,追踪微调中特征变化
  • 早期层保留通用特征,中间层过渡,后期层完全适配任务
  • 揭示了模型如何在不破坏原有知识的前提下学习新任务

微调预训练Transformer是提升基础模型在特定任务上性能的关键技术,从BERT到大语言模型均广泛应用。理解微调过程对揭示模型如何适应特定目标、保留通用表征并获取任务专属特征至关重要。本文以BERT为例,通过分析激活相似性、训练稀疏自编码器(SAEs)以及可视化不同层的词元级激活,研究微调机制。在多个数据集和BERT各层上的实验表明,特征适应呈现稳定演进:早期层主要保留通用表征,中间层作为通用与任务特有特征的过渡,后期层则完全专用于任务适配。这些发现为理解微调对变换器架构中表征学习的影响提供了关键洞察。

原文摘要 · Abstract (English)

Fine-tuning pre-trained transformers is a powerful technique for enhancing the performance of base models on specific tasks. From early applications in models like BERT to fine-tuning Large Language Models (LLMs), this approach has been instrumental in adapting general-purpose architectures for specialized downstream tasks. Understanding the fine-tuning process is crucial for uncovering how transformers adapt to specific objectives, retain general representations, and acquire task-specific features. This paper explores the underlying mechanisms of fine-tuning, specifically in the BERT transformer, by analyzing activation similarity, training Sparse AutoEncoders (SAEs), and visualizing token-level activations across different layers. Based on experiments conducted across multiple datasets and BERT layers, we observe a steady progression in how features adapt to the task at hand: early layers primarily retain general representations, middle layers act as a transition between general and task-specific features, and later layers fully specialize in task adaptation. These findings provide key insights into the inner workings of fine-tuning and its impact on representation learning within transformer architectures.

Transformer微调表征演化

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