Learning Fine-tuning

LAMINI

Fine-tuning principles

img

img

img

Benefits

img

Tasks

img

img

Instruction finetuning

Definition

img

Data generation

img can use open-source tools or chatgpt

Training process

img

for epoch in range(epochs):
    for batch in train_dataloader:
        outputs = model(**batch)
        loss = outputs.loss
        loss.backward()
        optimizer.step()

Evaluation

Introduction

img

Benchmarks

img

Error Analysis

img

Conclusion

Practical approach to finetuning

  1. figure out your task
  2. collect data related to the task’s inputs/outputs
  3. Generate data if you don’t have enough data
  4. finetune a small model (400m - 1b)
  5. vary the amount of data you give the model
  6. evaluate your LLM to know what’s going well vs not
  7. collect more data to improve
  8. increase task complexity
  9. increase model size for performance

img

img