Multimodal Generative AI
ExampleCo’s newest policy is a scanned PDF. The “text” extractor returns nothing because each page is an image. An employee then asks a question by voice, and the transcription mistakes “not eligible” for “eligible.”
Multimodal systems work with more than one type of information, such as text, images, and audio. The important design question is where meaning can be lost as information moves between those forms.
Understanding vs Generating a Modality
| Capability | Input | Output | Example |
|---|---|---|---|
| Image understanding | Image and question | Text or structured result | Read a scanned policy table |
| Image generation | Text and optional images | Image | Create an illustration |
| Speech recognition | Audio | Transcript | Convert a spoken question to text |
| Speech generation | Text or other input | Audio | Read an answer aloud |
| Audio understanding | Audio and task | Interpretation or response | Identify relevant spoken content |
A model that accepts images does not necessarily generate them. A speech model is not automatically suitable for a document table. Check actual supported inputs, outputs, limits, and quality.
Two Ways to Read the Scanned Policy
Option A: Extract Text First
Optical character recognition (OCR) converts text visible in an image into machine-readable text.
Scanned page -> OCR and layout extraction -> Text passages
-> Existing retrieval and answer pipelineAdvantages:
- Text is searchable and inspectable.
- The normal RAG pipeline can be reused.
- Repeated questions need not reprocess the same image.
Risks:
20may be read as28.- A table header may attach to the wrong row.
- A footnote or negation may disappear.
- A diagram may not be represented well in plain text.
Option B: Send the Image to a Capable Model
Authorized page image + question -> Multimodal model -> Candidate answerThis can preserve visual relationships that plain OCR loses, but:
- The model can still misread a number or table.
- High-resolution pages can increase processing cost.
- Searching a large image collection still requires an indexing strategy.
- Citations need a page, region, or other stable location.
Direct visual input is not a guarantee of superior correctness.
A Hybrid Pipeline
flowchart TD
D["Approved scanned policy"] --> A["Authorize and validate file"]
A --> E["Extract text and layout"]
E --> Q{"Extraction adequate for indexing?"}
Q -->|"Yes"| I["Index versioned text with page references"]
Q -->|"No"| V["Visual processing or human review"]
V --> I
U["Spoken employee question"] --> T["Transcribe and preserve uncertainty"]
T --> R["Retrieve permitted current evidence"]
I --> R
R --> G["Generate and validate answer"]
G --> O["Text answer or approved speech output"]An “adequate extraction” gate needs defined checks: expected page count, nonempty content, table integrity checks where feasible, and review of critical numbers. A generic model confidence score is not enough.
Preserve Structure and Provenance
For a scanned table:
Region | Employment type | Annual days
A | Full-time | 20
B | Full-time | 30The useful extracted record is not just A 20 B 30.
Keep:
- Source document ID and version.
- Page number and, when available, bounding region.
- Column headers and row associations.
- Extraction method/version.
- Review state or known uncertainty.
When a policy value is high-impact, consider a reviewed structured record instead of repeatedly asking a model to interpret the image.
Audio Adds a Different Error Surface
A spoken question can be affected by accents, background noise, overlapping speakers, and similar-sounding terms.
For example:
Spoken: "Am I not eligible for carryover?"
Transcribed: "Am I eligible for carryover?"Retrieval may work perfectly on the wrong question. When a critical ambiguity remains, ask the user to confirm the transcript or relevant detail.
Do not treat a voice recording or speaker resemblance as sufficient application authentication or approval for a consequential action.
A Small Processing Skeleton
PSEUDOCODE
identity = authenticate(request)
file = validate_supported_type_size_and_content(request.file)
require_upload_permission(identity, file.destination)
derived = extract_text_and_layout(file)
if derived.empty or derived.required_structure_invalid:
mark_processing_needs_review()
return explicit_processing_status()
store_versioned_derived_content(
text=derived.text,
source_locations=derived.locations,
method_version=derived.method_version,
permissions=inherited_source_permissions
)
if request.includes_audio_question:
transcript = transcribe_with_approved_processor(request.audio)
if critical_meaning_uncertain(transcript):
return ask_for_transcript_confirmation()
continue_with_authorized_rag()The uncertainty check is a product rule informed by evaluated signals and user context, not a universal speech-confidence threshold.
Cost and Latency Need Modality-Specific Units
Text token estimates do not transfer blindly to images or audio.
| Input/output | Possible usage driver |
|---|---|
| Image | Resolution, number of crops/tiles, provider image accounting |
| Audio input | Duration, format, transcription or model-specific units |
| Audio output | Generated duration or model-specific units |
| Video | Frame sampling, duration, audio, and temporal processing |
| Extracted text | Text tokens plus extraction work |
Provider accounting differs. Estimate using the actual processing path and verify with measured usage.
Compare:
- One-time OCR plus repeated text retrieval.
- Repeated direct image-model calls.
- A hybrid that sends only selected pages to visual processing.
For frequently queried static policies, preprocessing can amortize cost. For a one-off chart question, direct image input may be simpler.
Privacy and Injection Follow the Content
- A scanned page can contain personal data.
- An audio recording can contain unrelated speakers.
- A transcript or image caption is another derived copy.
- Instructions inside media remain untrusted content.
- A hosted OCR or speech service is a data processor too.
Apply source permissions, provider review, encryption, retention, deletion, and safe logging across originals and derivatives. See GenAI safety.
Evaluate by Modality and Failure Type
| Slice | What to test |
|---|---|
| Scans | Low contrast, rotation, small type |
| Tables | Headers, row alignment, merged cells |
| Numbers | Similar characters and decimal separators |
| Audio | Noise, accents, negation, unusual policy names |
| Mixed input | Whether the model attributes each claim to the right source |
| Generated speech | Whether spoken values match the validated text |
Do not let good clean-image performance hide poor scanned-table performance. Separate extraction/transcription errors from retrieval and generation errors.
Related Concepts
- RAG ingestion covers evidence preparation.
- Evaluation covers slices and stage isolation.
- Serving and cost covers complete-path budgets.
Trade-offs
| Approach | Benefit | Limitation |
|---|---|---|
| OCR then text RAG | Inspectable, reusable index | Loses some visual meaning |
| Direct image input | Preserves visual relationships | Cost and model interpretation errors |
| Speech-to-text first | Reuses text workflow | Transcription can change intent |
| Direct audio model | Integrated interaction | Harder stage isolation and provider-specific behavior |
| Human-reviewed extraction | Stronger critical-data confidence | Review effort and delay |
Test Your Understanding
Try answering before expanding. Explain the missing assumption, not just the vocabulary.