File size: 1,194 Bytes
6eb5c20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Generation And Structure

## JSONL Schema

Minimal record:

```json
{"text":"...","domain":"code_fim","difficulty":"medium","meta":{"lang":"python"}}
```

Recommended metadata:

```json
{
  "text": "...",
  "domain": "code_fim",
  "difficulty": "hard",
  "meta": {
    "lang": "python",
    "repo": "owner/name",
    "path": "src/file.py",
    "license": "Apache-2.0",
    "source": "the-stack-v2",
    "mode": "psm"
  }
}
```

## FIM Text Format

Primary order:

```text
<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>{middle}
```

Secondary order:

```text
<|fim_suffix|>{suffix}<|fim_prefix|>{prefix}<|fim_middle|>{middle}
```

Use primary order for most records and keep a smaller secondary slice for model
robustness.

## Balance Targets

The long-term target mix is:

- FIM records: majority share.
- Continuation/code generation records: minority but substantial share.
- Languages: Python, Rust, C/C++, JavaScript/TypeScript, Java, Go.
- Lengths: short, medium, and long records.
- Difficulty: easy, medium, hard.

## Duplicate Policy

The duplicate key is a hash of normalized `text` content. A checkpoint is not
upload-ready unless the in-bundle duplicate count is zero.