File size: 8,829 Bytes
d862b72
3cced8a
 
 
 
 
d862b72
 
3cced8a
d862b72
3cced8a
 
 
 
 
 
d862b72
 
3cced8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43b1e15
 
3cced8a
 
 
 
 
 
 
 
 
 
 
 
d862b72
 
 
 
3cced8a
d862b72
 
 
 
 
3cced8a
d862b72
3cced8a
d862b72
3cced8a
d862b72
3cced8a
 
 
 
 
 
d862b72
3cced8a
d862b72
3cced8a
d862b72
3cced8a
 
 
 
 
 
d862b72
3cced8a
d862b72
3cced8a
 
 
 
 
 
 
 
d862b72
3cced8a
d862b72
3cced8a
 
 
 
 
 
 
 
d862b72
3cced8a
d862b72
3cced8a
 
d862b72
3cced8a
 
d862b72
3cced8a
 
 
 
d862b72
3cced8a
 
 
 
d862b72
3cced8a
d862b72
3cced8a
 
 
 
 
 
 
 
 
d862b72
 
 
 
 
 
 
 
 
3cced8a
d862b72
 
 
3cced8a
 
 
 
 
 
d862b72
 
3cced8a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
---
language:
  - en
  - zh
  - es
  - ur
license: apache-2.0
task_categories:
  - text-generation
tags:
  - code
  - multilingual
  - legesher
  - transpilation
  - tiny-aya-expedition
  - language-decoded
pretty_name: Language Decoded Data
size_categories:
  - 10K<n<100K
configs:
  - config_name: condition-1-en
    data_files:
      - split: train
        path: data/condition-1-en/train-*.parquet
      - split: validation
        path: data/condition-1-en/validation-*.parquet
  - config_name: condition-2-ur
    data_files:
      - split: train
        path: data/condition-2-ur/train-*.parquet
      - split: validation
        path: data/condition-2-ur/validation-*.parquet
  - config_name: condition-2-zh
    data_files:
      - split: train
        path: data/condition-2-zh/train-*.parquet
      - split: validation
        path: data/condition-2-zh/validation-*.parquet
  - config_name: condition-2-es
    data_files:
      - split: train
        path: data/condition-2-es/train-*.parquet
      - split: validation
        path: data/condition-2-es/validation-*.parquet
dataset_info:
  features:
    - name: code
      dtype: string
    - name: code_en
      dtype: string
    - name: language
      dtype: string
    - name: file_path
      dtype: string
    - name: license
      dtype: string
    - name: token_count
      dtype: int64
---

# Language Decoded | Multilingual Code Dataset

Multilingual Python code datasets for the **Language Decoded** project (part of [Cohere's Tiny Aya Expedition](https://aya.for.ai)), investigating whether code's reasoning benefit for language models is **language-dependent** or **structure-dependent**.

## Research Question

> Does fine-tuning on non-English code (Python with translated keywords) improve multilingual reasoning as much as English code does?

Prior work ([Aryabumi et al., 2024 -- "To Code or Not to Code"](https://arxiv.org/abs/2408.10914)) demonstrated that including English code in pre-training data improves downstream reasoning performance by approximately 8%. However, that study only tested English code. This dataset enables the natural follow-up: does the reasoning benefit come from the _structure_ of code, or from the _language_ of its keywords?

## Dataset Description

This dataset provides filtered, quality-controlled Python source code in four configurations: the original English and three keyword-swapped variants (Chinese, Spanish, Urdu). The source data is drawn from [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup) (Python subset), filtered for quality using the following criteria:

- AST-valid Python only (must parse without errors)
- Permissive licenses only (MIT, Apache-2.0, BSD, etc.)
- 10--1000 lines of code
- Minimum 21 GitHub stars
- No autogenerated files
- SHA-256 deduplication

Keyword-swapped variants are produced using [Legesher](https://github.com/legesher/legesher) v0.7.3, which translates Python reserved words (37 keywords, 72 builtins, 66 exceptions) into the target language while preserving code structure and semantics.

## Available Configs

| Config           | Condition             | Language | Description                                                                                      |
| ---------------- | --------------------- | -------- | ------------------------------------------------------------------------------------------------ |
| `condition-1-en` | Condition 1 (control) | English  | Unmodified filtered Python from The Stack Dedup                                                  |
| `condition-2-ur` | Condition 2           | Urdu     | Keyword-swapped Python -- 37 keywords, 72 builtins, 66 exceptions translated via Legesher v0.7.3 |
| `condition-2-zh` | Condition 2           | Chinese  | Keyword-swapped Python -- same transpilation method                                              |
| `condition-2-es` | Condition 2           | Spanish  | Keyword-swapped Python -- same transpilation method                                              |

## Schema

| Column        | Type   | Description                                                                                                                                          |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`        | string | Python source code. For condition-2 configs, this is the transpiled (keyword-swapped) version. For condition-1, this is the original English source. |
| `code_en`     | string | Original English Python source code. Identical to `code` for condition-1-en.                                                                         |
| `language`    | string | ISO 639-1 language code: `en`, `ur`, `zh`, or `es`.                                                                                                  |
| `file_path`   | string | Original file path in The Stack Dedup.                                                                                                               |
| `license`     | string | SPDX license identifier for the source file.                                                                                                         |
| `token_count` | int64  | Token count computed using the CohereLabs/tiny-aya-base tokenizer.                                                                                   |

## Experimental Conditions

The Language Decoded experiment uses a ladder of six conditions to isolate the mechanism behind code's reasoning benefit. This dataset currently provides data for conditions 1 and 2:

| Condition       | Name                 | Purpose                                                                    |
| --------------- | -------------------- | -------------------------------------------------------------------------- |
| Baseline        | No fine-tuning       | Establishes the performance floor                                          |
| Condition 1     | English code         | Tests whether code fine-tuning helps at all (replicates Aryabumi et al.)   |
| Condition 2     | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit |
| Conditions 3--6 | (planned)            | Additional controls not yet included in this dataset                       |

## Usage

```python
from datasets import load_dataset

# Load English code (control)
ds = load_dataset("legesher/language-decoded-data", "condition-1-en")

# Load a keyword-swapped variant
ds = load_dataset("legesher/language-decoded-data", "condition-2-ur")
ds = load_dataset("legesher/language-decoded-data", "condition-2-zh")
ds = load_dataset("legesher/language-decoded-data", "condition-2-es")

# Access splits
train = ds["train"]
val = ds["validation"]
```

## Technical Details

| Parameter              | Value                                                                                                              |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
| Source dataset         | [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup) (Python subset)                 |
| Transpilation tool     | [Legesher](https://github.com/legesher/legesher) v0.7.3 (legesher-core, legesher-i18n)                             |
| Tokenizer              | CohereLabs/tiny-aya-base                                                                                           |
| Base model             | [CohereLabs/tiny-aya-base](https://huggingface.co/CohereLabs/tiny-aya-base) (3.35B params)                         |
| Train/validation split | 90% / 10% (seed 42)                                                                                                |
| File format            | Parquet (snappy compression)                                                                                       |
| Filtering criteria     | AST-valid, permissive licenses, 10--1000 lines, min 21 GitHub stars, no autogenerated files, SHA-256 deduplication |

## Citation

```bibtex
@misc{language-decoded-2026,
  title={Language Decoded: Investigating Language-Dependent vs. Structure-Dependent Reasoning Benefits of Code},
  author={Madison Edgar and Saad Bazaz and Rafay Mustafa and Sarah Jawaid and Rashik Shahjahan and Khojasteh Mirza and Sohaib Bazaz},
  year={2026},
  publisher={Hugging Face},
  url={https://huggingface.co/datasets/legesher/language-decoded-data}
}
```

## Links

- [Legesher on GitHub](https://github.com/legesher/legesher)
- [Tiny Aya Expedition](https://aya.for.ai)
- [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup)

## License

Apache 2.0