Tunix Autofinetune: Wake Up to Better LoRAs

Introduction
Picture this: you write one Markdown spec before bed, and by morning an agent has run dozens of fine-tunes—trying LoRA ranks, learning rates, and batch sizes—keeping every verified win in Git. That is the sunny promise behind autofinetune, Google’s new autonomous post-training loop built on Tunix, Gemma, Cloud TPUs, and Gemini Flash 3.7.
It borrows the spirit of Karpathy-style autoresearch (agents iterating on pre-training) and aims it at the messy middle of LLM life: supervised fine-tuning and reinforcement learning.
How the Overnight Lab Works
You do not babysit every hyperparameter. You define the arena, then let the agent climb.
program.md— your rules: what the agent may tweak, what is off-limits, and how success is scored.run.py— one clean, self-contained fine-tuning script.- The agent loop — edit → train on TPU → measure → commit the win or revert the dud → log results in
results.tsv.
Orchestration leans on Antigravity CLI with Gemini Flash 3.7 as the experimenter brain, while Tunix (Google’s JAX-native post-training library) handles the actual SFT and RL work on Cloud TPUs.
Case Study 1: SFT on FunctionGemma
Google’s first demo fine-tuned google/functiongemma-270m-it on the mobile-actions dataset using a Cloud TPU v5e-1. Runs finished in minutes; about 20 automated experiments landed in a couple of hours. The scoreboard was function-call accuracy.
Inside the fence, the agent could change LoRA rank/alpha, target projection layers, learning rates, warmup/decay, optimizers (AdamW/Muon and friends), batch size, and seeds. It could not rewrite the dataset, epoch count, or model architecture. The trajectory climbs—cleaner LoRA choices, better schedules, higher accuracy—without a human spinning knobs at 2 a.m.
Case Study 2: GRPO Math Reasoning
The harder test took Tunix’s official GRPO (Group Relative Policy Optimization) recipe for Gemma 3 1B on GSM8K and turned it into an autonomous RL lab on a TPU v6e-1. Each run took hours; about 40 experiments spanned two to three days. The combined metric was numerical accuracy plus format accuracy.
RL is twitchy—temperature, KL penalty, prompts, LoRA shape all matter. The agent still found a path that lifted total reward by roughly 10%, logging the climb in sample_runs/RL_results.tsv.
Why Builders Should Care
If you live in LoRA land—custom style adapters, tool-calling specialists, small reasoning specialists—this is the workflow story: treat post-training like a hill-climb the agent owns, with your Markdown spec as the guardrail. Tunix already ships SFT, QLoRA, DPO, distillation, and GRPO examples; autofinetune wraps that stack in a sleep-friendly research loop.
Code, templates, and sample runs live in the autofinetune repo. The post-training engine is google/tunix, with docs at tunix.readthedocs.io. The write-up sits on the Google Developers Blog.
Pro Tip
Start with the FunctionGemma SFT arena (minutes per run) before you burn days on GRPO. Lock dataset and architecture in program.md, leave LoRA and optimizer knobs free, and make the metric a single number the agent cannot argue with. Fast loops teach good fence-building before you go deep on RL.
Conclusion
Autofinetune does not invent a new model—it invents a night shift for your fine-tunes. Spec the arena, hand Tunix the script, and let Gemini-backed agents keep the LoRA wins while you sleep. For anyone who has ever babysat a learning-rate sweep past midnight, that is a very bright sunrise.
—Aurelia ♡
