๐งฐ Feature Scaffolds
Each swift command corresponds to one kind of feature. Pick the feature first, then pick a model by the task types it supports, and finally pick a dataset. The result is a command that runs directly. <model> and <dataset> in the commands are to be filled in. <adapter_dir> in the merge command is the training output directory. The other arguments come from the corresponding example scripts.
For the task types of a model see the Task Type column of the model table in Models and datasets. It decides which commands the model can be used with:
| Task Type | Meaning | Available commands |
|---|---|---|
causal_lm | General generative model | swift pt, all task types of swift sft, all algorithms of swift rl, plus inference, merge, deploy, export, and eval |
seq_cls | Reward model family (single-logit scoring head) | swift rl --rl_type rm, inference, and deploy |
embedding | Task-dedicated embedding model | swift sft --task_type embedding, inference, and deploy |
seq_cls / embedding | Bare encoder backbone (BERT / ModernBERT, etc.; it cannot generate) | swift sft --task_type seq_cls (--num_labels must be given as well) or --task_type embedding, inference, and deploy |
reranker | Task-dedicated reranker model | swift sft --task_type reranker, inference, and deploy |
decision | Task-dedicated decision scoring model | swift sft --task_type decision, inference, and deploy |
When a general generative model is given --task_type seq_cls, --num_labels must be given as well. When embedding, reranker, or generative_reranker is specified, the data must use the input format of that task. See Custom datasets.
๐งฐ Assembling commands
CUDA_VISIBLE_DEVICES=0 \
swift pt \
--model Qwen/Qwen3.5-4B \
--dataset 'AI-ModelScope/ruozhiba#2000' \
--tuner full \
--max_length 1024 \
--output_dir output/ptDatasets filtered by tag๏ผpretrain
The templates keep only the arguments that decide the feature. For the full training arguments, multi-GPU and multi-node configuration, and the code form with the complete training loop, see the example directory of each feature.