RookWorld & ROOK: Reasoning Over Organized Knowledge
Collection
training language models to reason with a world model: https://laion.ai/notes/rook/ https://jorahn.github.io/research/rook-clf-demo/ • 6 items • Updated
A 124M parameter language model for chess with chain-of-thought reasoning, trained with synthetic explanations from Stockfish 16.1.
ROOK-LM generates chess moves with detailed reasoning traces, incorporating position analysis, candidate evaluation, and move selection in a chain-of-thought format.
ROOK-LM uses a structured format with position, candidate moves, evaluations, and best move:
<FEN position>
M: <candidate moves in UCI notation>
E: <evaluation scores for each candidate>
B: <best move in UCI notation>
Concrete Training Example:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1
M: e2e4 d2d4 g1f3 c2c4 g2g3
E: 0.3 0.3 0.2 0.1 0.0
B: e2e4
Breakdown:
Generation Example (Inference):
# Input prompt
prompt = "r1bqkbnr/pppp1ppp/2n5/4p3/4P3/5N2/PPPP1PPP/RNBQKB1R w KQkq - 2 3"
# Model generates continuation (stripped padding)
output = "M: d2d4 b1c3 f1c4 f1b5 d2d3 E: 0.6 0.5 0.4 0.3 0.2 B: d2d4"
The model learns to:
The model generates coherent chess analysis including:
Custom chess tokenizer combining:
The model uses the llm.c framework for efficient training:
# Training command
./train_gpt2 \
--input_bin data/rook_train.bin \
--val_bin data/rook_val.bin \
--model_file log/model.bin \
--batch_size 512 \
--sequence_length 2048
@article{rook2024,
title={ROOK: Strategic Reasoning in Chess Without Search},
author={Rahn, Jonathan and Jitsev, Jenia and Sun, Qi},
journal={LAION Research Notes},
year={2024},
url={https://laion.ai/notes/rook/}
}
Jonathan Rahn - GitHub | Research Page
LAION research note: https://laion.ai/notes/rook/