File size: 1,786 Bytes
0f9707f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
license: mit
tags:
  - world-model
  - dreamerv3
  - binary-arithmetic
  - mechanistic-interpretability
---

# A World Model That Learned Perfect Binary Arithmetic

DreamerV3 world model trained on a 4-bit binary counting environment (500K steps). The model learned to simulate carry cascades autonomously — 100% completion rate under full observation ablation.

**Paper**: [GitHub](https://github.com/major-scale/anim-binary-counting)

## Files

| File | Description | Size |
|------|-------------|------|
| `latest.pt` | Full DreamerV3 checkpoint (PyTorch) | 136 MB |
| `exported/dreamer_weights.bin` | Extracted weight matrices for numpy RSSM | 23 MB |
| `exported/dreamer_manifest.json` | Weight name mapping | 4 KB |
| `battery.npz` | Pre-collected hidden states from 15 episodes | 25 MB |
| `metrics.jsonl` | Training metrics log | 79 KB |

## Usage

The analysis scripts use the exported weights (no PyTorch required):

```bash
git clone https://github.com/major-scale/anim-binary-counting
cd anim-binary-counting

# Download exported weights
mkdir -p checkpoints/exported
wget https://huggingface.co/major-scale/anim-binary-counting/resolve/main/exported/dreamer_weights.bin -O checkpoints/exported/dreamer_weights.bin
wget https://huggingface.co/major-scale/anim-binary-counting/resolve/main/exported/dreamer_manifest.json -O checkpoints/exported/dreamer_manifest.json
wget https://huggingface.co/major-scale/anim-binary-counting/resolve/main/battery.npz -O data/battery.npz

# Run analysis
pip install -r code/requirements.txt
python code/analysis/verify_dual_mode.py
```

## Training

Trained with [DreamerV3-torch](https://github.com/NM512/dreamerv3-torch) on a single GPU (~4 hours). See `code/training/` in the GitHub repo for configs and launcher.

## License

MIT