← All entries
Dataset2025#154

swallowcode2

Summary

[SwallowCode-v1](https://huggingface.co/datasets/tokyotech-llm/swallow-code) was a high-quality Python code dataset generated through an LLM-based rewriting pipeline.

Venue
tokyotech-llm
Access
free
License
apache-2.0
License family
Permissive
Language
en
Hugging Face
tokyotech-llm/swallow-code-v2
Author type
unknown
Added
Jul 17, 2026
Verified
Jul 17, 2026
Research status
done

From the source

Repository
tokyotech-llm/swallow-code-v2
Created
Oct 20, 2025
Last updated
Nov 8, 2025
Downloads (last month)
5,638
Likes
50
Size
100M to 1B rows
Modalities
text
Tasks
text-generation
Formats
json

Fetched Oct 3, 2026 from Hugging Face. These numbers change; the curated fields above do not come from here.

Tags

hf-dataset-language-modeling

Topics

Language Modeling, Code

Dataset profile

Scale
Card: 49.8B Llama-3 tokens (v1 was 16.1B). usedStorage 5,194,499,027,449 bytes (~5.19 TB / 4.72 TiB) for all pipeline stages on Hub. Default SwallowCode-v2 = stage5-auto-format/python/medium: 150 jsonl (train_0001–0160 with gaps 0050, 0055, 0115–0122); most ~7.0–7.2 GB, a tail of ~2.2–4.7 GB shards. datasets-server estimated_num_rows 146,711,936 across configs (partial viewer). stage4-llm-rewrite estimated 19,588,324 rows (stage5 is the ruff-formatted medium rewrite of that set; stage5/swallowcode-v2 size endpoints failed). YAML size_categories 10M<n<100M vs Hub tag 100M<n<1B (multi-config). gated=false. Hub 11,154 downloads / 44 likes at check.
Format
jsonl per pipeline stage (stage1-auto-format … stage5-auto-format). Default config swallowcode-v2 points at stage5 python medium train*.
Type
Pretraining corpus / rewritten Python code
License
Apache-2.0 (card). Also subject to The-Stack-v2 licensing terms (card). v1 was Llama 3.3 Community License — this v2 dump is the Apache release. Qwen3 rewrite outputs inherit Qwen terms where applicable.
Cost
Free
Languages
Python source (card language:en). Comments mixed; rewriter is English-oriented. Python-only released (13-language plan dropped for GPU cost). Leftover stage1/c jsonl shards exist but are not the v2 release.
Modality
Text (Python source)
Domain
Python code pretraining; LLM-rewritten Stack-v2
Time period
HF createdAt 2025-10-20; lastModified 2025-11-08. Paper 2025-05-05 (arXiv 2505.02881) describes v1 (16.1B, Llama 3.3 license); this Hub dump is the Apache v2 rewrite. Discord posted 2025-11-17. Source The-Stack-v2 (Software Heritage GitHub; older). Rewriter Qwen3-235B-A22B-Instruct-2507.
Purpose
Public 49.8B-token Apache-2.0 rewritten Python corpus for code pre-training, vs gated The-Stack-v2 and metadata-only Nemotron-Pretraining-Code-v1
Used for
Llama-3.1-8B 50B-token continual pretrain: +20.7 HumanEval / +21.9 HumanEval+ pass@1 vs Stack-Edu (card). Paper v1 CPT +17.0 / +17.7 vs Stack-Edu. Hub 11,154 downloads / 44 likes at check. GitHub rioyokotalab/swallow-code-math 31 stars. Tokyo Tech Swallow checkpoints.
Authors
Original snippets: GitHub via The-Stack-v2. Rewrites: Qwen3-235B-A22B-Instruct. Quality scorer: SeedCoder prompt. Tokyo Tech (Kazuki Fujii, Yukito Tajima, Masaki Kawamura, Naoaki Okazaki, Rio Yokota et al.).
Bias
Python-only. Ablation: rewriting Medium-quality SeedCoder-scored seeds beat High-quality on HumanEval (authors hypothesize simpler, problem-like files match the bench). Qwen3 rewrite style can uniformize code. Upstream The-Stack-v2 GitHub popularity/permissive-license skew remains. Instruct rewriter used (Thinking model similar quality, higher GPU). 1-stage rewrite adopted over v1’s 2-stage (similar downstream, ~2× cheaper).
Text quality
Five-stage transform-and-retain: ruff auto-format → length filter → SeedCoder 0–10 score → Qwen3-235B rewrite for clarity/structure → final ruff. Contrasts filter-only Stack-Edu. Residual LLM rewrite errors, over-simplification, and leftover tmp_*.jsonl under stage3/high. Do not train on stage1/c or unreleased language dirs.
Sample size
Default swallowcode-v2 / stage5-auto-format: python medium train* (150 shards; ~20M estimated from stage4). Also configs stage1-auto-format, stage2-length-filter (high), stage3-llm-score (high+medium YAML; server currently exposes medium), stage4-llm-rewrite. No val/test. Sister tokyotech-llm/swallow-math-v2 is a separate repo.
Long context
Mixed (length-filtered; stage2 longer_samples dir exists). Typical files are medium code snippets, not repo-scale documents.
Intermediate steps
Yes (The-Stack-v2 Python → ruff → length filter → SeedCoder score → Qwen3 1-stage rewrite → ruff). Intermediate stages 1–4 are on Hub. Code/prompts: github.com/rioyokotalab/swallow-code-math.
Idea quality
High
Novelty
High (public 49.8B Apache rewritten Stack-v2 Python with actual files, not metadata-only)
Text conversion
Ready jsonl. load_dataset("tokyotech-llm/swallow-code-v2", "swallowcode-v2") or config stage5-auto-format. Streaming required (multi-TB repo; stage5 alone is ~1 TB of jsonl).
Collection method
Download
Static
Unknown (HF lastModified 2025-11-08; Python-only one-shot; authors mention a possible v3)
Processed
Unknown

Research notes

  • downloads=13854; likes=42
  • Discord posted the HF pointer. Cite Fujii et al. 2025 arXiv 2505.02881. gated=false; public. Substituted for gated bigcode/the-stack, bigcode/the-stack-v2, and nvidia/Nemotron-Pretraining-Code-v1 (CuratorBote still no access 2026-08-14). Distinct from OpenCoder FineWeb Code Corpus already in this catalog. Not in papers_local.csv. Not on the Aug 13 live Datasets sheet export.

Related entries

  • Datasetresearch profile2025added Jul 17, 20268,875 downloads/moshares a link

    swallowmath2

    tokyotech-llm

    [SwallowMath-v2](https://huggingface.co/datasets/tokyotech-llm/swallow-math-v2) is a large-scale mathematical dataset containing **32 billion tokens**, developed as the successor to [SwallowMath-v1](https://huggingface.co/datasets/tokyotech-llm/swallow-math).

    hf-dataset-language-modelingmath-json-text-datasets-dask-mlcroissant-math-has-paper

  • Datasetresearch profile2024added Jul 17, 20266,031 downloads/moshares a link

    The Stack v2

    BigCode Project (collaboration including Hugging Face, ServiceNow, INRIA, Software Heritage)

    The Stack v2 is a large-scale pre-training dataset of source code containing over 3 billion files in 600+ programming and markup languages, derived from the Software Heritage archive. It serves as a pre-training corpus for Code LLMs (used to train StarCoder2), with the full dataset at 67.5TB and the deduplicated version at 32.1TB (~900B tokens). The dataset provides SWHIDs (Software Heritage IDs) for provenance and compliance, with file contents stored on Software Heritage's S3 bucket.

  • Datasetresearch profile2024added Sep 10, 20266,031 downloads/moshares a link

    The Stack v2

    bigcode

    Open reproducible Code LLM pretraining corpus with license/provenance metadata and developer opt-out

Similar entries