{"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/how-to-configure-good-in-context-sequence-for","title":"How to Configure Good In-Context Sequence for Visual Question Answering","arxiv_id":"2312.01571","date":"2023-12-04","proceeding":"CVPR 2024 1","authors":["Li Li","Jiawei Peng","Huiyi Chen","Chongyang Gao","Xu Yang"],"abstract":"Inspired by the success of Large Language Models in dealing with new tasks via In-Context Learning (ICL) in NLP, researchers have also developed Large Vision-Language Models (LVLMs) with ICL capabilities. However, when implementing ICL using these LVLMs, researchers usually resort to the simplest way like random sampling to configure the in-context sequence, thus leading to sub-optimal results. To enhance the ICL performance, in this study, we use Visual Question Answering (VQA) as case study to explore diverse in-context configurations to find the powerful ones. Additionally, through observing the changes of the LVLM outputs by altering the in-context sequence, we gain insights into the inner properties of LVLMs, improving our understanding of them. Specifically, to explore in-context configurations, we design diverse retrieval methods and employ different strategies to manipulate the retrieved demonstrations. Through exhaustive experiments on three VQA datasets: VQAv2, VizWiz, and OK-VQA, we uncover three important inner properties of the applied LVLM and demonstrate which strategies can consistently improve the ICL VQA performance. Our code is provided in: https://github.com/GaryJiajia/OFv2_ICL_VQA.","url_abs":"https://arxiv.org/abs/2312.01571v1","url_pdf":"https://arxiv.org/pdf/2312.01571v1.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":[{"paper_slug":"how-to-configure-good-in-context-sequence-for","repo_url":"https://github.com/garyjiajia/ofv2_icl_vqa","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"question-answering","task_name":"Question Answering"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"visual-question-answering-1","task_name":"Visual Question Answering"},{"task_slug":"visual-question-answering","task_name":"Visual Question Answering (VQA)"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2312.01571","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2312.01571"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/garyjiajia/ofv2_icl_vqa","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":3},"by_repo_kind":{"official":{"samples":3,"ran":3,"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":"1cf0e65c242209ce","entry":"get_vqa_and_declaration_prompt","repo":"garyjiajia/ofv2_icl_vqa","repo_kind":"official","path":"open_flamingo/eval/evaluate_vqa.py","file_url":"https://github.com/garyjiajia/ofv2_icl_vqa/blob/HEAD/open_flamingo/eval/evaluate_vqa.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1cf0e65c242209ce"}},{"code_sha256_prefix":"cb603e8873e005fb","entry":"get_vqa_declaration_prompt","repo":"garyjiajia/ofv2_icl_vqa","repo_kind":"official","path":"open_flamingo/eval/evaluate_vqa.py","file_url":"https://github.com/garyjiajia/ofv2_icl_vqa/blob/HEAD/open_flamingo/eval/evaluate_vqa.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cb603e8873e005fb"}},{"code_sha256_prefix":"9856b1c204ebae37","entry":"postprocess_new_vqa_generation","repo":"garyjiajia/ofv2_icl_vqa","repo_kind":"official","path":"open_flamingo/eval/evaluate_vqa.py","file_url":"https://github.com/garyjiajia/ofv2_icl_vqa/blob/HEAD/open_flamingo/eval/evaluate_vqa.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"9856b1c204ebae37"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}