Manuscript Offprint
arXiv:2610.17079Rethinking LLM-Guided Visual Question Answering: Does Deeper Knowledge Integration Really Help?
Aneerban Saha , Vijay Kumar , Sameer Madhav D. , Priyam Srivastava , and Dhruv Bansal
Independent Researchers, India
aneerbansaha22@gmail.com, kumarvijay2003.vk@gmail.com,
sameermadhav.5@gmail.com, srivastavapriyam652@gmail.com,
Abstract. Knowledge-based Visual Question Answering (VQA) requires reasoning that extends beyond visible image content, demanding external commonsense and factual knowledge. While recent work leverages Large Language Models (LLMs) as knowledge sources, the question of how deeply such guidance should be integrated into a vision language architecture remains underexplored. In this work, we generate structured reasoning guidance, visual focus concepts, distractor elements and external knowledge using Llama 3.3 70B and systematically compare two integration strategies within a unified frozen ViT + FLAN-T5 framework on the OK-VQA benchmark: decision level late fusion and attention-matrix injection. Contrary to the prevailing assumption that deeper integration is superior, we find that shallow late fusion achieves the strongest results (39.4% exact match, +10.0 over the no guidance baseline), outperforming deep attention modification (31.8%) under data scarce fine-tuning. We further contribute an LLM based augmentation pipeline that expands training data more than tenfold via question paraphrasing. Our findings indicate that integration depth must be matched to the data regime.
Keywords: visual question answering, large language models, vision transformer, knowledge integration, multimodal fusion
1 Introduction
Visual Question Answering (VQA) is a fundamental multimodal task requiring joint reasoning over an image and a natural-language question to produce a correct answer. Conventional VQA models perform well when the answer is directly observable in the image, but degrade sharply on questions that require external knowledge - for example, “How old do you have to be in Canada to do this?” asked of an image of adults drinking wine. The OK-VQA benchmark [1] was designed precisely to expose this limitation: its questions cannot be answered from visual content alone.
Aneerban Saha et al.
A growing body of work addresses this gap by treating LLMs as implicit knowledge bases [2, 3, 4]. However, the dominant paradigm keeps the LLM as an external oracle queried through text prompts, while methods that do inject knowledge into a trainable architecture generally assume that deeper, more elaborate fusion mechanisms are better [5, 6]. Empirical evidence from the broader multimodal literature suggests otherwise: deep fusion can overfit and underperform shallow fusion when fine-tuning data are scarce. This raises a critical but underexplored question: how should LLM-generated guidance be integrated into a multimodal transformer, and does deeper integration actually help?
In this work, we generate structured reasoning guidance for each OK-VQA sample using Llama 3.3 70B: visual_focus concepts the model should attend to, ignore elements that are distractors, and knowledge facts required to answer. We encode this guidance with a CLIP text encoder and inject it into a unified frozen ViT + FLAN-T5 framework through two strategies of increasing depth: decision-level late fusion and attention-matrix injection into the query and key projections of the vision encoder.
Our contributions are: (1) a pipeline that converts LLM reasoning into structured, machine consumable guidance injected into a compact trainable VQA architecture, rather than prompting a frozen billion-parameter LLM at inference time; (2) a systematic comparison of shallow and deep knowledge integration under identical data scarce fine-tuning on OK-VQA; (3) a contrarian empirical finding, shallow late fusion outperforms deep attention modification on all metrics (exact match 39.4 vs. 31.8; token F1 41.3 vs. 33.3); and (4) an LLM based data augmentation pipeline that expands the filtered training set from 3,144 to approximately 36,000 samples.
The remaining article is arranged as follows: section 2 reviews related work. Section 3 describes dataset preparation and guidance generation. Section 4 presents the model architectures. Section 5 reports results and analysis. Section 6 concludes this paper.
2.1 Knowledge-Based Visual Question Answering
OK-VQA benchmark introduced by Marino et al. [1] comprises 14,055 image-question pairs over MS COCO images whose answers require knowledge external to the image, and demonstrated that contemporary VQA models degrade drastically in this setting. Early knowledge-based methods retrieved facts from structured sources: KRISP [7] combined implicit knowledge from multimodal pretraining with symbolic knowledge-graph reasoning, while MAVEx [8] validated candidate answers against knowledge retrieved from Wikipedia, ConceptNet, and image search.
A paradigm shift came with using LLMs as implicit knowledge bases. PICa [2] prompted GPT-3 with image captions and in-context examples, surpassing supervised state of the art on OK-VQA with only sixteen examples. KAT [3] jointly integrated implicit GPT-3 knowledge with explicit knowledge retrieved from Wikidata in an encoder–decoder. Prophet [4] trained a vanilla VQA model to produce answer heuristics that enrich the GPT-3 prompt. Most recently, MAIL [6] constructed scene and concept graphs via two-stage LLM prompting with a pseudo-siamese graph medium fusion, and KV-KBVQA [5] augmented a ViT with Kolmogorov-Arnold layers and bidirectional residual cross-modal attention, attributing prior limitations to “simplistic attention mechanisms.”
Two observations motivate our work. First, prompting-based methods keep the LLM as an external oracle queried in text space at inference time, incurring the cost of a billion-parameter model per query. Second, methods that fuse knowledge into a trainable model (KAT, MAIL, KV-KBVQA) presuppose that more elaborate, deeper fusion is the path forward – an assumption our study directly tests.
2.2 Vision-Language Fusion Strategies
Multimodal architectures have evolved from two-stream region-feature models to single-stream patch-token transformers. LXMERT [9] connected separate object-relationship and language encoders through a cross-modality encoder, while ViLT [10] embedded image patches like text tokens in a single transformer. Shin and Narihira [11] studied a minimal design in which image and text tokens are combined in a common embedding space – conceptually the ancestor of decision-level late fusion. The broader multimodal literature offers a relevant caution: on RGB-D object recognition, late fusion outperforms most early-fusion variants in vision transformers [12], suggesting optimal fusion depth is contingent on the data regime and the quality of pretrained unimodal encoders – precisely the variable our study isolates for LLM-generated guidance.
2.3 Attention Guidance and Modification in Transformers
A distinct family of methods steers attention to inject external signals. Samaran et al. [13] directly supervised attention for visual grounding and found that naive attention supervision does not straightforwardly improve task performance, an early negative result on forcing attention. In the language model setting, PASTA [14] reweights attention scores of selected heads to emphasize user specified content. These works demonstrate that language can condition a transformer's attention, but they do not test whether such deep conditioning remains beneficial when the guiding signal is LLM-generated and training data are scarce – the question we pose.
2.4 Foundation Models and LLM-Based Augmentation
Our system builds on frozen foundation models: the Vision Transformer [15], CLIP [16] whose contrastively-trained text encoder embeds our guidance, BLIP [17] for image captioning, and the text-to-text transformers T5 [18] and FLAN-T5 [19] for sequence-to-sequence answer generation. For data augmentation,
Aneerban Saha et al.
AugGPT [20] demonstrated that LLM paraphrasing of training samples improves low-resource classification; we apply the same principle to VQA questions.
Research gap. Prior work either queries LLMs externally at inference time or assumes deeper knowledge fusion is better. To our knowledge, no prior study systematically compares shallow decision level fusion and attention-matrix injection using identical LLM generated structured guidance under data-scarce fine-tuning on OK-VQA.
3 Dataset Preparation and Guidance Generation
3.1 OK-VQA Preprocessing
Each OK-VQA sample consists of an MS COCO image, a natural-language question, and multiple human-annotated answers. Answers are normalized (lowercasing, punctuation removal, whitespace trimming) and a single supervision target is selected per sample by majority vote among annotators using Eq. 1.
here, is the multiset of annotated answers for question . For example, ["dog", "a dog", "dog", "puppy", "dog"] "dog".
Because the answer distribution is heavily long-tailed, we retain only the top-K most frequent answers and discard samples with rarer labels, yielding 3,144 training samples over 500 answer classes – approximately six samples per class, a severe data-scarcity regime that motivates both our augmentation pipeline and our central research question. Images are resized to and processed using ViT image processor.
3.2 LLM-Based Reasoning Generation
OK-VQA contains no explicit reasoning annotations. We construct them automatically: for each sample, a BLIP captioning model [17] produces a caption c, and Llama 3.3 70B is prompted with the question q and caption c to emit a structured JSON object shown in Eq. 2.
here, is the set of visual focus concepts, the set of elements to ignore, and the set of external knowledge statements. For the wine-drinking example above, the LLM produces , , and . Generation is performed once offline with temperature 0.2 and cached, so no LLM call is needed at training or inference time.
3.3 LLM-Based Data Augmentation and Training Instances
To combat the six samples per class regime, we paraphrase questions with the same LLM under three constraints: the image is unchanged, the answer is unchanged, and only the question wording varies (e.g., “How old do you have to be in Canada to do this?” → “What is the legal drinking age in Canada?”). The pipeline includes shard-based caching, crash recovery, and deduplicated merging, expanding the dataset from 3,144 to approximately 36,000 samples, following the paraphrase-augmentation principle of AugGPT [20].
Questions are formatted for text-to-text generation following T5 conventions, with the guidance context concatenating focus and knowledge strings as in Eq. 3.
here, the input is tokenized to with maximum length 64; targets are tokenized to decoder labels y with maximum length 8.
4 Model Architectures
4.1 Shared Backbone
- Overall Framework: LLM-Guided VQA Pipeline

Fig. 1: Overall LLM-guided VQA framework: caption generation, structured reasoning, guidance encoding, and downstream model variants.
All variants share the same frozen ViT + FLAN-T5 architecture so that only the knowledge integration strategy differs (Fig. 1). Images are encoded using a pretrained ViT-Base [15] and the CLS embedding is used as the global visual representation. Questions are processed by FLAN-T5 [19].
Aneerban Saha et al.
Structured guidance (visual focus and external knowledge) is encoded using the frozen CLIP text encoder [16], mean pooled, and projected into the ViT feature space using Eq. 4.
here, is the mean-pooled CLIP embedding, and are trainable projection parameters, and is the guidance vector used by both integration strategies described below.
4.2 Baseline (No Guidance)
- Baseline Architecture (No Guidance)

Fig. 2: Baseline VQA architecture: ViT image features and FLAN-T5 question embeddings are fused via cross-attention before decoding.
The baseline passes only visual information to the decoder (Fig. 2). The CLS token is projected to the T5 embedding dimension and prepended as a single prefix token using Eq. 5.
here, denotes T5 input embeddings and sequence concatenation. The decoder is trained with the standard sequence-to-sequence cross-entropy given in Eq. 6.
here, is the answer token and denotes the trainable parameters.
4.3 Late Fusion (Decision-Level Integration)
Late fusion combines guidance with visual features only at the final stage (Fig. 3). The CLS token and guidance vector are concatenated and fused using Eq. 7.
here, denotes vector concatenation ( ). The fused prefix is prepended to the T5 input exactly as in the baseline. Guidance influences the decision but never the visual feature extraction – the shallowest possible integration.
- Late Fusion Architecture (Decision-Level)

Fig. 3: Late fusion: projected guidance is fused with the global visual representation immediately before decoding.
4.4 Attention-Matrix Injection (Deep Integration)
This variant injects guidance directly into the self-attention of the last six ViT layers (Fig. 4). In standard attention, for hidden states , the projections are computed using Eq. 8.
here, , , and are the pretrained query, key, and value projections. We first normalize the guidance, , and compute layer-specific guidance shifts and a per-sample scalar gate using Eq. 9.
Aneerban Saha et al.
here, and are trainable guidance projections and is the sigmoid function. The query and key matrices are then shifted for every token using Eq. 10.
here, is a learnable scaling factor (initialized to 5.0) and broadcasts the shift across all N tokens. Attention proceeds normally as in Eq. 11.
\mathrm{Attn}(\mathbf{Q}^{\prime},\mathbf{K}^{\prime},\mathbf{V})=\mathrm{softmax}\left(\frac{\mathbf{Q}^{\prime}\mathbf{K}^{\prime}^{\top}}{\sqrt{d_{h}}}\right)\mathbf{V} \tag{11}here, is the per-head dimension. Each modified layer receives its own transformed guidance , and the modified layers are unfrozen to co-adapt. Guidance here reshapes how the image is looked at, redistributing attention across patches.
- Attention Injection Architecture (Attention-Matrix Injection)

Fig. 4: Attention injection: projected guidance modifies the query and key projections inside the vision transformer.
5 Experiments and Results
5.1 Experimental Setup
All models are trained on the augmented, top-500-filtered OK-VQA dataset with an image-level 80/20 train/validation split (zero image overlap). Training uses Adam with learning rate , batch size 8–16, up to 15 epochs with early stopping (patience 3–4) on validation exact match, and gradient clipping at norm 1.0 where applicable. The ViT and CLIP encoders remain frozen except for explicitly unfrozen fused layers. Experiments run on a single NVIDIA GPU (8–16 GB VRAM) in a Colab environment.
5.2 Main Results
Table 1 reports the comparison of integration strategies. Late fusion achieves the best score on every metric, improving exact match by +10.0 points over the no-guidance baseline and token F1 by +10.4. Attention-matrix injection also improves over the baseline, but by a far smaller margin (+2.4 EM), and its BERTScore is marginally below baseline (-0.2), indicating that the deep injection does not translate semantic guidance into better answers under this data regime.
Table 1: Comparison of knowledge integration strategies on the augmented OK-VQA subset (validation split). Best results in bold.
| Strategy | Depth EM (%) | Edit | Sim. | Token F1 | BERTScore | ΔEM |
|---|---|---|---|---|---|---|
| Baseline (no guidance) | — | 29.44 | 40.57 | 30.97 | 91.21 | — |
| Late fusion | shallow | 39.44 | 48.97 | 41.34 | 92.14 | +10.0 |
| Attention injection | deep | 31.80 | 42.66 | 33.33 | 91.00 | +2.4 |
5.3 Per-Question-Type Analysis

Fig. 5: Per question type exact match accuracy for the three strategies.
Figure 5 breaks down exact match by question type. Late fusion improves over the baseline in every category, with the largest gains on What is, Other, and Color questions – categories where external context most directly disambiguates the answer. Attention injection is competitive on Where questions (35.3, the best of the three) but collapses on Who (10.0 vs. baseline 25.4) and Yes/No (45.6 vs. 65.2), suggesting that globally shifting all patch queries and keys by a single guidance direction can actively disrupt attention patterns needed for person-centric and verification-style questions. Counting remains uniformly difficult ( 6%), as guidance concepts carry no numeric signal.
Aneerban Saha et al.
5.4 Error Distribution
Figure 6 shows the distribution of prediction outcomes. Late fusion reduces the completely wrong fraction from (baseline) to ; attention injection achieves a smaller reduction (to ). Qualitative inspection (Fig. 7) shows both guided models recovering answers the baseline misses entirely, e.g., stripe for zebra patterns and refrigerator for cooling with the baseline frequently answering with a salient object rather than the requested attribute or function, a failure mode the guidance context corrects.

Fig. 6: Error distribution analysis across the three strategies.
| Question | Ground | Truth | Baseline | Fusion | Attn Mod | |
|---|---|---|---|---|---|---|
| 0 | Through what type of area is the person skiing? | wood | mountain | mountain | mountain | |
| 1 | What pattern is on the zebras? | stripe | zebra | stripe | stripe | |
| 2 | What could i use in this room to cool things? | refriger | wicker | refriger | refriger | |
| 3 | What was contained within the suitcase? | cloth | hat | tv | tv | |
| 4 | What is the bed's shape in the given image? | circl | hors | bed | bed | |
| 5 | What food is usually consumed during this activity? | hot dog | veget | hotdog | hotdog | |
| 6 | What is the dominant shape in the tile pattern on the wall? | star | squar | squar | squar | |
| 7 | What is seen on the tennis court floor? | water | tenni | ball | ball | |
| 8 | Guess the location where the snowboarding is taking place | mountain | hors | mountain | mountain | |
| 9 | What is the horse being saddled up for? | ride | hors | ride | ride |
Fig. 7: Qualitative examples: guided variants recover attribute and knowledge dependent answers the visual only baseline misses.
5.5 Discussion: Why Does Shallow Beat Deep?
Our central finding – late fusion outperforming attention injection by 7.6 EM points which contradicts the assumption, implicit in much recent work [5, 6], that deeper knowledge integration is better. We identify three contributing factors.
(1) Preservation of pretrained representations. Late fusion leaves the frozen ViT computation untouched. Attention injection perturbs queries and keys in six of twelve layers (Eq. 10) and unfreezes those layers, so the model must re-stabilize its visual representation using only 29k training samples – insufficient to recover, let alone exceed, the pretrained optimum. This mirrors the negative results on naive attention supervision reported by Samaran et al. [13].
(2) Granularity mismatch. The guidance vector P is a single global direction (a mean over concept embeddings). Injecting one global direction into every patch token's query and key (the broadcast in Eq. 10) cannot express which region each concept refers to; it uniformly biases attention, which helps some question types (Where) and harms others (Who, Yes/No). Late fusion treats P as what it actually is a global semantic summary and fuses it at the global representation level.
(3) Optimization burden. Attention injection introduces per layer projections, gates, and scaling factors that must be learned jointly with unfrozen ViT layers, whereas late fusion trains a single linear fusion. In the six-samples-per-class regime, the smaller hypothesis space wins, consistent with fusion-depth findings in adjacent multimodal domains [12].
These results do not imply that deep integration is inherently inferior, but rather that integration depth must be matched to the data regime: under scarce fine-tuning data with frozen backbones, decision-level fusion of LLM guidance is the more reliable choice.
6 Conclusion
This paper presented an LLM-guided VQA framework in which structured reasoning – visual focus concepts, distractor elements and external knowledge is generated by Llama 3.3 70B, encoded with CLIP, and integrated into a frozen ViT + FLAN-T5 architecture, together with a paraphrasing pipeline expanding training data more than tenfold. A systematic comparison under identical data scarce conditions shows that shallow, decision-level late fusion delivers the largest gains (+10.0 exact match), while deep attention-matrix injection yields only marginal improvement and can disrupt attention patterns required for certain question types – attributable to pretrained representation preservation, the global granularity of the guidance signal, and optimization burden under scarce data.
Future work may inject concept level guidance with spatial correspondence, giving deep integration the regional signal it currently lacks; repeat the comparison at larger data scales to chart the shallow-deep crossover; and extend the guidance schema with numeric fields for counting questions, with evaluation on the official OK-VQA protocol for leaderboard comparability.
Bibliography
[1] Kenneth Marino, Mohammad Rastegari, Ali Farhadi, and Roozbeh Mottaghi. OK-VQA: A visual question answering benchmark requiring external knowledge. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3195–3204, 2019.
[2] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Yumao Lu, Zicheng Liu, and Lijuan Wang. An empirical study of GPT-3 for few-shot knowledge-based VQA. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 3081–3089, 2022.
[3] Liangke Gui, Borui Wang, Qiuyuan Huang, Alexander Hauptmann, Yonatan Bisk, and Jianfeng Gao. KAT: A knowledge augmented transformer for vision-and-language. In Proceedings of the 2022 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL-HLT), pages 956–968, 2022.
[4] Zhenwei Shao, Zhou Yu, Meng Wang, and Jun Yu. Prompting large language models with answer heuristics for knowledge-based visual question answering. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 14974–14983, 2023.
[5] Zhengtao He, Zheng Liu, Yingying Si, Geng Sun, Tao Zhang, Xiaoyu Tang, and Guandong Xu. KV-KBVQA: Effective KAN vision transformer for knowledge-based visual question answering with residual cross-modal attention. In Data Information in Online Environments (DIONE), LNICST, vol. 569, pages 56–72. Springer, Cham, 2026.
[6] Junnan Dong, Qinggang Zhang, Huachi Zhou, Daochen Zha, Pai Zheng, and Xiao Huang. Modality-aware integration with large language models for knowledge-based visual question answering. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL), pages 2417–2429, 2024.
[7] Kenneth Marino, Xinlei Chen, Devi Parikh, Abhinav Gupta, and Marcus Rohrbach. KRISP: Integrating implicit and symbolic knowledge for open-domain knowledge-based VQA. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 14111–14121, 2021.
[8] Jialin Wu, Jiasen Lu, Ashish Sabharwal, and Roozbeh Mottaghi. Multimodal answer validation for knowledge-based VQA. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 2712–2721, 2022.
[9] Hao Tan and Mohit Bansal. LXMERT: Learning cross-modality encoder representations from transformers. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 5100–5111, 2019.
[10] Wonjae Kim, Bokyung Son, and Ildoo Kim. ViLT: Vision-and-language transformer without convolution or region supervision. In Proceedings of the 38th International Conference on Machine Learning (ICML), PMLR vol. 139, pages 5583–5594, 2021.
[11] Andrew Shin and Takuya Narihira. Transformer-exclusive cross-modal representation for vision and language. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pages 2719–2725, 2021.
[12] Georgios Tziafas and Hamidreza Kasaei. Early or late fusion matters: Efficient RGB-D fusion in vision transformers for 3D object recognition. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 9558–9565, 2023.
[13] Jules Samaran, Noa Garcia, Mayu Otani, Chenhui Chu, and Yuta Nakashima. Attending self-attention: A case study of visually grounded supervision in vision-and-language transformers. In Proceedings of the ACL-IJCNLP 2021 Student Research Workshop, pages 81–86, 2021.
[14] Qingru Zhang, Chandan Singh, Liyuan Liu, Xiaodong Liu, Bin Yu, Jianfeng Gao, and Tuo Zhao. Tell your model where to attend: Post-hoc attention steering for LLMs. In International Conference on Learning Representations (ICLR), 2024.
[15] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021.
[16] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In Proceedings of the 38th International Conference on Machine Learning (ICML), PMLR vol. 139, pages 8748–8763, 2021.
[17] Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. BLIP: Bootstrapping language-image pre-training for unified vision-language understanding and generation. In Proceedings of the 39th International Conference on Machine Learning (ICML), PMLR vol. 162, pages 12888–12900, 2022.
[18] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67, 2020.
[19] Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, et al. Scaling instruction-finetuned language models. Journal of Machine Learning Research, 25(70):1–53, 2024.
[20] Haixing Dai, Zhengliang Liu, Wenxiong Liao, Xiaoke Huang, Yihan Cao, Zihao Wu, Lin Zhao, Shaochen Xu, Wei Liu, Ninghao Liu, et al. AugGPT: Leveraging ChatGPT for text data augmentation. IEEE Transactions on Big Data, 11:907–918, 2025.