分层残差:残差宽度与计算宽度的极简解耦
研究论文 · 2026/11/09
残差连接是Transformer的基础,但隐式地将贯穿深度的残差宽度与每层内部的计算宽度绑定。我们提出分层残差(HiRes),一种极简的架构改动,将这两个维度解耦:加宽残差状态,同时保持每层计算宽度不变。HiRes将层分组为块:每个块内部使用标准的d维PreNorm层,而更宽的D维PostNorm外层残差连接各块。学习到的读写投影在块边界桥接两个空间,单个Transformer层保持不变。在不同模型规模和深度下,HiRes始终优于原始残差加法,拟合的缩放定律表明FLOPs效率提升1.30倍。在OLMoE-1B-7B的500B token预训练中,HiRes训练损失降低0.0208,下游准确率提高1.14个百分点。HiRes在激活内存和I/O成本更低的情况下,与其他残差扩展方法(如VWN、mHC和AttnRes)相比也具有竞争力。它仅由稠密投影和归一化构成,无需专用内核或基础设施级优化。因此,HiRes仅使用标准算子就将残差宽度暴露为一个实用的缩放变量。
HiRes提供了一种仅用标准算子就能将残差宽度作为缩放变量的实用方法,在提升效率的同时保持架构简洁,具有很高的实用价值。
Residual connections underpin Transformers, but they implicitly tie the residual width carried through depth to the compute width used inside each layer. We introduce Hierarchical Residuals (HiRes), a minimalist architectural change that decouples these dimensions, widening the residual state while keeping per-layer compute width fixed. HiRes groups layers into blocks: standard d-dimensional PreNorm layers operate inside each block, while a wider D-dimensional PostNorm outer residual connects blocks. Learned read/write projections bridge the two spaces at block boundaries, leaving individual Transformer layers unchanged. Across different model sizes and depths, HiRes consistently outperforms vanilla residual addition, with fitted scaling laws indicating a 1.30-fold improvement in FLOPs efficiency. On OLMoE-1B-7B pretraining for 500B tokens, HiRes achieves 0.0208 lower training loss and 1.14-point higher downstream accuracy. HiRes is also competitive with other residual expansion methods such as VWN, mHC and AttnRes with less activation memory and I/O costs. Built from only dense projections and normalizations, it requires neither specialized kernels nor infrastructure-level optimizations. HiRes thus exposes residual width as a practical scaling variable using only standard operators.