在ALiBi变换器中修复塌陷的注意力头
Surgical Repair of Collapsed Attention Heads in ALiBi Transformers
AI总结:
在ALiBi变换器中,通过手术重新初始化修复塌陷的注意力头,恢复98.7%的操作能力,并发现预训练配置可能为次优局部极小值。
摘要:
我们识别出在BLOOM变换器语言模型家族中存在一种系统性的注意力塌陷病理现象,其中ALiBi位置编码导致31-44%的注意力头几乎全部关注起始序列标记。塌陷在四个模型规模(560M到7.1B参数)中呈现出可预测的模式,集中在ALiBi斜率计划施加最陡峭距离惩罚的头部索引处。我们引入了手术重新初始化:具有零输出投影的有针对性的Q/K/V重新初始化,以及对所有非手术参数进行梯度屏蔽冻结。应用于BLOOM-1b7单个消费级GPU上,该技术在两次通过中恢复了98.7%的操作头部容量(242到379个384个头部)。与C4训练数据的受控比较证实,重新初始化——而不是语料库内容——驱动了恢复,并揭示了两种不同的术后现象:早期全局功能再分布,提高了模型性能,以及晚期局部退化,在嘈杂的训练信号下累积。扩展实验重新初始化大部分健康的头部与塌陷的头部一起产生了一个模型,该模型在训练困惑度上暂时优于标准BLOOM-1b7,提高了25%(12.70 vs. 16.99),表明预训练的注意力配置是次优的局部极小值。代码、检查点和诊断工具作为开源软件发布。
英文摘要:
We identify a systematic attention collapse pathology in the BLOOM family of transformer language models, where ALiBi positional encoding causes 31-44% of attention heads to attend almost entirely to the beginning-of-sequence token. The collapse follows a predictable pattern across four model scales (560M to 7.1B parameters), concentrating in head indices where ALiBi's slope schedule imposes the steepest distance penalties. We introduce surgical reinitialization: targeted Q/K/V reinitialization with zeroed output projections and gradient-masked freezing of all non-surgical parameters. Applied to BLOOM-1b7 on a single consumer GPU, the technique recovers 98.7% operational head capacity (242 to 379 of 384 heads) in two passes. A controlled comparison with C4 training data confirms that reinitialization -- not corpus content -- drives recovery, and reveals two distinct post-surgical phenomena: early global functional redistribution that improves the model, and late local degradation that accumulates under noisy training signal. An extended experiment reinitializing mostly-healthy heads alongside collapsed ones produces a model that transiently outperforms stock BLOOM-1b7 by 25% on training perplexity (12.70 vs. 16.99), suggesting that pretrained attention configurations are suboptimal local minima. Code, checkpoints, and diagnostic tools are released as open-source software.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。