Original post · AI translation
标题:“如何循环使用你的 Transformer:循环扩展、专门化与并行推理”
Meta 和麻省理工学院的一篇新论文发现,在循环中重复使用 Transformer 的层可以胜过普通模型。
循环会将相同的层运行多次,使模型在不增加参数的情况下拥有更大的深度。但每次循环都会消耗计算资源,而且通常必须对每个词元依次运行。
他们训练了参数量最高达 10 亿、训练数据最多达 1550 亿个词元的稠密模型,测试了在哪些位置设置循环以及循环多少次。他们还加入了微小的逐循环适配器,并修复了一种并行循环方法,使各次循环可以在解码期间同时运行。
在模型大小固定时,循环使用整个层堆栈带来的质量最高;而在训练计算资源紧张时,循环使用中间层的收益最大。逐循环适配器仅增加了 1.1% 至 4.3% 的参数,相比之下,将深度加倍会增加 51.4% 的参数;循环次数越多,这些适配器带来的帮助也越大。
Original
New Meta and MIT paper finds reusing a transformer's layers in loops can beat a plain model. Looping runs the same layers several times, giving a model more depth without more parameters. But each loop costs compute and normally runs in sequence for every token. They trained dense models up to 1B parameters on up to 155B tokens, testing where to loop and how many times. They also added tiny per-loop adapters and repaired a parallel looping method so loops can run at once during decoding. Looping the whole stack gave the best quality at a fixed size, while looping middle layers paid off best when training compute was tight. Per-loop adapters added only 1.1 to 4.3% more parameters, versus 51.4% for doubling depth, and helped more as loops increased.