门控循环变换器:通过循环调制实现表达深度

·

其他资讯 · 2026/08/27

缩放Transformer语言模型在表达性和内存效率之间存在固有矛盾。每层独立权重虽保留功能特化,但内存占用大;而标准深度共享则强制统一变换,降低表示多样性。我们提出门控循环Transformer,一种循环深度模型,由固定深度的前奏块和尾声块包围一个共享核心,迭代R次。受门控循环神经网络启发,我们使用轻量投影和逐元素更新门(基于隐藏状态、前奏输出和每步重采样的噪声)来调节循环更新,使模型能将输入特化到少数几层,而非需要许多独立层。在等FLOPS约束下,3层门控循环Transformer匹配12层GPT-2 Small基线的准确率,并在所有九个规模-预算单元中优于MoR和重尾深度采样;在中大规模下接近密集质量,在中等规模加倍预算后超越。在等参数约束下,更深循环达到2.76验证损失,而非循环对应为2.84。结果表明,自适应深度复用是以参数换质量的原则性策略:大规模下参数减少63%,峰值解码内存减少59%,编译生成延迟增加10%。

该论文提出一种新颖的循环深度Transformer架构,通过门控机制实现自适应深度复用,在保持模型质量的同时大幅减少参数和内存,为高效语言模型设计提供了新思路,实验验证充分,具有实际应用价值。

Scaling transformer language models creates an inherent tension between expressivity and memory efficiency. While unique weights across layers preserve functional specialization---from input-grounding to abstract refinement---they incur a substantial memory footprint. Conversely, standard depth-sharing enforces uniform transformations that collapse representational diversity and degrade modeling quality. We introduce Gated Recurrent Transformer, a recurrent depth transformer where fixed-depth prelude and coda blocks bracket a single shared core iterated R times. Inspired by gated recurrent neural networks, we employ a lightweight projection and an elementwise update gate---conditioned on the hidden state, the fixed prelude output, and noise resampled at every step---to modulate the recurrent update. This allows the model to specialize the input to the same few layers across recurrences, rather than requiring many unique layers to achieve functional diversity. Under an isoFLOPS constraint, a 3-layer Gated Recurrent Transformer matches the accuracy of a 12-layer GPT-2 Small baseline with similar training and inference FLOPs, and leads MoR and heavy-tail depth sampling in all nine scale-by-budget cells; at medium and large scale it approaches dense quality at the standard token budget and overtakes it at medium scale once that budget is doubled. Under an isoPARAMS constraint, deeper recurrence achieves a 2.76 validation loss versus 2.84 for a non-recurrent counterpart at matched parameter and data budget. Our results demonstrate that adaptive depth reuse is a principled strategy for trading parameters for quality: at large scale, 63% fewer parameters and 59% less peak decoding memory for a 10% increase in compiled generation latency.

阅读原文

参与讨论