Exercises
ex-sp-ch37-01
EasyCompute the number of trainable parameters for LoRA with r=16 applied to Q,K,V,O projections of a model with d=4096 and 32 layers.
ex-sp-ch37-02
EasyConvert 10 wireless Q&A pairs into the instruction-tuning format with system, user, and assistant roles.
ex-sp-ch37-03
EasyCalculate GPU memory requirements for full fine-tuning vs LoRA vs QLoRA for a 7B model.
ex-sp-ch37-04
EasyImplement a simple character-level GPT (1M params) following nanoGPT style and train on 100KB of text.
ex-sp-ch37-05
MediumFine-tune a 3B model on a wireless Q&A dataset using LoRA (r=8). Compare performance before and after fine-tuning.
ex-sp-ch37-06
MediumImplement the LoRA forward pass from scratch (without PEFT library). Show that merging adapters reproduces the same output.
ex-sp-ch37-07
MediumTrain the same model with LoRA ranks r=1, 4, 16, 64 and plot validation loss vs rank.
ex-sp-ch37-08
MediumImplement instruction tuning with proper loss masking (only on response tokens). Compare with naive full-sequence loss.
ex-sp-ch37-09
MediumBuild a data quality pipeline: deduplicate, filter, and score instruction-response pairs using an LLM judge.
ex-sp-ch37-10
HardFine-tune a 7B model with QLoRA and benchmark against the base model on 3GPP terminology comprehension.
ex-sp-ch37-11
HardImplement curriculum learning for fine-tuning: start with easy examples and gradually increase difficulty.
ex-sp-ch37-12
HardTrain a domain-adapted tokenizer on telecom text and compare token efficiency with GPT-2's tokenizer.
ex-sp-ch37-13
HardImplement DPO alignment on your fine-tuned model using synthetic preference data generated by a stronger model.
ex-sp-ch37-14
ChallengeTrain a small multimodal model that can analyze constellation diagram images and identify the modulation scheme.
ex-sp-ch37-15
ChallengeBuild a complete fine-tuning pipeline: data curation, training with LoRA, evaluation on multiple benchmarks, and model merging.