--- license: cc-by-4.0 task_categories: - text-generation - question-answering tags: - calibration - quantization - imatrix - awq - gptq - mtp - speculative-decoding - instruction-tuning - synthetic - multi-domain size_categories: - 10K` and friends are linted against). That is deliberate: `llama-perplexity` has no `--parse-special`, so a marker embedded in the text tokenizes as a control token on one stack and as plain BPE on the other, which quietly makes PPL/KLD numbers incomparable. This corpus is safe to use as an eval file. ## Using it **Calibration corpus** — write the `calib` half out as flat text: ```python from datasets import load_dataset ds = load_dataset("pearsonkyle/broad-domain-supplement", split="corpus") calib = ds.filter(lambda r: r["half"] == "calib") with open("corpus.broad.calib.txt", "w") as f: f.write("\n\n".join(calib["text"])) ``` ```bash llama-imatrix -m model-F16.gguf -f corpus.broad.calib.txt -o imatrix.gguf -c 4096 ``` Interleave it with your in-domain corpus rather than concatenating: a token-budgeted calibrator samples the file, and a large block at the head can eat the whole budget. **MTP draft-head training** — the disjoint half, next-token: ```python mtp = ds.filter(lambda r: r["half"] == "mtp") text = "\n\n".join(mtp["text"]) # ~500k tokens ``` **Instruction tuning** — already chat-shaped: ```python from transformers import AutoTokenizer inst = load_dataset("pearsonkyle/broad-domain-supplement", split="instruct") tok = AutoTokenizer.from_pretrained("") rendered = tok.apply_chat_template(inst[0]["messages"], tokenize=False) # authored prompts only (the question was written as a question, not templated): authored = inst.filter(lambda r: r["prompt_source"] == "authored") ``` **Filtering by topic** — every row carries `area` and `subject`: ```python ml = ds.filter(lambda r: r["area"] == "data_science_ml") ``` ## Read this before using `instruct` The `instruct` split's prompts come from two different places and the difference matters: * **`prompt_source: "authored"`** (~6%) — the `qa` and `transcript` rows. The question or user turn was *written as a prompt*. These are genuine instruction data. * **`prompt_source: "templated"`** (~94%) — the `prose` and `table` rows. The source text was written as continuous exposition, and the prompt is **generated** from the section heading and subject using a small set of templates. The *responses* are hand-written; the *questions* are not. Templated prompts are fine for light instruction tuning and for teaching a model to answer topically on demand. They are repetitive by construction, and a model trained on them heavily will learn the template. If you want prompt diversity, filter to `authored`, rewrite the prompts, or mix this with a real instruction set — do not treat all 5.5k rows as if a person wrote 5.5k distinct questions. This is stated plainly because a dataset that quietly presents templated prompts as authored ones is the kind of thing that is discovered later, in results. ## Caveats * **Token counts are estimates.** `est_tokens` uses a measured 3.70 chars/token ratio, not a real tokenizer. Expect a few percent of drift; recount with your own tokenizer if it matters. Two figures in the table differ for real reasons rather than by mistake: `instruct` totals *more* than `corpus` because it counts the generated prompts as well as the responses, and both sit slightly under the ~1.0M raw-file figure because section headers, the per-file metadata block, and blank separator lines are not part of any sample. * **Single author, single voice.** One person wrote all of it, so it is stylistically consistent in a way a scraped corpus is not. Good for controlled calibration, and it means the corpus does not represent stylistic diversity — do not use it to measure that. * **Breadth over depth.** Each subject is a competent overview at roughly 5k tokens, not expert-level treatment. It is written to exercise vocabulary and reasoning patterns across many domains, which is what calibration needs; it is not a reference text. * **`transcript` tool calls were never executed.** They are illustrative dialogues written to look like tool use, kept as literal assistant text rather than lifted into a structured `tool_calls` field, because presenting authored text as a captured trace would be misleading. * No claim is made that the content is error-free. It is a written corpus, not a verified one. ## Row schema Shared by both splits: | field | meaning | | --- | --- | | `id` | stable content hash of the sample | | `area`, `subject` | directory-level topic and subject file (e.g. `physics` / `quantum_information`) | | `area_title`, `subject_title` | human-readable forms | | `section` | the `## Section` heading the sample sits under | | `register` | `prose` / `table` / `qa` / `transcript` — how it is written | | `half` | **`calib` or `mtp` — disjoint.** Filter on this; do not re-split | | `source_file` | path within `calibration_supplements/broad/` | | `n_chars`, `est_tokens` | size; tokens are a 3.70 chars/token **estimate** | `corpus` split adds: | field | meaning | | --- | --- | | `text` | the sample as authored, section heading included | `instruct` split adds: | field | meaning | | --- | --- | | `messages` | chat-format turns (`user` / `assistant`, plus `tool` for transcripts) | | `prompt_source` | `authored` (the prompt is from the source) or `templated` (generated from the heading — see the note above) | | `n_turns` | message count | ## Reproducing Generated with [Quant-Tuner](https://github.com/pearsonkyle/Quant-Tuner); see `docs/ternary_qat.md` for the end-to-end pipeline and `src/quant_tuner/datasets/` for the exact builder used to publish this.