Tuning Large Language Models for Real-World ApplicationsChapter 57

Step 7: Train

Section 7 of 13-~ 1 min read-Synced from Cuantum content
trainer.train()

Code Breakdown

  • This starts the supervised fine-tuning run using the configuration from Step 6.
  • With LoRA/QLoRA, training updates the adapter weights while the (quantized) base model stays frozen.
  • Watch the training loss. If it fails to decrease or becomes unstable, the first fixes are usually a smaller learning rate or shorter max_seq_length.

Training time will vary depending on dataset size and hardware.

Monitor GPU usage with:

nvidia-smi