循环循环变换器
Recurrent Looped Transformer

原始链接: https://yifanzhang-pro.github.io/recurrent-looped-tranformer/

该架构引入了一种混合模型,结合了并行**因果编码器**与**循环解码器**,实现了随序列长度线性扩展的深度。 通过利用循环路径,模型的有效深度随着序列的推进而增加——在处理 $t$ 个标记后会经过 $tL_D$ 个解码器块——同时保持每个标记的计算成本恒定。该模型通过对已知标记进行编码器任务批处理,并对解码器执行独立的迭代更新,从而优先保证硬件效率。 关键技术特征包括: * **统一状态转换:** 系统维护一个由循环输出 ($s_t$) 和局部滑动窗口注意力 (SWA) KV 缓存 ($C_t^D$) 组成的持久状态。 * **内存效率:** 全局编码器内存为交叉注意力提供受限的前缀,而解码器注意力在局部窗口内运行,确保状态在服务边界内保持一致。 * **资源共享:** 该模型采用 48 层编码器和 48 层解码器,通过权重共享来平衡深度推理能力与高效的浮点运算 (FLOP) 利用率。 这种设计使模型能够高性能地处理长序列,从而实现连接提示词处理与标记生成之间的连续状态转换。

Hacker News 最新 | 往期 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 循环递归 Transformer (yifanzhang-pro.github.io) 11 分,由 MayCXC 发布于 1 小时前 | 隐藏 | 往期 | 收藏 | 3 条评论 帮助 dankai 4 分钟前 | 下一条 [–] 这仅仅是一个关于架构的理论,还是真的有一些基准测试或结果来证实它? 回复 jal278 0 分钟前 | 父评论 | 下一条 [–] 看起来只是一个理论,很惊讶它在 HN 上被顶得这么高。 回复 jal278 5 分钟前 | 上一条 [–] 在没有上下文的情况下,我不确定这为什么重要——没有结果或实现,而且我相信之前已经有 Transformer 与 RNN 相结合的方案了。不过也许我忽略了它的相关性或深刻见解。 回复 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文
01 / REASONING

Depth that grows with the sequence.

Each token extends the recurrent path through the full decoder. After \(t\) tokens, that path traverses \(tL_D\) decoder blocks while the per-token block count stays fixed.

02 / HARDWARE

Parallel work around a recurrent core.

Batch known-token encoder work and independent decoder updates. Reuse weights and memory, and checkpoint activations while preserving the reference computation.

03 / RL

One transition from sampling to replay.

Rebuild the full history under current parameters, including prompt states and decoder SWA KV. Keep recorded behavior probabilities tied to the actual sampler.

The complete state matters.

Causal encoderKnown-token parallelism · global KV memory

Recurrent decoderEncoder cross-attention · local decoder SWA

Carry forward: recurrent output + decoder SWA KV

The previous output enters the next merge. Each SWA layer reads its own recent keys and values.

Prompt and response share one state transition. Encoder memory is prefix-restricted; decoder attention respects its local window. Neither decoder state component resets at the serving boundary.

\[H_t=(s_t,C_t^D),\qquad H_0=(s_\star,\varnothing).\]

\[(s_t,C_t^D)=D_\phi\!\left(\operatorname{Merge}(e_t,s_{t-1});M_{\le t},C_{t-1}^D,t\right).\]

\[p_\Theta(x_{t+1}\mid x_{1:t})=\operatorname{softmax}\!\left(W_o\operatorname{RMSNorm}_o(s_t)\right)_{x_{t+1}}.\]

Here \(M_{\le t}\) is global encoder memory, \(s_t\) is the recurrent output, and \(C_t^D\) contains layerwise decoder KV. A SWA window of \(W\) includes the current token and retains at most \(W-1\) historical entries for the next update.

The concrete configuration uses 48 encoder layers and 48 decoder layers, with compatible attention and FFN weights shared across stages. The temporal path traverses \(48t\) decoder blocks after \(t\) tokens. Each token executes 96 logical blocks; decoder cross-attention means these blocks do not all have equal FLOPs.

联系我们 contact @ memedata.com