ablation/exp1-the-stack-v2-train-smol-ids-python because it was flagged as potentially containing unsafe data collected from the Python subset of https://huggingface.co/datasets/bigcode/the-stack-v2-train-smol-ids. However, since this dataset can be reconstructed from the-stack-v2-train-smol-ids, there is no issue in terms of reproducibility.ablation/exp10-direct-sgcr/jsonl/train-00005-of-00005.jsonl (a dataset directly rewritten from the-stack-v2-train-smol-ids). While loading it as JSONL for LLM training poses an extremely low risk, please be aware.💻 SwallowCode is a high-quality code dataset comprising approximately 16.1 billion tokens of Python code, derived from The-Stack-v2-train-smol-ids through a four-stage pipeline:syntax validation, pylint-based style filtering, and a two-stage LLM rewriting process using Llama-3.3-70B-Instruct. The pipeline enforces style conformity (Style-Guided Code Rewriting, SGCR) and transforms snippets into self-contained, algorithmically efficient examples (Self-Contained Optimization Rewriting, SCOR). SwallowCode is designed to enhance large language model (LLM) performance in program synthesis and code generation.
More details are available in our paper: https://arxiv.org/abs/2505.02881.
The dataset is released as:
SwallowCode: Approximately 16.1 billion tokens of Python code, processed through syntax validation, pylint filtering, SGCR, and SCOR, formatted as JSONL files. (ablation/exp11-scor/jsonl)
Additionally, intermediate datasets from ablation experiments are released in the ablation/ directory.
All data is publicly available under the Llama 3.3 Community License.
SwallowCode refines Python code from The-Stack-v2-train-smol-ids through a four-stage pipeline to eliminate noise, ensure stylistic consistency, and enhance semantic quality.
Pipeline Overview
compile() function, reducing samples by 9.7% (from 41M to 37M).The full pipeline and prompts are available at https://github.com/rioyokotalab/swallow-code-math.
The ablation/ directory contains JSONL files for intermediate datasets from ablation experiments.
These datasets correspond to the experiments described in the paper:
exp1-the-stack-v2-train-smol-ids-python: Baseline Python subset from The-Stack-v2.exp2-syntax-error-filtered: After syntax error filtering.exp3-linter-filtered: After pylint-based filtering (score ≥ 7).exp4-code_comment_ja_or_en: Restricted to English or Japanese comments.exp5-sgcr: After SGCR rewriting.exp6-llm-based-scoring: Filtered by LLM-based scoring (score ≥ 6).exp7: Mixed data (1:1 ratio of exp3 and exp5).exp10-direct-sgcr: Python subset from The-Stack-v2 (exp1) with direct SGCR applied, skipping syntax error and pylint-based filtering.exp11-scor: Final SwallowCode dataset after SCOR rewriting.Each directory contains JSONL files with processed code samples. For details, see the paper’s Appendix (Tables 6–18) or the repository at https://github.com/rioyokotalab/swallow-code-math.
Continual pre-training of Llama-3.1-8B for approximately 50 billion tokens, with SwallowCode as the code subset (16% of the mixture), yields significant improvements:
SwallowCode aims to advance LLM capabilities in code generation by providing a high-quality, openly licensed dataset. We:
The dataset may inherit biases from The-Stack-v2 or Llama-3.3-70B-Instruct, including:
SwallowCode is released under the Llama 3.3 Community License.
Usage is subject to The-Stack-v2’s licensing terms.
Potential directions include:
@misc{fujii2025rewritingpretrainingdataboosts,
title={Rewriting Pre-Training Data Boosts LLM Performance in Math and Code},
author={Kazuki Fujii and Yukito Tajima and Sakae Mizuki and Hinari Shimada and Taihei Shiotani and Koshiro Saito and Masanari Ohi and Masaki Kawamura and Taishi Nakamura and Takumi Okamoto and Shigeki Ishida and Kakeru Hattori and Youmi Ma and Hiroya Takamura and Rio Yokota and Naoaki Okazaki},
year={2025},
eprint={2505.02881},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2505.02881},
}
63 commits
ablation/exp1-the-stack-v2-train-smol-ids-python because it was flagged as potentially containing unsafe data collected from the Python subset of https://huggingface.co/datasets/bigcode/the-stack-v2-train-smol-ids. However, since this dataset can be reconstructed from the-stack-v2-train-smol-ids, there is no issue in terms of reproducibility.ablation/exp10-direct-sgcr/jsonl/train-00005-of-00005.jsonl (a dataset directly rewritten from the-stack-v2-train-smol-ids). While loading it as JSONL for LLM training poses an extremely low risk, please be aware.💻 SwallowCode is a high-quality code dataset comprising approximately 16.1 billion tokens of Python code, derived from The-Stack-v2-train-smol-ids through a four-stage pipeline:syntax validation, pylint-based style filtering, and a two-stage LLM rewriting process using Llama-3.3-70B-Instruct. The pipeline enforces style conformity (Style-Guided Code Rewriting, SGCR) and transforms snippets into self-contained, algorithmically efficient examples (Self-Contained Optimization Rewriting, SCOR). SwallowCode is designed to enhance large language model (LLM) performance in program synthesis and code generation.
More details are available in our paper: https://arxiv.org/abs/2505.02881.
The dataset is released as:
SwallowCode: Approximately 16.1 billion tokens of Python code, processed through syntax validation, pylint filtering, SGCR, and SCOR, formatted as JSONL files. (ablation/exp11-scor/jsonl)
Additionally, intermediate datasets from ablation experiments are released in the ablation/ directory.
All data is publicly available under the Llama 3.3 Community License.
SwallowCode refines Python code from The-Stack-v2-train-smol-ids through a four-stage pipeline to eliminate noise, ensure stylistic consistency, and enhance semantic quality.
Pipeline Overview
compile() function, reducing samples by 9.7% (from 41M to 37M).The full pipeline and prompts are available at https://github.com/rioyokotalab/swallow-code-math.
The ablation/ directory contains JSONL files for intermediate datasets from ablation experiments.
These datasets correspond to the experiments described in the paper:
exp1-the-stack-v2-train-smol-ids-python: Baseline Python subset from The-Stack-v2.exp2-syntax-error-filtered: After syntax error filtering.exp3-linter-filtered: After pylint-based filtering (score ≥ 7).exp4-code_comment_ja_or_en: Restricted to English or Japanese comments.exp5-sgcr: After SGCR rewriting.exp6-llm-based-scoring: Filtered by LLM-based scoring (score ≥ 6).exp7: Mixed data (1:1 ratio of exp3 and exp5).exp10-direct-sgcr: Python subset from The-Stack-v2 (exp1) with direct SGCR applied, skipping syntax error and pylint-based filtering.exp11-scor: Final SwallowCode dataset after SCOR rewriting.Each directory contains JSONL files with processed code samples. For details, see the paper’s Appendix (Tables 6–18) or the repository at https://github.com/rioyokotalab/swallow-code-math.
Continual pre-training of Llama-3.1-8B for approximately 50 billion tokens, with SwallowCode as the code subset (16% of the mixture), yields significant improvements:
SwallowCode aims to advance LLM capabilities in code generation by providing a high-quality, openly licensed dataset. We:
The dataset may inherit biases from The-Stack-v2 or Llama-3.3-70B-Instruct, including:
SwallowCode is released under the Llama 3.3 Community License.
Usage is subject to The-Stack-v2’s licensing terms.
Potential directions include:
@misc{fujii2025rewritingpretrainingdataboosts,
title={Rewriting Pre-Training Data Boosts LLM Performance in Math and Code},
author={Kazuki Fujii and Yukito Tajima and Sakae Mizuki and Hinari Shimada and Taihei Shiotani and Koshiro Saito and Masanari Ohi and Masaki Kawamura and Taishi Nakamura and Takumi Okamoto and Shigeki Ishida and Kakeru Hattori and Youmi Ma and Hiroya Takamura and Rio Yokota and Naoaki Okazaki},
year={2025},
eprint={2505.02881},
archivePrefix={arXiv},
primaryClass={cs.LG},
url={https://arxiv.org/abs/2505.02881},
}
63 commits