Instruction fine-tuning a small LLM
Instruction-tunes Pythia-70M on a documentation Q&A set and evaluates it against base models.
What it does
Q&A pairs from the Lamini documentation dataset are formatted with question and answer prompt templates, tokenised with padding and truncation and split 90/10. Pythia-70M is trained with the Hugging Face Trainer, compared with base and instruction-tuned Llama 2 outputs, and evaluated by exact match on the test split and on ARC-Easy through lm-evaluation-harness.
What was built
- 01
Alpaca and Lamini docs examples are hydrated into instruction prompt templates and saved as JSONL.
- 02
Tokenizer pads with the EOS token, truncates to 2048 tokens and adds labels before a 90/10 split.
- 03
Trainer fine-tunes Pythia-70M for a few steps; a longer-trained checkpoint is compared on the same questions.
- 04
Evaluation runs exact-match checks on test questions and ARC-Easy via lm-evaluation-harness.
The pipeline, layer by layer
Four layers, one pipeline.
L1Data
- Lamini docs Q&A
- Prompt templates
L2Preparation
- Tokenise, pad, truncate
- Train-test split
L3Training
- Pythia-70M fine-tuning
L4Evaluation
- Exact match
- ARC-Easy harness