divagr1925 commited on
Commit
8ef5dd8
路
verified 路
1 Parent(s): 4eec64a

Model card: lead with the game running inside the transformer

Browse files
Files changed (1) hide show
  1. README.md +18 -11
README.md CHANGED
@@ -5,7 +5,6 @@ pipeline_tag: text-generation
5
  tags:
6
  - chip-8
7
  - emulator
8
- - hand-crafted-weights
9
  - mechanistic-interpretability
10
  - compiled-transformer
11
  - custom_code
@@ -13,17 +12,21 @@ tags:
13
 
14
  # chipformer
15
 
16
- A decoder-only transformer that runs CHIP-8 games. Its weights were **set by hand, not trained**:
17
- predicting the next token *is* executing the program.
18
 
19
- - **Training steps: 0.** No data, no gradients. The weights are compiled from circuits
20
- written in a small DSL, in about 0.3 seconds.
21
- - 18 layers, d_model 382, 42 attention heads,
22
- 22,276 ReLU (ReGLU) units, vocabulary 8,708.
23
- - 32,328,660 parameters, of which 139,229 are nonzero.
24
- float64 throughout.
25
- - One fixed set of weights runs every game: Tetris, Space Invaders, Brix, Pong and 100+ more.
26
- Each game's quirk profile is just more state in the prompt.
 
 
 
 
 
27
 
28
  **Play it in your browser:** [divagr.com/chipformer](https://divagr.com/chipformer) 路
29
  [Hugging Face Space](https://huggingface.co/spaces/divagr1925/chipformer) 路 Source: [GitHub](https://github.com/divagr18/chipformer)
@@ -51,6 +54,10 @@ The architecture is ordinary:
51
  `modeling_chipformer.py` contains nothing CHIP-8 specific apart from the host loop, which only feeds
52
  tokens in and reads the screen back.
53
 
 
 
 
 
54
  ## Usage
55
 
56
  ```python
 
5
  tags:
6
  - chip-8
7
  - emulator
 
8
  - mechanistic-interpretability
9
  - compiled-transformer
10
  - custom_code
 
12
 
13
  # chipformer
14
 
15
+ **Tetris, running entirely inside a transformer.**
 
16
 
17
+ This model *is* a CHIP-8 computer. Give it a game as the prompt and greedy decoding runs the game:
18
+ every token it predicts is one write to the machine's memory (a register, the program counter, a
19
+ row of pixels). Paint those writes onto a 64脳32 screen and you are playing Tetris. Your keypresses
20
+ and the 60 Hz clock go into the context window. Everything else, every frame, every collision,
21
+ every point on the scoreboard, comes out of the model.
22
+
23
+ There is no emulator behind it. It is the same loop every language model runs: read the context,
24
+ predict the next token, append it, repeat.
25
+
26
+ - One set of weights plays Tetris, Space Invaders, Brix, Pong and 100+ other games. Switching games
27
+ means switching the prompt.
28
+ - An ordinary decoder-only architecture: 18 layers, d_model 382,
29
+ 42 attention heads, 22,276 ReGLU units, vocabulary 8,708, float64.
30
 
31
  **Play it in your browser:** [divagr.com/chipformer](https://divagr.com/chipformer) 路
32
  [Hugging Face Space](https://huggingface.co/spaces/divagr1925/chipformer) 路 Source: [GitHub](https://github.com/divagr18/chipformer)
 
54
  `modeling_chipformer.py` contains nothing CHIP-8 specific apart from the host loop, which only feeds
55
  tokens in and reads the screen back.
56
 
57
+ **Where the weights come from.** They are compiled from a description of the CHIP-8 circuit
58
+ (written in a small DSL in the GitHub repo) rather than learned, which is what makes every
59
+ instruction exact. 139,229 of the 32,328,660 parameters are nonzero.
60
+
61
  ## Usage
62
 
63
  ```python