You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
support training decision ("System One") models with SFTTrainer #7623
Decision models (Cloudflare Clef / Clef-flash, Perplexity pplx-decider, TypeSafe Jev, community Kev / JevK5 / Laya, Unsloth FastDecisionModel) are causal LMs + LoRA that answer a typed question (noul yes/no, choice, ordinal score) with a probability distribution over a fixed option set. No generation: one forward pass, logits at the answer position restricted to the option tokens, softmax.
Shared recipe: label-smoothed CE over restricted logits (+ Brier), Gaussian soft targets for ordinal levels, option permutation / none-of-the-above augmentation, temperature scaling.
Not sure if DecisionTrainer is a better approach. The recipe I hacked right now is a ~300-line SFTTrainer subclass, but a third of it exists only to bypass private APIs. Proposed primitives:
SFTConfig.extra_columns: list[str] — dataset columns kept through remove_unused_columns and the default collator (today: override _set_signature_columns_if_needed + collator).
A documented compute_loss contract or loss_fn hook, plus a public way to log extra metrics (today: self._metrics[mode]).
An examples/ recipe: Clef-style decision model with SFTTrainer.
Non-goals: new trainer, decision-specific dataset format, head module, GRPO changes (for a one-token policy the expected reward is closed-form; sampling is strictly worse).
Motivation
These models are shipping from Cloudflare, Perplexity and TypeSafe, and Unsloth already supports them; TRL cannot express the objective without private-API overrides. The blockers (pass-through columns, candidate-restricted loss, calibration metrics) are generic and hit anyone training a custom loss on SFTTrainer.
I read #4223, #4374, #7182 / #7254 and #5485 first: a standalone trainer would overlap ~90% with SFTTrainer and fail the usage/maintenance bar, and a "decision head" abstraction has the same risk as Judge. Small primitives plus a recipe match the "prototype outside, upstream on traction" path.
Feature request
Decision models (Cloudflare Clef / Clef-flash, Perplexity
pplx-decider, TypeSafe Jev, community Kev / JevK5 / Laya, UnslothFastDecisionModel) are causal LMs + LoRA that answer a typed question (noulyes/no,choice, ordinalscore) with a probability distribution over a fixed option set. No generation: one forward pass, logits at the answer position restricted to the option tokens, softmax.Shared recipe: label-smoothed CE over restricted logits (+ Brier), Gaussian soft targets for ordinal levels, option permutation / none-of-the-above augmentation, temperature scaling.
Not sure if
DecisionTraineris a better approach. The recipe I hacked right now is a ~300-lineSFTTrainersubclass, but a third of it exists only to bypass private APIs. Proposed primitives:SFTConfig.extra_columns: list[str]— dataset columns kept throughremove_unused_columnsand the default collator (today: override_set_signature_columns_if_needed+ collator).compute_losscontract orloss_fnhook, plus a public way to log extra metrics (today:self._metrics[mode]).examples/recipe: Clef-style decision model withSFTTrainer.Non-goals: new trainer, decision-specific dataset format, head module, GRPO changes (for a one-token policy the expected reward is closed-form; sampling is strictly worse).
Motivation
These models are shipping from Cloudflare, Perplexity and TypeSafe, and Unsloth already supports them; TRL cannot express the objective without private-API overrides. The blockers (pass-through columns, candidate-restricted loss, calibration metrics) are generic and hit anyone training a custom loss on
SFTTrainer.I read #4223, #4374, #7182 / #7254 and #5485 first: a standalone trainer would overlap ~90% with
SFTTrainerand fail the usage/maintenance bar, and a "decision head" abstraction has the same risk asJudge. Small primitives plus a recipe match the "prototype outside, upstream on traction" path.Related: #3871.
Your contribution
Happy to write PRs and work on an end to end implementation