transgrid
systematic-generalization
chenwen245299 commited on
Commit
ffc2819
路
verified 路
1 Parent(s): ffb82c9

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +148 -0
README.md ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - transgrid
4
+ - systematic-generalization
5
+ datasets:
6
+ - BlueWhaleLab/TranSGrid
7
+ ---
8
+
9
+ # TranSGrid Models
10
+
11
+ This repository provides the trained Transformer checkpoints for **TranSGrid**, introduced in [What Do Current Systematic Generalization Tasks Miss? A Reasoning-Centered Analysis](https://arxiv.org/abs/2609.19212).
12
+
13
+ TranSGrid is a grid-transformation testbed for studying systematic generalization through **deductive, inductive, and abductive reasoning**. Given an initial board and a target board, a model needs to generate a sequence of actions that transforms the initial board into the target. The action space includes ten operation types on rows, columns, and local 2 脳 2 blocks.
14
+
15
+ The released models operate on **6 脳 6 boards containing digits from 0 to 9**. Predictions are evaluated by executing the generated actions: a prediction is correct if it reaches the target board, even if it differs from the reference sequence.
16
+
17
+ **Links:** [Paper](https://arxiv.org/abs/2609.19212) 路 [Code](https://github.com/BlueWhaleLab/TranSGrid) 路 [Dataset](https://huggingface.co/datasets/BlueWhaleLab/TranSGrid) 路 [Interactive Demo](https://huggingface.co/spaces/BlueWhaleLab/TranSGrid)
18
+
19
+ ## Available Models
20
+
21
+ Checkpoints are organized into four model configurations:
22
+
23
+ | Directory | Configuration |
24
+ | --- | --- |
25
+ | `flat_board/` | FLAT + BOARD |
26
+ | `flat_pair/` | FLAT + PAIR |
27
+ | `grid_board/` | GRID + BOARD |
28
+ | `grid_pair/` | GRID + PAIR |
29
+
30
+ Each configuration contains seven encoder鈥揹ecoder Transformer checkpoints, named `level1.pt` through `level7.pt`. The GRID+PAIR models range from **0.96M** parameters at Level 1 to **88.43M** parameters at Level 7.
31
+ The examples below use `grid_pair/level7.pt`. To run another model, download its checkpoint and update the `--ckpt` argument.
32
+
33
+ ## Installation
34
+
35
+ The checkpoints are PyTorch `.pt` files. Use them with the model implementation and evaluation scripts in the [GitHub repository](https://github.com/BlueWhaleLab/TranSGrid).
36
+
37
+ Python **3.10 or newer** is required. Run all subsequent commands from the code repository's root directory.
38
+
39
+ ```bash
40
+ git clone https://github.com/BlueWhaleLab/TranSGrid.git
41
+ cd TranSGrid
42
+
43
+ conda create -p ./.conda python=3.12
44
+ conda activate ./.conda
45
+
46
+ pip install -r requirements.txt
47
+ pip install huggingface_hub
48
+ ```
49
+
50
+ ## Download a Checkpoint
51
+
52
+ Download the GRID+PAIR Level 7 model:
53
+
54
+ ```bash
55
+ hf download BlueWhaleLab/TranSGrid \
56
+ grid_pair/level7.pt \
57
+ --local-dir checkpoints
58
+ ```
59
+
60
+ The checkpoint will be saved to `checkpoints/grid_pair/level7.pt`.
61
+
62
+ For example, to download the FLAT+BOARD Level 3 model:
63
+
64
+ ```bash
65
+ hf download BlueWhaleLab/TranSGrid \
66
+ flat_board/level3.pt \
67
+ --local-dir checkpoints
68
+ ```
69
+
70
+ ## Run Evaluation
71
+
72
+ ### Greedy Decoding
73
+
74
+ Evaluate the model on the TranSGrid benchmark:
75
+
76
+ ```bash
77
+ python eval.py \
78
+ --ckpt checkpoints/grid_pair/level7.pt \
79
+ --data data/transgrid.jsonl \
80
+ --beams 1 \
81
+ --batch-size 128 \
82
+ --save results/TranSGrid/level7_grid_pair-greedy-bs128.jsonl \
83
+ --group-by deductive_score inductive_score abductive_level stop_reason
84
+ ```
85
+
86
+ ### Beam Search (Top@8)
87
+
88
+ Generate eight candidates per instance:
89
+
90
+ ```bash
91
+ python eval.py \
92
+ --ckpt checkpoints/grid_pair/level7.pt \
93
+ --data data/transgrid.jsonl \
94
+ --beams 8 \
95
+ --batch-size 128 \
96
+ --save results/TranSGrid/level7_grid_pair-beam8-bs128.jsonl \
97
+ --group-by deductive_score inductive_score abductive_level stop_reason
98
+ ```
99
+
100
+ **Top@8** counts an instance as solved if any of the eight candidates reaches the target board. Each saved JSONL row contains one selected prediction, its solve status, and the rank of the first successful candidate; it does not contain all eight candidates.
101
+
102
+ Reduce `--batch-size` if GPU memory is limited.
103
+
104
+ ### Held-out Test Set
105
+
106
+ Download the held-out Test split:
107
+
108
+ ```bash
109
+ hf download BlueWhaleLab/TranSGrid \
110
+ test.jsonl \
111
+ --repo-type dataset \
112
+ --local-dir data
113
+ ```
114
+
115
+ Then evaluate it:
116
+
117
+ ```bash
118
+ python eval.py \
119
+ --ckpt checkpoints/grid_pair/level7.pt \
120
+ --data data/test.jsonl \
121
+ --beams 8 \
122
+ --batch-size 128 \
123
+ --save results/Test/level7_grid_pair-beam8-bs128.jsonl
124
+ ```
125
+
126
+ ### View Saved Results
127
+
128
+ Print aggregate and grouped results without running decoding again:
129
+
130
+ ```bash
131
+ python report.py results/TranSGrid \
132
+ --axes deductive_score inductive_score abductive_level stop_reason
133
+ ```
134
+
135
+ For dataset generation, model training, and evaluation on the **Decoupled** and **SCAN** variants, see the [GitHub README](https://github.com/BlueWhaleLab/TranSGrid#readme).
136
+
137
+ ## Citation
138
+
139
+ If you use these models or TranSGrid in your research, please cite:
140
+
141
+ ```bibtex
142
+ @article{qi2026current,
143
+ title={What Do Current Systematic Generalization Tasks Miss? A Reasoning-Centered Analysis},
144
+ author={Qi, Chengwen and Ye, Deheng and Bian, Yatao},
145
+ journal={arXiv preprint arXiv:2609.19212},
146
+ year={2026}
147
+ }
148
+ ```