PythiloLesson 2 of 6 · progress kept in this browser

Practice in Lab: Project: Train query/value LoRA adapters →

Download complete project source →

Project: Train query/value LoRA adapters

A small adapter is meaningful only together with its exact base model and tokenizer. Insert LoRA into the query and value projections in both encoder layers, freeze all original encoder weights, and optimize only A, B and the classification head. Zero-initialize B so the adapter initially preserves the pretrained projection. The project proves that frozen parameters remain unchanged and reloads the adapter for numerical comparison.

Your task

Freeze BERT, insert rank-four Q/V adapters, train the classifier and export the exact base/tokenizer identity. Implement run_project(output, quick=False). Follow the reference report/artifact schema; the checks run quick=True with actual pretrained weights and real data. The full dataset is the default.

This lesson uses pythilo_finetune and torch, which Python in this browser does not include. Read it here, and run and check it in the Pythilo app on iPhone or iPad.