OpenMythos 推出開源「Claude Mythos」理論重構
OpenMythos 推出開源「Claude Mythos」理論重構,使用 PyTorch 實現循環 Transformer 與 MoE 路由。
專案介紹
OpenMythos 是由 Kye Gomez 開發的開源專案,為 Anthropic「Claude Mythos」的獨立社區理論重構,基於公開研究與推測,並無官方關聯。它使用 PyTorch 實現 Recurrent-Depth Transformer (RDT),架構分為 Prelude(標準 Transformer 層一次執行)、循環 Recurrent Block(最多 max_loop_iters 次迴圈)和 Coda(標準 Transformer 層一次執行)。注意力機制可切換 MLA(Multi-Latent Attention)或 GQA,前饋網路採用稀疏 MoE,包含路由專家與共享專家,適合探索計算適應性與深度可變推理。安裝僅需 pip install open-mythos,使用範例支援 n_loops=4 至 8,770M 參數模型可匹敵 1.3B 標準 Transformer 品質。
核心假設
核心假設「Claude Mythos」為 Recurrent-Depth Transformer (RDT),即 Looped Transformer (LT),非堆疊數百獨特層,而是重複使用固定權重多次執行 forward pass,提供更深思考。與 Chain-of-Thought 不同,無中間 token 輸出,所有推理在單一 forward pass 的連續 latent space 靜默進行。更新規則為 h_{t+1} = A·h_t + B·e + Transformer(h_t, e),其中 e 為 Prelude 編碼輸入,每迴圈注入以防漂移,h_t 為隱藏狀態,A 與 B 為學習注入參數。Transformer 塊正常應用注意力與 MLP。
架構細節
架構為 Prelude → Recurrent Block → Coda,Recurrent Block 執行共享 TransformerBlock 最多 T=16 次。FFN 為 DeepSeekMoE 設計,大量細粒路由專家,每 token 僅啟用 top-K 子集,加上少量永遠啟用共享專家捕捉跨領域共通模式。路由器依迴圈深度選擇不同專家子集,每迭代為計算上獨特 pass,MoE 提供領域廣度,迴圈提供推理深度。注意力預設 Multi-Latent Attention,快取壓縮低階 KV latent,生產規模下 KV 記憶體減 10–20×。三穩定機制包括:
- LTI 約束注入(ρ(A) < 1 結構性保證),
- 每位置 Adaptive Computation Time (ACT) 停止機制,
- 每迭代 Depth-Wise LoRA 適配器提升表達力。
參數效率與擴展法則
k 層迴圈模型執行 L 次,等同 kL 層標準 Transformer 品質,僅需 k 層參數。Parcae (Prairie et al., 2026) 實證:770M 參數 RDT 匹敵 1.3B 標準模型,同訓練資料下約半數參數達同品質。推理深度依 inference-time compute 而非儲存參數決定,重構擴展辯論焦點,從訓練模型大小轉向推理迴圈深度。Parcae 首建立迴圈訓練可預測擴展法則:固定 FLOP 預算下,增加平均迴圈次數並減 token 數,損失低於最小迴圈多資料訓練;推理更多 test-time loops 改善品質,呈可預測飽和指數衰減,類似 Chain-of-Thought 擴展。
解釋 Mythos 優勢
RDT 解釋 Mythos 在系統性泛化、深度外推、隱式 Chain-of-Thought 與無參數爆炸四優勢。
- 系統性泛化:標準 Transformer 無法組合訓練外知識,RDT 經三階段 grokking(記憶化→同分布泛化→OOD 新穎組合突現)通過,Mythos 在新穎問題上質性不同,能力突變而非漸進。
- 深度外推:訓練 5-hop 推理鏈,測試 10-hop 標準失敗,RDT 透過更多推理迴圈成功,對應 Mythos 處理多步數學、長視野規劃、層級論證無需顯式 Chain-of-Thought。
- 隱式 Chain-of-Thought:每迴圈等同一步 CoT,但連續 latent space 可同時編碼多替代下一步,近似廣度優先搜尋而非單一路徑(Saunshi et al., 2025 形式證明)。
- 無參數爆炸:記憶體不隨推理深度成長,推理計算隨迴圈計數而非模型大小,深度推理「免費」。
訓練穩定性解決
迴圈模型訓練不穩,殘差爆炸(h_t 無界成長)與損失尖峰主導。視為離散 LTI 動態系統,穩定依賴 spectral radius ρ(A) < 1(≥1 則發散)。Parcae 解法結構性保證:A 參數化為連續負對角矩陣,ZOH/Euler 離散化 A_discrete = exp(Δt · A_continuous),負性強制 A := Diag(-exp(log_A)) 配學習 Δt,無視學習率或批次雜訊皆 ρ(A) < 1。高學習率下乾淨訓練,Anthropic 很可能以此使 Mythos 可訓練。
迴圈差異化與過度思考
迴圈索引嵌入假設:無位置訊號下相同權重難兼顧早期模式匹配與晚期精煉,類 RoPE 嵌入迴圈索引讓每迭代功能獨特,如序列位置差異,提升表達力不增參數。過度思考問題:過多迴圈隱藏狀態漂移至雜訊,Universal Transformer (Dehghani et al., 2018) 用 ACT 機制,每位置學習純量動態停止,難位多計算、簡單早停,使模型具 Turing-complete 理論意涵,Mythos 幾乎確定有類似收斂訊號。
MoE 設計推測
RDT 解釋深度,MoE 解釋廣度,處理程式碼、數學、文學、科學、法律等領域。Recurrent Block 每 FFN 替換細粒 MoE,小專家(1/m 正常大小),路由器依親和分數選 top-mK,加上共享專家吸收語法、基本推理、通用脈絡,避免冗餘學習。訓練動態調整路由 logits 偏置防路由崩潰,平衡負載不扭曲損失。h_t 演化下每深度不同專家子集,僅小部分每 token 啟用,真參數計為儲存而非計算數。
開源貢獻與呼聲
OpenMythos 貢獻 PyTorch 完整 RDT 實現含 MoE FFN、Multi-Latent Attention、Parcae LTI 穩定注入、Depth-wise LoRA 適配器,提供可重現基準研究迴圈動態、擴展行為、推理深度。GitHub:https://github.com/kyegomez/OpenMythos,Discord:http://discord.gg/EamjgSaEQf。歡迎貢獻訓練穩定、擴展實驗、迴圈深度分析、替代注意力。
Mythos 推測總結
| 屬性 | 描述 |
|---|---|
| 架構 | Recurrent-Depth Transformer (Prelude + Looped Recurrent Block + Coda) |
| FFN 層 | 推測 MoE — 細粒專家 + 永遠啟用共享專家 |
| 參數計 | 總極大;每 token 小比例啟用 |
| 推理機制 | 迭代 latent 更新隱式多跳 — 無中間 token 輸出 |
| 推理時擴展 | 更多 loops = 更深推理,可預測指數衰減 |
| 訓練穩定 | LTI 約束注入,spectral radius < 1 |
| 迴圈差異 | 可能用迴圈索引位置嵌入 (類 RoPE) |
| 停止 | Adaptive Computation Time 或學習收斂準則 |
| 擴展法則 | 最佳訓練同步擴展迴圈與資料,非單獨參數 |
| 推理 vs 記憶 | 結構偏組合;記憶需獨立處理 |
Introducing OpenMythos
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
An open-source, first-principles theoretical reconstruction of Claude Mythos, implemented in PyTorch.
The architecture instantiates a looped transformer with a Mixture-of-Experts (MoE) routing mechanism, enabling iterative depth via weight sharing and… pic.twitter.com/YLvCid6CAr
2 /
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
I hypothesize that Mythos is a Recurrent-Depth Transformer (RDT) a class of looped transformer in which a fixed set of weights is applied iteratively across T loop steps within a single forward pass.
Crucially, reasoning occurs entirely in continuous latent space. There is… pic.twitter.com/SRjJAjW0qo
3 / 7
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
The recurrent block executes one shared TransformerBlock for up to T=16 loop iterations. At each step, the frozen encoded input e is re-injected via a stable LTI update rule: h_{t+1} = A·h_t + B·e + Transformer(h_t, e)
The FFN inside this block is a Mixture-of-Experts… pic.twitter.com/S5V1rYYUqi
4 /
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
The full architecture is:
Prelude → Recurrent Block → Coda
Prelude and Coda are standard transformer layers run once. The Recurrent Block is the computational core. Attention defaults to Multi-Latent Attention (DeepSeek-V2) caching a compressed low-rank KV latent rather…
5 /
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
On parameter efficiency: a looped model with k layers run L times achieves the quality of a kL-layer standard transformer with only k layers of parameters.
Empirically (Parcae, Prairie et al., 2026): at 770M parameters, an RDT matches a 1.3B standard model on the same… pic.twitter.com/cmeKiQiDiJ
6 /
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
OpenMythos contributes:
1. A fully open, configurable PyTorch implementation of the RDT hypothesis with MoE FFN and Multi-Latent Attention
2. LTI-stable recurrent injection (Parcae) integrated as a first-class training primitive
3. Depth-wise LoRA adapters enabling… pic.twitter.com/sSX2FHPWgy
7 /
— Kye Gomez (swarms) (@KyeGomezB) April 19, 2026
This is an open research effort. We welcome contributions on training stability, scaling experiments, loop depth analysis, and alternative attention mechanisms.
If you work on recurrent transformers, MoE, or inference-time scaling we would value your involvement.
Repo →…
