🤖 AI/ML

Multimodal

Multimodal / Multi-modal AI

AI that processes multiple forms of data, such as text, images, audio, and video, in an integrated way. GPT-4o, Gemini 2, and Claude 3.5 are typical multimodal models.

📖 Detailed Explanation

Multimodal AI is artificial intelligence that can simultaneously understand and generate data in multiple forms (modalities), such as text, images, audio, and video. Because it can integrate diverse sensory information to make judgments and respond, much like humans do, it has far stronger comprehension and expressiveness than single-modality AI.

The advancement of multimodal AI was accelerated by the emergence of the Vision Transformer (ViT) and CLIP. CLIP used contrastive learning on text-image pairs to map the two modalities into the same embedding space, and this approach became the foundation of modern multimodal LLMs such as GPT-4V, Gemini, and Claude.

The core architecture of a multimodal model consists of encoders that process each modality and a fusion layer that integrates them. Images are processed by a Vision Encoder (ViT-based) and audio by an audio encoder such as Whisper, and the results are then combined with an LLM to perform cross-modal reasoning. Recently, native multimodal architectures have emerged that learn multiple modalities together from the start.

In practice, multimodal AI is used for document understanding (OCR + text analysis), video analysis, robot control, medical imaging diagnosis, e-commerce product description generation, and more. As of 2025, GPT-4o supports real-time text + image + audio input and output, and Gemini 2 supports multimodal reasoning with a 1-million-token context.

ModelInput modalityOutput modalityFeatures
GPT-4oText, image, audioText, audioReal-time voice conversation, emotion recognition
Gemini 2Text, image, audio, videoText, image1-million-token context
Claude 3.5Text, imageText200K context, strong at document analysis
Mistral Large 3Text, imageTextOpen-source multimodal LLM
Qwen-VL / LLaVAText, imageTextOpen source, self-hosting possible

💻 Code Example

# 멀티모달 AI API 사용 예제
import openai
import anthropic
import base64
from pathlib import Path

# 1. OpenAI GPT-4o 멀티모달 (이미지 분석)
client = openai.OpenAI()

def analyze_image_gpt4o(image_path: str, question: str):
    """GPT-4o로 이미지 분석"""
    # 이미지를 base64로 인코딩
    with open(image_path, "rb") as f:
        image_data = base64.b64encode(f.read()).decode("utf-8")

    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[
            {
                "role": "user",
                "content": [
                    {"type": "text", "text": question},
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": f"data:image/jpeg;base64,{image_data}",
                            "detail": "high"  # low, high, auto
                        }
                    }
                ]
            }
        ],
        max_tokens=1024
    )
    return response.choices[0].message.content

# 사용 예시
result = analyze_image_gpt4o(
    "chart.png",
    "이 차트에서 2024년 매출 트렌드를 분석해주세요."
)
print(result)


# 2. Claude 3.5 멀티모달 (문서 분석)
claude_client = anthropic.Anthropic()

def analyze_document_claude(image_path: str, instruction: str):
    """Claude로 문서/이미지 분석"""
    with open(image_path, "rb") as f:
        image_data = base64.standard_b64encode(f.read()).decode("utf-8")

    # 이미지 타입 감지
    suffix = Path(image_path).suffix.lower()
    media_types = {".png": "image/png", ".jpg": "image/jpeg", ".gif": "image/gif"}
    media_type = media_types.get(suffix, "image/jpeg")

    response = claude_client.messages.create(
        model="claude-3-5-sonnet-20241022",
        max_tokens=2048,
        messages=[
            {
                "role": "user",
                "content": [
                    {
                        "type": "image",
                        "source": {
                            "type": "base64",
                            "media_type": media_type,
                            "data": image_data
                        }
                    },
                    {"type": "text", "text": instruction}
                ]
            }
        ]
    )
    return response.content[0].text


# 3. 여러 이미지 비교 분석
def compare_images(image_paths: list[str], question: str):
    """여러 이미지를 동시에 분석"""
    content = [{"type": "text", "text": question}]

    for path in image_paths:
        with open(path, "rb") as f:
            image_data = base64.b64encode(f.read()).decode("utf-8")
        content.append({
            "type": "image_url",
            "image_url": {"url": f"data:image/jpeg;base64,{image_data}"}
        })

    response = client.chat.completions.create(
        model="gpt-4o",
        messages=[{"role": "user", "content": content}],
        max_tokens=2048
    )
    return response.choices[0].message.content


# 4. 오픈소스 멀티모달 (LLaVA / Qwen-VL)
# pip install transformers accelerate
from transformers import AutoProcessor, LlavaForConditionalGeneration
from PIL import Image

def analyze_with_llava(image_path: str, prompt: str):
    """LLaVA로 로컬 이미지 분석"""
    model_id = "llava-hf/llava-1.5-7b-hf"

    processor = AutoProcessor.from_pretrained(model_id)
    model = LlavaForConditionalGeneration.from_pretrained(
        model_id,
        torch_dtype="auto",
        device_map="auto"
    )

    image = Image.open(image_path)
    conversation = [
        {"role": "user", "content": [
            {"type": "image"},
            {"type": "text", "text": prompt}
        ]}
    ]

    text = processor.apply_chat_template(conversation, add_generation_prompt=True)
    inputs = processor(images=image, text=text, return_tensors="pt").to(model.device)

    output = model.generate(**inputs, max_new_tokens=512)
    return processor.decode(output[0], skip_special_tokens=True)

print("=== 멀티모달 AI 예제 실행 완료 ===")

🗣️ Say It Like This in Practice

💬 In a Product Planning Meeting
"I think we should add a multimodal feature to customer support. When a user uploads an error screenshot, GPT-4o analyzes the image and immediately tells them the cause of the problem and the solution. The resolution rate should go up by more than 30% compared to when we only receive text."
💬 In an Interview
"Multimodal AI is a model that processes multiple modalities in an integrated way. It embeds images with a Vision Encoder and combines them with an LLM to perform cross-modal reasoning. GPT-4o processes text, images, and audio natively, and in practice it is used for document understanding, product description generation, video summarization, and more."
💬 In a Technical Discussion
"Open-source multimodal models such as LLaVA and Qwen-VL have also come close to GPT-4V-level performance. If you can't use an API because of sensitive data, self-hosting can solve it. However, because of the Vision Encoder, a lot of VRAM is needed, so you should plan around an A100."

Take a mock interview on this topic → WIA SOOM AI Interview · Start for free

⚠️ Common Mistakes & Cautions

❌
Ignoring image resolution

Images that are too small degrade analysis quality, and images that are too large cause token costs to spike. With GPT-4o, use the detail: low/high option to balance quality against cost.

❌
Sending sensitive images

Personal information and trade secrets contained in images are sent to the cloud API. For sensitive data, use an on-premises multimodal model (LLaVA, Qwen-VL).

✅
The right approach: optimize by modality

Claude 3.5 is strong at document OCR, and GPT-4o is strong at real-time conversation. For video analysis, Gemini supports a long context. Choose the model that fits the purpose, and optimize costs through image preprocessing.

🔗 Related Terms

📚 Learn More