Views
No views yet
P / G → QApplePiesFromScratch/dta-benchmark| Model | DTA-Overall | DTA-Closure | DTA-FixedPts | DTA-Involution | DTA-Cycle |
|---|---|---|---|---|---|
| MechanismBase (10M) | 77.5% | 80.0% | 90.0% | 100.0% | 40.0% |
| GPT-3.5-turbo (175B) | 55.0% | 70.0% | 10.0% | 50.0% | 90.0% |
| GPT-4 (1.8T) | 87.5% | 100.0% | 70.0% | 90.0% | 90.0% |
| Random baseline | 25.0% | 50.0% | 25.0% | 50.0% | 25.0% |
| Engine (oracle) | 100.0% | 100.0% | 100.0% | 100.0% | 100.0% |
1# The model requires the pl/ library and engine.py from the repo
2# Clone: github.com/ApplePiesFromScratch/propagation-logic
3
4from model import MechanismBase, SmallConfig
5from tokenizers import Tokenizer
6import torch
7
8config = SmallConfig()
9model = MechanismBase(config)
10# Load weights from Hub (see full usage in repo)
11
12tokenizer = Tokenizer.from_file("mechanism_tokenizer/tokenizer.json")
13
14# Give the model a partial derivation trace
15partial = """DOMAIN: color_domain
16CARRIER: ['red', 'green', 'blue']
17GRADIENTS: ['complement', 'id']
18THETA: 1.0
19---
20"""
21
22ids = torch.tensor(tokenizer.encode(partial).ids).unsqueeze(0)
23output = model.generate(ids, max_new_tokens=200, temperature=0.3)
24print(tokenizer.decode(output[0].tolist()))python generate_data.py # generates derivation trace corpus
python tokenizer_train.py # BPE tokenizer on corpus
python train.py # SmallConfig, ~30 min on RTX 4060 Ti