AI Hints
Home›Fine-Tuning LLMs Tutorial›Interview Questions and Cheat Sheets
Fine-Tuning LLMs · Lesson 117 of 120

Cheat Sheet: Settings

Good starting values.

⏱ 2 min read▶ Video at 2:57:28🎓 Free
Watch this lesson in the Fine-Tuning LLMs courseWatch on YouTube ↗Full Fine-Tuning LLMs course

Settings can feel overwhelming. Here are good starting values, that work for most LoRA fine-tuning jobs.

  • Settings feel overwhelming
  • Good starting values
  • Work for most jobs

LoRA settings

For LoRA, start with rank sixteen, and alpha thirty two. Use a small dropout, like zero point zero five. And target all linear layers. These are safe defaults for most tasks.

SettingStart with
r16
lora_alpha32 (2 × r)
lora_dropout0.05
target_modules"all-linear"

Training settings

For training, use a learning rate around two times ten to the minus four, for LoRA. Start with one to three epochs. Use the largest batch that fits, with gradient accumulation for an effective batch of sixteen to thirty two. And evaluate every epoch.

SettingStart with
learning_rate1e-4 to 2e-4
num_train_epochs1 to 3
effective batch16 to 32
eval_strategy"epoch"

Generation settings

For generation, use do sample equals false, for structured output, like JSON. For creative text, use sampling, with a temperature around zero point seven. And always set max new tokens.

SettingStart with
JSON / labelsdo_sample=False
creative texttemperature 0.7
max_new_tokensjust enough
alwaysmodel.eval()

Summary

Let's recap. Rank sixteen, alpha thirty two, all linear layers. Learning rate two times ten to the minus four, one to three epochs. And greedy decoding for structured output. Next, the final quiz.

Key takeaways
  • r=16, alpha=32
  • lr 2e-4, 1–3 epochs
  • Greedy for JSON
Next up: Final Quiz — test yourself