{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/a-simple-baseline-for-knowledge-based-visual","title":"A Simple Baseline for Knowledge-Based Visual Question Answering","arxiv_id":"2310.13570","date":"2023-10-20","proceeding":null,"authors":["Alexandros Xenos","Themos Stafylakis","Ioannis Patras","Georgios Tzimiropoulos"],"abstract":"This paper is on the problem of Knowledge-Based Visual Question Answering (KB-VQA). Recent works have emphasized the significance of incorporating both explicit (through external databases) and implicit (through LLMs) knowledge to answer questions requiring external knowledge effectively. A common limitation of such approaches is that they consist of relatively complicated pipelines and often heavily rely on accessing GPT-3 API. Our main contribution in this paper is to propose a much simpler and readily reproducible pipeline which, in a nutshell, is based on efficient in-context learning by prompting LLaMA (1 and 2) using question-informative captions as contextual information. Contrary to recent approaches, our method is training-free, does not require access to external databases or APIs, and yet achieves state-of-the-art accuracy on the OK-VQA and A-OK-VQA datasets. Finally, we perform several ablation studies to understand important aspects of our method. Our code is publicly available at https://github.com/alexandrosXe/ASimple-Baseline-For-Knowledge-Based-VQA","url_abs":"https://arxiv.org/abs/2310.13570v2","url_pdf":"https://arxiv.org/pdf/2310.13570v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"visual-question-answering-1","task_name":"Visual Question Answering"},{"task_slug":"visual-question-answering","task_name":"Visual Question Answering (VQA)"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"cosine-annealing","method_name":"Cosine Annealing"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"gpt-3","method_name":"GPT-3"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-cosine-annealing","method_name":"Linear Warmup With Cosine Annealing"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/visual-question-answering-on-a-okvqa","task":"Visual Question Answering (VQA)","dataset":"A-OKVQA","model":"A Simple Baseline for KB-VQA","rank_in_archive_order":14,"of":15,"metrics":{"DA VQA Score":"57.5"},"uses_additional_data":false},{"leaderboard":"/sota/visual-question-answering-on-ok-vqa","task":"Visual Question Answering (VQA)","dataset":"OK-VQA","model":"A Simple Baseline for KB-VQA","rank_in_archive_order":7,"of":37,"metrics":{"Accuracy":"61.2"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2310.13570","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2310.13570"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"deterministic:regex_extraction","url":"https://github.com/alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA","reach":null}],"summary":{"ran":1,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"found_in_text":{"samples":3,"ran":2,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":3,"samples":[{"code_sha256_prefix":"7007073639ccccfc","entry":"get_context_examples","repo":"alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA","repo_kind":"found_in_text","path":"source/a_ok_vqa_in_context_learning.py","file_url":"https://github.com/alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA/blob/HEAD/source/a_ok_vqa_in_context_learning.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7007073639ccccfc"}},{"code_sha256_prefix":"62c401b90838b72a","entry":"sort_captions_based_on_similarity","repo":"alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA","repo_kind":"found_in_text","path":"source/a_ok_vqa_in_context_learning.py","file_url":"https://github.com/alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA/blob/HEAD/source/a_ok_vqa_in_context_learning.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"62c401b90838b72a"}},{"code_sha256_prefix":"25348932cc901e49","entry":"val_in_context_learning_a_ok_vqa","repo":"alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA","repo_kind":"found_in_text","path":"source/a_ok_vqa_in_context_learning.py","file_url":"https://github.com/alexandrosXe/A-Simple-Baseline-For-Knowledge-Based-VQA/blob/HEAD/source/a_ok_vqa_in_context_learning.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"25348932cc901e49"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}