🌐 Site, with the findings and a playground: https://physics-you-cant-delete.vercel.app
Tiny from-scratch video transformers (6–13M parameters) trained on a synthetic 2D world where balls drift behind screens. Each world changes one physical rule, and that's the only difference between them:
| world | what happens to a ball once it's fully behind a screen |
|---|---|
normal |
it keeps moving and comes out the far side |
teleport |
it jumps behind the other screen and comes out there (the manipulation Wood's lab used when rearing newborn chicks) |
vanish |
it's gone for good |
Shown frames up to the moment a ball is hidden, each model imagines the rest. The normal model brings the ball back out of the same screen, the teleport model out of the other one, and the vanish model never brings it back.
local_*, wide_*, deep_*)
relay a timing-like "expect it about now" signal through the hidden frames, stronger with depth or span, but
location only reaches the reveal when it can be looked up directly.memory_* read the video in 2-frame chunks that can only
talk through 16 memory slots. They learn where at every hide length (normal +16.8, teleport −10.6) at lower loss
than full attention, and cutting the memory carry sends it to chance.mix_<p> teleport in a fraction p of hides. Preference = 1.84 × log((1−p)/p),
R² = 0.993 for 1–50%, with a floor below ~1% (0.1% and 0.01% look the same).gravity_novx never saw a ball move vertically. It still expects a
dropped ball to fall, but it drifts sideways at the slowest speed it ever saw (100% of drops). Case-based, not
separable components. Narrower holes (gravity_floor0.2, gravity_floor0.4) show where that starts: a 0.2 px/frame gap gets filled in, 0.4 and wider snap to the nearest seen speed.models/<name>/ckpt.pt, config.json, train_args.json
tok_p4.npz 4x4-patch tokenizer (2,048 tokens; 257 tokens per 64x64 frame)
src/worldgen/ the simulator, tokenizer, model (GPT / local attention / MemoryGPT), probes
generate_example.py the GIF above
| model | world | attention | notes |
|---|---|---|---|
normal, normal_s1 |
normal | full | 2 training seeds |
teleport, teleport_s1, teleport_s2 |
teleport | full | 3 training seeds |
vanish, vanish_s1, vanish_s2 |
vanish | full | 3 training seeds |
local_normal, local_teleport |
normal / teleport | each token sees the last 3 frames | |
wide_normal |
normal | last 5 frames | |
deep_normal |
normal | last 3 frames, 12 layers | |
memory_normal, memory_teleport |
normal / teleport | 2-frame chunks + 16 carried memory slots | MemoryGPT |
mix_0.0001 … mix_0.5 |
normal, a fraction p of hides teleport | full | dose-response |
gravity_control, gravity_novx, gravity_floor0.2, gravity_floor0.4 |
gravity world (no screens) | full | novx / floor<f>: sideways speeds below 0.6 / f never seen |
All are trained for 30k steps × 16 windows × 16 frames (~2B tokens) on 20k clips (seed 2). They are 6 layers, d=256, unless noted.
pip install torch numpy pillow huggingface_hub
python generate_example.py --models normal teleport vanish --out imagine.gif
generate_example.py downloads what it needs from this repo and works with the full-attention models (it uses the KV cache, which the local-attention variants don't support). To load any model yourself:
import sys, torch
from huggingface_hub import snapshot_download
root = snapshot_download("ianaldenjones/physics-you-cant-delete", allow_patterns=["src/**", "tok_p4.npz", "models/teleport/*"])
sys.path.insert(0, f"{root}/src")
from worldgen.model import GPTConfig, build_model
cfg = GPTConfig.load(f"{root}/models/teleport/config.json")
model = build_model(cfg); model.load_state_dict(torch.load(f"{root}/models/teleport/ckpt.pt")["model"])
These are tiny models in a toy world, trained on synthetic data only. Nothing here is a claim about large video models or about chicks. The comparison is about what data can teach. The results rest on matched controls: seed-matched clips that are identical up to the edit, and probes scored against a model that never saw the concept. Seeds are 2–3 for the headline models and 1 for the local-attention variants.
The data is fully synthetic, so there's no third-party content. The code and weights are MIT.
models/deep_normal/ckpt.pt 42 MiBmodels/gravity_floor0.2/ckpt.pt 24 MiBmodels/gravity_floor0.4/ckpt.pt 24 MiBmodels/mix_0.0001/ckpt.pt 24 MiBmodels/mix_0.001/ckpt.pt 24 MiBmodels/gravity_control/ckpt.pt 24 MiBmodels/gravity_novx/ckpt.pt 24 MiBmodels/local_normal/ckpt.pt 24 MiBmodels/local_teleport/ckpt.pt 24 MiBmodels/mix_0.01/ckpt.pt 24 MiBmodels/mix_0.05/ckpt.pt 24 MiBmodels/mix_0.2/ckpt.pt 24 MiBmodels/mix_0.5/ckpt.pt 24 MiBmodels/normal/ckpt.pt 24 MiBmodels/normal_s1/ckpt.pt 24 MiBmodels/teleport/ckpt.pt 24 MiBmodels/teleport_s1/ckpt.pt 24 MiBmodels/teleport_s2/ckpt.pt 24 MiBmodels/vanish/ckpt.pt 24 MiBmodels/vanish_s1/ckpt.pt 24 MiBmodels/vanish_s2/ckpt.pt 24 MiBmodels/wide_normal/ckpt.pt 24 MiBmodels/memory_normal/ckpt.pt 21 MiBmodels/memory_teleport/ckpt.pt 21 MiBtok_p4.npz 32.7 KiB