Multimodal RAG Architecture Optimization for Production

microsoft · Tech · 2024 · source Agentic: no · promotional bias: low · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Enterprise multimodal RAG

Microsoft ISE needed a RAG pipeline that could answer enterprise document questions grounded in both text and images, while making ingestion and retrieval efficient enough for production use.

Constraints:

Architecture

The team enriched document images with GPT-4V descriptions at ingestion, stored those descriptions with text in Azure AI Search, and systematically tuned chunking, prompts, classifiers, metadata, and inference model selection.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  document-ingestion["Document Ingestion"]
  image-filtering["Image Filtering"]
  gpt-4v-image-enrichment["GPT-4V Image Enrichment"]
  text-chunking["Text Chunking"]
  azure-ai-search["Azure AI Search"]
  inference-model["Inference Model"]
  document-ingestion --> image-filtering
  document-ingestion --> text-chunking
  image-filtering --> gpt-4v-image-enrichment
  gpt-4v-image-enrichment --> azure-ai-search
  text-chunking --> azure-ai-search
  azure-ai-search --> inference-model
  inference-model --> azure-ai-search
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Document Ingestion Processes enterprise documents containing text and images. Image Filtering, Text Chunking
Image Filtering Selects images worth enriching to reduce ingestion latency. GPT-4V Image Enrichment
GPT-4V Image Enrichment Generates detailed descriptions of document images. Azure AI Search
Text Chunking Creates searchable text chunks from documents. Azure AI Search
Azure AI Search Stores text, image descriptions, vectors, and metadata for retrieval. Inference Model
Inference Model Answers domain queries from retrieved multimodal context. Azure AI Search

Data flow

Documents are ingested, image-containing pages are filtered, GPT-4V generates descriptions for selected images, text and image chunks plus metadata are indexed in Azure AI Search, and the inference model retrieves grounded context to answer user queries.

“The solution uses GPT-4V to generate detailed image descriptions during ingestion, storing them alongside text in Azure AI Search for unified vector retrieval.”summary, stated
“intelligent image filtering”summary, implied

Why this architecture

Separating image enrichment from inference let the team use the strongest model for each stage while indexing image meaning in the same retrieval system as text.

“GPT-4V was superior for image enrichment while GPT-4o performed better for inference”summary, stated
“separate image chunks outperformed inline descriptions for retrieval”summary, stated

Models used: GPT-4V · GPT-4o · Azure AI Search

Scale

Alternatives considered (roads not taken)

Inline image descriptions inside text chunks

Rejected because: Separate image chunks performed better for retrieval.

“separate image chunks outperformed inline descriptions for retrieval”summary, stated

Use the same model for image enrichment and inference

Rejected because: GPT-4V was better for enrichment while GPT-4o was better for inference.

“GPT-4V was superior for image enrichment while GPT-4o performed better for inference”summary, stated

Patterns

rag-retrieval (retrieval)

Text and generated image descriptions are indexed together for grounded multimodal retrieval.

“storing them alongside text in Azure AI Search for unified vector retrieval.”summary, stated

eval-driven-development (evaluation)

The team used systematic experiments to choose prompts, chunking, thresholds, metadata, and models.

“Through systematic experimentation, the team optimized several pipeline components including image enrichment prompts, chunk structure, classifier thresholds, and model selection”summary, stated

model-routing (model-selection)

Different models were selected for enrichment and inference based on observed performance.

“GPT-4V was superior for image enrichment while GPT-4o performed better for inference”summary, stated

Tradeoffs

Filter images before enrichment

Chose Classifier-thresholded enrichment over Enrich every image in every document.

Rationale: Filtering preserved retrieval improvement while reducing ingestion latency.

“including image enrichment prompts, chunk structure, classifier thresholds, and model selection, achieving improved retrieval metrics while reducing ingestion latency by 30-50%”summary, stated

Use document metadata in retrieval

Chose Metadata-aware source retrieval over Content-only retrieval.

Rationale: Metadata improved source recall.

“including document metadata significantly improved source recall.”summary, stated

Gotchas (what bit them)

Image enrichment can make ingestion too slow if applied indiscriminately.

Root cause: Every image sent to a vision model adds processing cost and latency.

Resolution: Use intelligent image filtering before enrichment.

“reducing ingestion latency by 30-50% through intelligent image filtering.”summary, stated

Naive chunk representation can bury image evidence.

Root cause: Inline descriptions did not retrieve as well as separate image chunks.

Resolution: Index image descriptions as separate retrievable chunks.

“separate image chunks outperformed inline descriptions for retrieval”summary, stated

Evaluation

The team ran controlled experiments over pipeline components and measured retrieval metrics plus ingestion latency.

Metrics: Retrieval metrics · Source recall · Ingestion latency

“achieving improved retrieval metrics while reducing ingestion latency by 30-50% through intelligent image filtering.”summary, stated

Outcomes

The report gives a 30-50% ingestion-latency reduction but does not disclose corpus size or production traffic.

“Key findings included that separate image chunks outperformed inline descriptions for retrieval, GPT-4V was superior for image enrichment while GPT-4o performed better for inference, and including document metadata significantly improved source recall.”summary, stated