Table of Contents
Fetching ...

Prompt Highlighter: Interactive Control for Multi-Modal LLMs

Yuechen Zhang, Shengju Qian, Bohao Peng, Shu Liu, Jiaya Jia

TL;DR

Prompt Highlighter introduces a training-free, token-level interaction paradigm to control multi-modal LLMs and VLMs by highlighting input spans and guiding generation through classifier-free guidance-inspired mechanisms. The approach builds two-branch conditioning and attention-activation strategies to bias token probabilities and attention toward highlighted content, enabling more focused, reliable outputs without fine-tuning. It supports both direct visual token mappings and Q-Former based mappings, and demonstrates improvements on general VLM benchmarks, reliable description metrics, and user studies, while maintaining practical efficiency. The work highlights the potential of granular, interactive input control to enhance explainability and robustness in multimodal generation, with broad applicability across captioning, QA, and description tasks.

Abstract

This study targets a critical aspect of multi-modal LLMs' (LLMs&VLMs) inference: explicit controllable text generation. Multi-modal LLMs empower multi-modality understanding with the capability of semantic generation yet bring less explainability and heavier reliance on prompt contents due to their autoregressive generative nature. While manipulating prompt formats could improve outputs, designing specific and precise prompts per task can be challenging and ineffective. To tackle this issue, we introduce a novel inference method, Prompt Highlighter, which enables users to highlight specific prompt spans to interactively control the focus during generation. Motivated by the classifier-free diffusion guidance, we form regular and unconditional context pairs based on highlighted tokens, demonstrating that the autoregressive generation in models can be guided in a classifier-free way. Notably, we find that, during inference, guiding the models with highlighted tokens through the attention weights leads to more desired outputs. Our approach is compatible with current LLMs and VLMs, achieving impressive customized generation results without training. Experiments confirm its effectiveness in focusing on input contexts and generating reliable content. Without tuning on LLaVA-v1.5, our method secured 70.7 in the MMBench test and 1552.5 in MME-perception. The code is available at: https://github.com/dvlab-research/Prompt-Highlighter/

Prompt Highlighter: Interactive Control for Multi-Modal LLMs

TL;DR

Prompt Highlighter introduces a training-free, token-level interaction paradigm to control multi-modal LLMs and VLMs by highlighting input spans and guiding generation through classifier-free guidance-inspired mechanisms. The approach builds two-branch conditioning and attention-activation strategies to bias token probabilities and attention toward highlighted content, enabling more focused, reliable outputs without fine-tuning. It supports both direct visual token mappings and Q-Former based mappings, and demonstrates improvements on general VLM benchmarks, reliable description metrics, and user studies, while maintaining practical efficiency. The work highlights the potential of granular, interactive input control to enhance explainability and robustness in multimodal generation, with broad applicability across captioning, QA, and description tasks.

Abstract

This study targets a critical aspect of multi-modal LLMs' (LLMs&VLMs) inference: explicit controllable text generation. Multi-modal LLMs empower multi-modality understanding with the capability of semantic generation yet bring less explainability and heavier reliance on prompt contents due to their autoregressive generative nature. While manipulating prompt formats could improve outputs, designing specific and precise prompts per task can be challenging and ineffective. To tackle this issue, we introduce a novel inference method, Prompt Highlighter, which enables users to highlight specific prompt spans to interactively control the focus during generation. Motivated by the classifier-free diffusion guidance, we form regular and unconditional context pairs based on highlighted tokens, demonstrating that the autoregressive generation in models can be guided in a classifier-free way. Notably, we find that, during inference, guiding the models with highlighted tokens through the attention weights leads to more desired outputs. Our approach is compatible with current LLMs and VLMs, achieving impressive customized generation results without training. Experiments confirm its effectiveness in focusing on input contexts and generating reliable content. Without tuning on LLaVA-v1.5, our method secured 70.7 in the MMBench test and 1552.5 in MME-perception. The code is available at: https://github.com/dvlab-research/Prompt-Highlighter/
Paper Structure (49 sections, 9 equations, 20 figures, 8 tables, 2 algorithms)

This paper contains 49 sections, 9 equations, 20 figures, 8 tables, 2 algorithms.

Figures (20)

  • Figure 1: Prompt Highlighter facilitates token-level user interactions for customized generation, compatible with both LLMs and VLMs. Compared with vanilla inference and prompt engineering, the context-highlighted inference provided by our method offers controllable generations and produces customized results. Outputs correlated with the highlighted parts are underlined.
  • Figure 2: An abstract pipeline of Prompt Highlighter. Users can control the focus of generation by marking out specific image regions or text spans. Then a token-level mask $\mathbf{m}$ is created to guide the language model's inference.
  • Figure 3: Visualizing attention maps. Left: A segment of the attention map between the generated tokens and the input requirement prompt: "… fix the grammar and keep LaTeX format, make it compact…". Some representative tokens are marked for reference. Right: Query-based token mapping. This shows the attention score on 32 queries in the first cross-attention layer of the Q-Former.
  • Figure 4: Highlighting visual tokens with Q-Former-based methods. In comparison with vanilla inference, we augment the learnable queries $\mathbf{q}$ by activating corresponding attention weights in the Cross-Attention (CA) blocks.
  • Figure 5: Attention scores in the first four queries of the Q-Former. Each row shows a different user selection and text output.
  • ...and 15 more figures