File size: 4,871 Bytes
d517dc9 | 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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | # tinycodinglm dataset schema
TL;DR: https://huggingface.co/docs/hub/session-traces-format
One JSONL session per file, UTF-8. **Line endings vary** (most files CRLF; `cp/` and
`agentic/` are LF) — parsers must accept both. Six layouts are defined here; web-search
and web-research layouts are defined in `WEB_SCHEMA.md`.
## 1. Single-turn SFT Q&A (`ai`, `asm`, `career`, `cf`, `chess`, `code`, `cpp`, `doc`, `eng`, `i18n`, `lang`, `life`, `lmstudio`, `math`, `mc`, `misc`, `polyglot`, `reason`, `sci`, `sec`, `sys`, `tok`, `cp`)
Exactly 4 lines per file:
1. `{"type":"session","harness":"<harness>","id":"<file-stem>","name":"<title>", "tools": [openai-compatible tools declarations (responses api)]}`
2. `{"type":"message","message":{"role":"system","content":"..."}}`
3. `{"type":"message","message":{"role":"user","content":"..."}}`
4. `{"type":"message","message":{"role":"assistant","content":"..."}}`
`harness` is one of `opencode`, `deepseek-harness`, `copilot-cli`, `my-agent`,
`llama.cpp`. Assistant `content` is the final answer; curated coding answers are
expected to be syntactically valid code.
## 2. URL/text recall layout (`c4`, `fineweb`, `fineweb-edu`, `openwebmath`, ...)
Line 1 is a `session` record, followed by exactly 2 `message` records:
1. `{"type":"message","message":{"role":"user","content":"<URL>"}}`
2. `{"type":"message","message":{"role":"assistant","content":"<extracted page text>"}}`
There is **no system message** by design: the user turn is a URL and the assistant
turn is the extracted page text. Session fields:
- `c4`: `source`, `config`, `url`, `timestamp`, `truncated`.
- `fineweb`: `source`, `config`, `source_id`, `url`, `dump`, `date`, `language`,
`language_score`, `token_count`, `truncated`.
- `fineweb-edu`: `source`, `config`, `source_id`, `url`, `dump`, `language`,
`language_score`, `token_count`, `score`, `int_score`, `truncated`.
- `openwebmath`: `source`, `config`, `url`, `date`, `metadata`, `truncated`.
This is a recall/pretraining layout, not conversational-assistant SFT. `truncated:true`
marks a hard character cap only; it does **not** capture dangling/mid-sentence
extraction endings, which are common.
## 6. OpenThoughts (`ot/`)
4 lines: `session`, `system`, `user`, `assistant`. The assistant message has two
fields:
- `reasoningContent`: the chain of thought.
- `content`: the final solution.
The system prompt is the neutral OT3 prompt
("You are an expert problem solver. Think step by step before giving the final answer.").
Raw `<|begin_of_thought|>` / `<|end_of_thought|>` / `<|begin_of_solution|>` /
`<|end_of_solution|>` sentinels were stripped and split into the two fields.
Two subsets: `ot-000001`..`ot-113957` from OpenThoughts-114k (113 957 rows) and
`ot-113958`..`ot-143957` from OpenThoughts3-1.2M code rows (30 000 rows). Imported
content is third-party distilled data (Apache-2.0): keep attribution on
redistribution and do not apply the first-party invariants about prompt leakage or
exploit gadgets to it without review. Assistant answers are long (median ~15-58 KB,
max ~200 KB) by design.
## Harness values
`c4`, `fineweb`, `fineweb-edu`, `openwebmath`, `openwebtext`, `mimo`,
`wikipedia`, `openthoughts`, `opencode`, `deepseek-harness`, `copilot-cli`,
`my-agent`, `llama.cpp`.
## Invariants (enforced on every record)
- Filename stem equals session `id` (e.g. `sec/sec-0625.jsonl` has `id: sec-0625`).
Descriptive agentic stems carry the full id.
- Line 1 is a `session` record.
- Role sequence matches the layout of the directory (§1-§6).
- UTF-8; line endings vary (mostly CRLF; `cp/` and `agentic/` are LF).
- No C0 control characters in decoded content (outside `\n`, `\t`).
- Assistant `content` is non-empty except for agentic turns (tool-call placeholders or
incomplete imported turns), web turns that carry `toolCalls` (the tool call is the
response), and reasoning-only OpenThoughts traces (where
`reasoningContent` holds the full trace).
- If `reasoningContent` is present, it is a non-empty string, `content` holds the
final answer, and no `<|begin_of_thought|>` / `<|end_of_thought|>` /
`<|begin_of_solution|>` / `<|end_of_solution|>` sentinel remains.
- Curated coding answers (§1) must be syntactically valid code and must not echo
harness instructions ("following the best practices … Reply with the fixed
optimized code" is prompt leakage, never an answer).
- `truncated:true` marks a hard character cap, not extraction damage.
## Quick validation
Parse every line as JSON, assert the role sequence for the directory's layout,
assert `stem == session id`, assert non-empty assistant `content` (except agentic
placeholders), and scan `ot/` assistant text for the fused-token sentinels above.
For `fineweb`/`fineweb-edu`, also check `date`/`dump` ranges and language scores;
for Wikipedia, key on `(language, source_id)`.
|