Goal: Build a LoRA adapter with Hugging Face PEFT, empirically compare trainable-parameter counts against full fine-tuning, sweep rank and target-module choices to observe their tradeoffs, then merge your adapter into a standalone model and benchmark it against the adapter+base setup — all using free, local/Colab tools. Steps:
transformers, peft, datasets, and accelerate. Work through the official Hugging Face LLM Course notebook on LoRA fine-tuning via PEFT, adapting it to a small base model (for example, a model in the 100M–1B parameter range) so it fits comfortably on a free-tier GPU.LoraConfig with r=8 and alpha=16 (following the alpha = 2r guideline), targeting the attention projection modules. Wrap the base model with get_peft_model() and call .print_trainable_parameters(). Record the trainable-parameter count and the percentage of the total this represents.target_modules from attention-only to all-linear (or explicitly include the MLP/feed-forward projection layers). Record the new trainable-parameter count and training loss, and compare qualitatively against the attention-only run from Step 3.merge_and_unload() to produce a standalone merged model. Time inference (e.g., average time per generation over 5–10 prompts) for the merged model versus the unmerged adapter+base setup, and compare output quality between the two — they should be functionally identical.Deliverables: Submit your Colab notebook (.ipynb, shared link or file upload) with all cells executed and outputs visible, plus your written report (as a text entry or attached document) containing the configuration comparison table and your analysis.