SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.09138 · CVPR · 2022

MuKEA: Multimodal Knowledge Extraction and Accumulation for Knowledge-based Visual Question Answering

Yue Hu, Qi Wu, Jing Yu, Bang Liu, Yang Ding, Mingxin Cui

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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 8 have no contract verdict; 2 failures of our instrument; 0 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/2203.09138.json · badge: /api/ran/2203.09138.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
AndersonStra/MuKEA canonical (classifier label)
classifier basis not recorded on the link
10 ran · 0 no recorded run
FunctionStatusWhere it lives
distanceL2 Ran
ran on a synthesized input
AndersonStra/MuKEA/contrastive_loss.py
code served (permissive licence) · get_code("d342fd2a97947b8f")
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 1, dtype family float, shape (2,) 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 distanceL2 computes L2 distance between two tensors h and t
# It performs element-wise subtraction, squares, and sums over the last dimension
# Both h and t should be tensors of compatible shapes

h = torch.randn(2, 4)  # batch size 2, dimension 4
t = torch.randn(2, 4)  # batch size 2, dimension 4

ARGS = {
    "h": h,
    "t": t,
}
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 1, dtype family float, shape (2,) — shape (2,) 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
dot_sim Ran
ran on a synthesized input
AndersonStra/MuKEA/contrastive_loss.py
code served (permissive licence) · get_code("6a49bab714ec6122")
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, 3) 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 performs im.mm(s.t())
# im needs to support .mm() method (matrix multiply)
# s needs to support .t() method (transpose)
# Both should be 2D tensors for this operation to make sense

# Create image embedding matrix: shape (2, 4) - 2 images, 4-dim embeddings
im = torch.randn(2, 4)

# Create sentence embedding matrix: shape (3, 4) - 3 sentences, 4-dim embeddings
s = torch.randn(3, 4)

ARGS = {
    "im": im,
    "s": s,
}
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 2, dtype family float, shape (2, 3) — shape (2, 3) 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
gumbel_softmax Ran
ran on a synthesized input
AndersonStra/MuKEA/okvqa/gumbel_softmax.py
code served (permissive licence) · get_code("8181c4e9f8e6986a")
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.functional as F

torch.manual_seed(0)

# Create a small logits tensor
# Shape: [batch_size=2, n_class=4]
logits = torch.randn(2, 4)

ARGS = {
    'logits': logits,
    'temperature': 1.0,
    'hard': True
}
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 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
gumbel_softmax_sample Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
AndersonStra/MuKEA/okvqa/gumbel_softmax.py
pointer only (licence: MIT); the stored copy get_code serves, from gatech-eic/nasa, is pointer only (licence: NONE) · get_code("0d41bbe52278fde1")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gatech-eic/nasa, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

l2_sim Ran
ran on a synthesized input
AndersonStra/MuKEA/contrastive_loss.py
code served (permissive licence) · get_code("4f72de8caeab7fb0")
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, 3) 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)

# Analyze l2_sim function:
# - im: tensor with .shape[0] accessed, then .unsqueeze(0), .repeat(b_s, 1, 1)
# - s: tensor with .shape[0] accessed, then .unsqueeze(1), .repeat(1, b_im, 1)
# Both are passed to distanceL2 which expects tensors with matching last dimension

# Create small tensors with distinct batch sizes and embedding dimension
im = torch.randn(2, 4)  # batch_size=2, embedding_dim=4
s = torch.randn(3, 4)   # batch_size=3, embedding_dim=4

ARGS = {
    "im": im,
    "s": s
}
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 2, dtype family float, shape (2, 3) — shape (2, 3) 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
my_collate Ran
ran on a synthesized input
AndersonStra/MuKEA/dataset.py
code served (permissive licence) · get_code("6928e9031c786532")
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 torch
import numpy as np

torch.manual_seed(0)

# The function expects a batch where each element is a tuple of 6 items:
# (id, ques, ans, img, spatial, mostid)
# After zip(*batch), it unpacks into 6 lists

batch_item_1 = (
    'id_0',                                    # id
    'What is this?',                           # ques
    'An answer',                               # ans
    torch.randn(4, 3),                        # img
    torch.randn(2, 5),                        # spatial
    'most_id_0'                               # mostid
)

batch_item_2 = (
    'id_1',                                    # id
    'Another question?',                       # ques
    'Another answer',                          # ans
    torch.randn(4, 3),                        # img
    torch.randn(2, 5),                        # spatial
    'most_id_1'                               # mostid
)

batch = [batch_item_1, batch_item_2]

ARGS = {
    'batch': batch
}
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 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
my_collate_2 Ran
ran on a synthesized input
AndersonStra/MuKEA/inference.py
code served (permissive licence) · get_code("aa11211deb269101")
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 torch
import numpy as np

torch.manual_seed(0)

# Create a batch of items matching the expected structure
batch = [
    {
        'id': 'item_0',
        'ques': torch.randn(4),
        'ans': torch.randn(3),
        'img': torch.randn(5, 4),
        'object': torch.randn(6, 3),
        'spatial': torch.randn(7, 2),
        'length': 10
    },
    {
        'id': 'item_1',
        'ques': torch.randn(4),
        'ans': torch.randn(3),
        'img': torch.randn(5, 4),
        'object': torch.randn(6, 3),
        'spatial': torch.randn(7, 2),
        'length': 15
    }
]

ARGS = {
    'batch': batch
}
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 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
my_collate_pretrain Ran
ran on a synthesized input
AndersonStra/MuKEA/dataset.py
code served (permissive licence) · get_code("fbc1ba4579bafa09")
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 torch

torch.manual_seed(0)

# The function expects a batch where each element is a tuple of 6 items:
# (id, ques, ans, img, spatial, mostid)
# After zip(*batch), it unpacks into 6 lists

batch_data = [
    ("id_0", "question_0", "answer_0", torch.randn(4, 3), torch.randn(2, 4), "most_0"),
    ("id_1", "question_1", "answer_1", torch.randn(4, 3), torch.randn(2, 4), "most_1"),
]

ARGS = {
    "batch": batch_data
}
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 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
plural Ran
ran on a synthesized input
AndersonStra/MuKEA/dataset.py
code served (permissive licence) · get_code("2eb06695bbb6d9cb")
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

# The function 'plural' takes a single parameter 'word' which is a string
# It performs string operations on it to convert singular nouns to plural

ARGS = {
    'word': 'cat'
}
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 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
sample_gumbel Ran
ran; our contract draft was wrong, not the code
AndersonStra/MuKEA/okvqa/gumbel_softmax.py
pointer only (licence: MIT); the stored copy get_code serves, from gatech-eic/nasa, is pointer only (licence: NONE) · get_code("7c913c414af7196f")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from gatech-eic/nasa, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 3 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
sample_gumbel 7 other papers
5 dated earlier, 2 later
1912.10917 (2019-12)
FasterSeg: Searching for Faster Real-time Semantic Segmentation
2008.11062 (2020-08)
GAN Slimming: All-in-One GAN Compression by A Unified Optimization Framework
Fu_SACoD_Sensor_Algorithm_Co-Design_Towards_Efficient_CNN-Powered_Intelligent_PhlatCam_ICCV_2021_paper (2021 (year only))
SACoD: Sensor Algorithm Co-Design Towards Efficient CNN-powered Intelligent PhlatCam
and 4 more not named here
gumbel_softmax_sample 5 other papers
4 dated earlier, 1 later
1912.10917 (2019-12)
FasterSeg: Searching for Faster Real-time Semantic Segmentation
2008.11062 (2020-08)
GAN Slimming: All-in-One GAN Compression by A Unified Optimization Framework
Fu_SACoD_Sensor_Algorithm_Co-Design_Towards_Efficient_CNN-Powered_Intelligent_PhlatCam_ICCV_2021_paper (2021 (year only))
SACoD: Sensor Algorithm Co-Design Towards Efficient CNN-powered Intelligent PhlatCam
and 2 more not named here
dot_sim 3 other papers
2 dated earlier, 1 later
2004.09144 (2020-04)
Transformer Reasoning Network for Image-Text Matching and Retrieval
2008.05231 (2020-08)
Fine-grained Visual Textual Alignment for Cross-Modal Retrieval using Transformer Encoders
2306.08789 (2023-06)
Efficient Token-Guided Image-Text Retrieval with Consistent Multimodal Contrastive Training

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

Knowledge-based visual question answering requires the ability of associating external knowledge for openended cross-modal scene understanding. One limitation of existing solutions is that they capture relevant knowledge from text-only knowledge bases, which merely contain facts expressed by first-order predicates or language descriptions while lacking complex but indispensable multimodal knowledge for visual understanding. How to construct vision-relevant and explainable multimodal knowledge for the VQA scenario has been less studied. In this paper, we propose MuKEA to represent multimodal knowledge by an explicit triplet to correlate visual objects and fact answers with implicit relations. To bridge the heterogeneous gap, we propose three objective losses to learn the triplet representations from complementary views: embedding structure, topological relation and semantic space. By adopting a pre-training and fine-tuning learning strategy, both basic and domain-specific multimodal knowledge are progressively accumulated for answer prediction. We outperform the state-of-the-art by 3.35% and 6.08% respectively on two challenging knowledge-required datasets: OK-VQA and KRVQA. Experimental results prove the complementary benefits of the multimodal knowledge with existing knowledge bases and the advantages of our end-to-end framework over the existing pipeline methods. The code is available at https://github.com/AndersonStra/MuKEA.

For agents

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

get_harvested_code_for_paper("2203.09138")
get_code_for_paper("2203.09138")
have("2203.09138")

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

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

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

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

Connect an agent — have() is free.