madiedgar's picture
Upload dataset
6241943 verified
|
raw
history blame
14.8 kB
metadata
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-*
      - split: validation
        path: data/condition-1-en/validation-*
  - config_name: condition-1-en-5k
    data_files:
      - split: train
        path: data/condition-1-en-5k/train-*
      - split: validation
        path: data/condition-1-en-5k/validation-*
  - 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
  - config_name: condition-2-es-5k
    data_files:
      - split: train
        path: data/condition-2-es-5k/train-*
      - split: validation
        path: data/condition-2-es-5k/validation-*
  - 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-ur-5k
    data_files:
      - split: train
        path: data/condition-2-ur-5k/train-*
      - split: validation
        path: data/condition-2-ur-5k/validation-*
  - config_name: condition-2-zh
    data_files:
      - split: train
        path: data/condition-2-zh/train-*
      - split: validation
        path: data/condition-2-zh/validation-*
  - config_name: condition-2-zh-5k
    data_files:
      - split: train
        path: data/condition-2-zh-5k/train-*
      - split: validation
        path: data/condition-2-zh-5k/validation-*
  - config_name: condition-3-zh-5k
    data_files:
      - split: train
        path: data/condition-3-zh-5k/train-*
      - split: validation
        path: data/condition-3-zh-5k/validation-*
dataset_info:
  - config_name: condition-1-en
    features:
      - name: file_path
        dtype: string
      - name: code
        dtype: string
      - name: code_en
        dtype: string
      - name: language
        dtype: string
      - name: license
        dtype: string
      - name: token_count
        dtype: int32
    splits:
      - name: train
        num_bytes: 403718262
        num_examples: 31818
      - name: validation
        num_bytes: 42626910
        num_examples: 3536
    download_size: 164619518
    dataset_size: 446345172
  - config_name: condition-1-en-5k
    features:
      - name: file_path
        dtype: string
      - name: code
        dtype: string
      - name: code_en
        dtype: string
      - name: language
        dtype: string
      - name: license
        dtype: string
      - name: token_count
        dtype: int32
    splits:
      - name: train
        num_bytes: 55261555
        num_examples: 4500
      - name: validation
        num_bytes: 6365959
        num_examples: 500
    download_size: 22897728
    dataset_size: 61627514
  - config_name: condition-2-es-5k
    features:
      - name: file_path
        dtype: string
      - name: code
        dtype: string
      - name: code_en
        dtype: string
      - name: language
        dtype: string
      - name: license
        dtype: string
      - name: token_count
        dtype: int32
    splits:
      - name: train
        num_bytes: 55864731
        num_examples: 4500
      - name: validation
        num_bytes: 6432095
        num_examples: 500
    download_size: 23031674
    dataset_size: 62296826
  - config_name: condition-2-ur-5k
    features:
      - name: file_path
        dtype: string
      - name: code
        dtype: string
      - name: code_en
        dtype: string
      - name: language
        dtype: string
      - name: license
        dtype: string
      - name: token_count
        dtype: int32
    splits:
      - name: train
        num_bytes: 56906247
        num_examples: 4500
      - name: validation
        num_bytes: 6545730
        num_examples: 500
    download_size: 23158039
    dataset_size: 63451977
  - config_name: condition-2-zh
    features:
      - name: file_path
        dtype: string
      - name: code
        dtype: string
      - name: code_en
        dtype: string
      - name: language
        dtype: string
      - name: license
        dtype: string
      - name: token_count
        dtype: int32
    splits:
      - name: train
        num_bytes: 405515831
        num_examples: 31818
      - name: validation
        num_bytes: 45065811
        num_examples: 3536
    download_size: 165387142
    dataset_size: 450581642
  - config_name: condition-2-zh-5k
    features:
      - name: file_path
        dtype: string
      - name: code
        dtype: string
      - name: code_en
        dtype: string
      - name: language
        dtype: string
      - name: license
        dtype: string
      - name: token_count
        dtype: int32
    splits:
      - name: train
        num_bytes: 55793642
        num_examples: 4500
      - name: validation
        num_bytes: 6422792
        num_examples: 500
    download_size: 22978834
    dataset_size: 62216434
  - config_name: condition-3-zh-5k
    features:
      - name: file_path
        dtype: large_string
      - name: code
        dtype: large_string
      - name: code_en
        dtype: string
      - name: language
        dtype: large_string
      - name: license
        dtype: large_string
      - name: token_count
        dtype: int64
      - name: source_type
        dtype: large_string
    splits:
      - name: train
        num_bytes: 40782466
        num_examples: 4500
      - name: validation
        num_bytes: 4531385
        num_examples: 500
    download_size: 17299185
    dataset_size: 45313851
  - config_name: default
    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), 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") 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 (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 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
condition-3-zh-5k Condition 3 Chinese Blended: 3,486 native Chinese code + 1,514 transpiled Python (see Condition 3 section below)

Schema

Conditions 1--2

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.

Condition 3

Condition 3 blends native Chinese code with transpiled code and adds a source_type column to distinguish them. code_en is populated for transpiled rows (keeping them in sync with conditions 1--2) but null for native code rows, which have no English equivalent.

Column Type Description
file_path string File identifier (native filename or transpiled file path)
code string The code content (native or transpiled)
code_en string/null English original -- populated for transpiled rows, null for native code rows
language string ISO 639-1 language code (zh)
license string Source license (SPDX identifier, UNKNOWN, or varies)
token_count int64 Token count computed using the CohereLabs/tiny-aya-base tokenizer
source_type string "native" (natively Chinese-authored) or "transpiled" (keyword-swapped English)

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
Condition 3 Mixed native sources Tests whether diverse native-language code adds value beyond keyword swapping
Conditions 4--6 (planned) Additional controls not yet included in this dataset

Usage

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")

# Load blended native + transpiled (condition 3)
ds = load_dataset("legesher/language-decoded-data", "condition-3-zh-5k")

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

# Filter condition-3 by source type
native_only = train.filter(lambda x: x["source_type"] == "native")

Technical Details

Parameter Value
Source dataset bigcode/the-stack-dedup (Python subset)
Transpilation tool Legesher v0.7.3 (legesher-core, legesher-i18n)
Tokenizer CohereLabs/tiny-aya-base
Base model 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

@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

License

Apache 2.0