docs: make Chinese README the default

This commit is contained in:
wehub-resource-sync
2026-07-13 10:12:41 +00:00
parent 3743a9ebc6
commit 7f7bff3a80
+135 -129
View File
@@ -1,3 +1,9 @@
<!-- WEHUB_ZH_README -->
> [!NOTE]
> 本文档由 WeHub 基于上游 README 翻译整理,属于社区翻译,非官方中文文档。
> [English](./README.en.md) · [原始项目](https://github.com/kyegomez/OpenMythos) · [上游 README](https://github.com/kyegomez/OpenMythos/blob/HEAD/README.md)
> 原作者、版权与许可证归属以原始项目及本仓库 LICENSE 文件为准。
# OpenMythos
<p align="left">
@@ -27,12 +33,12 @@
</a>
</p>
> **Disclaimer:** OpenMythos is an independent, community-driven theoretical reconstruction based solely on publicly available research and speculation. It is not affiliated with, endorsed by, or connected to Anthropic or any of their proprietary systems.
> **免责声明:** OpenMythos 是一项独立的、社区驱动的理论重构项目,仅基于公开可用的研究与推测。它与 Anthropic 及其任何专有系统均无关联、未获认可,也不存在任何联系。
OpenMythos is an open-source, theoretical implementation of the Claude Mythos model. It implements a Recurrent-Depth Transformer (RDT) with three stages: **Prelude** (transformer blocks), a looped **Recurrent Block** (up to `max_loop_iters`), and a final **Coda**. Attention is switchable between MLA and GQA, and the feed-forward uses a sparse MoE with routed and shared experts ideal for exploring compute-adaptive, depth-variable reasoning.
OpenMythos 是 Claude Mythos 模型的开源理论实现。它实现了一个循环深度 TransformerRecurrent-Depth TransformerRDT),包含三个阶段:**Prelude**transformer 块)、循环的 **Recurrent Block**(最多 `max_loop_iters`),以及最终的 **Coda**。注意力机制可在 MLA GQA 之间切换,前馈网络采用稀疏 MoE(混合专家),包含路由专家与共享专家,非常适合探索计算自适应、深度可变的推理。
## Installation
## 安装
```bash
pip install open-mythos
@@ -40,13 +46,13 @@ pip install open-mythos
#uv pip install open-mythos
```
To enable Flash Attention 2 in `GQAttention` (requires CUDA and build tools):
要在 `GQAttention` 中启用 Flash Attention 2(需要 CUDA 和构建工具):
```bash
pip install open-mythos[flash]
```
## Usage
## 用法
```python
@@ -105,9 +111,9 @@ print(
## Model Variants
## 模型变体
Pre-configured scales from 1B to 1T parameters:
预配置的规模从 1B 1T 参数:
```python
from open_mythos import (
@@ -128,7 +134,7 @@ total = sum(p.numel() for p in model.parameters())
print(f"Parameters: {total:,}")
```
| Variant | `dim` | Experts | `expert_dim` | Loop iters | Context | Max output |
| 变体 | `dim` | 专家数 | `expert_dim` | 循环迭代次数 | 上下文 | 最大输出 |
|---|---|---|---|---|---|---|
| `mythos_1b` | 2048 | 64 | 2048 | 16 | 4k | 4k |
| `mythos_3b` | 3072 | 64 | 4096 | 16 | 4k | 4k |
@@ -140,54 +146,54 @@ print(f"Parameters: {total:,}")
---
## Training
## 训练
The training script for the 3B model on FineWeb-Edu is at [`training/3b_fine_web_edu.py`](training/3b_fine_web_edu.py).
3B 模型在 FineWeb-Edu 上的训练脚本位于 [`training/3b_fine_web_edu.py`](training/3b_fine_web_edu.py)
**Single GPU:**
** GPU**
```bash
python training/3b_fine_web_edu.py
```
**Multi-GPU (auto-detects GPU count):**
**多 GPU(自动检测 GPU 数量):**
```bash
torchrun --nproc_per_node=$(python -c "import torch; print(torch.cuda.device_count())") training/3b_fine_web_edu.py
```
Key design choices:
关键设计选择:
| Feature | Detail |
| 特性 | 详情 |
|---|---|
| Optimizer | AdamW |
| Dataset | `HuggingFaceFW/fineweb-edu` (`sample-10BT` by default, swap to `sample-100BT` or `default` for full run) |
| Tokenizer | `openai/gpt-oss-20b` via `MythosTokenizer` |
| Parallelism | PyTorch DDP via `torchrun`, sharded streaming dataset |
| Precision | bfloat16 on H100/A100, float16 + GradScaler on older GPUs |
| Schedule | Linear warmup (2000 steps) → cosine decay |
| Target | 30B tokens (~Chinchilla-adjusted for looped architecture) |
| 优化器 | AdamW |
| 数据集 | `HuggingFaceFW/fineweb-edu`(默认 `sample-10BT`,完整训练可切换为 `sample-100BT` `default` |
| 分词器 | 通过 `MythosTokenizer` 使用 `openai/gpt-oss-20b` |
| 并行 | 通过 `torchrun` 使用 PyTorch DDP,分片流式数据集 |
| 精度 | H100/A100 上使用 bfloat16,较旧 GPU 上使用 float16 + GradScaler |
| 调度 | 线性预热(2000 步)→ 余弦衰减 |
| 目标 | 30B tokens(约按 Chinchilla 为循环架构调整) |
---
## Documentation
## 文档
| Page | Description |
| 页面 | 描述 |
|---|---|
| [`docs/open_mythos.md`](docs/open_mythos.md) | Full API reference for the `OpenMythos` class — constructor, `forward`, `generate`, all sub-modules, configuration reference, and usage examples |
| [`docs/datasets.md`](docs/datasets.md) | Recommended training datasets with token budget guidance per model size |
| [`docs/open_mythos.md`](docs/open_mythos.md) | `OpenMythos` 类的完整 API 参考 —— 构造函数、`forward``generate`、所有子模块、配置参考及用法示例 |
| [`docs/datasets.md`](docs/datasets.md) | 推荐训练数据集,并提供各模型规模的 token 预算指导 |
---
## The Central Hypothesis
## 核心假设
Claude Mythos is suspected to be a **Recurrent-Depth Transformer (RDT)** also called a Looped Transformer (LT). Rather than stacking hundreds of unique layers, a subset of layers is recycled and run through multiple times per forward pass. Same weights. More loops. Deeper thinking.
Claude Mythos 被认为是一种 **循环深度 TransformerRDT**— 也称为 Looped Transformer(LT)。它并非堆叠数百个独立层,而是将一部分层循环复用,在前向传播中多次运行。权重相同。循环更多。思考更深。
This is not chain-of-thought. There is no intermediate token output. All of this reasoning happens **silently, inside a single forward pass**, in continuous latent space.
这不是思维链(chain-of-thought)。没有中间 token 输出。所有这些推理都在**单次前向传播中悄然完成**,在连续潜空间中发生。
---
## Architecture
## 架构
A looped transformer divides its layers into three functional blocks:
循环 Transformer 将其层划分为三个功能块:
```
Input
@@ -202,195 +208,195 @@ Input
Output
```
The recurrent block update rule at each loop step t:
循环块在每个循环步 t 的更新规则:
```
h_{t+1} = A·h_t + B·e + Transformer(h_t, e)
```
Where:
- `h_t` is the hidden state after loop t
- `e` is the encoded input (from the Prelude), injected at every loop
- `A` and `B` are learned injection parameters
- The Transformer blocks apply attention and MLP as usual
其中:
- `h_t` 是循环 t 之后的隐藏状态
- `e` 是来自 Prelude 的编码输入,在每次循环中注入
- `A` `B` 是学习的注入参数
- Transformer 块照常应用注意力与 MLP
The injection of `e` at every step is what prevents the model from drifting — it keeps the original input signal alive throughout the entire recurrence depth.
在每一步注入 `e` 可防止模型漂移 —— 它使原始输入信号在整个循环深度中保持活跃。
The full implementation is in [`open_mythos/main.py`](open_mythos/main.py). See the [`OpenMythos` class reference](docs/open_mythos.md) for a detailed API walkthrough, configuration options, and usage examples.
完整实现位于 [`open_mythos/main.py`](open_mythos/main.py)。请参阅 [`OpenMythos` 类参考](docs/open_mythos.md) 了解详细的 API 演练、配置选项与用法示例。
### Attention Implementations
### 注意力实现
The attention layer is switchable via `cfg.attn_type`:
注意力层可通过 `cfg.attn_type` 切换:
| Option | Class | Description |
| 选项 | 类 | 描述 |
|---|---|---|
| `"gqa"` | `GQAttention` | Grouped Query Attention (Ainslie et al., 2023) — fewer KV heads than Q heads (`n_kv_heads < n_heads`), reducing KV-cache memory by `n_heads / n_kv_heads`. Uses **Flash Attention 2** (Dao et al., 2023) when `flash-attn>=2.8.3` is installed: GQA is handled natively (no KV head expansion), I/O-bound-optimal, with a transparent fallback to manual scaled dot-product attention when the package is absent. |
| `"mla"` | `MLAttention` | Multi-Latent Attention (DeepSeek-V2) — caches a compressed KV latent (`kv_lora_rank`) rather than full K/V, with split RoPE / no-RoPE head dims for position-aware compression. |
| `"gqa"` | `GQAttention` | 分组查询注意力(Grouped Query AttentionAinslie 等,2023)—— KV 头数少于 Q 头数(`n_kv_heads < n_heads`),将 KV-cache 内存降低 `n_heads / n_kv_heads`。当安装 `flash-attn>=2.8.3` 时使用 **Flash Attention 2**Dao 等,2023):原生支持 GQA(无需扩展 KV 头),I/O 绑定最优,并在未安装该包时透明回退到手动缩放点积注意力。 |
| `"mla"` | `MLAttention` | 多潜变量注意力(Multi-Latent AttentionDeepSeek-V2)—— 缓存压缩的 KV 潜变量(`kv_lora_rank`)而非完整 K/V,采用拆分 RoPE / RoPE 头维度以实现位置感知压缩。 |
RoPE is applied to Q and K before caching, so cached values do not need to be re-rotated on retrieval.
RoPE 在缓存之前应用于 Q 和 K,因此检索时无需对缓存值重新旋转。
---
## Why This Explains Mythos
## 这如何解释 Mythos
### 1. Systematic Generalization
### 1. 系统性泛化(Systematic Generalization
Vanilla transformers fail to combine knowledge in ways they have never seen during training. Looped transformers pass this test. The ability emerges through a **three-stage grokking process**:
普通 Transformer 无法以训练中从未见过的方式组合知识。循环 Transformer 能通过这一考验。该能力通过**三阶段 grokking 过程**涌现:
1. Memorization — model fits training distribution
2. In-distribution generalization — model handles known compositions
3. Systematic generalization — model handles novel compositions OOD, abruptly and suddenly
1. 记忆(Memorization)—— 模型拟合训练分布
2. 分布内泛化(In-distribution generalization)—— 模型处理已知组合
3. 系统性泛化 —— 模型突然、陡然地处理分布外(OOD)的新颖组合
This is why Mythos feels qualitatively different from other models on novel questions — the capability phase-transitions in, rather than emerging gradually.
这就是为什么 Mythos 在新颖问题上给人的感觉与其他模型截然不同 —— 能力以相变方式涌现,而非逐渐显现。
### 2. Depth Extrapolation
### 2. 深度外推(Depth Extrapolation
Train on 5-hop reasoning chains. Test on 10-hop. Vanilla transformer fails. Looped transformer succeeds — by running more inference-time loops. This maps directly to the observation that Mythos handles deeply compositional problems (multi-step math, long-horizon planning, layered arguments) without explicit chain-of-thought.
在 5 跳推理链上训练,在 10 跳上测试。普通 Transformer 失败。循环 Transformer 成功 —— 通过在推理时运行更多循环。这直接对应于 Mythos 能处理深度组合性问题(多步数学、长程规划、层层论证)而无需显式思维链(chain-of-thought)的观察。
More loops at inference = deeper reasoning chains = harder problems solved.
推理时更多循环 = 更深的推理链 = 解决更难的问题。
### 3. Latent Thoughts as Implicit Chain-of-Thought
### 3. 隐式思维链的潜态思考(Latent Thoughts as Implicit Chain-of-Thought
Each loop iteration is the functional equivalent of one step of chain-of-thought, but operating in continuous latent space rather than token space. A looped model running T loops implicitly simulates T steps of CoT reasoning. This has been formally proven (Saunshi et al., 2025).
每次循环迭代在功能上等价于思维链的一步,但运行于连续潜空间而非 token 空间。运行 T 次循环的循环模型隐式模拟 T 步 CoT 推理。这已有形式化证明(Saunshi et al., 2025)。
Furthermore, continuous latent thoughts — unlike discrete token outputs — can encode **multiple alternative next steps simultaneously**. This allows something closer to breadth-first search over the reasoning space, rather than a single committed reasoning path. The model is effectively exploring many possible directions inside each forward pass before converging.
此外,连续潜态思考 —— 与离散 token 输出不同 —— 可同时编码**多种备选下一步**。这使得模型更接近于在推理空间上进行广度优先搜索,而非沿单条已确定的推理路径前进。模型在每次前向传播中实际上在探索多种可能方向,然后才收敛。
### 4. No Parameter Explosion
### 4. 无参数爆炸(No Parameter Explosion
A looped model with k layers run L times achieves the quality of a kL-layer non-looped model, with only k layers worth of parameters. For Mythos-scale deployments, this matters enormously:
具有 k 层、运行 L 次的循环模型,可达到 kL 层非循环模型的质量,但参数量仅相当于 k 层。对于 Mythos 规模的部署,这一点至关重要:
- Memory footprint does not grow with reasoning depth
- Inference-time compute scales with loop count, not model size
- This makes deeper reasoning "free" in terms of parameters
- 内存占用不随推理深度增长
- 推理时计算量随循环次数扩展,而非模型规模
- 这使得更深推理在参数意义上近乎「免费」
---
## The Stability Problem (and How It Was Likely Solved)
## 稳定性问题(及其可能的解决方案)
Training looped models is notoriously unstable. Two failure modes dominate:
训练循环模型 notoriously 不稳定。两种失效模式占主导:
- **Residual explosion** — the hidden state `h_t` grows unboundedly across loops
- **Loss spikes** — training diverges suddenly due to large spectral norms in injection parameters
- **残差爆炸** —— 隐藏状态 `h_t` 在循环间无界增长
- **损失尖峰** —— 注入参数中较大的谱范数导致训练突然发散
### The Dynamical Systems View
### 动力系统视角(The Dynamical Systems View
Recast looping as a discrete linear time-invariant (LTI) dynamical system over the residual stream. Ignoring the nonlinear Transformer contribution, the recurrence becomes:
将循环重新表述为残差流上的离散线性时不变(LTI)动力系统。忽略非线性 Transformer 贡献后,递推变为:
```
h_{t+1} = A·h_t + B·e
```
For this LTI system, stability is governed entirely by the **spectral radius** of A:
- `ρ(A) < 1`stable, convergent
- `ρ(A) ≥ 1`unstable, divergent
对该 LTI 系统,稳定性完全由 A 的**谱半径**决定:
- `ρ(A) < 1`稳定、收敛
- `ρ(A) ≥ 1`不稳定、发散
Empirically, every divergent training run learns `ρ(A) ≥ 1`. Every convergent run maintains `ρ(A) < 1`.
经验上,每一次发散的训练运行都会学到 `ρ(A) ≥ 1`。每一次收敛的运行都维持 `ρ(A) < 1`
### The Fix
### 修复方案(The Fix
Constrain the injection parameters so that stability is guaranteed **by construction**:
约束注入参数,使稳定性**在构造上**得到保证:
1. Parameterize A as a continuous negative diagonal matrix
2. Discretize using ZOH/Euler schemes: `A_discrete = exp(Δt · A_continuous)`
3. Enforce negativity via `A := Diag(-exp(log_A))` with a learned scalar `Δt`
4. This ensures `ρ(A) < 1` always holds, regardless of learning rate or batch noise
1. 将 A 参数化为连续负对角矩阵
2. 使用 ZOH/Euler 方案离散化:`A_discrete = exp(Δt · A_continuous)`
3. 通过 `A := Diag(-exp(log_A))` 与可学习标量 `Δt` 强制负性
4. 这确保无论学习率或批次噪声如何,`ρ(A) < 1` 始终成立
The result: the looped model becomes significantly more robust to hyperparameter selection and trains cleanly even at high learning rates. This is the Parcae architecture (Prairie et al., 2026), and it represents the most likely class of solution Anthropic used to make Mythos trainable.
结果:循环模型对超参数选择显著更鲁棒,即使在高学习率下也能干净训练。这就是 Parcae 架构(Prairie et al., 2026),它代表了 Anthropic 使 Mythos 可训练所采用的最可能一类解决方案。
---
## Scaling Laws for Looped Models
## 循环模型的缩放定律(Scaling Laws for Looped Models
Parcae establishes the first predictable scaling laws for looped training:
Parcae 建立了循环训练的首套可预测缩放定律:
- **Training**: For a fixed FLOP budget with fixed parameters, increasing mean recurrence and reducing token count yields a lower loss than training with minimal loops on more data. Optimal recurrence and optimal token count both follow **power laws** with consistent exponents across scales.
- **Inference**: More test-time loops improves quality following a **predictable, saturating exponential decay** — gains are real but diminishing. This mirrors the inference-time scaling of chain-of-thought.
- **训练**:在固定 FLOP 预算与固定参数下,提高平均循环次数并减少 token 数量,相比在更多数据上以最少循环训练,可获得更低损失。最优循环次数与最优 token 数量均遵循**幂律**,且各规模下指数一致。
- **推理**:更多测试时循环按**可预测的饱和指数衰减**提升质量 —— 收益真实但递减。这与思维链的推理时缩放相呼应。
At 770M parameters, a looped model achieves the downstream quality of a 1.3B fixed-depth Transformer trained on the same data — roughly **half the parameters for the same quality**.
770M 参数下,循环模型达到与在相同数据上训练的 1.3B 固定深度 Transformer 相当的下游质量 —— 大致为**相同质量仅需约一半参数**。
Applied to Mythos: if trained under these scaling laws, Mythos could be dramatically more parameter-efficient than it appears, with a large fraction of its apparent "capability" coming from loop depth rather than raw parameter count.
应用于 Mythos:若按这些缩放定律训练,Mythos 的参数效率可能远比表面所见更高,其相当一部分看似的「能力」来自循环深度而非原始参数量。
---
## The Loop Index Embedding Hypothesis
## 循环索引嵌入假说(The Loop Index Embedding Hypothesis
A key open question is whether the looped block behaves **identically** on every iteration, or whether it can learn to do different things at different loop depths.
一个关键开放问题是:循环块在每次迭代中是否行为**完全相同**,还是能否在不同循环深度学习做不同的事。
Without any positional signal across loops, the same weights must handle both early-stage pattern matching and late-stage refinement — a tight constraint. A **RoPE-like embedding of the loop index** injected alongside the input at each step would allow the same parameters to implement functionally distinct operations across iterations, much like how RoPE allows the same attention heads to behave differently at different sequence positions.
若循环间没有任何位置信号,同一组权重必须同时处理早期模式匹配与后期精炼 —— 这是紧约束。在每一步与输入一同注入**类 RoPE 的循环索引嵌入**,可使同一参数在不同迭代中实现功能上不同的运算,正如 RoPE 使同一注意力头在不同序列位置表现不同。
If Mythos uses this technique, each loop is not a repetition — it is a distinct computational phase, all sharing weights but operating in different representational regimes. This would substantially increase the expressiveness of the recurrent block without increasing parameter count.
Mythos 采用该技术,每次循环并非重复 —— 而是不同的计算阶段,共享权重但运行于不同的表示 regime。这将在不增加参数量的前提下大幅提升循环块的表达能力。
---
## The Overthinking Problem
## 过度思考问题(The Overthinking Problem
More loops is not always better. Beyond a certain depth, excessive recurrence **degrades predictions** the hidden state drifts past the solution and into noise. This is the "overthinking" failure mode.
更多循环并不总是更好。超过一定深度后,过度循环会**劣化预测** —— 隐藏状态漂过解而进入噪声。这就是「过度思考」失效模式。
The original Universal Transformer (Dehghani et al., 2018) addressed this with an **Adaptive Computation Time (ACT)** halting mechanism: a learned scalar per position that dynamically decides when to stop looping. Positions that are harder to process receive more computation; simple tokens halt early.
原始 Universal TransformerDehghani et al., 2018)通过**自适应计算时间(Adaptive Computation Time, ACT)**停机机制解决:每个位置一个可学习标量,动态决定何时停止循环。更难处理的位置获得更多计算;简单 token 提前停机。
Mythos almost certainly has some version of this. The model cannot naively run the maximum number of loops on every input — it needs a learned signal for when the answer has converged. The ACT mechanism also makes the model **Turing-complete** under certain assumptions, which has theoretical implications for the class of problems it can solve.
Mythos 几乎肯定有某种版本。模型不能对每个输入天真地运行最大循环次数 —— 它需要可学习信号来判断答案何时收敛。ACT 机制还在特定假设下使模型**图灵完备(Turing-complete)**,这对它能求解的问题类有理论含义。
---
## Mixture of Experts — Suspected for Large Parameter Counts
## 混合专家 —— 大参数量下的推测(Mixture of Experts — Suspected for Large Parameter Counts
The looped transformer explains the depth of Mythos's reasoning, but not the breadth. Handling wildly different domains — code, math, literature, science, law — with the same weights requires **Mixture of Experts (MoE)**. The suspected design replaces every FFN in the Recurrent Block with a fine-grained MoE layer: each FFN is split into many small experts (1/m the normal size), a router selects the top-mK of them per token via learned affinity scores, and a small number of **shared experts** are always activated regardless of routing to absorb common cross-domain knowledge — syntax, basic reasoning, general context — that would otherwise be redundantly learned by every routed expert. Routing collapse is prevented through a bias term on the router logits adjusted dynamically during training, keeping load balanced across experts without distorting the loss signal.
循环 Transformer 解释了 Mythos 推理的深度,但未解释广度。用同一组权重处理截然不同的领域 —— 代码、数学、文学、科学、法律 —— 需要**混合专家(Mixture of Experts, MoE)**。推测设计将循环块(Recurrent Block)中每个 FFN 替换为细粒度 MoE 层:每个 FFN 拆分为多个小专家(正常大小的 1/m),路由器通过可学习亲和分数为每个 token 选择 top-mK 个,少量**共享专家**无论路由如何始终激活,以吸收本应由各路由专家冗余学习的跨域共性知识 —— 语法、基础推理、通用上下文。通过训练期间动态调整路由器 logits 上的偏置项防止路由坍缩,在专家间保持负载均衡且不扭曲损失信号。
As the hidden state `h_t` evolves across loop iterations, the router may select different expert subsets at each depth, making every loop computationally distinct despite shared weights. MoE provides breadth; looping provides depth. If the activation ratio is ~5%, Mythos could hold hundreds of billions of total parameters while activating only a small fraction per token — the true parameter count, if ever disclosed, would be a storage number, not a compute number.
随着隐藏状态 `h_t` 在循环迭代中演化,路由器可能在每个深度选择不同专家子集,使每次循环在共享权重下计算上仍各不相同。MoE 提供广度;循环提供深度。若激活比例约为 5%,Mythos 可拥有数千亿总参数,而每个 token 仅激活一小部分 —— 真实参数量若日后披露,将是存储数字,而非计算数字。
---
## The Memorization-Reasoning Tradeoff
## 记忆与推理的权衡
Looped models exhibit an interesting dichotomy: looping improves reasoning but can hurt memorization. The recurrent structure is optimized for iterative composition — running a reasoning chain forward — but does not inherently improve the storage of rote facts.
循环模型呈现出一种有趣的两分性:循环能提升推理能力,却可能损害记忆能力。递归结构针对迭代组合进行了优化——向前推进推理链——但并不会天然改善对机械事实的存储。
This maps to an observable characteristic of Mythos: it reasons exceptionally well about novel problems it has never seen, but its factual recall can be inconsistent. The architecture is structurally biased toward composition over memorization.
这与 Mythos 的一个可观察特征相对应:它对从未见过的新问题推理能力极强,但事实回忆可能不稳定。该架构在结构上偏向于组合而非记忆。
Looping-based regularization (Saunshi et al., 2025) can be used to balance this tradeoff during training — applying stronger looping constraints for reasoning tasks while relaxing them for retrieval tasks.
基于循环的正则化(Saunshi 等人,2025)可在训练期间用来平衡这一权衡——对推理任务施加更强的循环约束,而对检索任务则放松这些约束。
---
## Parameter Reuse via LoRA Adaptation
## 通过 LoRA 适配实现参数复用
A complementary approach from Relaxed Recursive Transformers (Bae et al., 2024): rather than requiring fully identical weights at every loop, add a small **depth-wise LoRA module** at each iteration. This preserves the compactness of weight sharing while allowing each loop to adapt its behavior slightly.
来自 Relaxed Recursive TransformersBae 等人,2024)的一种互补方法:与其要求每次循环的权重完全一致,不如在每次迭代时添加一个小的**深度维度 LoRA 模块**。这既保持了权重共享的紧凑性,又允许每个循环略微调整其行为。
The result:
- Each loop shares a large common weight matrix (the recursive base)
- A small rank-r adaptation matrix shifts behavior per iteration depth
- The total parameter overhead is minimal
结果如下:
- 每次循环共享一个大型公共权重矩阵(递归基座)
- 一个小型秩为 r 的适配矩阵按迭代深度调整行为
- 总参数开销极小
This bridges the gap between pure weight-tying (maximally parameter-efficient, less expressive) and fully distinct layers (maximally expressive, no parameter savings). Mythos likely sits somewhere on this spectrum.
这弥合了纯权重绑定(参数效率最高、表达能力较弱)与完全独立的层(表达能力最强、无参数节省)之间的差距。Mythos 很可能处于这一谱系的某个位置。
---
## Continuous Depth-wise Batching
## 连续深度维度批处理
A downstream consequence of the recursive architecture: **Continuous Depth-wise Batching**. Because all tokens share the same recurrent block, the model can exit the loop at different depths for different tokens or sequences — processing easy inputs quickly and hard inputs with more iterations, all within the same batch.
递归架构的一个下游后果:**连续深度维度批处理(Continuous Depth-wise Batching**。由于所有 token 共享相同的递归块,模型可以为不同的 token 或序列在不同深度退出循环——在同一批次内快速处理简单输入、对困难输入进行更多迭代。
Theoretical analysis suggests 2-3x improvements in inference throughput. For a deployed model like Mythos serving many users simultaneously, this would be a substantial efficiency gain.
理论分析表明推理吞吐量可提升 2-3 倍。对于像 Mythos 这样同时服务大量用户的已部署模型,这将是可观的效率增益。
---
## Summary: What Mythos Probably Is
## 总结:Mythos 可能是什么
| Property | Description |
| 属性 | 描述 |
|---|---|
| Architecture | Recurrent-Depth Transformer (Prelude + Looped Recurrent Block + Coda) |
| FFN layer | Suspected MoE — fine-grained experts + always-on shared experts |
| Parameter count | Very large total; small fraction activated per token (~5% estimate) |
| Reasoning mechanism | Implicit multi-hop via iterative latent updates — no token output between steps |
| Inference-time scaling | More loops = deeper reasoning, following predictable exponential decay |
| Training stability | LTI-constrained injection parameters with spectral radius < 1 |
| Loop differentiation | Likely uses loop-index positional embedding (à la RoPE) per iteration |
| Halting | Adaptive Computation Time or learned convergence criterion |
| Attention | GQA (with optional Flash Attention 2) or MLA with compressed KV latent cache |
| Scaling law | Optimal training scales looping and data together, not parameters alone |
| Reasoning vs. memory | Structurally biased toward composition; memorization requires separate treatment |
| Deployment | Continuous Depth-wise Batching enables variable compute per request |
| 架构 | 递归深度 TransformerPrelude + 循环递归块 + Coda |
| FFN 层 | 疑似 MoE——细粒度专家 + 始终激活的共享专家 |
| 参数量 | 总量很大;每个 token 仅激活一小部分(约 5% 估计) |
| 推理机制 | 通过迭代隐状态更新实现隐式多跳——步骤之间无 token 输出 |
| 推理时扩展 | 更多循环 = 更深推理,遵循可预测的指数衰减 |
| 训练稳定性 | LTI 约束的注入参数,谱半径 < 1 |
| 循环区分 | 可能使用循环索引位置嵌入(类似 RoPE)区分每次迭代 |
| 停止 | 自适应计算时间(Adaptive Computation Time)或学习的收敛准则 |
| 注意力 | GQA(可选 Flash Attention 2)或带压缩 KV 隐状态缓存的 MLA |
| 缩放定律 | 最优训练将循环与数据同步扩展,而非单独扩展参数 |
| 推理 vs. 记忆 | 结构上偏向组合;记忆需要单独处理 |
| 部署 | 连续深度维度批处理可为每个请求分配可变计算量 |
---
## References
## 参考文献
### Twitter / X
@@ -420,9 +426,9 @@ Theoretical analysis suggests 2-3x improvements in inference throughput. For a d
---
## Citation
## 引用
If you use OpenMythos in your research or build on this work, please cite:
如果在研究中使用 OpenMythos 或基于本工作构建,请引用:
```bibtex
@software{gomez2026openmythos,
@@ -436,6 +442,6 @@ If you use OpenMythos in your research or build on this work, please cite:
---
## License
## 许可证
MIT License — Copyright (c) 2026 Kye Gomez. See [`LICENSE`](LICENSE) for the full text.
MIT License — Copyright (c) 2026 Kye Gomez。完整文本见 [`LICENSE`](LICENSE)