Datasets:
Add dataset guide
Browse files
dataset_guide/GENERATION_AND_STRUCTURE.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generation And Structure
|
| 2 |
+
|
| 3 |
+
## JSONL Schema
|
| 4 |
+
|
| 5 |
+
Minimal record:
|
| 6 |
+
|
| 7 |
+
```json
|
| 8 |
+
{"text":"...","domain":"code_fim","difficulty":"medium","meta":{"lang":"python"}}
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
Recommended metadata:
|
| 12 |
+
|
| 13 |
+
```json
|
| 14 |
+
{
|
| 15 |
+
"text": "...",
|
| 16 |
+
"domain": "code_fim",
|
| 17 |
+
"difficulty": "hard",
|
| 18 |
+
"meta": {
|
| 19 |
+
"lang": "python",
|
| 20 |
+
"repo": "owner/name",
|
| 21 |
+
"path": "src/file.py",
|
| 22 |
+
"license": "Apache-2.0",
|
| 23 |
+
"source": "the-stack-v2",
|
| 24 |
+
"mode": "psm"
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
## FIM Text Format
|
| 30 |
+
|
| 31 |
+
Primary order:
|
| 32 |
+
|
| 33 |
+
```text
|
| 34 |
+
<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>{middle}
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
Secondary order:
|
| 38 |
+
|
| 39 |
+
```text
|
| 40 |
+
<|fim_suffix|>{suffix}<|fim_prefix|>{prefix}<|fim_middle|>{middle}
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
Use primary order for most records and keep a smaller secondary slice for model
|
| 44 |
+
robustness.
|
| 45 |
+
|
| 46 |
+
## Balance Targets
|
| 47 |
+
|
| 48 |
+
The long-term target mix is:
|
| 49 |
+
|
| 50 |
+
- FIM records: majority share.
|
| 51 |
+
- Continuation/code generation records: minority but substantial share.
|
| 52 |
+
- Languages: Python, Rust, C/C++, JavaScript/TypeScript, Java, Go.
|
| 53 |
+
- Lengths: short, medium, and long records.
|
| 54 |
+
- Difficulty: easy, medium, hard.
|
| 55 |
+
|
| 56 |
+
## Duplicate Policy
|
| 57 |
+
|
| 58 |
+
The duplicate key is a hash of normalized `text` content. A checkpoint is not
|
| 59 |
+
upload-ready unless the in-bundle duplicate count is zero.
|
dataset_guide/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dataset Guide
|
| 2 |
+
|
| 3 |
+
This folder documents how the 20 GiB JSONL checkpoints are generated, validated,
|
| 4 |
+
uploaded, and consumed for training.
|
| 5 |
+
|
| 6 |
+
## Design Goal
|
| 7 |
+
|
| 8 |
+
The dataset is optimized for code completion, FIM training, and architecture
|
| 9 |
+
ablation between Dense and MoE models. Each checkpoint is a self-contained unit
|
| 10 |
+
that can be uploaded to Google Drive, Hugging Face, or mounted in Colab.
|
| 11 |
+
|
| 12 |
+
## Generation Method
|
| 13 |
+
|
| 14 |
+
Generation must be streaming and out-of-core:
|
| 15 |
+
|
| 16 |
+
- Never load a whole corpus or checkpoint into RAM.
|
| 17 |
+
- Write JSONL shards incrementally.
|
| 18 |
+
- Use a disk-backed dedup index.
|
| 19 |
+
- Keep source files immutable.
|
| 20 |
+
- Stop generation when disk free space approaches the safety floor.
|
| 21 |
+
|
| 22 |
+
## Checkpoint Unit
|
| 23 |
+
|
| 24 |
+
Each checkpoint targets about 20 GiB because that size is practical for Google
|
| 25 |
+
Drive uploads and Colab/H100 training runs. A checkpoint owns its local JSONL
|
| 26 |
+
files; files are moved into the checkpoint folder rather than copied.
|
| 27 |
+
|
| 28 |
+
## Required Validation
|
| 29 |
+
|
| 30 |
+
Before a checkpoint is considered upload-ready:
|
| 31 |
+
|
| 32 |
+
- Every line must parse as JSON.
|
| 33 |
+
- Every record must contain non-empty `text`.
|
| 34 |
+
- In-bundle duplicate count must be zero.
|
| 35 |
+
- Checksums must be regenerated after any file rewrite.
|
| 36 |
+
- `UPLOAD_READY.md` must say the checkpoint is ready.
|
| 37 |
+
|
| 38 |
+
## Training Loader Expectations
|
| 39 |
+
|
| 40 |
+
Training loaders should read `dataset/*.jsonl` line by line. They should append
|
| 41 |
+
EOS between records, preserve FIM tokens, and avoid multi-worker duplication by
|
| 42 |
+
sharding files or line ranges across workers.
|