--- license: apache-2.0 task_categories: - text-generation tags: - arithmetic - compositional-generalization - length-generalization - synthetic size_categories: - 10K", s1["train"][0]["output"]) ood7 = load_dataset("Ajay0728/Compositional-reasoning-arithmetic-datasets", "study1", split="ood_ops7") ``` You can also download the raw JSON files directly. Each file is a JSON object with the examples under `"data"` and the generation metadata in the other top-level keys. ## Fields Each example has these fields: | Field | Type | Description | |---|---|---| | `input` | string | Model input: the fully parenthesized expression, with spaces around operators | | `output` | string | Target: the integer result as a string | | `expression` | string | Same as `input` | | `result` | int | Integer value of the expression | | `num_operations` | int | Number of binary operators | | `depth` | int | Depth of the expression tree | | `intermediate_max` | int | Largest absolute intermediate value during evaluation | | `operator_counts` | dict | Count of each of `+ - * /` | | `seed_id` | int | Index of the generator seed this example came from | Each file also has these top-level metadata keys: - `study`, `split`, `seed`, `generator_commit`, `timestamp` - `buckets`: the operation count, depth, tree shape and rejection rate for each group of expressions - `operator_distribution_actual`: how often each operator actually appears ## How the data was generated Each expression is built as a random binary expression tree with a target operation count, depth, and shape. A shape is either *balanced* or *chain*, where a chain nests to one side only. Candidates are rejected unless: - every division is exact (integer result, no remainder, no division by zero) - the final result satisfies |result| ≤ 10,000 All inputs are at most 51 characters long. Outputs are at most 6 characters (e.g. `-10000`). **Operator balance:** division is rare in every split, about 3–5% of operators, because the exact-division requirement rejects most division candidates. The other three operators make up roughly 28–35% each. Results broken down by operator, especially for division, should account for these small counts. ## Integrity `CHECKSUMS.txt` lists the SHA-256 hash of each file. Its paths start with `datasets_v2/`, so to verify, put the files in a folder named `datasets_v2` and run `shasum -a 256 -c CHECKSUMS.txt` from that folder's parent. ## Superseded version An earlier version of these datasets, `datasets/` in the GitHub repo, was used with an evaluation path that silently cut inputs to 20 characters. Results from that version are retired. This v2 release is the one used for every number reported in the paper. ## Citation ```bibtex @misc{jamanjyothi2026partial, title = {Partial Competence and Limited Transfer: Comparing LSTM and Transformer Generalization on Arithmetic Expressions}, author = {Jamanjyothi, Ajay}, year = {2026}, note = {arXiv preprint (ID pending)} } ```