Datasets:
docs: align card with published condition-5 configs (ur/zh/es)
#11
by madiedgar - opened
README.md
CHANGED
|
@@ -921,7 +921,7 @@ Prior work ([Aryabumi et al., 2024 -- "To Code or Not to Code"](https://arxiv.or
|
|
| 921 |
|
| 922 |
## Dataset Description
|
| 923 |
|
| 924 |
-
This dataset provides filtered, quality-controlled Python source code in multiple configurations: the original English, three keyword-swapped variants (Chinese, Spanish, Urdu), a blended native+transpiled mix,
|
| 925 |
|
| 926 |
- AST-valid Python only (must parse without errors)
|
| 927 |
- Permissive licenses only (MIT, Apache-2.0, BSD, etc.)
|
|
@@ -934,7 +934,7 @@ Keyword-swapped variants are produced using [Legesher](https://github.com/legesh
|
|
| 934 |
|
| 935 |
## Available Configs
|
| 936 |
|
| 937 |
-
Conditions 1--2 are available in three current Phase 3 sizes: `-103k` full corpora, `-20k` random subsets sampled from the corresponding `-103k` config with seed 42, and `-5k` compact subsets. Phase 2 `-32k` configs are still available with the `phase-2-the-stack-v1-*` prefix.
|
| 938 |
|
| 939 |
| Config | Condition | Language | Description | Train | Val |
|
| 940 |
| ------------------------- | ----------- | -------- | ------------------------------------------------ | ------ | ------ |
|
|
@@ -952,7 +952,9 @@ Conditions 1--2 are available in three current Phase 3 sizes: `-103k` full corpo
|
|
| 952 |
| `condition-2-ur-5k` | 2 | Urdu | Compact 5k subset | 4,500 | 500 |
|
| 953 |
| `condition-3-zh-5k` | 3 | Chinese | Blended: native Chinese code + transpiled Python | 4,500 | 500 |
|
| 954 |
| `condition-4-zh-5k` | 4 | Chinese | Strictly native Chinese code | 6,553 | 729 |
|
| 955 |
-
| `condition-5-ur-5k-c4ai-aya-expanse-32b` | 5 | Urdu
|
|
|
|
|
|
|
| 956 |
|
| 957 |
## Schema
|
| 958 |
|
|
@@ -965,10 +967,26 @@ Used by: `condition-1-en-*`, `condition-2-zh-*`, `condition-2-es-*`, `condition-
|
|
| 965 |
| `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. |
|
| 966 |
| `code_en` | string | Original English Python source code. Identical to `code` for condition-1-en. |
|
| 967 |
| `language` | string | ISO 639-1 language code: `en`, `ur`, `zh`, or `es`. |
|
| 968 |
-
| `file_path` | string | Original file path in
|
| 969 |
| `license` | string | SPDX license identifier for the source file. |
|
| 970 |
| `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
|
| 971 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 972 |
### Condition 3
|
| 973 |
|
| 974 |
Used by: `condition-3-zh-5k`
|
|
@@ -1015,6 +1033,7 @@ The Language Decoded experiment uses a ladder of conditions to isolate the mecha
|
|
| 1015 |
| Condition 2 | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit |
|
| 1016 |
| Condition 3 | Mixed native sources | Tests whether diverse native-language code adds value beyond keyword swapping |
|
| 1017 |
| Condition 4 | Strictly native code | Tests whether code authored by native speakers carries unique signal beyond transpilation |
|
|
|
|
| 1018 |
|
| 1019 |
### The Experimental Ladder
|
| 1020 |
|
|
@@ -1051,6 +1070,11 @@ ds = load_dataset("legesher/language-decoded-data", "condition-3-zh-5k")
|
|
| 1051 |
# Load strictly native code (condition 4)
|
| 1052 |
ds = load_dataset("legesher/language-decoded-data", "condition-4-zh-5k")
|
| 1053 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1054 |
# Access splits
|
| 1055 |
train = ds["train"]
|
| 1056 |
val = ds["validation"]
|
|
@@ -1063,21 +1087,24 @@ native_only = train.filter(lambda x: x["source_type"] == "native")
|
|
| 1063 |
|
| 1064 |
| Parameter | Value |
|
| 1065 |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
| 1066 |
-
| Source dataset
|
|
|
|
| 1067 |
| Transpilation tool | [Legesher](https://github.com/legesher/legesher) v0.7.3 (legesher-core, legesher-i18n) |
|
| 1068 |
| Tokenizer | CohereLabs/tiny-aya-base |
|
| 1069 |
| Base model | [CohereLabs/tiny-aya-base](https://huggingface.co/CohereLabs/tiny-aya-base) (3.35B params) |
|
|
|
|
| 1070 |
| Train/validation split | 90% / 10% (seed 42) |
|
| 1071 |
| File format | Parquet (snappy compression) |
|
| 1072 |
| Filtering criteria | AST-valid, permissive licenses, 10--1000 lines, min 21 GitHub stars, no autogenerated files, SHA-256 deduplication |
|
| 1073 |
|
| 1074 |
## Limitations
|
| 1075 |
|
| 1076 |
-
- **Source bias**: The Stack
|
| 1077 |
- **Keyword-only transpilation**: Legesher translates Python reserved words (keywords, builtins, exceptions) but leaves comments, docstrings, string literals, and variable/function names in their original language (typically English). This means condition-2 code is a hybrid of translated keywords and English identifiers.
|
| 1078 |
- **Token count variation**: Transpiled code may have different token counts than the English original due to multi-byte characters (especially for Chinese and Urdu), even though the code structure is identical.
|
| 1079 |
- **Single programming language**: Currently limited to Python. Results may not generalize to other programming languages.
|
| 1080 |
- **Condition 4 scope**: Native Chinese code is limited to publicly available sources (The Stack, Wenyan, Program-in-Chinese, Qi, Mulan) and may not represent the full spectrum of Chinese-language programming.
|
|
|
|
| 1081 |
|
| 1082 |
## Citation
|
| 1083 |
|
|
@@ -1095,7 +1122,8 @@ native_only = train.filter(lambda x: x["source_type"] == "native")
|
|
| 1095 |
|
| 1096 |
- [Legesher on GitHub](https://github.com/legesher/legesher)
|
| 1097 |
- [Tiny Aya Expedition](https://aya.for.ai)
|
| 1098 |
-
- [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup)
|
|
|
|
| 1099 |
- [Language Decoded Community (native code)](https://huggingface.co/datasets/legesher/language-decoded-community)
|
| 1100 |
- [Language Decoded Experiments (tracking)](https://huggingface.co/datasets/legesher/language-decoded-experiments)
|
| 1101 |
- [Language Decoded LoRA (model hub)](https://huggingface.co/legesher/language-decoded-lora)
|
|
|
|
| 921 |
|
| 922 |
## Dataset Description
|
| 923 |
|
| 924 |
+
This dataset provides filtered, quality-controlled Python source code in multiple configurations: the original English, three keyword-swapped variants (Chinese, Spanish, Urdu), a blended native+transpiled mix, strictly native Chinese code, and a model-translated set in which an LLM translates the full source (identifiers, strings, and comments, not just keywords). Python source for Conditions 1, 2, and 5 is drawn from [bigcode/the-stack-v2-dedup](https://huggingface.co/datasets/bigcode/the-stack-v2-dedup) (Python subset) for the current Phase 3 configs; the legacy `phase-2-the-stack-v1-*` configs are sourced from [The Stack v1](https://huggingface.co/datasets/bigcode/the-stack). Conditions 3 and 4 additionally draw on natively-authored code (see those conditions below). Source files are filtered for quality using the following criteria:
|
| 925 |
|
| 926 |
- AST-valid Python only (must parse without errors)
|
| 927 |
- Permissive licenses only (MIT, Apache-2.0, BSD, etc.)
|
|
|
|
| 934 |
|
| 935 |
## Available Configs
|
| 936 |
|
| 937 |
+
Conditions 1--2 are available in three current Phase 3 sizes: `-103k` full corpora, `-20k` random subsets sampled from the corresponding `-103k` config with seed 42, and `-5k` compact subsets. Phase 2 `-32k` configs are still available with the `phase-2-the-stack-v1-*` prefix. Condition 5 (`condition-5-*-c4ai-aya-expanse-32b`) is the model-translated set — currently `5k` only, and raw/pre-cleanup (see the note above).
|
| 938 |
|
| 939 |
| Config | Condition | Language | Description | Train | Val |
|
| 940 |
| ------------------------- | ----------- | -------- | ------------------------------------------------ | ------ | ------ |
|
|
|
|
| 952 |
| `condition-2-ur-5k` | 2 | Urdu | Compact 5k subset | 4,500 | 500 |
|
| 953 |
| `condition-3-zh-5k` | 3 | Chinese | Blended: native Chinese code + transpiled Python | 4,500 | 500 |
|
| 954 |
| `condition-4-zh-5k` | 4 | Chinese | Strictly native Chinese code | 6,553 | 729 |
|
| 955 |
+
| `condition-5-ur-5k-c4ai-aya-expanse-32b` | 5 | Urdu | Model-translated (full LLM translation via Cohere Aya) — raw, pre-cleanup | 4,088 | 381 |
|
| 956 |
+
| `condition-5-zh-5k-c4ai-aya-expanse-32b` | 5 | Chinese | Model-translated (full LLM translation via Cohere Aya) — raw, pre-cleanup | 4,052 | 381 |
|
| 957 |
+
| `condition-5-es-5k-c4ai-aya-expanse-32b` | 5 | Spanish | Model-translated (full LLM translation via Cohere Aya) — raw, pre-cleanup | 4,032 | 329 |
|
| 958 |
|
| 959 |
## Schema
|
| 960 |
|
|
|
|
| 967 |
| `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. |
|
| 968 |
| `code_en` | string | Original English Python source code. Identical to `code` for condition-1-en. |
|
| 969 |
| `language` | string | ISO 639-1 language code: `en`, `ur`, `zh`, or `es`. |
|
| 970 |
+
| `file_path` | string | Original file path in the source dataset. |
|
| 971 |
| `license` | string | SPDX license identifier for the source file. |
|
| 972 |
| `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
|
| 973 |
|
| 974 |
+
### Condition 5
|
| 975 |
+
|
| 976 |
+
Used by: `condition-5-ur-5k-c4ai-aya-expanse-32b`, `condition-5-zh-5k-c4ai-aya-expanse-32b`, `condition-5-es-5k-c4ai-aya-expanse-32b`
|
| 977 |
+
|
| 978 |
+
Condition 5 uses the conditions 1--2 schema plus an `idx` column. `code` is the full LLM-translated source (identifiers, strings, comments, and keywords); `code_en` is the English original. These configs are raw model output — see the note at the top of this card.
|
| 979 |
+
|
| 980 |
+
| Column | Type | Description |
|
| 981 |
+
| ------------- | ------ | ------------------------------------------------------------------------------------- |
|
| 982 |
+
| `code` | string | Model-translated Python source (full LLM translation via Cohere Aya). |
|
| 983 |
+
| `code_en` | string | Original English Python source code. |
|
| 984 |
+
| `language` | string | ISO 639-1 language code: `ur`, `zh`, or `es`. |
|
| 985 |
+
| `file_path` | string | Original file path in the source dataset. |
|
| 986 |
+
| `license` | string | SPDX license identifier for the source file. |
|
| 987 |
+
| `idx` | int64 | Source row index into `condition-1-en-5k`. Enables row-level joins across conditions. |
|
| 988 |
+
| `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
|
| 989 |
+
|
| 990 |
### Condition 3
|
| 991 |
|
| 992 |
Used by: `condition-3-zh-5k`
|
|
|
|
| 1033 |
| Condition 2 | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit |
|
| 1034 |
| Condition 3 | Mixed native sources | Tests whether diverse native-language code adds value beyond keyword swapping |
|
| 1035 |
| Condition 4 | Strictly native code | Tests whether code authored by native speakers carries unique signal beyond transpilation |
|
| 1036 |
+
| Condition 5 | Model-translated code | Tests whether full LLM translation (identifiers, strings, comments -- not just keywords) changes the reasoning benefit, relative to Condition 2's keyword-only swap |
|
| 1037 |
|
| 1038 |
### The Experimental Ladder
|
| 1039 |
|
|
|
|
| 1070 |
# Load strictly native code (condition 4)
|
| 1071 |
ds = load_dataset("legesher/language-decoded-data", "condition-4-zh-5k")
|
| 1072 |
|
| 1073 |
+
# Load model-translated code (condition 5 -- raw, pre-cleanup)
|
| 1074 |
+
ds = load_dataset("legesher/language-decoded-data", "condition-5-ur-5k-c4ai-aya-expanse-32b")
|
| 1075 |
+
ds = load_dataset("legesher/language-decoded-data", "condition-5-zh-5k-c4ai-aya-expanse-32b")
|
| 1076 |
+
ds = load_dataset("legesher/language-decoded-data", "condition-5-es-5k-c4ai-aya-expanse-32b")
|
| 1077 |
+
|
| 1078 |
# Access splits
|
| 1079 |
train = ds["train"]
|
| 1080 |
val = ds["validation"]
|
|
|
|
| 1087 |
|
| 1088 |
| Parameter | Value |
|
| 1089 |
| ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
|
| 1090 |
+
| Source dataset (Phase 3, `condition-*`) | [bigcode/the-stack-v2-dedup](https://huggingface.co/datasets/bigcode/the-stack-v2-dedup) (Python subset) |
|
| 1091 |
+
| Source dataset (Phase 2, `phase-2-the-stack-v1-*`) | [bigcode/the-stack](https://huggingface.co/datasets/bigcode/the-stack) (The Stack v1) |
|
| 1092 |
| Transpilation tool | [Legesher](https://github.com/legesher/legesher) v0.7.3 (legesher-core, legesher-i18n) |
|
| 1093 |
| Tokenizer | CohereLabs/tiny-aya-base |
|
| 1094 |
| Base model | [CohereLabs/tiny-aya-base](https://huggingface.co/CohereLabs/tiny-aya-base) (3.35B params) |
|
| 1095 |
+
| Condition 5 translation model | Cohere `c4ai-aya-expanse-32b` (Aya Expanse 32B, via the Cohere API) |
|
| 1096 |
| Train/validation split | 90% / 10% (seed 42) |
|
| 1097 |
| File format | Parquet (snappy compression) |
|
| 1098 |
| Filtering criteria | AST-valid, permissive licenses, 10--1000 lines, min 21 GitHub stars, no autogenerated files, SHA-256 deduplication |
|
| 1099 |
|
| 1100 |
## Limitations
|
| 1101 |
|
| 1102 |
+
- **Source bias**: The Stack skews toward popular, well-starred GitHub repositories, which may not represent the full diversity of Python code in the wild.
|
| 1103 |
- **Keyword-only transpilation**: Legesher translates Python reserved words (keywords, builtins, exceptions) but leaves comments, docstrings, string literals, and variable/function names in their original language (typically English). This means condition-2 code is a hybrid of translated keywords and English identifiers.
|
| 1104 |
- **Token count variation**: Transpiled code may have different token counts than the English original due to multi-byte characters (especially for Chinese and Urdu), even though the code structure is identical.
|
| 1105 |
- **Single programming language**: Currently limited to Python. Results may not generalize to other programming languages.
|
| 1106 |
- **Condition 4 scope**: Native Chinese code is limited to publicly available sources (The Stack, Wenyan, Program-in-Chinese, Qi, Mulan) and may not represent the full spectrum of Chinese-language programming.
|
| 1107 |
+
- **Condition 5 is raw model output**: The `condition-5-*` configs contain prompt-leakage contamination -- translator-model preamble text, JSON wrappers, and explanation commentary leaked into string literals and identifier names, in AST-valid and AST-invalid rows alike. Cleaned configs will be published separately. See the note at the top of this card.
|
| 1108 |
|
| 1109 |
## Citation
|
| 1110 |
|
|
|
|
| 1122 |
|
| 1123 |
- [Legesher on GitHub](https://github.com/legesher/legesher)
|
| 1124 |
- [Tiny Aya Expedition](https://aya.for.ai)
|
| 1125 |
+
- [bigcode/the-stack-v2-dedup](https://huggingface.co/datasets/bigcode/the-stack-v2-dedup) (Phase 3 source)
|
| 1126 |
+
- [bigcode/the-stack](https://huggingface.co/datasets/bigcode/the-stack) (The Stack v1 — Phase 2 source)
|
| 1127 |
- [Language Decoded Community (native code)](https://huggingface.co/datasets/legesher/language-decoded-community)
|
| 1128 |
- [Language Decoded Experiments (tracking)](https://huggingface.co/datasets/legesher/language-decoded-experiments)
|
| 1129 |
- [Language Decoded LoRA (model hub)](https://huggingface.co/legesher/language-decoded-lora)
|