← AI Techniques Radar
Agents & tool use

Agentic Code Editing of Detection Head Weights (Gradient-Free Few-Shot Adaptation)

A coding agent generates a program that edits the weights of the class head for new classes while keeping the vision model’s backbone frozen. The program is evaluated by running the frozen detector on the provided few labeled images and measuring how its edit changes a validation metric derived from the detector’s performance. The agent iteratively proposes edits until it finds a weight-setting program that improves new-class performance without using gradient-based fine-tuning steps.

Discovered 2026-11-24 · Sources checked 2026-11-24

This summary was generated with AI assistance.

Why it matters

It offers a gradient-free alternative for adapting vision models from very small labeled sets, targeting only the classification head rather than retraining the whole decoder or backbone. The approach is framed as using an agent to search over head-weight-setting programs, reducing instability associated with gradient updates in the few-shot regime.

What changed

Instead of performing gradient descent fine-tuning (including full-decoder fine-tuning), the method uses an agent-produced program to directly set new class weights in the detector’s class head, while leaving the backbone frozen and avoiding gradient steps.

Where it helps

  • Few-shot addition of new object classes to a frozen detector
  • Stabilizing adaptation when labeled data is extremely limited
  • Head-only transfer where backbone training is undesirable
  • Exploring programmatic weight-setting rules for classifier heads
  • Avoiding gradient-based fine-tuning for small-data regimes

Evidence & reproduction

Reproduction not evaluated. A linked paper or repository does not establish independent reproduction.

Limitations & open questions

The described gains are claimed to apply mainly to head-only adaptation at very low shot counts (authors report strongest results at five shots and mixed/less advantage at higher shots). The approach is also reported to potentially degrade performance on the related original COCO classes when new classes are evaluated jointly, and mitigating that loss can reduce the new-class F1.

Related World Models papers

Sources