CoolFace
Datasetpublic

mdonigian/starcoder-curated

StarCoderData Curated A curated subset of StarCoderData optimised for training a 500M parameter model focused on structured data output (JSON generation, function calling, schema compliance). Dataset Summary Total code files: 5,203,508 Total tokens: 3.9B (target: 3.5B) Classifier-scored files: 1,553,596 (1.7B tokens) Non-classified files: 3,649,912 (2.2B tokens) — filtered by heuristics, not the classifier Source: bigcode/starcoderdata Classifier:… See the full description on the dataset page: https://huggingface.co/datasets/mdonigian/starcoder-curated.

sourceHugging Faceodc-byupdated 7mo agoView on Hugging Face
0likes108downloads
Dataset Card

StarCoderData Curated

A curated subset of StarCoderData optimised for training a 500M parameter model focused on structured data output (JSON generation, function calling, schema compliance).

Dataset Summary

  • Total code files: 5,203,508
  • Total tokens: 3.9B (target: 3.5B)
  • Classifier-scored files: 1,553,596 (1.7B tokens)
  • Non-classified files: 3,649,912 (2.2B tokens) — filtered by heuristics, not the classifier
  • Source: bigcode/starcoderdata
  • Classifier: mdonigian/code-curator-v1 (UniXcoder-base, multi-task)
  • Curation: Per-language-slice filtering + compression ratio pre-filter + MinHash deduplication

Filtering Strategy

Different language groups need different curation approaches. Not every slice goes through the GPU classifier — schema languages and GitHub issues are filtered with cheaper heuristics because the classifier was trained on general-purpose code and isn't the right tool for inherently structured formats.

All slices share these pre-filters:

  • zlib compression ratio < 0.10 (catches extreme repetition)
  • MinHash LSH deduplication (128 perms, 5-line shingles, 0.7 Jaccard threshold)

Classifier-Scored Slices (relevance_filter)

These languages were scored by the multi-task classifier. Files were ranked by structured data relevance and filtered to keep only those with relevance ≥ 2.0 and quality ≥ 1.5, sampled down to the per-slice token budget:

  • TypeScript: ~600M tokens — strong type system, filter by SD relevance ≥ 2
  • Python: ~600M tokens — filter by SD relevance ≥ 2
  • Rust/Go/Java: ~600M tokens — strongly typed, filter by SD relevance ≥ 2

Non-Classified Slices

These languages were not run through the classifier. Their quality, structured_data, and content_type columns contain default placeholder values (0.0 / "unclassified") and should be ignored:

  • Schema languages (JSON/YAML/SQL/protobuf/thrift/XSLT): ~800M tokens — inherently structured data formats; quality floor + random sample to budget
  • GitHub Issues (technical): ~500M tokens — keyword filter matching structured-data topics (JSON, schema, API, protobuf, gRPC, etc.)
  • General code (78 other languages): ~1B tokens — random sample for language diversity; quality floor only

Language Slice Distribution

SliceStrategyLanguagesTargetActual% of Target
schema_languageslight_filterjson, yaml, sql, protocol-buffer +2 more800M799M99.9%
typescriptrelevance_filtertypescript600M598M99.7%
pythonrelevance_filterpython600M594M99.1%
rustgojavarelevance_filterrust, go, java600M485M80.8%
github_issueskeyword_filtergithub-issues-filtered-structured500M426M85.2%
general_codelight_filterada, agda, alloy, antlr +74 more1000M999M99.9%

Classifier-Scored Slices — Detail

The quality and structured data scores below apply only to the 1,553,596 files (1.7B tokens) that went through the classifier. Non-classified slices are excluded from these statistics.

SliceFilesTokensAvg QualityAvg SD Relevance
typescript841,426598M3.812.88
python567,721594M3.712.73
rustgojava144,438485M3.973.07

Content Group Distribution (classifier-scored files only)

Group% of Classified TokensTokensFiles
Library/Package64.3%1,079,381,5021,075,672
Application3.4%56,360,750118,200
Script/CLI1.1%17,853,66224,871
Test Code5.5%91,370,76348,003
Config/Data/Generated/Other25.8%432,393,146286,850

Structured Data Relevance (classifier-scored files only)

The strongest classifier signal (Spearman 0.81 on held-out data). SD2+ files contain significant structured data patterns (API endpoints, JSON parsing, schema definitions, etc.).

Quality mean: 3.79, Median: 3.88.

LevelRangeTarget %Actual %Files
SD0[0.0, 0.5)10.0%0.0%0
SD1[0.5, 1.5)20.0%0.0%0
SD2[1.5, 2.5)35.0%3.2%49,213
SD3[2.5, 3.5)35.0%96.8%1,504,383

Quality Distribution (classifier-scored files only)

LevelDescriptionFiles
1Broken/gibberish0
2Functional but poor42,668
3Decent129,945
4Good1,380,674
5Excellent309

Non-Classified Slices — Detail

These slices were filtered using heuristics. The classifier columns (quality, structured_data, content_type) are set to defaults and do not reflect actual code quality — the filtering was done by other means:

SliceStrategyFilesTokensHow Filtered
schema_languageslight_filter2,203,233799MQuality floor (≥1.5) + token budget, randomly sampled
github_issueskeyword_filter485,384426MKeyword match for structured-data topics + quality floor
general_codelight_filter961,295999MQuality floor (≥1.5) + token budget, randomly sampled

Programming Languages

Language% TokensFiles
typescript15.3%841,426
python15.2%567,721
github-issues-filtered-structured10.9%485,384
markdown8.9%351,728
json8.7%1,124,326
go8.5%73,899
sql5.9%121,035
javascript5.8%281,216
yaml5.8%957,872
java3.2%57,787
c-sharp3.0%114,063
html2.9%53,527
c2.8%75,899
haskell2.2%84,862
rust0.7%12,752

Token Count Distribution

PercentileTokens
P1055
P25111
P50 (median)255
P75631
P901,416
Mean749

Schema

Each row contains:

FieldTypeDescription
contentstringSource code text
langstringProgramming language
sizeintFile size in bytes
token_countintEstimated token count (size // 4)
qualityfloatCode quality score 1-5 (classifier-scored slices only; 0.0 for non-classified)
structured_datafloatStructured data relevance 0-3 (classifier-scored slices only; 0.0 for non-classified)
content_typestringContent type — 9 classes (classifier-scored slices only; "unclassified" for non-classified)
language_slicestringLanguage slice name (use this to filter by curation strategy)
relevance_scorefloatComposite relevance score (classifier-scored slices only; 0.0 for non-classified)
Tip: To work with only classifier-scored data, filter on language_slice in {"typescript", "python", "rust_go_java"}.

Methodology

  1. 1.Download: All language folders from bigcode/starcoderdata.
  2. 2.Classification: Multi-task UniXcoder-base model (3 heads: quality, SD relevance, content type) runs on TypeScript, Python, Rust, Go, and Java Schema languages, GitHub issues, and general code skip this step.
  3. 3.Pre-filtering: zlib compression ratio filter removes repetitive boilerplate before GPU inference.
  4. 4.Filtering: Per-slice strategy — relevance-based ranking for classified languages, keyword matching for GitHub issues, random sampling for schema/general code. All slices enforce a quality floor.
  5. 5.Deduplication: MinHash LSH (128 perms, 5-line shingles, 0.7 Jaccard threshold). Highest-relevance file kept from each cluster.