--- license: apache-2.0 task_categories: - text-generation language: - en tags: - terminal-agent - agentic - sft - terminus-2 - qwen3.5 pretty_name: OpenThoughts-Agent v1 SFT, normalized to the Terminus-2 contract size_categories: - 10K 32,768 tokens under the Qwen3.5 template → 14,312 (60 dropped) ├─ train 14,112 └─ holdout 200 ``` | | | |---|---| | examples | **14,312** (14,112 / 200) | | tokens | 100,185,231 — mean 7,000, p50 6,078, p90 11,923, p99 22,530, max 32,739 | | assistant turns | mean 7.46, max 32 | | distinct tasks | 14,312 — **one trajectory per task** | | source model | `QuantTrio/GLM-4.6-AWQ` (all rows) | | steps/epoch @ GBS 128 | 110 | ### The 837 dropped rows, and why they are dropped whole 645 had an assistant turn that will not parse as JSON (overwhelmingly an unescaped inner quote: `"made directories "1" and "2" here"`), 192 had one missing a required key. A trajectory is dropped **entirely** when any of its turns fails. Truncating at the last good turn was measured and rejected: across those 837 the median salvageable fraction is **0.15**, and **323 fail on the very first assistant turn**. Truncating would mostly contribute one-turn stubs of ten-turn episodes and skew the length distribution toward short, easy prefixes. Unescaped inner quotes are **not** repaired. Where a broken string ends is a guess, and a guess here writes invented content into supervision. ### Two normalizations that are easy to get wrong **1. Literal newlines inside JSON strings are repaired, not dropped.** Agents emit `"analysis": "step one⏎step two"` with a real newline. That is invalid JSON by spec and `json.loads` rejects it as an "Invalid control character", but the meaning is unambiguous, so it is re-dumped with the newline properly escaped. Every assistant turn in this dataset parses under **strict** `json.loads`. **2. The stale warning preamble is stripped.** When an assistant turn had to be renormalized, the *next* observation begins `Previous response had warnings: - Extra text detected before JSON object` — a complaint about a formatting error that no longer exists in the data. Left in, it trains the model to expect a scolding for output it was just shown as correct. **572 observations** needed this repair. The preamble is kept whenever the preceding turn was already clean, because then the complaint is about something real. 5.82 % of assistant turns were rewritten in some way (`n_rewritten_turns`). ## Schema `default` config: | field | type | notes | |---|---|---| | `messages` | `list<{role, content}>` | `user` / `assistant` only, user-first, assistant-last | | `trajectory_id` | string | upstream `trial_name` | | `task_group_id` | string | upstream `task`; unique per row here | | `model_name` | string | `QuantTrio/GLM-4.6-AWQ` | | `n_tokens` | int | full sequence under the Qwen3.5 chat template | | `n_assistant_turns` | int | mean 7.46, max 32 | | `n_rewritten_turns` | int | assistant turns whose JSON was renormalized | `messages[0]` is **`user`, not `system`** — that is how Terminus-2 delivers the harness prompt, and keeping it as `user` makes training and serving identical. A `system` turn would shift the rendered prefix and therefore the loss mask; rows containing one are refused rather than folded in (upstream has none). `pretokenized` config: | field | type | meaning | |---|---|---| | `input_ids` | `list[int]` | tokens of the whole-conversation render | | `loss_mask` | `list[int]` | 1 = train on this token, 0 = context only; aligned 1:1, no offset | Same 14,112 / 200 rows, **98,567,847 tokens, 30,711,017 trained (31.16 %)**. To get `labels`, set `labels[i] = input_ids[i]` where `loss_mask[i] == 1` else `-100`, and do **not** shift — HuggingFace CausalLMs and Liger's fused CE shift internally. ## Verification before release - **0 chat-template contract failures.** `apply_chat_template(tokenize=False)` then tokenizing equals `apply_chat_template(tokenize=True)` for every row — that equality is what makes the character offsets the mask is built from valid. Rows failing it are dropped, not silenced. - **0 user-turn leakage**: no terminal observation token is ever trained on. - 31.05 % of tokens trained (300-row independent audit), 31.16 % over the full pretokenized export. - Holdout is **group-disjoint** by construction: upstream `task` is unique per row (15,209 distinct over 15,209 rows), so no sibling of a held-out task is in train. Asserted at build time rather than assumed. Tokenizer: `Qwen/Qwen3.5-27B` — byte-identical across the five Qwen3.5 sizes (0.8B / 4B / 9B / 27B / 35B-A3B), so `pretokenized` is valid for any of them. ## Mixing with RST-SFT Identical canonical assistant form and identical mask semantics, so concatenation is safe. What differs, and matters for interpreting a mixed run: | | this dataset | `RST-SFT-Qwen3.5-27B` (`cap10`) | |---|---|---| | examples | 14,312 | 10,778 | | tokens | 100.2 M | 99.9 M | | assistant turns / row | 7.46 mean | 12.0 mean | | tasks | 14,312, one trajectory each | 1,329 groups, capped at ~10 each | | source models | 1 | 4 | | license | apache-2.0 | cc-by-4.0 | The task/trajectory ratio is the real difference: RST is many trajectories over few task lineages, this is one trajectory over many distinct tasks. Mixed, they are complementary — breadth of task from here, depth of horizon from there. > **Note for anyone diffing against `RST-SFT-Qwen3.5-27B`:** that dataset was > built before the two normalizations above. Every row it contains is > byte-identical under the current normalizer (verified over all 126,630 of its > assistant turns), so it is not wrong — it simply predates the recovery of ~492 > previously-dropped turns and would gain rows if rebuilt. ## Limitations - **Single source model.** All rows come from `QuantTrio/GLM-4.6-AWQ`, so this distills one policy's style, not a consensus. - **Not replay-verified here.** Upstream's own filtering is taken as given; no trajectory was re-executed and no verifier was re-run in producing this copy. - **Success-only, and one sample per task** — there is no within-task contrast, so this is not usable as a preference set. - 60 rows over 32,768 tokens were dropped, biasing mildly against the longest-horizon episodes. ## Attribution Derived from [`open-thoughts/OpenThoughts-Agent-v1-SFT`](https://huggingface.co/datasets/open-thoughts/OpenThoughts-Agent-v1-SFT) (Apache-2.0) by the OpenThoughts team, and released under the same license. Trajectories were reconstructed, assistant JSON normalized, stale warning preambles repaired, deduplicated, length-gated and pre-tokenized. No new rollouts were generated and no verifier was re-run.