UltraData-Code / README.md
BigDong's picture
update README
86a7233
|
Raw
History Blame
15 kB
---
language:
- en
- zh
license: apache-2.0
size_categories:
- n>100B
task_categories:
- text-generation
pretty_name: UltraData-Code
tags:
- llm
- code
- code-pretraining
- algorithmic-code
- synthetic-data
configs:
- config_name: UltraData-Code-L2
data_files:
- split: cpp
path: "data/UltraData-Code-L2/cpp/*.parquet"
- split: cs
path: "data/UltraData-Code-L2/cs/*.parquet"
- split: go
path: "data/UltraData-Code-L2/go/*.parquet"
- split: java
path: "data/UltraData-Code-L2/java/*.parquet"
- split: js
path: "data/UltraData-Code-L2/js/*.parquet"
- split: php
path: "data/UltraData-Code-L2/php/*.parquet"
- split: py
path: "data/UltraData-Code-L2/py/*.parquet"
- split: r
path: "data/UltraData-Code-L2/r/*.parquet"
- split: rb
path: "data/UltraData-Code-L2/rb/*.parquet"
- split: rust
path: "data/UltraData-Code-L2/rust/*.parquet"
- split: sh
path: "data/UltraData-Code-L2/sh/*.parquet"
- config_name: UltraData-Code-L3
data_files:
- split: cpp
path: "data/UltraData-Code-L3/cpp/*.parquet"
- split: cs
path: "data/UltraData-Code-L3/cs/*.parquet"
- split: go
path: "data/UltraData-Code-L3/go/*.parquet"
- split: java
path: "data/UltraData-Code-L3/java/*.parquet"
- split: js
path: "data/UltraData-Code-L3/js/*.parquet"
- split: php
path: "data/UltraData-Code-L3/php/*.parquet"
- split: py
path: "data/UltraData-Code-L3/py/*.parquet"
- split: r
path: "data/UltraData-Code-L3/r/*.parquet"
- split: rb
path: "data/UltraData-Code-L3/rb/*.parquet"
- split: rust
path: "data/UltraData-Code-L3/rs/*.parquet"
- split: sh
path: "data/UltraData-Code-L3/sh/*.parquet"
default_config_name: UltraData-Code-L2
---
# UltraData-Code
<div align="center">
<img src="assets/ultradata-code-logo.png" width="600" alt="UltraData-Code logo"/>
</div>
<p align="center">
<a href="https://huggingface.co/collections/openbmb/ultradata">πŸ“¦ UltraData Collection</a> |
<a href="https://ultradata.openbmb.cn/">🌐 UltraData</a> |
<a href="https://huggingface.co/collections/openbmb/minicpm5">πŸ€— MiniCPM5 Series</a> |
πŸ“– Tech Report (Coming Soon)
</p>
<p align="center">English | <a href="README_ZH.md">δΈ­ζ–‡</a></p>
## πŸ“š Introduction
UltraData-Code is a complete implementation of the [UltraData](https://ultradata.openbmb.cn/) [L0-L4 tiered data management framework](https://arxiv.org/pdf/2602.09003). It covers four code data states from L0 through L3, with each level corresponding to a distinct construction stage. The pipeline starts from approximately **192 million** public GitHub repositories at L0. This release provides **UltraData-Code-L2** (~**400B tokens**) and **UltraData-Code-L3** (~**150B tokens**) across **11 programming languages**.
**L0: Repository archival.** We preserve the latest revision on the default branch of approximately 192 million public [GitHub](https://github.com/) repositories, together with code, directory structure, file relationships, and provenance metadata. This archive provides complete raw data and traceability for subsequent processing.
**L1: Standardized natural code.** Starting from L0, we perform large-scale filtering, cleaning, format normalization, and near-duplicate deduplication. General rules remove oversized files, invalid paths, unsupported text, and obvious anomalies. Checks tailored to each language and file type then normalize and clean the remaining content. For deduplication, files are partitioned by extension. MinHash signatures are generated and LSH retrieves near-duplicate candidates. Similarity edges define connected components. For groups containing multiple near-duplicates, the highest ranked 50% are retained. Files with no detected near duplicate are all kept. The result is a standardized natural code corpus.
**L2: Algorithmically relevant code.** Across 11 programming languages, we select algorithmically relevant code (**ALGO**) from L1. Each file receives a semantic embedding. File-role annotations and language-specific heuristics provide dual-cue supervision. An MLP relevance classifier learns a continuous relevance score. File-role predictions and a code-quality threshold complete the final selection. The selector covers core algorithm and data structure implementations as well as computational and problem-solving logic in DATA, WEB, TOOL, and TEST files. L2 contains approximately **400B tokens** and retains about 12.23% of L1 files. Under the same 1B base model and 10B-token continual pre-training budget, L2 improves over L1 by 7.80 and 5.13 points on EvalPlus and MultiPL-E, and over Stack-Edu by 4.37 and 3.05 points.
**L3: Task-oriented synthesis.** Using ALGO data from L2 as seeds, we construct a standalone task description, solution analysis, reference implementation, and test code. The task is independent of the original code snippet. The analysis explains the algorithm, edge cases, and complexity. The reference implementation provides executable code that runs independently. The tests target the required behavior. Each real implementation is transformed into a structured training sample aligning task, reasoning, code, and verification. L3 covers the same 11 programming languages and contains approximately **150B tokens**. Under the same 1B base model and 10B-token continual pre-training budget, replacing half of the L2 training tokens with L3 further improves EvalPlus and MultiPL-E by 8.42 and 8.07 points over L2-only training. With the same 1:1 token mix, L2-L3 mixed training improves over the L2 + CodeAlchemy-code-qa mix by 5.57 and 7.80 points on EvalPlus and MultiPL-E.
## πŸ“’ What's New
- **[2026.09.07]** The [***UltraData-Code***](https://huggingface.co/datasets/openbmb/UltraData-Code) dataset is released! The complete implementation of the [UltraData](https://ultradata.openbmb.cn/) [L0-L4 tiered data management framework](https://arxiv.org/pdf/2602.09003). It covers four code data states from L0 through L3, with each level corresponding to a distinct construction stage. This release currently open-sources **L2** (~400B tokens) and **L3** (~150B tokens) across 11 programming languages. πŸš€πŸš€πŸš€
- **[2026.09.07]** ***[MiniCPM5-2B](https://huggingface.co/openbmb/MiniCPM5-2B) is released!***, the second model in the MiniCPM5 series after MiniCPM5-1B. It is a dense 2B Transformer that scales up the same training recipe, built for on-device, local deployment, and resource-constrained scenarios. It reaches **2B-class open-source SOTA**, remains competitive with 4B-class models, and shows particular advantages in coding, mathematics, long-context understanding, tool use, and agentic tasks. UltraData-RL-2609 serves as the core RL dataset for MiniCPM5-2B. πŸš€πŸš€πŸš€
- **[2026.02.08]** The [***UltraData***](https://ultradata.openbmb.cn/) platform is now live, introducing the [L0-L4 tiered data management framework](https://arxiv.org/pdf/2602.09003). πŸ”πŸ”πŸ”
## πŸ’‘ Highlights
> **Abstract:** Code generation is a core capability of large language models, and code data is central to the pretraining process that develops it. As code corpora grow, their scale, diversity, and quality increasingly shape the capabilities learned during pretraining. Following a tiered data management perspective, we present **UltraData-Code** as a family of four connected data states: repository archival at L0, standardized natural code at L1, algorithmic selection at L2, and task-oriented synthesis at L3. L0 archives the latest revision on the default branch of each public GitHub repository with its file structure, relationships, and provenance. L1 applies scalable filtering, normalization, and near deduplication to obtain standardized natural code. L2 selects algorithmically relevant files from L1 using language-adaptive signals from file roles and heuristics, together with code-quality constraints, yielding approximately 400B tokens across 11 programming languages. L3 applies task-oriented synthesis to algorithmic files from L2, turning each implementation into a structured programming exercise with aligned task, analysis, solution, and test fields, and generating approximately 150B tokens in the same 11 languages. Under controlled 10B-token continual pretraining of a 1B model, training on L2 instead of L1 raises pass@1 on EvalPlus by **7.80 points** and on MultiPL-E by **5.13 points**, while exceeding Stack-Edu by 4.37 and 3.05 points, respectively. Replacing half of the L2 training tokens with L3 yields a further gain of **8.42 points** on EvalPlus and **8.07 points** on MultiPL-E over training on L2 alone, while exceeding the strongest synthetic data baseline by 5.57 and 7.80 points, respectively.
- **A connected code data construction pipeline:** UltraData-Code links repository archival and standardized natural code with fine-grained selection and structured synthesis, yielding approximately 400B tokens at L2 and 150B tokens at L3 across 11 programming languages.
- **Fine-grained curation of algorithmically relevant code:** We introduce file-level algorithmic relevance as a selection objective and combine file-role cues with language-specific heuristic evidence to identify computational content beyond files explicitly labeled as algorithm implementations.
- **Task-oriented synthesis grounded in implementations:** Each selected implementation serves as the common source for a task, analysis, solution, and test record, preserving computational intent while adding task semantics and structured supervision.
<div align="center">
<img src="assets/ultradata-code-l0-l3-overview.png" width="760" alt="UltraData-Code L0-L3 construction pipeline"/>
</div>
## πŸ“ˆ Evaluation Results
The 10B-token comparisons use the same 1B base model, architecture, optimization settings, preprocessing, decontamination, and evaluation protocol.
### Python Results
- **Algorithmic selection yields the strongest natural code result.** UltraData-Code-L2-py improves the average EvalPlus pass@1 by **17.91 points** over UltraData-Code-L1-py and by **8.46 points** over Stack-Edu-py. Ultra-Stack-v3-py reaches the second-highest natural code average, while UltraData-Code-L2-py records the strongest average overall among the natural code settings.
- **Structured synthesis improves the matched mixture.** The equal-token UltraData-Code-L2-py + UltraData-Code-L3-py mixture reaches a **46.43** average pass@1, **3.30 points** above training on L2 alone and **4.46 points** above the matched L2 + SwallowCode-v2 mixture.
<div align="center">
<img src="assets/python-training-dynamics.png" alt="Python training dynamics" width="760"/>
</div>
<div align="center">
<img src="assets/python_results.png" alt="Python main results table" width="900"/>
</div>
### Multilingual Results
- **L2 selection improves over L1 baselines.** UltraData-Code-L2 exceeds UltraData-Code-L1 by **7.80 points** on EvalPlus and **5.13 points** on MultiPL-E, and exceeds Stack-Edu by **4.37** and **3.05 points**, respectively.
- **L3 synthesis provides a further gain.** Replacing half of the L2 training tokens with L3 yields **8.42** and **8.07 points** over training on L2 alone on EvalPlus and MultiPL-E. Under the same 1:1 token mix, UltraData-Code-L2-L3 exceeds the strongest reported synthetic baseline by **5.57** and **7.80 points**, respectively.
- **The advantage persists during scaling.** At 100B tokens, the L2-L3 mixture reaches 57.06 on EvalPlus and 39.54 on MultiPL-E, exceeding training on L2 alone by 10.11 and 12.39 points and the matched CodeAlchemy-code-qa mixture by 10.86 and 9.60 points.
<div align="center">
<img src="assets/multilingual-training-dynamics.png" alt="Multilingual training dynamics" width="760"/>
</div>
<div align="center">
<img src="assets/multilingual_results.png" alt="Multilingual main results table" width="900"/>
</div>
## 🧾 Data Formats
### UltraData-Code-L2
Each row represents one selected source file. The fields are:
- `uuid`: unique file identifier.
- `repo_name`: source repository name.
- `relative_path`: file path relative to the repository.
- `content`: source code text.
- `category`: predicted file role, such as `ALGO`, `WEB`, `TOOL`, `DATA`, `TEST`, `CONFIG`, or `EXCLUDE`.
- `algo_rel_score`: algorithmic relevance score in `[0, 1]`.
- `quality_score`: code quality score in `[0, 10]`.
### UltraData-Code-L3
Each row is a programming exercise grounded in a real implementation:
- `uuid`: unique file identifier.
- `content`: serialized training content.
- `content_format`: serialization format for `content`.
- `raw_content`: original generated record before serialization.
- `task`: standalone problem statement.
- `analysis`: algorithm, edge cases, and complexity discussion.
- `solution`: reference implementation that runs independently.
- `test`: generated test candidates.
- `full_content`: serialization containing all generated fields.
- `full_content_format`: serialization format for `full_content`.
## ❀️ Acknowledgements
- The ***UltraData-Code-L2*** file-level semantic embeddings are computed with [Qwen3-Embedding-0.6B](https://huggingface.co/Qwen/Qwen3-Embedding-0.6B).
Thanks for their awesome work! Open source contributions make UltraData-Code possible! πŸ™Œ
## πŸ’³ License and Data Sources
This project is released under the [Apache 2.0](./LICENSE) license. ***UltraData-Code*** is built from code in multiple public repositories (L2) and from model-generated task records derived from those files (L3). Users must also comply with the **LICENSE of each source repository**. Apache 2.0 does not override those terms.
Public availability of a repository is not a grant of redistribution, commercial use, or training rights. Rights holders may request removal via the contact channel on the dataset page.
The dataset should not contain plaintext secrets or unauthorized personal data. Please report sensitive content or takedown requests through the same channel.
**No unauthorized unchanged redistribution:** Without prior written permission from the original authors (or this organization), any institution, organization, or third-party platform is strictly prohibited from directly reposting, mirroring, re-hosting, or commercially repackaging and republishing any artifacts of this project in any form.
## πŸ“– Citation
If you find **UltraData-Code** useful in your research, please consider citing:
```bibtex
@misc{ultradata_code,
title = {{UltraData-Code}: From Raw Repositories to
Algorithmically Dense and Task-Oriented Code Data},
author = {Chengying Tu and Hengyu Zhao and Shuaikang Xue and Zhongming Qu and Jihao Zhou and Xinle Lin and Junshao Guo and Zixuan Fu and Qiang Ma and Jie Zhou and Chaojun Xiao and Hongfei Yan and Yudong Wang and Xu Han and Zhiyuan Liu and Maosong Sun},
year = {2026},
publisher = {Hugging Face},
howpublished = {\url{https://huggingface.co/datasets/openbmb/UltraData-Code}}
}
```