#586·Qwen-VL

How to extract joint image-text embeddings from Qwen-VL?

Author: saniawaheed97Created Apr 15, 2026Updated Apr 15, 2026

Hi,

I’m trying to use Qwen-VL as an embedding model instead of for generation, and I had a question about accessing intermediate multimodal representations.

Given an image + text prompt, I want to extract a joint representation that reflects both modalities (from the decoder hidden states before text generation), and use it for similarity-based retrieval.

Questions

  1. Where is the best place to extract this joint representation? Final LLM hidden states, or a specific decoder layer, or cross-attention outputs?

  2. What representation would you recommend for downstream tasks like retrieval?

    • Mean pooling over tokens?
    • Specific tokens (e.g., text tokens after cross-attention)?
  3. Does Qwen-VL support returning hidden states (e.g., output_hidden_states=True)?

Any pointers to relevant code sections would also be really helpful.

Thanks!