Few-shot adaptation transfers pretrained Vision-Language Models (VLMs) to new domains using a small set of labeled images. Most methods fit prompts, representations, or classifiers within an adaptation procedure specified in advance. Yet the visual distinctions needed for recognition can differ substantially across domains, motivating the question: Can an LLM agent use few-shot examples and model observations to design the adaptation procedure itself? We propose Agentic Model Editing (AME), an agentic framework that jointly designs input transformations, encoder edits, feature computation, and classifier fitting as an executable, domain-customized adaptation program. The agent inspects images, class semantics, model parameters, intermediate representations, and activations to formulate hypotheses about the target task. It implements and tests candidate programs on the support set, with aggregate validation accuracy guiding refinement and selection. Each program fits a complete domain model that is fixed before testing. The agent and its tools are shared across domains, while each domain receives its own adaptation program. Across eleven datasets with CLIP ViT-B/16, AME achieves the highest average accuracies of 81.2% without back-propagation and 81.9% with back-propagation among the compared methods. Further experiments demonstrate applicability across VLM backbones and LLM agents.
Figures & tables
Figure 1: Conventional few-shot adaptation applies a predefined algorithm across domains (a). AME instead uses a shared LLM agent to design a domain-customized adaptation program from labeled examples and observations of the pretrained model (b).
Figure 2: Overview of AME . (a) Inputs and tools expose labeled target examples and the pretrained VLM. (b) The agent inspects images, class semantics, weights, representations, and activations to formulate, implement, and test model-editing hypotheses on the support set. Each experiment guides the next round of observation and editing. (c) External feedback guides refinement and selection for deployment.
Method
Caltech
Pets
Cars
Flowers
Food
SUN
DTD
EuroSAT
UCF
Aircraft
ImageNet
Avg.
Zero-shot
93.3
88.2
65.5
67.4
85.3
62.5
44.4
42.1
65.2
23.9
66.7
64.1
Tip-Adapter
94.3 ±0.1
90.7 ±0.8
72.0 ±0.5
93.5 ±0.8
86.1 ±0.3
70.5 ±0.3
62.5 ±1.2
71.8 ±2.5
76.0 ±0.4
35.6 ±1.3
70.1 ±0.1
74.8 ±0.2
APE
95.3 ±0.1
91.6 ±0.5
75.9 ±0.6
94.6 ±0.4
86.5 ±0.1
73.6 ±0.2
66.8 ±3.0
73.4 ±2.9
80.1 ±1.5
38.5 ±0.5
71.4 ±0.1
77.0 ±0.5
TIP-X
94.7 ±0.6
91.9 ±1.0
75.0 ±0.3
93.9 ±0.7
86.3 ±0.1
71.7 ±0.4
63.8 ±0.1
73.2 ±3.6
78.0 ±0.4
37.9 ±0.7
70.2 ±0.2
76.1 ±0.2
GDA
94.6 ±0.5
92.1 ±0.1
77.8 ±0.2
97.2 ±0.0
86.7 ±0.3
74.0 ±0.2
67.3 ±0.7
83.5 ±3.5
82.2 ±1.0
43.8 ±1.1
71.5 ±0.1
79.2 ±0.3
LBBO
93.6 ±0.0
91.3 ±0.2
66.5 ±0.8
72.1 ±0.4
86.1 ±0.1
65.1 ±0.1
46.7 ±0.8
50.8 ±2.1
67.7 ±0.1
25.2 ±0.7
68.1 ±0.3
66.7 ±0.3
Table 1: BP-free few-shot adaptation accuracy (%) using CLIP ViT-B/16 with k=8 labeled images per class. Bold and underlined values indicate the best and second-best displayed results, respectively.
Method
Caltech
Pets
Cars
Flowers
Food
SUN
DTD
EuroSAT
UCF
Aircraft
ImageNet
Avg.
Zero-shot
93.3
88.2
65.5
67.4
85.3
62.5
44.4
42.1
65.2
23.9
66.7
64.1
Tip-Adapter-F
95.0 ±0.2
91.8 ±0.4
78.1 ±0.9
94.6 ±0.5
86.7 ±0.2
73.2 ±0.4
66.9 ±0.8
77.6 ±4.5
82.1 ±1.1
38.8 ±1.4
71.6 ±0.1
77.9 ±0.3
CoOp
94.3 ±0.4
91.5 ±0.9
79.4 ±0.7
94.7 ±0.4
82.9 ±0.4
71.7 ±0.6
65.1 ±1.2
77.7 ±3.2
80.1 ±0.8
38.6 ±1.1
69.6 ±0.1
76.9 ±0.1
MaPLe
95.1 ±0.4
93.1 ±0.5
71.3 ±0.4
89.2 ±0.7
87.3 ±0.1
73.1 ±0.3
62.3 ±0.7
78.5 ±1.8
79.2 ±0.5
33.2 ±0.6
71.4 ±0.2
75.8 ±0.1
CLAP
95.2 ±0.2
92.5 ±0.3
79.0 ±0.3
95.4 ±0.5
87.0 ±0.1
74.5 ±0.3
67.8 ±0.2
77.1 ±4.6
82.7 ±0.7
40.7 ±0.8
71.4 ±0.0
78.5 ±0.4
2SFS
95.9 ±0.4
93.1 ±0.2
81.3 ±0.6
96.3 ±0.1
86.3 ±0.4
75.6 ±0.2
69.3 ±0.7
88.0 ±2.4
84.4 ±1.1
44.6 ±1.0
72.3 ±0.0
80.6 ±0.1
Table 2: Few-shot adaptation accuracy (%) with back-propagation enabled using CLIP ViT-B/16 with k=8 labeled images per class. Bold and underlined values indicate the best and second-best displayed results, respectively.
Figure 3: Effects of external feedback on UCF101, Caltech101, and the eleven-domain average. At each round, validation accuracy selects among candidates submitted so far; curves show their test accuracies with one standard deviation. The initial program is submitted before receiving external feedback.
Method
DTD
Caltech
Aircraft
EuroSAT
Cars
Avg.
Zero-shot
61.4
97.5
36.6
39.0
85.0
63.9
APE
73.4 ±1.6
98.3 ±0.2
59.0 ±1.0
73.6 ±2.6
90.2 ±0.7
78.9 ±0.2
GDA
74.7 ±1.5
98.2 ±0.2
66.0 ±0.8
83.9 ±3.3
92.8 ±0.6
83.1 ±0.6
TIMO
76.3 ±2.6
98.3 ±0.2
64.7 ±0.8
83.6 ±2.9
92.2 ±0.1
83.0 ±0.1
CDPS
75.0 ±0.8
98.1 ±0.4
61.8 ±1.3
74.4 ±1.6
88.4 ±0.2
79.5 ±0.3
Ours
78.0 ±0.8
98.4 ±0.2
69.6 ±2.0
89.1 ±1.4
92.9 ±0.7
85.6 ±0.7
Table 3: Adaptation results of AME on another contrastive VLM, SigLIP2-Base/16 , under the BP-free setting averaged across three random seeds. We bold the best and underline second-best.
Method
DTD
Caltech
Aircraft
EuroSAT
Cars
Avg.
Zero-shot
50.9
87.3
19.2
51.8
41.4
50.1
LBBO
50.7 ±0.4
87.2 ±0.1
20.3 ±0.0
52.3 ±0.2
41.0 ±0.4
50.3 ±0.0
IPO
50.6 ±0.2
87.5 ±0.1
20.0 ±0.1
54.1 ±1.3
42.4 ±0.3
50.9 ±0.3
SAVs
73.7 ±0.5
97.2 ±0.1
54.3 ±1.3
76.8 ±3.3
83.6 ±0.4
77.1 ±0.6
MPO
51.4 ±0.9
89.8 ±2.2
20.3 ±0.5
55.6 ±2.0
40.8 ±0.9
51.6 ±0.6
Ours
77.2 ±0.9
98.4 ±0.3
68.8 ±1.7
89.6 ±1.3
92.1 ±0.1
85.2 ±0.6
Table 4: Adaptation results of AME on an instruction-following generative VLM, Qwen3-VL-4B-Instruct , under the BP-free setting averaged across three random seeds. The best and second-best results are bold and underlined , respectively.
Method / Agent
DTD
Caltech
Aircraft
EuroSAT
Cars
Avg.
Zero-shot
44.4
93.3
23.9
42.1
65.5
53.8
GPT-6-luna
70.3 ±1.8
95.4 ±0.0
42.8 ±1.9
86.5 ±1.1
79.1 ±0.6
74.8 ±0.2
GPT-6.1-terra
70.8 ±2.3
95.9 ±0.2
42.6 ±3.1
88.9 ±0.5
78.2 ±0.7
75.3 ±1.0
GPT-6.1-sol
71.3 ±0.7
95.9 ±0.2
46.0 ±0.9
89.5 ±1.4
80.5 ±0.2
76.6 ±0.3
Table 5: Adaptation results on CLIP ViT-B/16 under the BP-free setting using different LLM agent backends. The best and second-best results are bold and underlined , respectively.
Figure 4: Percentage of visual-encoder parameters changed in the final adapted model. Most pretrained parameters remain unchanged, and the editing ratio varies across domains.
Figure 5: Single-run EuroSAT case with CLIP . (a) Misclassified support images and margins across encoder layers; blue/red indicate correct/incorrect predictions. (b) Summary connecting layer representations, an MLP correction, and feature fusion.
Figure 6: Single-run Aircraft case with SigLIP2 . (a) Inspected support images and native pooling attention. (b) Summarized agent analysis connecting within-class MLP residual variation with a rank-8 encoder edit and feature fusion.
Institute of Artificial Intelligence, Huazhong University of Science and Technology, Wuhan, China · School of Computer Science and Technology, Huazhong University of Science and Technology, Wuhan, China.