EmbeddingGemma 2 fine-tuning with Unsloth and LoRA

Learn embedding fine-tuning with paired data, duplicate-free batches and source-based tests. The presenter trains audio adapters on an A100 in Colab.

Player not loading? Watch on YouTube

This tutorial uses Unsloth and LoRA to fine-tune EmbeddingGemma 2 for sound classification and search over YouTube transcripts. Unlike LLM training with target answers, embedding training brings matching inputs closer together. The presenter explains question-passage pairs, in-batch negatives and why a no-duplicates sampler prevents matching passages from becoming false negatives. Training and search must use the same prompt format.

The notebook runs on an A100 GPU in Colab. For ESC-50 environmental sounds, the presenter reports top-1 accuracy rising from 24.5% to 65.8% after about seven and a half minutes. A separate test withheld ten sound classes; those classes did not improve. That result limits the evidence for broader audio generalization.

For transcript search, the presenter builds pairs from 120 videos and splits training and evaluation by video. Reported top-1 retrieval improves from 66.3% to 75.0% after less than three minutes of training. Both experiments lose about four points on general text search, a reason to check other uses of the shared multimodal backbone.

The walkthrough also covers an audio adapter reload problem in the version used: its saved processor truncated clips. Reusing the base model's processor fixed the issue in the presenter's test.