📱 FunctionGemma 270M — Mobile Actions SFT
Fine-tune Google's FunctionGemma 270M-IT to turn phone requests
("turn on the flashlight", "schedule a team meeting tomorrow at 4pm") into
function calls, using the gated google/mobile-actions
dataset and TRL's SFTTrainer.
This is a full fine-tune (no LoRA) in prompt/completion format with
completion_only_loss=True, so loss is computed only on the assistant's call.
The chat template is applied with the dataset's tools= schema. Pick a request,
run SFT, and watch the exact-match function-call accuracy go up.
Omitted from the original notebook: Hugging Face Hub upload and the
.litertlm / ai-edge-torch on-device conversion (not Space-friendly).
⚙️ Controls
Try one
1 3
50 1000
10 100
0.000001 0.00005
1 8
1 16
64 512
0 1
🔍 Results
- Greedy decoding (temperature 0) is best for function calling — you want the single most likely call, not a creative one.
- Exact-match accuracy is a lower bound: a call with equivalent arguments
(e.g. a slightly reworded
query) counts as wrong but may still be acceptable. - A GPU is strongly recommended. On CPU, training and scoring will be slow — shrink the train/eval subsets.