Skip to main content
ClaudeWave
EN, English
kyegomez / Plugins

OpenMythos

A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature.

  • 14.9k stars
  • 3.3k forks
  • 61 open issues
  • Language: Python
  • License: MIT
  • updated

Install

Claude Code
/plugin marketplace add kyegomez/OpenMythos
/plugin install openmythos
  1. Inside Claude Code, add the marketplace and install the plugin with the commands above.
  2. Follow any post-install configuration from the README.
  3. Restart the session if commands or hooks do not show up immediately.

Editor's note

OpenMythos is a PyTorch implementation of a speculative reconstruction of the architecture suspected to underlie Anthropic's Claude Mythos model, built entirely from publicly available research rather than any proprietary information. The core design is a Recurrent-Depth Transformer consisting of three stages: a Prelude of standard transformer blocks, a looped Recurrent Block that runs for a configurable number of iterations up to `max_loop_iters`, and a final Coda, enabling compute-adaptive reasoning where inference depth can vary at generation time. Attention can be switched between Multi-head Latent Attention (MLA) and Grouped Query Attention (GQA), and the feed-forward layer uses a sparse Mixture-of-Experts setup with routed and shared experts. Pre-configured factory functions cover scales from 1B to 1T parameters, and a training script for the 3B variant targets 30 billion tokens on FineWeb-Edu using PyTorch DDP. The library is installable via pip and carries no affiliation with Anthropic. Researchers and ML engineers exploring looped transformer architectures are its primary audience.

README

Plugins overview

Full README on GitHub

OpenMythos

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 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.

Installation

pip install open-mythos

#uv pip install open-mythos

To enable Flash Attention 2 in GQAttention (requires CUDA and build tools):

pip install open-mythos[flash]

Usage


import torch
from open_mythos.main import OpenMythos, MythosConfig


attn_type = "mla"  # or "gqa"

base = {
    "vocab_size": 1000,
    "dim": 256,
    "n_heads": 8,
    "max_seq_len": 128,
    "max_loop_iters": 4,
    "prelude_layers": 1,
    "coda_layers": 1,
    "n_experts": 8,
    "n_shared_experts": 1,
    "n_experts_per_tok": 2,
    "expert_dim": 64,
    "lora_rank": 8,
    "attn_type": attn_type,
}

if attn_type == "gqa":
    cfg = MythosConfig(**base, n_kv_heads=2)
else:
    cfg = MythosConfig(
        **base,
        n_kv_heads=8,
        kv_lora_rank=32,
        q_lora_rank=64,
        qk_rope_head_dim=16,
        qk_nope_head_dim=16,
        v_head_dim=16,
    )

model = OpenMythos(cfg)
total = sum(p.numel() for p in model.parameters())
print(f"\n[{attn_type.upper()}] Parameters: {total:,}")

ids = torch.randint(0, cfg.vocab_size, (2, 16))
logits = model(ids, n_loops=4)
print(f"[{attn_type.upper()}] Logits shape: {logits.shape}")

out = model.generate(ids, max_new_tokens=8, n_loops=8)
print(f"[{attn_type.upper()}] Generated shape: {out.shape}")

A = model.recurrent.injection.get_A()
rho = torch.linalg.eigvals(A).abs().max().item()
print(
    f"[{attn_type.upper()}] Spectral radius ρ(A) = {rho:.4f} (must be < 1)"
)

Model Variants

Pre-configured scales from 1B to 1T parameters:

from open_mythos import (
    mythos_1b,
    mythos_3b,
    mythos_10b,
    mythos_50b,
    mythos_100b,
    mythos_500b,
    mythos_1t,
    OpenMythos,
)

cfg = mythos_7b()  # returns a MythosConfig
model = OpenMythos(cfg)

total = sum(p.numel() for p in model.parameters())
print(f"Parameters: {total:,}")
VariantdimExpertsexpert_dimLoop itersContextMax output
mythos_1b2048642048164k4k
mythos_3b3072644096164k4k
mythos_10b40961285632248k4k
mythos_50b61442569728328k4k
mythos_100b819225613568321M128k
mythos_500b1228851223040481M128k
mythos_1t1638451234560641M128k

Training

The training script for the 3B model on FineWeb-Edu is at training/3b_fine_web_edu.py.

Single GPU:

python training/3b_fine_web_edu.py

Multi-GPU (auto-detects GPU count):

torchrun --nproc_per_node=$(python -c "import torch; print(torch.cuda.device_count())") training/3b_fine_web_edu.py

Key design choices:

FeatureDetail
OptimizerAdamW
DatasetHuggingFaceFW/fineweb-edu (sample-10BT by default, swap to sample-100BT or default for full run)
Tokenizeropenai/gpt-oss-20b via MythosTokenizer
ParallelismPyTorch DDP via torchrun, sharded streaming dataset
Precisionbfloat16 on H100/A100, float16 + GradScaler on older GPUs
ScheduleLinear warmup (2000 steps) → cosine decay
Target30B tokens (~Chinchilla-adjusted for looped architecture)

Documentation

PageDescription
docs/open_mythos.mdFull API reference for the OpenMythos class — constructor, forward, generate, all sub-modules, configuration reference, and usage examples
docs/datasets.mdRecommended training datasets with token budget guidance per model size

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.

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.


Architecture

A looped transformer divides its layers into three functional blocks:

Input
  ↓
[Prelude P]        — standard transformer layers, run once
  ↓
[Recurrent Block R] — looped T times
  ↑_______↓         (hidden state h updated each loop with input injection e)
  ↓
[Coda C]           — standard transformer layers, run once
  ↓
Output

The recurrent block update rule at each loop step 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

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.

The full implementation is in open_mythos/main.py. See the OpenMythos class reference for a detailed API walkthrough, configuration options, and usage examples.

Attention Implementations

The attention layer is switchable via cfg.attn_type:

OptionClassDescription
"gqa"GQAttentionGrouped 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"MLAttentionMulti-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.

RoPE is applied to Q and K before caching, so cached values do not need to be re-rotated on retrieval.


Why This Explains Mythos

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:

  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

This is why Mythos feels qualitatively different from other models on novel questions — the capability phase-transitions in, rather than emerging gradually.

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.

More loops at inference = deeper reasoning chains = harder problems solved.

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).

Topics
aianthropicattentionclaudeclaude-aiclaude-codeclaude-code-pluginclaude-mythosclaude-sonnetdeepmindgpt-5gpt-7jaxlooped-transformersmlpytorchsonnettorch
Frequently asked

What people ask about OpenMythos

What is kyegomez/OpenMythos?

kyegomez/OpenMythos is plugins for the Claude AI ecosystem. A theoretical reconstruction of the Claude Mythos architecture, built from first principles using the available research literature. It has 14.9k GitHub stars and its last recorded update is dated 2026-05-23.

How do I install OpenMythos?

You can install OpenMythos by cloning the repository (https://github.com/kyegomez/OpenMythos) or following the README instructions on GitHub. ClaudeWave also provides quick install blocks on this page.

Is kyegomez/OpenMythos safe to use?

Our security agent has analyzed kyegomez/OpenMythos and assigned a Trust Score of 95/100 (tier: Verified). See the full breakdown of passed checks and flags on this page.

Who maintains kyegomez/OpenMythos?

kyegomez/OpenMythos is maintained by kyegomez. The last recorded GitHub activity is dated 2026-05-23, with 61 open issues.

Are there alternatives to OpenMythos?

Yes. On ClaudeWave you can browse similar plugins at /categories/plugins, sorted by popularity or recent activity.

Maintain this repo? Show its Trust Score in your README

The badge shows this repository's current Trust Score and verdict, and links back to this page. It follows the catalogue data: nobody can buy or edit the score it displays.

ClaudeWave Trust Score for kyegomez/OpenMythos
Markdown (README)
[![ClaudeWave Trust Score for kyegomez/OpenMythos](https://claudewave.com/api/badge/kyegomez-openmythos)](https://claudewave.com/en/repo/kyegomez-openmythos)
HTML
<a href="https://claudewave.com/en/repo/kyegomez-openmythos"><img src="https://claudewave.com/api/badge/kyegomez-openmythos" alt="ClaudeWave Trust Score for kyegomez/OpenMythos" width="320" height="64"></a>

What the badge means and how the score is computed