NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

LIVE: Learnable In-Context Vector for Visual Question Answering

Yingzhe Peng, chenduo hao, Xinting Hu, Jiawei Peng, Xin Geng, Xu Yang

In-Context Learning (ICL) has become the "Swiss Army Knife" of Large Language Models (LLMs). By simply prefixing a few examples (demonstrations) to a query, we can coax a model into performing new tasks without any fine-tuning. However, as we move into the realm of Large Multimodal Models (LMMs)—where we deal with both text and images—ICL hits a wall. Adding dozens of image-text pairs as context makes inference painfully slow and computationally expensive.

A new paper from researchers at Southeast University and Nanyang Technological University, titled "LIVE: Learnable In-Context Vector for Visual Question Answering," proposes a clever way out. Instead of feeding the model a long string of examples every time, they distill the "essence" of those examples into a single, learnable vector.

TL;DR

LIVE (Learnable In-Context Vector) replaces bulky multimodal demonstrations with a compact, trained vector that shifts the model's internal state toward the correct task. It outperforms 32-shot in-context learning in accuracy while being 25x faster in terms of FLOPs and nearly as fast as zero-shot inference.

What Problem Does This Paper Address?

Traditional In-Context Learning (ICL) suffers from two major "taxes":

  1. The Efficiency Tax: Every demonstration added to the prompt increases the number of tokens the Transformer must process. In multimodal tasks like Visual Question Answering (VQA), images consume significant "token real estate," leading to massive slowdowns.
  2. The Sensitivity Tax: ICL is notoriously fickle. If you pick the "wrong" examples or order them poorly, performance craters.
Conventional ICL vs. LIVE

Previous attempts to solve this in NLP used non-learnable "In-Context Vectors" (ICVs) extracted from the model's hidden layers during inference. While these work for simple text tasks, the authors found they fail miserably on complex tasks like VQA. These non-learnable vectors often get "stuck" on simple biases—like the model's tendency to answer "yes" or "no"—rather than understanding the nuances of a visual scene.

Methods: The LIVE Approach

The authors propose LIVE, which treats the effect of demonstrations as a "shift" in the model's latent space.

LIVE Methodology and Training

1. Mathematical Foundation

By decomposing the Self-Attention mechanism, the authors show that providing context to a query essentially adds a "shift vector" to the query's representation. LIVE aims to learn this shift directly.

2. Layer-wise Learnable Vectors

Instead of one global vector, LIVE assigns a unique learnable vector ($v_l$) and a weight factor ($\alpha_l$) to every layer of the LMM. This acknowledges that different layers of a model handle different levels of abstraction (e.g., early layers might process visual features, while later layers handle logic).

3. Distillation Training

To train these vectors, the authors use a two-part loss function:

  • KL Divergence ($L_d$): They force the model (using only the LIVE vector) to match the output probability distribution of the same model when it is actually given 32 real-world demonstrations.
  • Ground Truth Loss ($L_{gt}$): A standard cross-entropy loss to ensure the model actually gets the answer right.

By training on diverse, randomly sampled 32-shot examples, the LIVE vector learns to capture the "common denominator" of the task while ignoring the noise of individual examples.

Datasets and Evaluation

The primary evaluation was conducted on VQAv2 (the gold standard for open-ended VQA) and OKVQA (a more difficult benchmark requiring external knowledge). To prove generalization, they also tested on COCO Captioning, TextOCR, Clevr, and OcrVQA. The primary backbone model used was IDEFICS-9B, with additional validation on IDEFICS-v2-8B.

Key Insights and Results

  • ICL as a "Direction": The most profound insight is that ICL isn't just about providing information; it's about "steering" the model's latent states. LIVE proves you can steer the model just as well with a pre-calculated vector as you can with raw data.
  • Data Efficiency: Unlike LoRA (Low-Rank Adaptation), which often requires thousands of samples to tune a model, LIVE achieves near-peak performance with as few as 500 to 700 training samples.
  • Accuracy Boost: On VQAv2, LIVE achieved 58.54% accuracy, surpassing 32-shot ICL (56.18%) and Zero-Shot (29.25%).
  • Massive Speedup: LIVE requires only 1/24.97 of the FLOPs compared to 32-shot ICL. In real-world runtime, it is 8.25x faster than 32-shot ICL, performing almost identically to a zero-shot model.
  • Robustness and Generalizability: LIVE is significantly more robust than ICL, providing a stable, "optimized" task representation. A "General LIVE" vector, trained across multiple datasets, still outperformed 32-shot ICL, suggesting these vectors capture universal task-solving strategies.

Limitations and Future Work

While the results are impressive, the authors note a few areas for growth. The current study focuses primarily on the IDEFICS architecture; testing on a wider variety of LMMs (like LLaVA or Qwen-VL) would be beneficial. Additionally, while VQA is the primary focus, future work could explore if LIVE can handle even more complex, multi-step reasoning tasks or long-form video understanding.

Source: Peng et al., "LIVE: Learnable In-Context Vector for Visual Question Answering," NeurIPS 2024.

Summary updated

BibTeX
@inproceedings{peng2024live,
  author = {Yingzhe Peng and chenduo hao and Xinting Hu and Jiawei Peng and Xin Geng and Xu Yang},
  title = {{LIVE: Learnable In-Context Vector for Visual Question Answering}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=QhRemVrZbG},
}
Figure