Gradient-Free Few-Shot Adaptation of Vision Models via Agentic Coding
Khayrul Islam
Key points
From the paper's conclusion- Hence a coding agent can replace gradient descent only in part: inside the head and at five shots.
Abstract
Adapting a vision model to new classes from a few labeled images usually relies on gradient fine-tuning, which is unstable with so few images. We ask whether a coding agent can replace gradient descent for this task. We propose the Agent edit, a method in which a coding agent writes a program that sets the new class weights in the class head of a frozen COCO-trained detector, with no gradient step. The agent runs the detector on the labeled images a limited number of times and sees how much its edit lowers COCO mAP; the program rebuilds the weights without the agent. In the same head and with the same labels, the Agent edit outperforms full-decoder fine-tuning at five shots on 2 of four fine-grained sets, by 11.2 and 12.3 F1 points, and ties on the rest. At ten shots, fine-tuning ties with or outperforms it. Moreover, when the new classes are scored jointly with the COCO classes, the AP of the COCO class to which they belong falls by up to 33.3 points, and limiting that loss lowers F1 on the new classes. Most of the agent's programs share three parts, which we write as a formula that needs no agent. A classifier on frozen backbone features reaches a higher F1 than every method inside the head on every set. Hence a coding agent can replace gradient descent only in part: inside the head and at five shots.
Read the paper
Discussion
Science Skim's AI key points, plus readers' public thoughts
Readers' thoughts
No reader thoughts yet.
Related papers
- Few-Shot Adaptation of Vision-Language Models via Agentic Model EditingarXiv · 2026
- On the Few-Shot Adaptation of Vision-Language Models: A Few Gradient Signs Are All You NeedarXiv · 2026
- Simple Agents Outperform Experts in Biomedical Imaging Workflow Optimization.Proceedings. IEEE Computer Society Conference on Computer Vision and Pattern Recognition · 2026
- Fine-Tuning Without Gradients? Closed-Form, LLM-Written Classifiers on a Frozen EncoderarXiv · 2026
- Training-Only Heterogeneous Image-Patch-Text Graph Supervision for Advancing Few-Shot Learning AdaptersarXiv · 2026
- Text Is Just Another Shot in Vision-Language Models: Simple Probes on Frozen Encoders Do ItarXiv · 2026