Datasets:
The dataset could not be loaded because the splits use different data file formats, which is not supported. Read more about the splits configuration. Click for more details.
Error code: FileFormatMismatchBetweenSplitsError
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
MMSciCode
About | Benchmark Construction | Statistics | Usage | Citation
About
This repository contains MMSciCode, a benchmark for paper-grounded scientific research coding. MMSciCode evaluates whether a model can recover masked core functions from real research code using the surrounding repository context, paper-derived context, and sample-specific implementation metadata.
The benchmark spans Python, R, and C/C++ projects collected from scientific papers and their associated code releases. Each task is evaluated by inserting the generated function back into the original project and running the corresponding unit tests.
This Hugging Face dataset repository contains both the benchmark data and the Dockerfile build assets used to reproduce the execution environments.
Benchmark Construction
MMSciCode is built from real scientific software projects through a function-level construction pipeline:
- Paper and code collection: scientific papers are paired with their released code repositories.
- Function extraction: candidate functions are extracted from each project together with file paths, line numbers, and repository structure metadata.
- Core-function selection: expert annotations identify functions that implement paper-relevant algorithms, equations, simulations, or analysis procedures.
- Task creation: selected functions are masked while preserving the surrounding code context and paper-derived implementation evidence.
- Executable validation: generated implementations are inserted back into the original project and checked with sample-specific tests.
- Environment packaging: Dockerfile build contexts are provided for the exported execution environments.
Why MMSciCode?
Scientific coding differs from short standalone programming tasks: solutions must often match paper-specific notation, domain assumptions, project-local APIs, numerical behavior, and existing repository structure. MMSciCode is designed to measure those abilities directly by using real research code and containerized execution.
Each sample directory under a language-level data/ folder includes metadata
such as available functions, selected core functions, paper or article context,
repository structure, and test status.
Statistics
| Item | Count |
|---|---|
| Function-level tasks | 624 |
| Source sample directories | 285 |
| Programming languages | 3 |
| Python samples | 203 |
| R samples | 60 |
| C/C++ samples | 22 |
| Dockerfile environment directories | 204 |
Dockerfile environment directories are organized by language-level
dockerfiles/ folders:
| Dockerfile group | Count |
|---|---|
Python/dockerfiles/ |
201 |
R/dockerfiles/ |
1 |
C_CPP/dockerfiles/ |
2 |
Repository Layout
MMSciCode/
Python/
data/
<sample_id>/
dockerfiles/
<environment_id>/
R/
data/
<sample_id>/
dockerfiles/
<environment_id>/
C_CPP/
data/
<sample_id>/
dockerfiles/
<environment_id>/
index.tsv
build_all_serial.sh
distributable_env_dockerfiles.tar.gz
Typical sample files include:
article_content.json
article_metadata.json or article_info.json
functions.json
selected_core_functions.json
structure.txt
unit_test_status.json
code/
The root index.tsv maps Docker image names to environment IDs and Dockerfile
directories. The archive distributable_env_dockerfiles.tar.gz contains the
same distributable Dockerfile assets as a standalone package.
Usage
Downloading the Dataset
git lfs install
git clone https://huggingface.co/datasets/MMSciCode/MMSciCode
cd MMSciCode
Or download with huggingface_hub:
from huggingface_hub import snapshot_download
dataset_dir = snapshot_download(
repo_id="MMSciCode/MMSciCode",
repo_type="dataset",
)
Inspecting a Task
Each benchmark task is defined inside a language-specific data/ directory.
For example:
ls Python/data/<sample_id>
cat Python/data/<sample_id>/selected_core_functions.json
cat Python/data/<sample_id>/unit_test_status.json
selected_core_functions.json describes the functions selected for evaluation,
including their source locations, natural-language descriptions, paper
references, and implementation cues.
Building Docker Environments
The repository includes Dockerfile build contexts under the language-level
dockerfiles/ directories. To build all indexed environments serially:
chmod +x build_all_serial.sh
./build_all_serial.sh
The build script reads index.tsv, locates each Dockerfile directory under
Python/dockerfiles/, R/dockerfiles/, or C_CPP/dockerfiles/, and tags the
resulting image with the name listed in the index.
Optional build arguments can be passed through environment variables:
CONDA_MIRROR=https://mirrors.tuna.tsinghua.edu.cn/anaconda ./build_all_serial.sh
PIP_STRICT=1 ./build_all_serial.sh
Using the Standalone Dockerfile Package
If you only need the Dockerfile build contexts, extract the bundled archive:
tar -xzf distributable_env_dockerfiles.tar.gz
cd distributable_env_dockerfiles
./build_all_serial.sh
Links
| Resource | Link |
|---|---|
| Dataset | MMSciCode/MMSciCode |
| Organization | MMSciCode |
| Dockerfile index | index.tsv |
| Docker build script | build_all_serial.sh |
Citation
- Downloads last month
- 5,442