SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.14496 · EMNLP · 2024

African or European Swallow? Benchmarking Large Vision-Language Models for Fine-Grained Object Classification

Radu Timofte, Goran Glavaš, Gregor Geigle, Wünlp

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 6 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2406.14496.json · badge: /api/ran/2406.14496.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
gregor-ge/FOCI-Benchmark canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
FeedForward Ran
ran; our contract draft was wrong, not the code
gregor-ge/FOCI-Benchmark/benchmark/model/my_llava.py
code served (permissive licence) · get_code("4d75570b4e91d0b4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

ARGS = {
    "dim": 64,
    "mult": 4
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gregor-ge/FOCI-Benchmark/benchmark/model/model_internlm_xcomposer2.py
code served (permissive licence) · get_code("e378246b3fecc27f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 5, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# Analyze the function to understand what's needed:
# - q: tensor with shape that supports indexing [..., :x.shape[-1] // 2]
#      and operations with cos/sin; used with q.size(2)
# - k: similar to q
# - cos: tensor that gets squeezed(1), squeezed(0), then unsqueezed and expanded
# - sin: tensor that gets squeezed(1), squeezed(0), then unsqueezed and expanded
# - position_ids: used with len() and to determine batch size

# The function expects:
# - q, k: shape (batch, num_heads, seq_len, head_dim) based on usage
# - cos, sin: shape that after squeeze(1).squeeze(0) gives (seq_len, head_dim)
#             so original shape is (1, 1, seq_len, head_dim)
# - position_ids: list or tensor with length = batch_size

batch_size = 2
num_heads = 3
seq_len = 5
head_dim = 4

# Create q and k tensors
# shape: (batch_size, num_heads, seq_len, head_dim)
q = torch.randn(batch_size, num_heads, seq_len, head_dim)
k = torch.randn(batch_size, num_heads, seq_len, head_dim)

# Create cos and sin tensors
# After squeeze(1).squeeze(0), they should have shape (seq_len, head_dim)
# So before squeezing, shape is (1, 1, seq_len, head_dim)
cos = torch.randn(1, 1, seq_len, head_dim)
sin = torch.randn(1, 1, seq_len, head_dim)

# Create position_ids
# len(position_ids) should equal batch_size
position_ids = [0, 1]

ARGS = {
    "q": q,
    "k": k,
    "cos": cos,
    "sin": sin,
    "position_ids": position_ids,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 5, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_accuracy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gregor-ge/FOCI-Benchmark/benchmark/clip_benchmark/evaluate.py
code served (permissive licence) · get_code("11ec7f195cfd82d8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Batch size: 2, embedding dimension: 4
batch_size = 2
embedding_dim = 4
num_text_embeddings = 6  # 3 classes × 2 prompts

# Create image embeddings: shape (2, 4)
image_embeddings = torch.randn(batch_size, embedding_dim)
image_embeddings = F.normalize(image_embeddings, dim=1)

# Create text embeddings: shape (6, 4) for 3 classes with 2 prompts each
text_embeddings = torch.randn(num_text_embeddings, embedding_dim)
text_embeddings = F.normalize(text_embeddings, dim=1)

# Create target labels: shape (2,) with values in [0, 1, 2]
target = [0, 1]

# Create label_subset: shape (2, 3) - subset of labels for each sample
# This is used with torch.gather, so it needs to be 2D with shape matching scores
label_subset = [[0, 1, 2], [0, 1, 2]]

# num_prompts parameter
num_prompts = 2

ARGS = {
    "image_embeddings": image_embeddings,
    "text_embeddings": text_embeddings,
    "target": target,
    "label_subset": label_subset,
    "num_prompts": num_prompts,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_image_embeddings Ran
ran on a synthesized input
gregor-ge/FOCI-Benchmark/benchmark/clip_benchmark/evaluate.py
code served (permissive licence) · get_code("a98c46154e50ba44")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (4, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.data import Dataset

torch.manual_seed(0)

# Create a minimal image dataset
class DummyImageDataset(Dataset):
    def __init__(self, num_samples=4, image_dim=3):
        self.num_samples = num_samples
        self.image_dim = image_dim
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        # Return a single image tensor (3D: channels x height x width)
        return torch.randn(self.image_dim, 8, 8)

# Create a minimal model with encode_images method
class DummyImageEncoder(nn.Module):
    def __init__(self, embedding_dim=4):
        super().__init__()
        self.embedding_dim = embedding_dim
        self.linear = nn.Linear(3 * 8 * 8, embedding_dim)
    
    def encode_images(self, batch):
        # batch shape: (batch_size, 3, 8, 8)
        batch_flat = batch.flatten(1)
        embeddings = self.linear(batch_flat)
        return embeddings

# Create a minimal args object
class Args:
    def __init__(self):
        self.batchsize = 2
        self.workers = 0

# Construct the arguments
image_dataset = DummyImageDataset(num_samples=4, image_dim=3)
model = DummyImageEncoder(embedding_dim=4)
args = Args()

ARGS = {
    'image_dataset': image_dataset,
    'model': model,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 4) — shape (4, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
compute_text_embeddings Ran
ran on a synthesized input
gregor-ge/FOCI-Benchmark/benchmark/clip_benchmark/evaluate.py
code served (permissive licence) · get_code("6173d5b591eda0ae")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.data import DataLoader

torch.manual_seed(0)

# Define a minimal text dataset
class TextDataset:
    def __init__(self, size=2):
        self.size = size
    
    def __len__(self):
        return self.size
    
    def __getitem__(self, idx):
        return {
            'input_ids': torch.randint(0, 100, (5,)),
            'attention_mask': torch.ones(5, dtype=torch.long)
        }

# Define a minimal collate function
def collate_fn(batch):
    input_ids = torch.stack([item['input_ids'] for item in batch])
    attention_mask = torch.stack([item['attention_mask'] for item in batch])
    return {
        'input_ids': input_ids,
        'attention_mask': attention_mask
    }

# Define a minimal model with encode_text method
class MinimalTextModel(nn.Module):
    def __init__(self, hidden_dim=4):
        super().__init__()
        self.linear = nn.Linear(5, hidden_dim)
    
    def encode_text(self, input_ids, attention_mask):
        # Simple encoding: sum over sequence dimension and project
        embeddings = input_ids.float().sum(dim=1, keepdim=True)
        embeddings = self.linear(embeddings.expand(-1, 5))
        return embeddings

# Define args object
class Args:
    def __init__(self):
        self.batchsize = 2
        self.workers = 0

# Construct all arguments
text_dataset = TextDataset(size=2)
collate = collate_fn
model = MinimalTextModel(hidden_dim=4)
args = Args()

ARGS = {
    'text_dataset': text_dataset,
    'collate': collate,
    'model': model,
    'args': args
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_generated_prediction Ran
ran; our contract draft was wrong, not the code
gregor-ge/FOCI-Benchmark/benchmark/evaluate.py
code served (permissive licence) · get_code("40549461bd5ba061")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Analyze the function:
# - predictions: iterable of strings that are checked with .lower() and .startswith()
# - choice_enumeration: string with letters (defaults to 'ABCD')
# The function loops through predictions and checks if each starts with any letter
# from choice_enumeration (case-insensitive)

# Create valid test data
predictions = [
    "Apple is a fruit",
    "Banana is yellow",
    "cherry pie",
    "This doesn't match any letter",
    "DELTA force",
    "aardvark",
]

choice_enumeration = 'ABCD'

ARGS = {
    'predictions': predictions,
    'choice_enumeration': choice_enumeration,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
gregor-ge/FOCI-Benchmark/benchmark/model/model_internlm_xcomposer2.py
code served (permissive licence) · get_code("c0aae1f053da2578")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 4, dtype family float, shape (2, 6, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function repeat_kv takes hidden_states tensor and n_rep integer
# hidden_states shape: (batch, num_key_value_heads, seqlen, head_dim)
# n_rep: integer for repetition factor

hidden_states = torch.randn(2, 3, 5, 4)  # (batch=2, num_key_value_heads=3, seqlen=5, head_dim=4)
n_rep = 2

ARGS = {
    "hidden_states": hidden_states,
    "n_rep": n_rep,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 6, 5, 4) — shape (2, 6, 5, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
rotate_half Ran
ran; our contract draft was wrong, not the code
gregor-ge/FOCI-Benchmark/benchmark/model/model_internlm_xcomposer2.py
code served (permissive licence) · get_code("b99eea6376d1e212")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

# The function rotate_half takes a single parameter 'x' which is a tensor
# It accesses x.shape[-1] to get the last dimension
# It uses indexing with [..., :] slicing notation
# It calls torch.cat() to concatenate tensors

# Create a small tensor with shape (2, 4) - batch size 2, hidden dim 4
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_tokenizer_llava Not yet run
unverified (harvested, no recorded run)
gregor-ge/FOCI-Benchmark/benchmark/model/my_llava.py
code served (permissive licence) · get_code("47a081bf4493440f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 3 the same month, 3 later) and 5 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
rotate_half 360 other papers
135 dated earlier, 21 the same month, 195 later, 6 same year, order not determinable, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
repeat_kv 243 other papers
79 dated earlier, 16 the same month, 144 later, 2 same year, order not determinable, 2 undated · 22 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2305.17888 (2023-05)
LLM-QAT: Data-Free Quantization Aware Training for Large Language Models
and 240 more not named here
FeedForward 47 other papers
16 dated earlier, 2 the same month, 28 later, 1 same year, order not determinable · 4 only as an assembly brick
2204.14198 (2022-04)
Flamingo: a Visual Language Model for Few-Shot Learning
2308.02463 (2023-08)
Towards Generalist Foundation Model for Radiology by Leveraging Web-scale 2D&3D Medical Data
2308.06721 (2023-08)
IP-Adapter: Text Compatible Image Prompt Adapter for Text-to-Image Diffusion Models
and 44 more not named here
apply_rotary_pos_emb 2 other papers
2 dated earlier
2402.11248 (2024-02)
CoLLaVO: Crayon Large Language and Vision mOdel
2403.07508 (2024-03)
MoAI: Mixture of All Intelligence for Large Language and Vision Models

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Recent Large Vision-Language Models (LVLMs) demonstrate impressive abilities on numerous image understanding and reasoning tasks. The task of fine-grained object classification (e.g., distinction between animal species), however, has been probed insufficiently, despite its downstream importance. We fill this evaluation gap by creating FOCI (Fine-grained Object ClassIfication), a difficult multiple-choice benchmark for fine-grained object classification, from existing object classification datasets: (1) multiple-choice avoids ambiguous answers associated with casting classification as open-ended QA task; (2) we retain classification difficulty by mining negative labels with a CLIP model. FOCI complements five popular classification datasets with four domain-specific subsets from ImageNet-21k. We benchmark 12 public LVLMs on FOCI and show that it tests for a complementary skill to established image understanding and reasoning benchmarks. Crucially, CLIP models exhibit dramatically better performance than LVLMs. Since the image encoders of LVLMs come from these CLIP models, this points to inadequate alignment for fine-grained object distinction between the encoder and the LLM and warrants (pre)training data with more fine-grained annotation. We release our code at https:// github.com/gregor-ge/FOCI-Benchmark.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.14496")
get_code_for_paper("2406.14496")
have("2406.14496")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2406.14496.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2406.14496.svg)](https://syntology.ai/paper/2406.14496)

Connect an agent — have() is free.