Repository navigation
Conversation
…OmniJev
Non-generative `decision` task_type: a single forward pass scores every
option into calibrated per-option probabilities. transformers backend only.
- model: ScoringModelLoader + JEV/Clef/OmniJev heads; OmniJev two-stage
cached branch forward over the hybrid Qwen3.5 backbone + media compose
- template: decision encode/collate (train right- / infer left-padding)
- dataset: unified user schema, per-model preprocessor subclasses
- loss: ScoringLoss + JEV/Clef/OmniJev heads (masked soft-CE + ordinal RPS)
- trainer: ScoringTrainer re-activates and saves the fp32 head under LoRA
- examples/train/decision/{jev,clef,omnijev}.sh + dataset plugin + data
- tests/test_align: four-stage alignment harness vs each official oracle
Aligned to each official inference path: encoding byte-exact, head math
<=1e-7, full forward within bf16 tolerance, loss+grad vs re-derived formula.
… type, fix verbalizer head - Add DecisionAugmentConfig with drop_instructions, subsample_options, state_as_text, shuffle_fields augmentation options for decision datasets - Move generic_decision from MLLMModelType/MLLMTemplateType to LLMModelType/LLMTemplateType (loads AutoModelForCausalLM, not multimodal) - Fix JevVerbalizerHead token resolution: warn on multi-token labels instead of silently using first token; improve error message - Normalize JEV synonyms: yes/y/1 -> true, no/n/0 -> false - Wire augment_config through DataArguments, loader, and all decision preprocessors - Remove generic_decision from self-check dataset list
…dataset pipeline, add BestPractices docs, update alignment tests
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds three groups of changes to the typed-decision (System-1) subsystem:
1. Decision schema augmentation (
DecisionAugmentConfig)Adds training-time data augmentation for
decisiontask_type datasets:--decision_drop_instructions— randomly drop the question instruction text (layout still rendered), forcing the model to infer intent from options alone.--decision_subsample_options— subsample choice question options to at most N (gold + N-1 distractors), only forchoicequestions.--decision_state_as_text— randomly flatten dictstateto human-readable text instead of JSON, so the model sees different renderings of the same record.--decision_shuffle_fields— shuffle dict state field order and question order in multi-question records.All options are disabled by default (zero-cost passthrough). Wired through
DataArguments,loader.init_decision_augment, and allScoringPreprocessorsubclasses (ClefPreprocessor,JevPreprocessor,OmniJevPreprocessor,OpenJevPreprocessor).2. Move
generic_decisionto LLM typegeneric_decisionloadsAutoModelForCausalLM(a text-only model), not a multimodal model. Moved fromMLLMModelType/MLLMTemplateTypetoLLMModelType/LLMTemplateType. This fixes the model registration to match the actual loader behavior.3. Fix
JevVerbalizerHeadtoken resolutionPreviously,
get_verbalizer_tokensilently returnedids[0]when a label encoded to multiple tokens, even when only the first token was the intended verbalizer. Now:unk_token_idwith a warning explaining the degenerate case (multiple labels collapsing to the same unk id).Also normalizes JEV synonyms:
yes/y/1→true,no/n/0→false(previouslyyesandtruewere distinct).Files changed
swift/arguments/base_args/data_args.py— new CLI args +get_decision_augment_config()swift/dataset/preprocessor/decision.py—DecisionAugmentConfig,augment_decision_row(), wired intoScoringPreprocessorbaseswift/dataset/loader.py—init_decision_augment()injectionswift/dataset/dataset/llm.py—OpenJevPreprocessorsynonym normalization + augment passthroughswift/model/constant.py—generic_decision→LLMModelTypeswift/model/decision_head.py— verbalizer token resolution fixswift/model/models/decision.py— useLLMModelType.generic_decisionswift/template/constant.py—generic_decision→LLMTemplateTypeswift/template/templates/decision.py— useLLMTemplateType.generic_decisionswift/dataset/preprocessor/__init__.py— exportDecisionAugmentConfigexamples/train/decision/dataset.py— removegeneric_decisionfrom self-check