SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2107.09106 · CVPR · 2021

Separating Skills and Concepts for Novel Visual Question Answering

Kate Saenko, Rogerio Feris, Hui Wu, Heng Ji, Spencer Whitehead

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 7 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2107.09106.json · badge: /api/ran/2107.09106.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
SpencerWhitehead/novelvqa canonical (classifier label)
classifier basis: census
1 ran · 0 no recorded run
MalvinaNikandrou/contvqa community (classifier label)
classifier basis not recorded on the link
6 ran · 1 no recorded run
FunctionStatusWhere it lives
get_categories_per_task Ran
ran on a synthesized input
MalvinaNikandrou/contvqa/src/contvqa/get_image_based_settings.py
code served (permissive licence) · get_code("fbfb2ee28ffecc81")
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 dict. 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 itertools
from random import shuffle
from typing import Literal

categories_transport = ['bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat']

categories_animals = ['bird', 'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe']

categories_sports = ['snowboard', 'sports ball', 'kite', 'baseball bat', 'baseball glove', 'skateboard', 'surfboard', 'tennis racket']

categories_food = ['banana', 'apple', 'sandwich', 'orange', 'broccoli', 'carrot', 'hot dog', 'pizza', 'donut', 'cake']

categories_interior = ['chair', 'couch', 'potted plant', 'bed', 'toilet', 'tv', 'laptop', 'mouse', 'remote', 'keyboard', 'cell phone', 'microwave', 'oven', 'toaster', 'sink', 'refrigerator']

categories_group_1 = ['bird', 'car', 'keyboard', 'motorcycle', 'orange', 'pizza', 'sink', 'sports ball', 'toilet', 'zebra']

categories_group_2 = ['airplane', 'baseball glove', 'bed', 'bus', 'cow', 'donut', 'giraffe', 'horse', 'mouse', 'sheep']

categories_group_3 = ['boat', 'broccoli', 'hot dog', 'kite', 'oven', 'sandwich', 'snowboard', 'surfboard', 'tennis racket', 'tv']

categories_group_4 = ['apple', 'baseball bat', 'bear', 'bicycle', 'cake', 'laptop', 'microwave', 'potted plant', 'remote', 'train']

categories_group_5 = ['banana', 'carrot', 'cell phone', 'chair', 'couch', 'elephant', 'refrigerator', 'skateboard', 'toaster', 'truck']

def get_categories_per_task(setting: Literal['taxonomy', 'diverse'], new_random_groups: bool=False) -> dict[str, list[str]]:
    """Get categories per task depending on the setting."""
    domain_to_categories = {'transport': categories_transport, 'animals': categories_animals, 'sports': categories_sports, 'food': categories_food, 'interior': categories_interior}
    if setting == 'taxonomy':
        tasks = domain_to_categories
    elif setting == 'diverse' and (not new_random_groups):
        tasks = {'group_1': categories_group_1, 'group_2': categories_group_2, 'group_3': categories_group_3, 'group_4': categories_group_4, 'group_5': categories_group_5}
    else:
        tasks = {}
        all_categories = list(itertools.chain.from_iterable(domain_to_categories.values()))
        num_tasks = len(domain_to_categories)
        num_categories_per_task = len(all_categories) // num_tasks
        shuffle(all_categories)
        for idx in range(num_tasks):
            tasks[f'group_{idx + 1}'] = all_categories[idx * num_categories_per_task:(idx + 1) * num_categories_per_task]
    return tasks

ARGS = {
    'setting': 'taxonomy',
    'new_random_groups': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 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
get_num_of_samples_per_task Ran
ran on a synthesized input
MalvinaNikandrou/contvqa/src/contvqa/get_dataset_statistics.py
code served (permissive licence) · get_code("a0692efb554bc382")
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 dict. 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 tempfile
import json
import os

# Create a temporary directory structure with the required JSON files
temp_dir = tempfile.mkdtemp()

# Create sample question ID data
train_ids = {
    "task1": ["q1", "q2", "q3"],
    "task2": ["q4", "q5"]
}

valid_ids = {
    "task1": ["q6", "q7"],
    "task2": ["q8"]
}

test_ids = {
    "task1": ["q9"],
    "task2": ["q10", "q11"]
}

# Write JSON files to temp directory
with open(os.path.join(temp_dir, 'train_question_ids.json'), 'w') as f:
    json.dump(train_ids, f)

with open(os.path.join(temp_dir, 'valid_question_ids.json'), 'w') as f:
    json.dump(valid_ids, f)

with open(os.path.join(temp_dir, 'test_question_ids.json'), 'w') as f:
    json.dump(test_ids, f)

ARGS = {
    'contvqa_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 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
get_optim Ran
ran on a synthesized input
SpencerWhitehead/novelvqa/core/model/optim.py
code served (permissive licence) · get_code("b6bf5a95f3801883")
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 WarmupOptimizer. 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
import torch.optim as Optim

torch.manual_seed(0)

# Build a minimal model with trainable parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

# Config class with required attributes
class Config:
    def __init__(self):
        self.LR_BASE = 0.001
        self.OPT_BETAS = (0.9, 0.999)
        self.OPT_EPS = 1e-8
        self.BATCH_SIZE = 2

__C = Config()

# Data size (total number of samples)
data_size = 100

# Build ARGS dictionary
ARGS = {
    '__C': __C,
    'model': model,
    'data_size': data_size,
    'lr_base': None
}
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 WarmupOptimizer — a WarmupOptimizer output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a WarmupOptimizer output the recorded ndim 0 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
get_question_ids_to_questions Ran
ran on a synthesized input
MalvinaNikandrou/contvqa/src/contvqa/plot_distributions.py
code served (permissive licence) · get_code("88571e8825d16071")
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 dict. 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 json
import os
import tempfile
import shutil

# Create a temporary directory for the VQA data
temp_dir = tempfile.mkdtemp()

# Create the questions JSON file that the function expects
questions_data = {
    'questions': [
        {'question_id': 1, 'question': 'What color is the sky?'},
        {'question_id': 2, 'question': 'How many people are in the image?'},
        {'question_id': 3, 'question': 'What is the object on the table?'},
    ]
}

questions_file_path = os.path.join(temp_dir, 'v2_OpenEnded_mscoco_train2014_questions.json')
with open(questions_file_path, 'w') as fp:
    json.dump(questions_data, fp)

ARGS = {
    'vqa_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 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
process_digit_article Ran
ran on a synthesized input
MalvinaNikandrou/contvqa/src/contvqa/answer_preprocessing.py
code served (permissive licence) · get_code("7201dbcd85dd597d")
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 str. 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 numpy as np

# The function process_digit_article takes a single parameter: inText (a string)
# Let's create a valid test input

ARGS = {
    'inText': "The quick brown fox jumps over a lazy dog. None of us could've done it."
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 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
process_punctuation Ran
ran on a synthesized input
MalvinaNikandrou/contvqa/src/contvqa/answer_preprocessing.py
code served (permissive licence) · get_code("389046e117d0b05c")
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 str. 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 re

period_strip = re.compile('(?!<=\\d)(\\.)(?!\\d)')
comma_strip = re.compile('(\\d)(\\,)(\\d)')
punct = [';', '/', '[', ']', '"', '{', '}', '(', ')', '=', '+', '\\', '_', '-', '>', '<', '@', '`', ',', '?', '!']

def process_punctuation(inText: str) -> str:
    outText = inText
    for p in punct:
        if (p + ' ' in inText or ' ' + p in inText) or re.search(comma_strip, inText) != None:
            outText = outText.replace(p, '')
        else:
            outText = outText.replace(p, ' ')
    outText = period_strip.sub('', outText, re.UNICODE)
    return outText

# Test with various text inputs
test_text_1 = "Hello, world! This is a test."
test_text_2 = "Price is $9,999 and 3.14 here."
test_text_3 = "No punctuation here"

ARGS = {
    "inText": "Hello, world! This is a test string with punctuation; maybe [some] brackets and (parentheses)."
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 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
read_json Ran
ran on a synthesized input
MalvinaNikandrou/contvqa/src/contvqa/common.py
code served (permissive licence) · get_code("a5e5d18d0c38ef2a")
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 dict. 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 json
import tempfile
import os

# Create a temporary JSON file with sample data
temp_dir = tempfile.mkdtemp()
temp_json_path = os.path.join(temp_dir, "test_data.json")

sample_data = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "dict"}
}

with open(temp_json_path, 'w') as f:
    json.dump(sample_data, f)

ARGS = {
    "path": temp_json_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 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
prep_ans Not yet run
unverified (harvested, no recorded run)
MalvinaNikandrou/contvqa/src/contvqa/answer_preprocessing.py
code served (permissive licence) · get_code("f71c20e0c28c07ae")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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
get_optim 1 other paper
1 dated earlier
1906.10770 (2019-06)
Deep Modular Co-Attention Networks for Visual Question Answering

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-22.

Repositories linked to this paper

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

Abstract

Generalization to out-of-distribution data has been a problem for Visual Question Answering (VQA) models. To measure generalization to novel questions, we propose to separate them into "skills" and "concepts". "Skills" are visual tasks, such as counting or attribute recognition, and are applied to "concepts" mentioned in the question, such as objects and people. VQA methods should be able to compose skills and concepts in novel ways, regardless of whether the specific composition has been seen in training, yet we demonstrate that existing models have much to improve upon towards handling new compositions. We present a novel method for learning to compose skills and concepts that separates these two factors implicitly within a model by learning grounded concept representations and disentangling the encoding of skills from that of concepts. We enforce these properties with a novel contrastive learning procedure that does not rely on external annotations and can be learned from unlabeled image-question pairs. Experiments demonstrate the effectiveness of our approach for improving compositional and grounding performance. 1 * Work was partly done as an intern at the MIT-IBM Watson AI Lab.

For agents

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

get_harvested_code_for_paper("2107.09106")
get_code_for_paper("2107.09106")
have("2107.09106")

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

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

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

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

Connect an agent — have() is free.