dataset_info:
- config_name: go-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 364025569
num_examples: 99663
download_size: 163830524
dataset_size: 364025569
- config_name: go-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1066841599
num_examples: 1992985
download_size: 438588731
dataset_size: 1066841599
- config_name: java-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 359305298
num_examples: 87504
download_size: 130012787
dataset_size: 359305298
- config_name: java-v1-pair-2M
features:
- name: query
dtype: string
- name: pos
dtype: string
splits:
- name: train
num_bytes: 1331514393
num_examples: 1752593
download_size: 480145623
dataset_size: 1331514393
- config_name: javascript-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: pos
dtype: string
- name: negs
list: string
splits:
- name: train
num_bytes: 505829400
num_examples: 98025
download_size: 212768692
dataset_size: 505829400
- config_name: javascript-v1-pair-2M
features:
- name: query
dtype: string
- name: document
dtype: string
splits:
- name: train
num_bytes: 1645071326
num_examples: 2000000
download_size: 712840086
dataset_size: 1645071326
- config_name: php-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: positive
dtype: string
- name: negative_1
dtype: string
- name: negative_2
dtype: string
- name: negative_3
dtype: string
- name: negative_4
dtype: string
- name: negative_5
dtype: string
- name: negative_6
dtype: string
- name: negative_7
dtype: string
splits:
- name: train
num_bytes: 456010637
num_examples: 100000
download_size: 187231845
dataset_size: 456010637
- config_name: php-v1-pair-2M
features:
- name: query
dtype: string
- name: document
dtype: string
splits:
- name: train
num_bytes: 1595714130
num_examples: 2000000
download_size: 586289099
dataset_size: 1595714130
- config_name: python-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: positive
dtype: string
- name: negative_1
dtype: string
- name: negative_2
dtype: string
- name: negative_3
dtype: string
- name: negative_4
dtype: string
- name: negative_5
dtype: string
- name: negative_6
dtype: string
- name: negative_7
dtype: string
splits:
- name: train
num_bytes: 427758453
num_examples: 100000
download_size: 192066322
dataset_size: 427758453
- config_name: python-v1-pair-2M
features:
- name: query
dtype: string
- name: document
dtype: string
splits:
- name: train
num_bytes: 1462591691
num_examples: 2000000
download_size: 645088234
dataset_size: 1462591691
- config_name: ruby-v1-hard-negatives-100k
features:
- name: query
dtype: string
- name: positive
dtype: string
- name: negative_1
dtype: string
- name: negative_2
dtype: string
- name: negative_3
dtype: string
- name: negative_4
dtype: string
- name: negative_5
dtype: string
- name: negative_6
dtype: string
- name: negative_7
dtype: string
splits:
- name: train
num_bytes: 224289181
num_examples: 100000
download_size: 104781612
dataset_size: 224289181
- config_name: ruby-v1-pair-2M
features:
- name: query
dtype: string
- name: document
dtype: string
splits:
- name: train
num_bytes: 856311579
num_examples: 2000000
download_size: 350446568
dataset_size: 856311579
configs:
- config_name: go-v1-hard-negatives-100k
data_files:
- split: train
path: go-v1-hard-negatives-100k/train-*
- config_name: go-v1-pair-2M
data_files:
- split: train
path: go-v1-pair-2M/train-*
- config_name: java-v1-hard-negatives-100k
data_files:
- split: train
path: java-v1-hard-negatives-100k/train-*
- config_name: java-v1-pair-2M
data_files:
- split: train
path: java-v1-pair-2M/train-*
- config_name: javascript-v1-hard-negatives-100k
data_files:
- split: train
path: javascript-v1-hard-negatives-100k/train-*
- config_name: javascript-v1-pair-2M
data_files:
- split: train
path: javascript-v1-pair-2M/train-*
- config_name: php-v1-hard-negatives-100k
data_files:
- split: train
path: php-v1-hard-negatives-100k/train-*
- config_name: php-v1-pair-2M
data_files:
- split: train
path: php-v1-pair-2M/train-*
- config_name: python-v1-hard-negatives-100k
data_files:
- split: train
path: python-v1-hard-negatives-100k/train-*
- config_name: python-v1-pair-2M
data_files:
- split: train
path: python-v1-pair-2M/train-*
- config_name: ruby-v1-hard-negatives-100k
data_files:
- split: train
path: ruby-v1-hard-negatives-100k/train-*
- config_name: ruby-v1-pair-2M
data_files:
- split: train
path: ruby-v1-pair-2M/train-*
license: apache-2.0
cornstack-samples
🚧 This dataset is under active development and may change.
cornstack-samples is a compact, sampled version of CoRNStack for code-focused embedding training, reranker training, and retrieval experiments.
Source dataset and paper:
- CoRNStack collection: https://huggingface.co/collections/nomic-ai/cornstack
- CoRNStack paper: https://huggingface.co/papers/2412.01007
Why this dataset
CoRNStack is large. This dataset provides smaller, practical subsets for faster iteration and lower-cost experiments.
Important notes:
- This is a sampled dataset, not the full CoRNStack distribution.
- If you need maximum coverage or full-scale training, use the original CoRNStack collection.
Config layout
Each language is published as two separate configs:
{lang}-v1-pair-2M{lang}-v1-hard-negatives-100k
Each config uses split train.
{lang}-v1-pair-2M
Fields:
querydocument
Target rows per language: ~2,000,000
{lang}-v1-hard-negatives-100k
Fields:
querypositivenegative_1negative_2negative_3negative_4negative_5negative_6negative_7
Target rows per language: ~100,000
Complete subset list (exact)
All subsets are published with split train.
| Subset (config name) | split | num_examples | type |
|---|---|---|---|
go-v1-pair-2M |
train |
2,000,000 | pair |
go-v1-hard-negatives-100k |
train |
100,000 | hard-negatives |
java-v1-pair-2M |
train |
2,000,000 | pair |
java-v1-hard-negatives-100k |
train |
100,000 | hard-negatives |
javascript-v1-pair-2M |
train |
2,000,000 | pair |
javascript-v1-hard-negatives-100k |
train |
100,000 | hard-negatives |
php-v1-pair-2M |
train |
2,000,000 | pair |
php-v1-hard-negatives-100k |
train |
100,000 | hard-negatives |
python-v1-pair-2M |
train |
2,000,000 | pair |
python-v1-hard-negatives-100k |
train |
100,000 | hard-negatives |
ruby-v1-pair-2M |
train |
2,000,000 | pair |
ruby-v1-hard-negatives-100k |
train |
100,000 | hard-negatives |
Quick usage
from datasets import load_dataset
pair_ds = load_dataset("hotchpotch/cornstack-samples", "python-v1-pair-2M", split="train")
hard_ds = load_dataset("hotchpotch/cornstack-samples", "python-v1-hard-negatives-100k", split="train")
print(pair_ds.column_names, len(pair_ds))
print(hard_ds.column_names, len(hard_ds))
Creation process (rough)
For each language:
- Read CoRNStack shard files (
shard-*.jsonl.gz). - Count lines per shard and allocate per-shard targets.
- Build pair data via random line-index sampling with valid string
query/document. - Build hard-negative data from disjoint rows:
- valid string
query/document negativescontains at least 7 unique non-empty strings- sample 7 negatives per row
- cap output via reservoir sampling
- valid string
Default seed is fixed (42) for reproducibility under identical source snapshots and parameters.
License
This dataset follows CoRNStack and is released under Apache-2.0.
Citation and attribution
If you use this dataset, please cite and attribute CoRNStack: