Config-Driven Fine-Tuning
A fine-tuning script is thirty lines of library calls and forty of configuration. These tools delete the thirty, leaving a YAML file that is diffable, shareable, and hard to get subtly wrong.
Standing
Commonly usedEstablished and frequently the right choice, but competing with live alternatives rather than having settled the question.
How most fine-tuning outside research labs is actually run. The specific projects change; the pattern of a declarative config over the same underlying libraries does not.
judged as of 2026-09 · what the labels mean
Theory
Nothing in these tools is novel. They are PEFT and TRL underneath, with Accelerate or DeepSpeed for the distributed layer. What they add is that the run is described by a file rather than by a program.
base_model: meta-llama/Llama-3.1-8B-Instruct
load_in_4bit: true
adapter: qlora
lora_r: 32
lora_alpha: 64
lora_target_linear: true # every projection, not a hand-written list
datasets:
- path: ./data/train.jsonl
type: chat_template # applies the model's own turn format
field_messages: messages
sequence_len: 4096
sample_packing: true # concatenate short examples, mask across
train_on_inputs: false # loss on the response only
micro_batch_size: 2
gradient_accumulation_steps: 8 # effective batch 16
num_epochs: 3
learning_rate: 2e-4
warmup_ratio: 0.03
deepspeed: deepspeed_configs/zero3.jsonWhy this is better than a script
The defaults are correct. train_on_inputs: false masks the loss on prompt
tokens. type: chat_template uses the tokeniser’s own format. Both are one line
here and both are silent failures when hand-rolled — a model trained to predict
its own prompts, or trained with the wrong turn markers, produces a plausible
loss curve and a worse model.
Packing is handled. sample_packing concatenates short examples to fill the
sequence, with attention masked across the boundaries so they cannot see each
other. Substantially faster on short-example datasets, and getting the mask wrong
is the classic way to leak between samples.
Runs are reproducible. The config is the experiment. It goes in git, it diffs, and someone else can rerun it.
Multi-GPU is a line. DeepSpeed ZeRO or FSDP as a config key, rather than a launcher script per topology.
What it is not for
Anything unusual. A custom loss, a modified architecture, a non-standard data pipeline — the config surface covers what the authors anticipated, and past that you are patching the tool rather than using it. At that point write the script.