madiedgar commited on
Commit
e0861e1
·
1 Parent(s): 5e1753c

docs: align card with published condition-5 configs (ur/zh/es) (#11)

Browse files

- docs: align card with published condition-5 configs (ur/zh/es) (d59f2d6f8678ccf952690718da93d947c2b1f73c)
- docs: correct source datasets (Phase 3 = the-stack-v2-dedup, Phase 2 = the-stack v1) (76c6dba5b170901d4b9c68156034323040b37b1b)

Files changed (1) hide show
  1. README.md +35 -7
README.md CHANGED
@@ -919,7 +919,7 @@ Prior work ([Aryabumi et al., 2024 -- "To Code or Not to Code"](https://arxiv.or
919
 
920
  ## Dataset Description
921
 
922
- 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, and strictly native Chinese code. 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:
923
 
924
  - AST-valid Python only (must parse without errors)
925
  - Permissive licenses only (MIT, Apache-2.0, BSD, etc.)
@@ -932,7 +932,7 @@ Keyword-swapped variants are produced using [Legesher](https://github.com/legesh
932
 
933
  ## Available Configs
934
 
935
- 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.
936
 
937
  | Config | Condition | Language | Description | Train | Val |
938
  | ------------------------- | ----------- | -------- | ------------------------------------------------ | ------ | ------ |
@@ -950,7 +950,9 @@ Conditions 1--2 are available in three current Phase 3 sizes: `-103k` full corpo
950
  | `condition-2-ur-5k` | 2 | Urdu | Compact 5k subset | 4,500 | 500 |
951
  | `condition-3-zh-5k` | 3 | Chinese | Blended: native Chinese code + transpiled Python | 4,500 | 500 |
952
  | `condition-4-zh-5k` | 4 | Chinese | Strictly native Chinese code | 6,553 | 729 |
953
- | `condition-5-ur-5k-c4ai-aya-expanse-32b` | 5 | Urdu | Model-translated Urdu condition | 4,024 | 447 |
 
 
954
 
955
  ## Schema
956
 
@@ -963,10 +965,26 @@ Used by: `condition-1-en-*`, `condition-2-zh-*`, `condition-2-es-*`, `condition-
963
  | `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. |
964
  | `code_en` | string | Original English Python source code. Identical to `code` for condition-1-en. |
965
  | `language` | string | ISO 639-1 language code: `en`, `ur`, `zh`, or `es`. |
966
- | `file_path` | string | Original file path in The Stack Dedup. |
967
  | `license` | string | SPDX license identifier for the source file. |
968
  | `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
969
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
970
  ### Condition 3
971
 
972
  Used by: `condition-3-zh-5k`
@@ -1013,6 +1031,7 @@ The Language Decoded experiment uses a ladder of conditions to isolate the mecha
1013
  | Condition 2 | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit |
1014
  | Condition 3 | Mixed native sources | Tests whether diverse native-language code adds value beyond keyword swapping |
1015
  | Condition 4 | Strictly native code | Tests whether code authored by native speakers carries unique signal beyond transpilation |
 
1016
 
1017
  ### The Experimental Ladder
1018
 
@@ -1049,6 +1068,11 @@ ds = load_dataset("legesher/language-decoded-data", "condition-3-zh-5k")
1049
  # Load strictly native code (condition 4)
1050
  ds = load_dataset("legesher/language-decoded-data", "condition-4-zh-5k")
1051
 
 
 
 
 
 
1052
  # Access splits
1053
  train = ds["train"]
1054
  val = ds["validation"]
@@ -1061,21 +1085,24 @@ native_only = train.filter(lambda x: x["source_type"] == "native")
1061
 
1062
  | Parameter | Value |
1063
  | ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
1064
- | Source dataset | [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup) (Python subset) |
 
1065
  | Transpilation tool | [Legesher](https://github.com/legesher/legesher) v0.7.3 (legesher-core, legesher-i18n) |
1066
  | Tokenizer | CohereLabs/tiny-aya-base |
1067
  | Base model | [CohereLabs/tiny-aya-base](https://huggingface.co/CohereLabs/tiny-aya-base) (3.35B params) |
 
1068
  | Train/validation split | 90% / 10% (seed 42) |
1069
  | File format | Parquet (snappy compression) |
1070
  | Filtering criteria | AST-valid, permissive licenses, 10--1000 lines, min 21 GitHub stars, no autogenerated files, SHA-256 deduplication |
1071
 
1072
  ## Limitations
1073
 
1074
- - **Source bias**: The Stack Dedup skews toward popular, well-starred GitHub repositories, which may not represent the full diversity of Python code in the wild.
1075
  - **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.
1076
  - **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.
1077
  - **Single programming language**: Currently limited to Python. Results may not generalize to other programming languages.
1078
  - **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.
 
1079
 
1080
  ## Citation
1081
 
@@ -1093,7 +1120,8 @@ native_only = train.filter(lambda x: x["source_type"] == "native")
1093
 
1094
  - [Legesher on GitHub](https://github.com/legesher/legesher)
1095
  - [Tiny Aya Expedition](https://aya.for.ai)
1096
- - [bigcode/the-stack-dedup](https://huggingface.co/datasets/bigcode/the-stack-dedup)
 
1097
  - [Language Decoded Community (native code)](https://huggingface.co/datasets/legesher/language-decoded-community)
1098
  - [Language Decoded Experiments (tracking)](https://huggingface.co/datasets/legesher/language-decoded-experiments)
1099
  - [Language Decoded LoRA (model hub)](https://huggingface.co/legesher/language-decoded-lora)
 
919
 
920
  ## Dataset Description
921
 
922
+ 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:
923
 
924
  - AST-valid Python only (must parse without errors)
925
  - Permissive licenses only (MIT, Apache-2.0, BSD, etc.)
 
932
 
933
  ## Available Configs
934
 
935
+ 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).
936
 
937
  | Config | Condition | Language | Description | Train | Val |
938
  | ------------------------- | ----------- | -------- | ------------------------------------------------ | ------ | ------ |
 
950
  | `condition-2-ur-5k` | 2 | Urdu | Compact 5k subset | 4,500 | 500 |
951
  | `condition-3-zh-5k` | 3 | Chinese | Blended: native Chinese code + transpiled Python | 4,500 | 500 |
952
  | `condition-4-zh-5k` | 4 | Chinese | Strictly native Chinese code | 6,553 | 729 |
953
+ | `condition-5-ur-5k-c4ai-aya-expanse-32b` | 5 | Urdu | Model-translated (full LLM translation via Cohere Aya) — raw, pre-cleanup | 4,088 | 381 |
954
+ | `condition-5-zh-5k-c4ai-aya-expanse-32b` | 5 | Chinese | Model-translated (full LLM translation via Cohere Aya) — raw, pre-cleanup | 4,052 | 381 |
955
+ | `condition-5-es-5k-c4ai-aya-expanse-32b` | 5 | Spanish | Model-translated (full LLM translation via Cohere Aya) — raw, pre-cleanup | 4,032 | 329 |
956
 
957
  ## Schema
958
 
 
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 the source dataset. |
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 5
973
+
974
+ 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`
975
+
976
+ 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.
977
+
978
+ | Column | Type | Description |
979
+ | ------------- | ------ | ------------------------------------------------------------------------------------- |
980
+ | `code` | string | Model-translated Python source (full LLM translation via Cohere Aya). |
981
+ | `code_en` | string | Original English Python source code. |
982
+ | `language` | string | ISO 639-1 language code: `ur`, `zh`, or `es`. |
983
+ | `file_path` | string | Original file path in the source dataset. |
984
+ | `license` | string | SPDX license identifier for the source file. |
985
+ | `idx` | int64 | Source row index into `condition-1-en-5k`. Enables row-level joins across conditions. |
986
+ | `token_count` | int64 | Token count computed using the CohereLabs/tiny-aya-base tokenizer. |
987
+
988
  ### Condition 3
989
 
990
  Used by: `condition-3-zh-5k`
 
1031
  | Condition 2 | Keyword-swapped code | Tests whether the _language_ of keywords matters for the reasoning benefit |
1032
  | Condition 3 | Mixed native sources | Tests whether diverse native-language code adds value beyond keyword swapping |
1033
  | Condition 4 | Strictly native code | Tests whether code authored by native speakers carries unique signal beyond transpilation |
1034
+ | 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 |
1035
 
1036
  ### The Experimental Ladder
1037
 
 
1068
  # Load strictly native code (condition 4)
1069
  ds = load_dataset("legesher/language-decoded-data", "condition-4-zh-5k")
1070
 
1071
+ # Load model-translated code (condition 5 -- raw, pre-cleanup)
1072
+ ds = load_dataset("legesher/language-decoded-data", "condition-5-ur-5k-c4ai-aya-expanse-32b")
1073
+ ds = load_dataset("legesher/language-decoded-data", "condition-5-zh-5k-c4ai-aya-expanse-32b")
1074
+ ds = load_dataset("legesher/language-decoded-data", "condition-5-es-5k-c4ai-aya-expanse-32b")
1075
+
1076
  # Access splits
1077
  train = ds["train"]
1078
  val = ds["validation"]
 
1085
 
1086
  | Parameter | Value |
1087
  | ---------------------- | ------------------------------------------------------------------------------------------------------------------ |
1088
+ | Source dataset (Phase 3, `condition-*`) | [bigcode/the-stack-v2-dedup](https://huggingface.co/datasets/bigcode/the-stack-v2-dedup) (Python subset) |
1089
+ | Source dataset (Phase 2, `phase-2-the-stack-v1-*`) | [bigcode/the-stack](https://huggingface.co/datasets/bigcode/the-stack) (The Stack v1) |
1090
  | Transpilation tool | [Legesher](https://github.com/legesher/legesher) v0.7.3 (legesher-core, legesher-i18n) |
1091
  | Tokenizer | CohereLabs/tiny-aya-base |
1092
  | Base model | [CohereLabs/tiny-aya-base](https://huggingface.co/CohereLabs/tiny-aya-base) (3.35B params) |
1093
+ | Condition 5 translation model | Cohere `c4ai-aya-expanse-32b` (Aya Expanse 32B, via the Cohere API) |
1094
  | Train/validation split | 90% / 10% (seed 42) |
1095
  | File format | Parquet (snappy compression) |
1096
  | Filtering criteria | AST-valid, permissive licenses, 10--1000 lines, min 21 GitHub stars, no autogenerated files, SHA-256 deduplication |
1097
 
1098
  ## Limitations
1099
 
1100
+ - **Source bias**: The Stack skews toward popular, well-starred GitHub repositories, which may not represent the full diversity of Python code in the wild.
1101
  - **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.
1102
  - **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.
1103
  - **Single programming language**: Currently limited to Python. Results may not generalize to other programming languages.
1104
  - **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.
1105
+ - **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.
1106
 
1107
  ## Citation
1108
 
 
1120
 
1121
  - [Legesher on GitHub](https://github.com/legesher/legesher)
1122
  - [Tiny Aya Expedition](https://aya.for.ai)
1123
+ - [bigcode/the-stack-v2-dedup](https://huggingface.co/datasets/bigcode/the-stack-v2-dedup) (Phase 3 source)
1124
+ - [bigcode/the-stack](https://huggingface.co/datasets/bigcode/the-stack) (The Stack v1 — Phase 2 source)
1125
  - [Language Decoded Community (native code)](https://huggingface.co/datasets/legesher/language-decoded-community)
1126
  - [Language Decoded Experiments (tracking)](https://huggingface.co/datasets/legesher/language-decoded-experiments)
1127
  - [Language Decoded LoRA (model hub)](https://huggingface.co/legesher/language-decoded-lora)