--- license: mit task_categories: - text-generation tags: - chain-of-thought - reasoning - controlled-environment - symbolic - LLM - DataAlchemy language: - en pretty_name: "DataAlchemy: A controllable laboratory for the science of Chain-of-Thought reasoning" size_categories: - 1M', # 'output': 'N N N N [F2] N N N N', # 'element': 'A A A A', 'transformation': '[F1] [F2]', # 'instruction': '', 'reasoning': 'N N N N [F2]', # 'answer': 'N N N N'} ``` Or load any file directly as raw JSONL: ```python import json with open("F1F2.jsonl") as f: records = [json.loads(line) for line in f] ``` ## Record schema One JSON object per line. Invariant: `input == element + " " + transformation + " " + instruction`, and the full rendered line is `input + " " + output`. | Field | Type | Meaning | | --- | --- | --- | | `input` | str | What the LM conditions on: `element + " " + transformation + " " + instruction`. | | `output` | str | What the LM should produce: reasoning trace (if any) + `` + final element. | | `element` | str | Input element atoms, space-joined. | | `transformation` | str | Transformation tokens, e.g. `[F1] [F2]`. | | `instruction` | str | Output-start marker: `` for CoT, `` for no-CoT. | | `reasoning` | str | Trace inside `output` before the final ``. Empty for `k=1`. | | `answer` | str | Final element after ``. | ## Intended use Two common usage examples: - **Task generalization** — pick subsets of the `k=2` files (`F1F1`, `F1F2`, `F2F1`, `F2F2`) as training and test set. This probes how well CoT reasoning transfers to an unseen task of primitives. - **Length / reasoning-depth generalization** — use the single-primitive chains `F1 → F1F1 → F1F1F1` (and analogously `F2 → F2F2 → F2F2F2`) to train at one depth `k` and evaluate at another. This probes whether CoT reasoning extrapolates to deeper reasoning chain than the model saw at training time. Refer to [`experiments/`](https://github.com/ChengshuaiZhao0/DataAlchemy/tree/main/experiments) and the [GitHub README](https://github.com/ChengshuaiZhao0/DataAlchemy#-experiments) for pre-wired launchers. ## How the data was generated Every file in this collection was produced with [`scripts/generate_data.py`](https://github.com/ChengshuaiZhao0/DataAlchemy/blob/main/scripts/generate_data.py) from the GitHub repo: ```bash # k=1 python scripts/generate_data.py --transformations "[F1]" --element-length 4 --output data/F1.jsonl python scripts/generate_data.py --transformations "[F2]" --element-length 4 --output data/F2.jsonl # k=2 python scripts/generate_data.py --transformations "[F1]" "[F1]" --element-length 4 --output data/F1F1.jsonl python scripts/generate_data.py --transformations "[F1]" "[F2]" --element-length 4 --output data/F1F2.jsonl python scripts/generate_data.py --transformations "[F2]" "[F1]" --element-length 4 --output data/F2F1.jsonl python scripts/generate_data.py --transformations "[F2]" "[F2]" --element-length 4 --output data/F2F2.jsonl # k=3 python scripts/generate_data.py --transformations "[F1]" "[F1]" "[F1]" --element-length 4 --output data/F1F1F1.jsonl python scripts/generate_data.py --transformations "[F2]" "[F2]" "[F2]" --element-length 4 --output data/F2F2F2.jsonl ``` ## Reproducibility & provenance Every record is deterministic given `--element-length`, `--rot-n`, `--pos-n`, and the transformation list — no randomness is involved for these 8 base files. Re-running the commands above with the stated flags reproduces every file byte-for-byte. ## License Released under the [MIT License](https://github.com/ChengshuaiZhao0/DataAlchemy/blob/main/LICENSE). ## Citation If our data helped you out, we'd love it if you gave us a citation! ```bibtex @article{zhao2025chain, title={Is Chain-of-Thought Reasoning of LLMs a Mirage? A Data Distribution Lens}, author={Zhao, Chengshuai and Tan, Zhen and Ma, Pingchuan and Li, Dawei and Jiang, Bohan and Wang, Yancheng and Yang, Yingzhen and Liu, Huan}, journal={arXiv preprint arXiv:2508.01191}, year={2025} } ```