arXiv:2605.03953cs.LGcs.CL2026-05被引 1

让Transformer动态选择性地使用早期特征,提升性能且不增加开销。

Transformers with Selective Access to Early Representations

论文配图:Transformers with Selective Access to Early Representations
图 1 · 摘自论文原文
  • 用上下文相关的门控机制控制对早期表示的访问,而非固定复制。
  • 在130M到1.3B参数模型上,验证损失和零样本准确率均优于基线。
  • 特别在检索密集型任务中提升约1.5分,保持与原模型相当的效率。

近期一些Transformer架构将早期层的表示传递给深层,因残差流深度变换后低层特征难以恢复。现有方法中,最简单的是添加静态值残差:学习的混合系数使第一层值投影V_1均匀分布于所有标记和注意力头。更灵活的密集或动态方法可恢复更精细的访问,但代价更高。我们认为V_1的有用性在不同标记、头和上下文中并不恒定;不同位置可能需要不同程度的早期词汇或语义信息。因此,我们将早期表示重用视为检索问题而非连接问题,提出选择性访问Transformer(SATFormer),保留第一层值路径,同时通过上下文依赖的门控机制控制访问。在130M至1.3B参数的模型上,SATFormer一致优于静态值残差和Transformer基线,验证损失和零样本准确率均有提升。其最大收益出现在检索密集型基准上,相较静态值残差平均提升约1.5分,同时保持接近基线的吞吐量和内存占用。门控分析表明存在稀疏、深度依赖、头特定和类别敏感的访问模式,支持其学习选择性重用早期表示而非均匀复制。代码已开源。

原文摘要 · Abstract (English)

Several recent Transformer architectures expose later layers to representations computed in the earliest layers, motivated by the observation that low-level features can become harder to recover as the residual stream is repeatedly transformed through depth. The cheapest among these methods add static value residuals: learned mixing coefficients that expose the first-layer value projection V_1 uniformly across tokens and heads. More expressive dense or dynamic alternatives recover finer-grained access, but at higher memory cost and lower throughput. The usefulness of V_1 is unlikely to be constant across tokens, heads, and contexts; different positions plausibly require different amounts of access to early lexical or semantic information. We therefore treat early-representation reuse as a retrieval problem rather than a connectivity problem, and introduce Selective Access Transformer (SATFormer), which preserves the first-layer value pathway while controlling access with a context-dependent gate. Across models from 130M to 1.3B parameters, SATFormer consistently improves validation loss and zero-shot accuracy over the static value-residual and Transformer baselines. Its strongest gains appear on retrieval-intensive benchmarks, where it improves over static value residuals by approximately 1.5 average points, while maintaining throughput and memory usage close to the baseline Transformer. Gate analyses suggest sparse, depth-dependent, head-specific, and category-sensitive access patterns, supporting the interpretation that SATFormer learns selective reuse of early representations rather than uniform residual copying. Our code is available at https://github.com/SkyeGunasekaran/SATFormer.

Transformer注意力机制模型优化特征重用

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