Download README.md from yrlyrl/spatial-mmcot-zebra_multihop: direct link, hf CLI and curl.
- Browser
- Download file 26.1 kB
-
https://huggingface.co/datasets/yrlyrl/spatial-mmcot-zebra_multihop/resolve/main/README.md
- Command line
-
hf download hf://datasets/yrlyrl/spatial-mmcot-zebra_multihop/README.md
-
curl -L -o README.md https://huggingface.co/datasets/yrlyrl/spatial-mmcot-zebra_multihop/resolve/main/README.md
license: cc-by-nc-4.0
pretty_name: Spatial MMCoT v1 - zebra_multihop
language:
- en
task_categories:
- visual-question-answering
- image-to-image
tags:
- spatial-reasoning
- interleaved-reasoning
- multimodal-chain-of-thought
size_categories:
- 1K<n<10K
configs:
- config_name: preview
default: true
data_files:
- split: train
path: preview/train/*.parquet
- split: validation
path: preview/validation/*.parquet
- config_name: train
data_files:
- split: train
path: train/*.parquet
- split: validation
path: validation/*.parquet
- config_name: meta
data_files:
- split: train
path: meta/train/*.parquet
- split: validation
path: meta/validation/*.parquet
Spatial MMCoT v1 · zebra_multihop
Zebra-CoT multi-hop object counting over rendered 3D scenes (primitive objects on textured ground under a sky). Many traces open with a viewpoint change, so the first target is often a novel view. The final thought re-examines the last target image, but on some rows it only says it counts the objects and never states the number; the count is then only in <answer>. Released rows carry 2 to 5 target images. 2,057 traces with more target images than the declared maximum were refused (S9), not cut, so every released row keeps its full chain. 707 rows (flags S9.px=*) were over the token budget at full size, so their targets are stored smaller; the BAGEL/ThinkMorph VAE transform (min_image_size 512) scales them back up for the image loss, so those targets are trained as upsampled, softer images. The thoughts keep upstream's numbered labels ('THOUGHT 0:', 'THOUGHT 1:', ...) inside <think>. They count upstream's thoughts across the whole trace, not the row's slots, so one slot often holds two or more labelled thoughts, and a slot after a target image can open with the unlabelled end of the previous thought. No other source in this release has these labels; if you mix sources and do not want a model to learn them, remove them with re.sub(r'THOUGHT \d+:\s*', '', text). Refused by the conversion's checks: 1,142 rows whose question announces operations without listing them (S0.ops_not_stated); 2,061 rows whose answer is not an integer (S0.non_integer_answer); 33 rows whose read-back is empty (S0.empty_readback).
Reasoning text in this release (r4)
The paragraph above describes the upstream data, and where it describes the reasoning text it describes the text of the previous release (r3). In this release every thought was rewritten: Qwen3.8-27B in thinking mode (temperature 1.0, top-p 0.95, top-k 20; prompt v4.1, scripts/annotate/rationale.py in our conversion code (the code repository is not public yet)) was shown the row's input images, its target images in order, the question, the options and the answer, and wrote the thought before each target image (what is still unknown, and what the picture should show to settle it) and the read-back after the last one. The images, the question, the options, the answer and the number of steps are r3's, checked row by row (image bytes, instruction, K and the <answer> value).
This is the training subset: 112 rows of r4 are not in it, listed with their reason in reports/subset_dropped.jsonl: 77 the rewritten row's estimated token cost exceeds the 24,576-token sample budget, which the trainer's packer would drop silently (over_budget); 35 the rewrite model judged the stored answer doubtful (its note is in the list) (label_doubt).
Self-check of the rewritten text (measured 2026-10-02 on 22 rows sampled from this source before the removals above, each judged against its full-resolution pictures): 0.95 faithfulness errors per row (a claim the pictures contradict), 55% of rows with none; the plan names the real obstacle on 77%, the read-back reads the picture it follows on 86%, and the answer follows from the text on 96%.
The measured caveats on the r3 card were counted on r3's rows and text and are not repeated here; the per-row known-issue lists below were measured again on these rows and this text.
Supervision kind (supervision_kind in meta): full_interleaved on every row: the upstream trace itself interleaves text and target images (drawn or rendered states on most sources; the source note above says which), and the read-back comes after the target image it reads. In this release the text was rewritten by a model shown every image of the row (see the r4 section above).
Upstream: multimodal-reasoning-lab/Zebra-CoT. Licence: cc-by-nc-4.0. Changes from upstream: every image is decoded, re-encoded as JPEG and downscaled (the input to 512x288; targets to 911x512, or 448 or 384 px wide on rows flagged S9.px=*); the image placeholders in the question and the reasoning were removed and the sentence around each repaired, sometimes by inserting words such as 'the image'; the reasoning is split into one thought per target; the ThinkMorph system prompt is prepended to the question; rows were filtered and balanced as described below.
Known issues
Rows with a measured per-row problem are listed in reports/known_issues/, one TSV per issue (a # <description> line, then row_uid<TAB>split<TAB>detail lines), so they can be filtered out. They are still in this release: no row was removed for these issues.
| issue | rows | train | validation | what | how it was found | file |
|---|---|---|---|---|---|---|
target_repeats_earlier_target |
665 | 644 | 21 | A target is byte-identical to an earlier target of the same row (a 'remove 0 X objects' step, or objects added and then removed), so the model is trained to redraw an image it has already drawn; S8 compares targets only with the input image. | sha1 of target j equals the sha1 of some target i < j of the same row; measured 2026-10-03; known_issues.py sha1 b2249331; export b3fa1b9 rows 14a4fb2c/18d9ad8f | reports/known_issues/target_repeats_earlier_target.tsv |
readback_states_no_count |
5 | 5 | 0 | The final thought never writes the answer's number: it promises to count, lists the objects without a total, or gives only an intermediate or partial number (a few say it without a numeral, e.g. 'only the purple capsule remains' for 1), so the number exists only in <answer> (read-backs that state a different count are listed in readback_states_other_count instead). | neither the digits of <answer> nor its number word (zero/no/none for 0; for 1, 'the only <singular noun>' but not 'a', 'an' or 'single') appears as a word in the read-back, after removing upstream's 'THOUGHT k:' labels; rows of readback_states_other_count excluded; measured 2026-10-03; known_issues.py sha1 b2249331; export b3fa1b9 rows 14a4fb2c/18d9ad8f | reports/known_issues/readback_states_no_count.tsv |
To leave the listed rows out (the snippet in the loader section downloads reports/known_issues/ with the data):
import glob, os
root = "<root>/zebra_multihop"
drop = {line.split("\t")[0] for f in glob.glob(os.path.join(root, "reports/known_issues/*.tsv"))
for line in open(f) if line.strip() and not line.startswith(("#", "row_uid\t"))}
# keep a row when its row_uid (a column of train/, meta/ and preview/) is not in drop
Size
| split | rows | target image slots | distinct target images |
|---|---|---|---|
| train | 2,865 | 10,556 | 9,850 |
| validation | 89 | 314 | 289 |
A slot is one target position in one row. No target image here is shared between rows: every repeat is inside one row, a target identical to an earlier target of the same row (after a step that leaves the scene unchanged, such as 'remove 0 RED objects'; see Known issues).
| task | train | validation |
|---|---|---|
| multihop_counting | 2,865 | 89 |
Input images per row: 1. Target images per row (the images the model is trained to generate): 2 to 5.
Image corpus (source_scene_corpus): procedural_grid 2,954. procedural_grid is this pipeline's label for any procedurally generated synthetic image (2D grid puzzles and simple 3D renders of primitive objects alike); the source note above says what the images show.
Row format
One row is: input image(s) and a question, then K rounds of thought → target image (the target is the source's own ground-truth image, which the model is trained to generate), then a final thought (normally a read-back of the last target; where a source's final thought is something else, or often leaves out the answer, the source note or Known issues says so) and the answer; here K is 2 to 5. In the train config:
image_list list<binary> inputs first, then the K target images in order
num_input_images int64 how many of image_list are inputs
instruction_list list<string> one element: system prompt + question
output_text_list list<string> K+1 elements:
[0] <think>plan 1</think><image_start>
[j] <image_end><think>plan j+1</think><image_start>
[K] <image_end><think>read-back</think><answer>answer</answer>
row_uid string join key to `meta` and `preview`
<answer> holds exactly meta.answer_value (also the answer column of preview) on every row: score model output against that string.
The system prompt is ThinkMorph's VLM_THINK_SYSTEM_PROMPT from its inferencer.py, verbatim (GEN_THINK_SYSTEM_PROMPT there has the same text), including its leading and trailing newline. The markers are plain strings, not tokenizer special tokens; the prompt writes </image_end> and the data writes <image_end>, exactly as the ThinkMorph-7B checkpoint was trained.
preview shows the same rows with one column per slot: input_image_i for the inputs; for each of the K = num_steps rounds, the plan thought_j and its target target_image_j, both empty for K <= j < 5; and the read-back in thought_5 on every row.
meta holds the per-row sidecar: task, scene_id and geometry_uid (the scene and geometry keys; the split key is named in the split paragraph below), trajectory_id (a camera-path or sample label, empty where the source has none), num_steps, num_input_images, answer_type, answer_value, majority_class_rate, target_image_kind, target_px, est_tokens, licence, split (train / validation, the Hub split names), supervision_kind (full_interleaved / visual_aux / visual_only) and filter_flags. majority_class_rate is the share of the task's most frequent answer_value among its training rows: it measures answer skew and is not a guessing baseline (where a task mixes question types or each row has its own options it can be far below chance); compare scores with the text-only baselines below.
Per-row license in meta: cc-by-nc-4.0 2,954.
Flags on released rows (filter_flags in meta and preview, comma-separated):
| flag | rows | meaning |
|---|---|---|
S5.replay_unsupported |
2,954 | no solver re-derives this task's answer from the trace, so S5 did not replay it |
S9.px=384 |
707 | targets stored at this long-edge size (px) because the row was over the token budget at full size; the trainer's VAE transform (short edge at least 512) scales them back up, so these targets are trained as upsampled, softer images |
S8.phash_near_but_distinct |
282 | a target's perceptual hash is within 6 bits of an input image's, but its pixels differ, so it is not a copy; kept |
S14.sampled_qa |
194 | chosen for the S14 human spot-check (reports/s14_sample.tsv) |
Training with a BAGEL-family loader
Every row here has one input image (num_input_images is 1), so the stock ThinkMorph UnifiedEditIterableDataset (https://github.com/ThinkMorph/ThinkMorph: image_list[0] as input, image_list[j+1] after output_text_list[j]) and the IPT release's version (which reads num_input_images) both read it as intended. Mixed with a source whose rows have more than one input image, only a loader that reads num_input_images is correct.
The stock BAGEL edit loader (ByteDance-Seed/Bagel) cannot train these rows: it never reads output_text_list and expects each instruction_list element to be a list of paraphrases.
parquet_info.json keys each training chunk as <source>/<split>/<file>, here zebra_multihop/train/chunk_00000.parquet, with row-group counts read from the parquet footers. The loader matches a chunk only when its key equals the path it builds, os.path.join(data_dir, file), and skips a chunk with no key without a warning: a source that is alone in its group then fails with IndexError: list index out of range, and in a mixed group it adds no rows. Download into a directory named after the source, not after the repository:
from huggingface_hub import snapshot_download
snapshot_download("yrlyrl/spatial-mmcot-zebra_multihop", repo_type="dataset", local_dir="<root>/zebra_multihop",
allow_patterns=["train/*", "validation/*", "parquet_info.json", "reports/known_issues/*"])
Then either run from <root> with data_dir: zebra_multihop/train and parquet_info_path: zebra_multihop/parquet_info.json, or rebuild the index with absolute keys and use an absolute data_dir:
import json, os
root = "/abs/path/to/root" # the directory that holds zebra_multihop/
info = json.load(open(os.path.join(root, "zebra_multihop", "parquet_info.json")))
info = {os.path.join(root, k): v for k, v in info.items()}
json.dump(info, open(os.path.join(root, "zebra_multihop", "parquet_info_abs.json"), "w"))
# data_dir = os.path.join(root, "zebra_multihop", "train") (spelled exactly so, no trailing slash)
# parquet_info_path = os.path.join(root, "zebra_multihop", "parquet_info_abs.json")
The Hugging Face cache (.../snapshots/<hash>/train/) or a folder named spatial-mmcot-zebra_multihop matches no key.
num_used_data counts chunk files, not rows: the loader repeats this source's file list up to that number, lists every (file, row group) pair, and deals whole row groups out, floor(R / world_size) to each rank and floor(that / num_workers) to each DataLoader worker. The remainder is never read. This source has 1 training chunk file holding 23 row groups of up to 128 rows, so keep num_used_data large, e.g. the 128 of ThinkMorph's interleaved_reasoning.yaml (upstream's example.yaml asks for more than GPUs x workers); every row group is then read. Set to 1 and alone in its group on 8 GPUs with 4 workers, it gives every DataLoader worker an empty list, and the iterator then loops forever printing repeat without yielding a row. In a run that mixes sources, give each source the same multiple of its own training chunk-file count, e.g. 128 per file (128 here): the file list is repeated up to num_used_data entries, so a flat 128 for every source would read a two-file source's rows half as often as a one-file source's.
How the rows were chosen
| stage | rows |
|---|---|
| upstream rows read | 10,000 |
refused before conversion (S0raw; each reason is in the table below) |
3,203 |
| quarantined at S4c (an automatic check could not match the read-back's conclusion to the label) | 92 |
| dropped at S5 (the text contains a phrase from S5's self-contradiction list, e.g. 'does not make sense', 'discrepancy', 'there must be a mistake'; a keyword match, not a comparison with the images, so it also removes some sound rows) | 17 |
| dropped at S8 (a target was removed as a copy of an input, as transparent or as too small, and the row had no target left or was a multi-step chain that cannot lose a state) | 918 |
| dropped at S9 (over the token budget or too many target images) | 2,057 |
| refused by the final structural check (S0, after S9) | 33 |
| after conversion and per-row filters | 3,680 |
| removed by S10 (none) | 0 |
| removed by answer-prior balancing (S13) | 614 |
removed for training after the r4 rewrite (subset_dropped.jsonl) |
112 |
| released | 2,954 |
Every removed row has one line, with its reason, in reports/:
| file | step | reason (the line's flag, or the field shown) |
rows |
|---|---|---|---|
build/dropped.jsonl |
S0 | S0.empty_readback |
33 |
build/dropped.jsonl |
S0raw | S0.non_integer_answer |
2,061 |
build/dropped.jsonl |
S0raw | S0.ops_not_stated |
1,142 |
build/dropped.jsonl |
S5 | S5.self_contradiction |
17 |
build/dropped.jsonl |
S8 | S8.chain_broken |
918 |
build/dropped.jsonl |
S9 | S9.needs_truncation |
2,057 |
build/quarantine.jsonl |
S4c | S4c.cot_label_conflict |
92 |
s13_dropped.jsonl |
S13 | step: answer |
614 |
subset_dropped.jsonl |
r4 | reason: over_budget |
77 |
subset_dropped.jsonl |
r4 | reason: label_doubt |
35 |
Every line of s13_dropped.jsonl has reason: prior_downsample; step names the balancing pass that removed it, and split is written train or val (the Hub's validation).
S0raw lines in build/dropped.jsonl were refused before a release row existed, so their row_uid field holds the converter's key for the upstream record, not a 16-hex row_uid; lines from later steps carry the row_uid the row had. No removed row appears in meta or preview. For this source the key is built from upstream fields that repeat across rows (for most sources a hash of the question text), so it is not unique: the 2,061 S0.non_integer_answer lines carry 2,059 distinct keys. Those rows are counted with their reason but cannot be traced to individual upstream rows.
92 rows were quarantined rather than dropped (S4c): an automatic check could not match the read-back's stated conclusion to the stored label. They were not reviewed by hand, and some are phrasing mismatches rather than wrong labels.
S8.k_zero and S8.chain_broken name what happened to the row, not which check removed the image; the lines in this build do not record whether it was the size, transparency or copy check.
Per-step counters of the conversion
10,000 upstream rows were read; S0raw refused 3,203 before a row existed and passed 6,797 to the first step. S0 runs once more, last, on the final bytes. The reason for every refused, dropped or quarantined row is in the files above.
| step | in | out | dropped | quarantined | rejected | repaired |
|---|---|---|---|---|---|---|
| S0raw (refused before conversion) | 10,000 | 6,797 | 0 | 0 | 3,203 | 0 |
| S4 | 6,797 | 6,797 | 0 | 0 | 0 | 0 |
| S4c | 6,797 | 6,705 | 0 | 92 | 0 | 0 |
| S5 | 6,705 | 6,688 | 17 | 0 | 0 | 0 |
| S8 | 6,688 | 5,770 | 918 | 0 | 0 | 0 |
| S9 | 5,770 | 3,713 | 2,057 | 0 | 0 | 0 |
| S0 (final structural check, after S9) | 3,713 | 3,680 | 33 | 0 | 0 | 0 |
The train/validation split keeps rows sharing a scene_id in meta on one side, and the assignment is frozen (splits/ in the summary repository). scene_id is the md5 of the upstream input image (problem_image_1), so a key is one input image; geometry_uid repeats it and trajectory_id is empty. S12 saw 3,680 rows under 3,680 keys, one row per key, so the split is in effect per row. No validation input image has the content of a training input image. The S12 run did not record whether its pixel-level near-copy test ran for this source, so near-copies are not ruled out.
Answer-prior balancing (S13)
Each (task, split) group is checked separately. An answer is the answer value compared as lower-cased text without a trailing full stop, with 'farther' read as 'further' and 'nearer' as 'closer' (for multiple choice, the option text, not the letter; where the candidates are drawn in the image, as in zebra_jigsaw and zebra_tetris, the answer is the letter itself). An answer is real when it holds at least 5 rows and 2% of the group; k is the number of real answers. Answer step: the target is max(30%, 1/k) when k >= 2, and max(30%, 1/d) over the d distinct answers when k = 1; a validation group uses the larger of its own target and its task's train target. A group is cut only when k >= 1 and its most common answer holds more than the target plus 5 percentage points; every answer is then capped at one common count, chosen so that none exceeds the target, and smaller answers keep all their rows. At the answer step, a group at or below that trigger, or with no real answer (k = 0), is left as it is, so its most common answer can hold up to the target plus 5 percentage points. A task whose train group has exactly two real answers is instead cut, in every split, so that its two largest answers have equal counts, with no trigger. Rank and label steps: then, in a group where every option value of every row is a number, the rank of the correct option among the sorted values, and after it, in a group where every trained answer is an option label, the label, are each capped by the same cut-and-trigger rule on their own counts (own target, validation included): capped, never evened out, so two labels are cut only when one exceeds 55%, and then only down to 50%. These steps can also cut groups the answer step left whole, including k = 0 groups, and can raise an answer's final share above its target; the run fails if a real answer ends above the target plus 5 percentage points. A train group of at least 20 rows in which one answer holds 90% or more fails the run. PET (exact_cells_pet) instead cuts each (question type x turn direction) cell to equal counts of its two answers; a PET cell that shows only one answer is removed.
| task | split | pass | rule | rows in → out | real answers k | target | largest share, before → after | cut |
|---|---|---|---|---|---|---|---|---|
| multihop_counting | train | answer | cap30[canon] |
3,574 → 2,972 | 8 | 30.0% | 41.8% → 30.0% | yes |
| multihop_counting | validation | answer | cap30[canon] |
106 → 94 | 7 | 30.0% | 37.7% → 29.8% | yes |
S13 removed 614 rows from this source.
Text-only baselines
Accuracy of guessers that never see an image. For each task the released training rows are split into two fixed halves by a hash of row_uid; each guesser is fitted on one half and scored once on the other (one held-out half, not cross-validation; eval rows below). The reference is chance (the mean of 1 / number of options) where every row is multiple choice, and otherwise the eval-half accuracy of always giving the answer most common in the fit half (when a task's top answers are nearly tied, this need not be the task's most common answer; the line after the table gives that answer's validation score). Accuracies are recounted from the stored rates and eval rows, so they are exact. A task is flagged when a text-only guesser beats its reference by more than 0.15 (for a free-form task, a guesser other than the most common answer). A flagged task can be partly answered from the text alone; an unflagged task passed only these probes, which do not prove the text carries no answer. Report scores on every task next to this baseline.
Guessers: keywords: the most common answer per set of spatial words in the question; majority: the answer most common in the fit half; template: the most common answer per question wording (numbers masked, object names kept).
| task | best text-only guesser | accuracy | reference | margin | eval rows | flagged |
|---|---|---|---|---|---|---|
| multihop_counting | template |
0.294 | 0.294 (majority) | +0.000 | 1,498 | no |
Always giving the most common training answer, scored on the validation split (the constant baseline to compare validation scores with): multihop_counting: always answering 1 (30.2% of training rows) scores 0.303 (27/89).
Spot-check (S14)
Pending. The S14 rows are chosen and flagged S14.sampled_qa in meta and preview; the human pass over them has not been signed off yet.
Citation
Zebra-CoT is by Ang Li, Charles Wang, Deqing Fu, Kaiyu Yue, Zikui Cai, Wang Bill Zhu, Ollie Liu, Peng Guo, Willie Neiswanger, Furong Huang, Tom Goldstein and Micah Goldblum, released under CC BY-NC 4.0; this repository is a converted subset of it (the changes are listed under the licence line above). Its card asks users to cite:
@inproceedings{li2026zebracot,
title={Zebra-CoT: A Dataset for Interleaved Vision-Language Reasoning},
author={Ang Li and Charles Wang and Deqing Fu and Kaiyu Yue and Zikui Cai and Wang Bill Zhu and Ollie Liu and Peng Guo and Willie Neiswanger and Furong Huang and Tom Goldstein and Micah Goldblum},
booktitle={The Fourteenth International Conference on Learning Representations},
year={2026},
url={https://openreview.net/forum?id=c6XIVI3TiQ}
}
Provenance
The release files were written by our conversion code (the code repository is not public yet), scripts/convert/export.py at commit b3fa1b993ca9, from build zebra_multihop_r3. The build was made by scripts/convert/run_source.py from the same repository at commit 76c78bd817c2. S10, S12 and S13 ran before the export; reports/export_manifest.json pins every input the export read by SHA-1 (build_manifest_sha1, s10_keep_sha1, s12_assignments_sha1, s13_balanced_keep_sha1).
Every row removed between upstream and this release has one line, with its reason, in reports/: build/dropped.jsonl (rows refused before conversion or dropped by a conversion step); build/quarantine.jsonl (rows set aside by S4c because an automatic check could not match the read-back's conclusion to the label); s10_dropped.jsonl (duplicates removed by S10); s10_label_conflicts.jsonl (rows S10 withheld because another row asks the identical question, options in the same order, of the same images with a different answer); s13_dropped.jsonl (rows removed by answer-prior balancing). known_issues/ lists rows with a measured problem (see Known issues); reports/ also holds the build manifest (absolute paths cut to basenames) and counters, the S14 sample list (s14_sample.tsv: row_uid, task, split) and export_manifest.json. Part of yrlyrl/spatial-mmcot.