Skip to content

Format the SFT reasoning sets and build the SFT mix at the DATA.md shares - #74

Open
ChosenAN wants to merge 5 commits into
exea-labs:mainfrom
ChosenAN:post-train-sft-mix
Open

ChosenAN wants to merge 5 commits into
exea-labs:mainfrom
ChosenAN:post-train-sft-mix

Conversation

@ChosenAN

Copy link
Copy Markdown
  • exealm/data/post.py: adds openmath, opencode, openthoughts3-math/-code/-science and tulu3-safety. Each records its license and the revision checked on 2026-11-24, and was checked on 100 live rows (results/post_data/live_check.json). The thinking section is written the same way in every set; --think keep|strip and --max_think_chars control how much is kept. Rows cut off mid-thought, and OpenCodeReasoning rows with no license, are dropped and counted.
  • exealm/data/post_mix.py (new): samples the formatted files into DATA.md's seven Stage 1 buckets toward a token budget.
    • Tokens are counted with the 32k tokenizer exactly as sft.py trains on them.
    • Buckets with no data are reported as missing; the required --missing flag says whether their share stays empty or is spread over the other buckets.
    • Duplicates are dropped across sources, and --benchmark runs the existing 13-token overlap test from decontam.py.
    • The report gives rows and tokens per bucket and per file, target and achieved shares, and every drop reason.
  • Trial: a 2,705-row mix trained tiny for 20 steps, and its token counts match sft.encode exactly (results/post_data/mix_trial.json, lengths.json).
  • Findings for the lead:
    • 99% of reasoning traces are longer than sft.py's 1,024 tokens, so at the default cut they lose their answers.
    • Tulu 3's safety subsets fill under 1% of a 1.5B mix.
    • The 13-token benchmark test over-drops on runs of numbers and letters.
    • Decisions needed: --missing empty vs redistribute, and whether Tulu 3's 100k WildChat rows should fill the real-user bucket.
  • Docs and to-do lists are updated. The full 1–2B mix, WildChat and tool use remain open.
  • Tests: 24 new offline tests; pytest gives 289 passed, 6 skipped, on CPU.

Add openmath (nvidia/OpenMathReasoning, cot), opencode (nvidia/OpenCodeReasoning,
split_0) and openthoughts3-math/-code/-science (OpenThoughts3-1.2M, each domain from
its own data files) to exealm/data/post.py, plus tulu3-safety (the safety subsets of
the Tulu 3 mixture) for the SFT mix's safety bucket. The thinking section is written
one way in every set; --think strip keeps only the answer and --max_think_chars drops
long traces. Rows cut off mid-thought, and OpenCodeReasoning rows with no license,
are dropped and counted. Checked on live rows (results/post_data/live_check.json).
exealm/data/post_mix.py samples the files exealm/data/post.py writes into DATA.md's
seven Stage 1 buckets toward a token budget (--tokens, default 1.5e9). Tokens are
counted with the project's 32k tokenizer and sft.format_chat, cut to --max_len as
sft.py cuts them. Buckets with no rows (WildChat, tool use) are reported as missing;
--missing, which has no default, leaves their share empty or redistributes it. Exact
duplicates are dropped across files (--max_per_prompt caps answers per question), and
--benchmark runs the 13-token overlap test of decontam.py on each message. The report
gives rows and tokens per bucket and per file, target and achieved shares, and every
drop reason from post.py and the mix.
results/post_data/lengths.json: tokens per conversation in the chat template, on the
formatted samples. 99 to 100% of the reasoning rows are longer than sft.py's default
1,024 tokens (median thinking 6,400 to 15,000 tokens). results/post_data/mix_trial.json:
the report of a 2,705-row trial mix, whose token counts sft.encode reproduces exactly.
DATA.md says which Stage 1 buckets have data and what is still open (WildChat, tool
use, too little safety data, traces longer than sft.py's cut). docs/data.md explains
post_mix.py and what the trial mix showed, including the 13-token benchmark test's
false matches on number runs. The README to-do (and its Japanese copy) marks the mix
builder done and keeps the full 1 to 2B-token mix and WildChat open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant