🚀 Try Zilliz Cloud, the fully managed Milvus, for free—experience 10x faster performance! Try Now>>

Milvus
Zilliz
  • Home
  • AI Reference
  • How might we incorporate multiple modalities in RAG (say retrieving an image or a table) and still use an LLM for generation? What additional evaluation considerations does this bring?

How might we incorporate multiple modalities in RAG (say retrieving an image or a table) and still use an LLM for generation? What additional evaluation considerations does this bring?

To incorporate multiple modalities like images or tables into a RAG (Retrieval-Augmented Generation) system while using an LLM for generation, the key challenge is aligning diverse data types with the text-centric nature of most LLMs. First, the retrieval component must index and query multimodal data. For images, this could involve using vision-language models (e.g., CLIP) to generate embeddings that map images and text into a shared space, allowing retrieval based on semantic similarity. Tables might be processed by serializing them into structured text (e.g., “Column A: X, Column B: Y”) or using specialized embeddings that capture tabular relationships. During generation, the LLM needs contextual access to these retrieved items. For example, an image could be described via a captioning model, and the caption would be fed to the LLM alongside text snippets. Tables might be summarized or converted into natural language descriptions to fit the LLM’s input constraints.

A practical implementation could involve a hybrid retrieval pipeline. Suppose a user asks, “What causes seasonal temperature changes?” The system might retrieve a text paragraph explaining axial tilt, an image of Earth’s orbit, and a table of temperature averages. The image would be processed into a textual description (e.g., “Diagram showing Earth’s elliptical orbit around the Sun”), and the table might be summarized as “Summer temperatures range from 20°C to 35°C.” The LLM then synthesizes these inputs into a coherent answer, referencing the image’s content and table data. Tools like BLIP-2 for image-to-text or TAPAS for table parsing could bridge modality gaps, ensuring the LLM receives unified context despite varying data formats.

Evaluating such systems introduces new considerations. First, multimodal relevance: metrics must assess whether retrieved images/tables align with the query’s intent, not just textual matches. This could involve human evaluation or vision-language similarity scores (e.g., CLIP-based metrics). Second, output consistency: does the generated text correctly reference non-textual data? For example, if an answer cites a table’s values, automated checks could verify numerical accuracy. Third, performance trade-offs: processing images/tables adds latency, so benchmarks must track speed versus accuracy. Finally, user experience metrics (e.g., clarity of multimodal references) become critical, as poorly integrated images or tables could confuse users. Testing should also account for edge cases, like retrieving an irrelevant image that the LLM mistakenly incorporates, highlighting the need for robustness in cross-modal alignment.

Like the article? Spread the word