Soft Knowledge Prompt: Help External Knowledge Become a Better Teacher to Instruct LLM in Knowledge-based VQA

Qunbo Wang, Ruyi Ji, Tianhao Peng, Wenjun Wu, Zechao Li, Jing LiuACL 2024

Abstract

LLM has achieved impressive performance on multi-modal tasks, which have received ever-increasing research attention. Recent research focuses on improving prediction performance and reliability (e.g., addressing the hallucination problem). They often prepend relevant external knowledge to the input text as an extra prompt. However, these methods would be affected by the noise in the knowledge and the context length limitation of LLM. In our work, we focus on making better use of external knowledge and propose a method to actively extract valuable information in the knowledge to produce the latent vector as a soft prompt, which is then fused with the image embedding to form a knowledge-enhanced context to instruct LLM. The experimental results on knowledge-based VQA benchmarks show that the proposed method enjoys better utilization of external knowledge and helps the model achieve better performance.

Introduction

Knowledge-based Visual Question Answering (VQA) is a complex task requiring models to synthesize visual information, textual questions, and external world knowledge. While Multimodal Large Language Models (MLLMs) are powerful, they often struggle with outdated internal knowledge or hallucinations.

The standard solution, Retrieval-Augmented Generation (RAG), typically involves prepending raw text snippets to the LLM prompt. However, this "traditional approach" faces three major hurdles: noise from irrelevant retrieved text, context window limitations, and the potential for the LLM to be distracted by topically similar but unhelpful information. To overcome these, we propose the Soft Knowledge Prompt (SKP) framework.

Methodology

The SKP framework treats external knowledge as a "teacher" that provides refined signals rather than raw, noisy data. Instead of passive retrieval, SKP actively "mines" pivotal information.

Comparison of the traditional approach vs. the proposed SKP framework.

The process involves several key innovations:

  • Knowledge Mining: The system uses visual features and the question as a query to calculate multi-head similarity across the tokens of retrieved knowledge, identifying exactly which parts are relevant to the specific image-question pair.
  • Soft Prompt Generation: This relevant information is compressed into a Soft Knowledge Prompt ($P$)—a latent vector in the LLM's embedding space. This is significantly more token-efficient than raw text.
  • Dynamic Fusion: A gating mechanism adaptively balances the importance of visual features ($V$) and the knowledge prompt ($P$) before they are fed into the LLM.
  • Tailored Optimization: The model is trained using a supervision signal that identifies "positive" knowledge (snippets that correct errors) and "negative" knowledge (snippets that lead to errors), training the model to prioritize helpful information.

Experimental Results

The SKP framework was evaluated on two primary benchmarks: OK-VQA (14,000+ questions) and A-OKVQA (a more challenging successor requiring broader reasoning).

Performance comparison on the OK-VQA dataset.

As shown in the results for OK-VQA, SKP demonstrated significant performance gains:

  • State-of-the-Art Performance: Using a Vicuna-7B backbone, SKP achieved a 63.3 VQA Score, outperforming much larger models like GPT-3 (175B) based systems (e.g., PICa at 48.0).
  • Efficiency: SKP outperformed the traditional text-prepending approach (63.3 vs 61.2), proving that the method of incorporation is as vital as the knowledge itself.
  • Robustness: On the difficult A-OKVQA dataset, SKP reached a score of 65.3, significantly higher than the traditional incorporation approach (63.8).

Conclusion

The Soft Knowledge Prompt framework effectively mitigates the noise and context constraints of traditional RAG in VQA tasks. By converting external knowledge into optimized latent vectors, SKP provides cleaner and more effective instructions to LLMs. Future work will explore co-training the retriever and the SKP miner to create a seamless end-to-end pipeline for knowledge-based reasoning.

Summary updated

BibTeX
@inproceedings{wang2024soft,
  author = {Qunbo Wang and Ruyi Ji and Tianhao Peng and Wenjun Wu and Zechao Li and Jing Liu},
  title = {{Soft Knowledge Prompt: Help External Knowledge Become a Better Teacher to Instruct LLM in Knowledge-based VQA}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2024},
  url = {https://openreview.net/forum?id=qQsx8Hq8if},
}
Figure