Can Fine-Tuned Vision-Language Models Generalize Across Tasks on the Same Images?

Date:

Pilot experiments at Research notes, Riverside, CA

A detailed caption can generate many questions about an image. But how many of those questions do we need for useful training? If a model learns to count objects, does it also learn to locate them? If it learns to count objects of one color, can it count objects of a particular shape?

These questions matter because training data often treats each image-question pair as a separate example, even when several questions draw on the same visual content. I ran a small experiment to see whether fine-tuning on one task transfers to other tasks over the same images.

Many vision-language models (VLMs) use a vision encoder aligned with text through a contrastive objective such as CLIP. Pooling patch-level image features can discard fine detail, while captions used during alignment may leave out details that later tasks require. Despite this, VLMs can perform well on OCR. Their weaknesses are more visible on tasks that depend on precise visual relationships, such as chart understanding and spatial reasoning.

Experiment question

The experiment asks whether training on a subset of questions can help a model use an image more broadly. For example, does training on object counts transfer to locating objects, or does training on color counts transfer to shape counts?

The central idea is image reuse during training: when one image supports many possible questions, does a model benefit from seeing more of those questions, or can a few representative tasks teach it to use the image more effectively?

Synthetic task design

To control the visual details and question types, I generated 1,000 scenes in Blender using this script. Each scene contains 3–8 objects with randomized shapes, colors, materials, and sizes. Here is one example of the scene attributes:

{
  "shapes": ["cube", "sphere", "cylinder"],
  "colors": ["gray", "red", "blue", "green", "brown", "purple", "cyan", "yellow"],
  "materials": ["rubber", "metal"],
  "sizes": ["large", "small"]
}

I designed eight tasks:

  • Extreme material, color, or shape: identify the property of the leftmost, rightmost, farthest, or nearest object.
  • Extreme all: identify the leftmost, rightmost, farthest, or nearest object and report its size, color, material, and shape.
  • Count material, color, or shape: count objects with a specified property.
  • Count relative to: count objects positioned to one side of, closer than, or farther than a specified object.

For people, I expected relative counting to be hardest because it requires finding a reference object before counting. Simple property counts should be easier, followed by identifying one property at an extreme. Identifying all four properties of an extreme object also requires a longer, precisely formatted answer, which may make it difficult for a VLM.

Data and models

I used 800 images for training and held out 200 for testing. For evaluation, I sampled up to 1,500 questions per task from each split. I compared training on all eight tasks with training on one task at a time, including a balanced setting with about 188 examples per task (roughly 1,500 total).

The models were Qwen2-VL-2B-Instruct and Llama-3.2-11B-Vision-Instruct, both in 4-bit form. I fine-tuned each model for two epochs with QLoRA using Unsloth, keeping the vision encoder frozen. The in-domain evaluation uses images seen during training; the out-of-domain evaluation uses the held-out images.

Results at a glance

The results suggest that fine-tuning can transfer across tasks on these synthetic scenes, though the size and direction of that transfer depend on the model and task. In the Llama evaluation, training on the Extreme Color task reached about 58% of the gain from training on all eight tasks, while also improving several other tasks.

A few patterns stood out:

  • Training on all tasks together generally performed best.
  • For Llama, performance was similar on the in-domain and held-out image sets, suggesting that the gains were not limited to memorizing the training images.
  • With a budget of roughly 1,500 examples, training on Extreme Color performed comparably to splitting the budget across all eight tasks in the reported comparison.
  • Qwen2-VL-2B showed little or inconsistent improvement on several tasks, suggesting that transfer also depends on the model’s starting capabilities.

These are pilot results from a controlled synthetic setting. They do not establish that the same transfer patterns will hold for natural images or other models, but they offer a useful way to study how much visual skill a model can reuse across tasks.

Detailed results

In-domain evaluation

Baseline and fine-tuned accuracy for Llama-3.2-11B-Vision-Instruct. Each cell shows accuracy.

In-domain accuracy across tasks and training settings for Llama-3.2-11B-Vision-Instruct.

Cross-task transfer after fine-tuning Llama-3.2-11B-Vision-Instruct on one task. Each cell shows the fraction of the improvement from full fine-tuning recovered by one-task fine-tuning:

(one-task accuracy − baseline accuracy) / (all-task accuracy − baseline accuracy) × 100%

Cross-task transfer scores for Llama-3.2-11B-Vision-Instruct on in-domain images.

Held-out images

Baseline and fine-tuned accuracy for Llama-3.2-11B-Vision-Instruct on held-out images. Each cell shows accuracy.

Accuracy across tasks and training settings for Llama-3.2-11B-Vision-Instruct on held-out images.

Cross-task transfer on held-out images after fine-tuning on one task, using the same transfer score defined above.

Cross-task transfer scores for Llama-3.2-11B-Vision-Instruct on held-out images.

Strongest cross-task transfer

Held-out images. Yellow marks the test task that benefited most from each training task, excluding the matching task.

Held-out cross-task transfer matrix with the strongest transfer for each training task highlighted.

Show complete per-task results for both models (four tables)

Complete score tables

Each cell reports accuracy; N is the number of questions. “All tasks” columns show multitask fine-tuning with two data budgets. The remaining columns show fine-tuning on one task at a time.

Qwen2-VL-2B-Instruct-bnb-4bit

In-domain images

TaskNBaselineAll (1,500/task)All (188/task)Extreme materialExtreme colorExtreme shapeExtreme allCount materialCount colorCount shapeCount relative
Extreme Material3640.51373626373626370.475274725274725250.53571428571428570.48076923076923080.55769230769230770.52747252747252750.412087912087912070.5549450549450550.5109890109890110.50549450549450550.554945054945055
Extreme Color4200.111904761904761910.15238095238095240.150.13809523809523810.154761904761904770.140476190476190480.116666666666666670.17380952380952380.145238095238095250.16190476190476190.14285714285714285
Extreme Shape3780.317460317460317440.34126984126984130.304232804232804240.3280423280423280.309523809523809530.312169312169312150.298941798941798950.34391534391534390.362433862433862440.346560846560846570.3862433862433862
Extreme All4120.0145631067961165050.0097087378640776690.016990291262135920.114077669902912630.0097087378640776690.00485436893203883450.00485436893203883450.0072815533980582530.0121359223300970870.0097087378640776690.012135922330097087
Count Material1840.23913043478260870.250.244565217391304350.0108695652173913040.244565217391304350.250.250.25543478260869570.217391304347826080.244565217391304350.1956521739130435
Count Color3860.272020725388601060.075129533678756480.075129533678756480.124352331606217610.044041450777202070.116580310880829010.383419689119170960.0544041450777202060.51036269430051820.336787564766839350.0
Count Shape2610.28352490421455940.229885057471264360.229885057471264360.233716475095785440.229885057471264360.260536398467432930.29501915708812260.229885057471264360.33333333333333330.31034482758620690.0038314176245210726
Count Relative To3950.093670886075949370.164556962025316440.164556962025316440.0151898734177215180.16708860759493670.19493670886075950.210126582278481020.172151898734177220.164556962025316440.154430379746835430.22025316455696203

Held-out images

TaskNBaselineAll (1,500/task)All (188/task)Extreme materialExtreme colorExtreme shapeExtreme allCount materialCount colorCount shapeCount relative
Extreme Material4000.530.5050.52250.50250.48250.49750.44750.5150.50.49750.495
Extreme Color4000.08250.15250.12750.14250.1650.15250.0650.17250.150.15750.15
Extreme Shape4000.3350.350.340.35250.35750.33750.310.32750.32250.3450.3075
Extreme All4000.0150.01750.00750.110.01250.0050.00750.020.0250.0.010.015
Count Material1900.242105263157894740.226315789473684220.221052631578947360.0421052631578947360.226315789473684220.226315789473684220.242105263157894740.210526315789473670.236842105263157880.25789473684210530.1736842105263158
Count Color4230.139479905437352250.24586288416075650.24586288416075650.115839243498817970.184397163120567360.137115839243498820.208037825059101650.099290780141843980.57919621749408980.342789598108747040.06619385342789598
Count Shape2540.24409448818897640.22834645669291340.22834645669291340.22834645669291340.19685039370078740.216535433070866150.185039370078740160.224409448818897630.283464566929133850.330708661417322860.051181102362204724
Count Relative To4000.0350.16250.17250.09250.13750.1750.06250.14750.21750.20750.21

Llama-3.2-11B-Vision-Instruct-bnb-4bit

In-domain images

TaskNBaselineAll (1,500/task)All (188/task)Extreme materialExtreme colorExtreme shapeExtreme allCount materialCount colorCount shapeCount relative
Extreme Material3640.068681318681318690.90109890109890110.61263736263736270.7609890109890110.59340659340659340.57142857142857140.0467032967032967040.5109890109890110.44230769230769230.27747252747252750.5274725274725275
Extreme Color4200.042857142857142860.94047619047619050.80714285714285720.104761904761904760.83571428571428570.58809523809523810.10.371428571428571440.48809523809523810.419047619047619060.45714285714285713
Extreme Shape3780.20370370370370370.910052910052910.81746031746031740.67460317460317460.80423280423280420.88359788359788360.0132275132275132270.58730158730158730.67989417989417990.63227513227513230.42328042328042326
Extreme All4120.029126213592233010.84708737864077670.46844660194174760.00485436893203883450.092233009708737860.0194174757281553380.59223300970873780.033980582524271840.077669902912621350.04126213592233010.18446601941747573
Count Material1840.108695652173913040.5326086956521740.38043478260869570.3586956521739130.288043478260869570.076086956521739140.00.451086956521739140.2663043478260870.2663043478260870.2608695652173913
Count Color3860.2668393782383420.91450777202072540.76165803108808290.62953367875647670.75906735751295340.65284974093264250.00259067357512953380.51554404145077730.85233160621761660.76943005181347150.2772020725388601
Count Shape2610.260536398467432930.72796934865900390.51724137931034490.40996168582375480.463601532567049830.252873563218390830.0076628352490421450.34482758620689660.55172413793103450.63984674329501910.26053639846743293
Count Relative To3950.126582278481012670.463291139240506360.215189873417721530.227848101265822780.222784810126582270.126582278481012670.00.227848101265822780.205063291139240520.182278481012658230.18734177215189873

Held-out images

TaskNBaselineAll (1,500/task)All (188/task)Extreme materialExtreme colorExtreme shapeExtreme allCount materialCount colorCount shapeCount relative
Extreme Material3640.060.9150.62250.82750.60750.65250.070.54250.50750.36750.5175
Extreme Color4200.040.90750.80250.09750.87250.590.060.3850.5350.46750.4825
Extreme Shape3780.1950.90250.8350.68750.820.910.0150.6650.680.66250.415
Extreme All4120.0350.81250.43750.0050.09250.01750.560.04750.0750.0250.2
Count Material1840.084210526315789470.452631578947368440.34736842105263160.27894736842105260.231578947368421050.110526315789473680.00.43684210526315790.26315789473684210.27894736842105260.22105263157894736
Count Color3860.226950354609929070.92434988179669030.82978723404255320.63356973995271870.78250591016548470.70921985815602840.0023640661938534280.48463356973995270.917257683215130.82978723404255320.2907801418439716
Count Shape2610.27952755905511810.75590551181102360.50.448818897637795260.50393700787401570.240157480314960620.0078740157480314960.35433070866141730.63779527559055120.62204724409448820.2795275590551181
Count Relative To3950.14250.42750.23250.19250.150.170.00.2050.220.21750.195