Loss Down, Loops Up: Fine-tuning a Gemma 4 31B coding agent on teacher trajectories lowered validation loss and cost solved tasks at both sampling settings we tested
Year: 2026
Type: preprint
Abstract: We fine-tuned Gemma 4 31B with a LoRA adapter on 240 successful teacher trajectories converted to the competition's repository-repair harness. Validation loss fell from 0.6375 to 0.2597. On the same 72 solvable FastAPI and Rich tasks, the fine-tuned agent solved fewer tasks than the base model at both sampling settings we ran: 15 versus 29 at temperature 0.2 (exact paired p = 0.00012) and 20 versus 32 at Gemma's recommended sampling of temperature 1.0, top-p 0.95, top-k 64 (p = 0.0075). How it failed depended on sampling. At temperature 0.2 it often submitted nothing (nonempty patches 31 versus 57), and full traces of 20 tasks show repetitive long generations or action loops in 16 fine-tuned runs and no base runs. At temperature 1.0 it submitted as often as the base model (58 versus 58), 11 of the 15 tasks it lost ended with a wrong patch, and the same signatures appeared in 21 of 72 fine-tuned runs versus 3 base runs. At temperature 0.2, instructions, oracle location hints and a doubled budget did not restore patch delivery. We turn these measurements into a pre-deployment check for fine-tuned tool-using agents. Code and data: https://www.kaggle.com/datasets/watermelon696969/gemma4-agent-loss-down-loops-up
Author: Wu, Chen-Yen
Institution: Chung Yuan Christian University
Language: English
Subfield: Information Systems
Field: Computer Science
Domain: Physical Sciences
Open Access status: green
OpenAlex ID: W7235292164
