SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.02503 · 2024

GeReA: Question-Aware Prompt Captions for Knowledge-based Visual Question Answering

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 18 functions out of this paper's own repositories and ran 11 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
upper9527/gerea canonical 11 of 18
FunctionStatusWhere it lives
calc_banned_bad_words_ids Ran upper9527/gerea/src/generation_utils.py
pointer only (licence: NONE) · get_code("e3ead4161d5e3d4a")
calc_banned_ngram_tokens Ran upper9527/gerea/src/generation_utils.py
pointer only (licence: NONE) · get_code("8d77347cfa15b834")
check_answer Ran upper9527/gerea/src/evaluation.py
pointer only (licence: NONE) · get_code("637b51b8df78832a")
encode_passages Ran upper9527/gerea/src/data.py
pointer only (licence: NONE) · get_code("bc0dae797248182b")
get_checkpoint_path Ran upper9527/gerea/src/util.py
pointer only (licence: NONE) · get_code("e3a0e6ac26d46ae2")
has_answer Ran upper9527/gerea/src/evaluation.py
pointer only (licence: NONE) · get_code("fa4ecbff4b9a354b")
init_logger Ran upper9527/gerea/src/util.py
pointer only (licence: NONE) · get_code("1700ba94a8342336")
okvqa_ems Ran upper9527/gerea/leaderboard_evaluation.py
pointer only (licence: NONE) · get_code("3762227466b20f21")
select_examples_NQ Ran upper9527/gerea/src/preprocess.py
pointer only (licence: NONE) · get_code("e2f8b9900fd662b1")
select_examples_TQA Ran upper9527/gerea/src/preprocess.py
pointer only (licence: NONE) · get_code("e544cd4b39e5ec61")
top_k_top_p_filtering Ran upper9527/gerea/src/generation_utils.py
pointer only (licence: NONE) · get_code("0dc219ab6716a127")
calculate_matches Not yet run upper9527/gerea/src/evaluation.py
pointer only (licence: NONE) · get_code("7a4988952dd3a127")
exact_match_score Not yet run upper9527/gerea/leaderboard_evaluation.py
pointer only (licence: NONE) · get_code("108d116eb5bdf952")
get_options Not yet run upper9527/gerea/src/options.py
pointer only (licence: NONE) · get_code("4c076a246978c67e")
load Not yet run upper9527/gerea/src/util.py
pointer only (licence: NONE) · get_code("a16b92bf7d32bad5")
load_data Not yet run upper9527/gerea/src/data.py
pointer only (licence: NONE) · get_code("67eac65279649d0a")
load_tf_weights_in_t5 Not yet run upper9527/gerea/src/modeling_t5.py
pointer only (licence: NONE) · get_code("52fdf83141474e49")
normalize_answer Not yet run upper9527/gerea/leaderboard_evaluation.py
pointer only (licence: NONE) · get_code("b92b07bb3574992a")

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 (VQA) requires world knowledge beyond the image for accurate answer. Recently, instead of extra knowledge bases, a large language model (LLM) like GPT-3 is activated as an implicit knowledge engine to jointly acquire and reason the necessary knowledge for answering by converting images into textual information (e.g., captions and answer candidates). However, such conversion may introduce irrelevant information, which causes the LLM to misinterpret images and ignore visual details crucial for accurate knowledge. We argue that multimodal large language model (MLLM) is a better implicit knowledge engine than the LLM for its superior capability of visual understanding. Despite this, how to activate the capacity of MLLM as the implicit knowledge engine has not been explored yet. Therefore, we propose GeReA, a generate-reason framework that prompts a MLLM like InstructBLIP with question relevant vision and language information to generate knowledge-relevant descriptions and reasons those descriptions for knowledge-based VQA. Specifically, the question-relevant image regions and question-specific manual prompts are encoded in the MLLM to generate the knowledge relevant descriptions, referred to as question-aware prompt captions. After that, the question-aware prompt captions, image-question pair, and similar samples are sent into the multi-modal reasoning model to learn a joint knowledge-image-question representation for answer prediction. GeReA unlocks the use of MLLM as the implicit knowledge engine, surpassing all previous state-of-the-art methods on OK-VQA and A-OKVQA datasets, with test accuracies of 66.5% and 63.3% respectively. Our code will be released at https://github.com/Upper9527/GeReA.

For agents

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

get_harvested_code_for_paper("2402.02503")
get_code_for_paper("2402.02503")
have("2402.02503")

Connect an agent — have() is free.