/ Модель

Характеристики

Лицензия
MIT
Архитектура
chipformer · dense
Библиотека
transformers
Опубликована
15 окт 2026

chipformer

Генерация текстаТекст → текст3 профессии

Chipformer — скомпилированная в трансформер виртуальная машина CHIP-8 для запуска игр и программ по токенизированному состоянию и вводу.

268скачиваний за 30 дней8лайковвеса обновлены15 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Chipformer — экспериментальная модель, разработанная divagr1925, которая реализует компьютер CHIP-8 внутри авторегрессионного трансформера. Вместо обычного диалога модель по токенам выполняет инструкции виртуальной машины: входной контекст задаёт ROM, состояние, нажатия клавиш и такты, а выходные токены описывают изменения памяти и экрана. Веса скомпилированы из описания схемы CHIP-8, а не получены обучением.

Модель предназначена для запуска игр и других программ CHIP-8, включая Tetris, Space Invaders, Brix и Pong; смена игры выполняется заменой промпта. Это decoder-only архитектура с 18 слоями, размерностью 382, 42 головами внимания, 22 276 блоками ReGLU и словарём из 8 708 токенов; число параметров — 32 328 660. Репозиторий содержит веса safetensors в float64 и имеет лицензию MIT.

Для точной работы требуется float64: fp16 и bf16 нарушают вычисления модели. Реализация на PyTorch работает медленнее требуемых 60 кадров в секунду, а контекст ограничен позициями ниже 4 194 304 токенов; игровой цикл периодически восстанавливает его из снимка состояния. Поддерживаются оригинальные инструкции CHIP-8 и флаги совместимости Octo, но не инструкции SCHIP/XO-CHIP и не особенность ожидания вертикального гашения экрана.

Сценарии применения

  • запуск Tetris в эмуляторе CHIP-8 на базе трансформера
  • воспроизведение игр CHIP-8, таких как Pong и Space Invaders
  • исследование выполнения программ виртуальной машины языковой моделью
  • изучение механистической интерпретируемости трансформеров

Ограничения

Для корректных вычислений требуется float64; fp16 и bf16 нарушают работу. Реализация на PyTorch работает лишь примерно со скоростью 2–3 кадров в секунду, а SCHIP/XO-CHIP и ожидание vBlank не поддерживаются.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

chipformer

Tetris, running entirely inside a transformer.

This model is a CHIP-8 computer. Give it a game as the prompt and greedy decoding runs the game: every token it predicts is one write to the machine's memory (a register, the program counter, a row of pixels). Paint those writes onto a 64×32 screen and you are playing Tetris. Your keypresses and the 60 Hz clock go into the context window. Everything else, every frame, every collision, every point on the scoreboard, comes out of the model.

There is no emulator behind it. It is the same loop every language model runs: read the context, predict the next token, append it, repeat.

  • One set of weights plays Tetris, Space Invaders, Brix, Pong and 100+ other games. Switching games means switching the prompt.
  • An ordinary decoder-only architecture: 18 layers, d_model 382, 42 attention heads, 22,276 ReGLU units, vocabulary 8,708, float64.

Play it in your browser: divagr.com/chipformer · Hugging Face Space · Source: GitHub

How it works

  • The ROM is the prompt. The prompt is BOOT, then one ADDR a, VAL v token pair per nonzero byte of machine state, then STEP.
  • Every output token is a write. Each instruction becomes a short record of writes such as @V3 =1F @PC =22A STEP. The screen is drawn from these writes.
  • The host injects the outside world. A TICK token arrives once per 60 Hz frame, and keypresses are injected as writes. Every other token is the model's greedy prediction.
  • Attention is memory. To read register V3, a head attends to the most recent write to V3. Keys use a parabola over the address plus a recency term, so the hardmax lands exactly there.
  • ReLU is the ALU. Addition, comparison, XOR and opcode decoding are all built from ReLUs, using identities like step(x) = ReLU(x+1) - ReLU(x).

The architecture is ordinary:

  • token embedding plus a position embedding from [t, t²]
  • causal softmax attention (β = 1000) with residual connections
  • ReGLU feed-forward layers
  • a linear unembedding
  • no normalization

modeling_chipformer.py contains nothing CHIP-8 specific apart from the host loop, which only feeds tokens in and reads the screen back.

Where the weights come from. They are compiled from a description of the CHIP-8 circuit (written in a small DSL in the GitHub repo) rather than learned, which is what makes every instruction exact. 139,229 of the 32,328,660 parameters are nonzero.

Usage

import torch
from huggingface_hub import hf_hub_download
from transformers import AutoModelForCausalLM

repo = "divagr1925/chipformer"
model = AutoModelForCausalLM.from_pretrained(repo, trust_remote_code=True, dtype=torch.float64)

rom = open(hf_hub_download(repo, "roms/tetris.ch8"), "rb").read()
game = model.play(rom, quirks="shift,loadstore,clip,jump", ipf=15)
for frame in range(120):
    game.frame(keys={5} if frame % 20 < 4 else ())  # CHIP-8 key 5 = left
print(game.ascii())

play_tetris.py animates the game in a terminal: python play_tetris.py.

The model is a normal PreTrainedModel, so you can also call it directly:

  • model(input_ids, past_key_values=cache) returns next-token logits over the 8,708-token vocabulary.
  • game.tokens (with keep_tokens=True) gives you the full trace.

Notes

  • Use float64. The memory-read heads compare attention scores of about 10¹³, and these are only exact in float64. fp16 and bf16 will break the machine.
  • Speed. Decoding is greedy, one token at a time with a KV cache. On a CPU in PyTorch that is about 200 tokens/s, or 2–3 frames per second of Tetris (the game wants 60).
    • game = model.play(...) multiplies by sparse copies of the big feed-forward matrices, since only 0.4% of the weights are nonzero. The outputs are identical; pass sparse=False to run the dense weights exactly as loaded.
    • The Rust/wasm engine in the GitHub repo uses the same weights with sparse matmuls and exact attention shortcuts. It runs the games at full speed in a browser.
  • Context. Positions must stay below 4,194,304 (2²²). ChipformerGame restarts the context from a state dump every 250,000 tokens, as the engine does.
  • Coverage. The weights implement the original CHIP-8 instruction set with Octo's quirk flags. SCHIP/XO-CHIP opcodes and the vBlank display-wait quirk are not supported.

Files

File
model.safetensorsdense float64 weights (what transformers loads)
model.chipformerthe same weights, sparse (nonzeros only), for the Rust/wasm engine
configuration_chipformer.py, modeling_chipformer.pythe architecture plus the host loop
play_tetris.pya terminal demo
roms/tetris.ch8Tetris by Fran Dachille (1991), freely distributable (Revival Studios CHIP-8 pack)

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
ChipformerForCausalLM
Ревизия весов
8ef5dd8

0 моделей