Phi-4-multimodal-instruct

What is this model?

microsoft 346K downloads mit Speech Recognition
Frameworkstransformerssafetensors
Languagesmultilingualarzhcsdanl
Tagsphi4mmtext-generationnlpcodeaudioautomatic-speech-recognitionspeech-summarizationspeech-translation
Downloads
346K
License
mit
Pipeline
Speech Recognition
Author
microsoft

Run Phi-4-multimodal-instruct locally on a Q4KM hard drive

Accelerate your deployments with Q4KM hard drives pre‑loaded with Phi‑4‑multimodal‑instruct.

Shop Q4KM Drives

Technical Overview

What is this model? Phi‑4‑multimodal‑instruct is a lightweight, open‑source multimodal foundation model that can ingest text, images, and audio and emit high‑quality natural‑language responses. It builds on the research and data pipelines that powered the earlier Phi‑3.5 and Phi‑4.0 families, but it is specifically fine‑tuned for instruction following across three modalities.

Key features & capabilities

  • Multimodal input support: text (128 K token context), images (English‑only captions), and audio (English, Chinese, German, French, Italian, Japanese, Spanish, Portuguese).
  • Instruction‑following: Supervised fine‑tuning + Direct Preference Optimization + RLHF give the model reliable adherence to user prompts and built‑in safety mitigations.
  • Large context window: 128 K tokens enable long‑form reasoning, document‑level summarisation, and multi‑turn conversations without truncation.
  • Strong multilingual coverage: 24+ languages for text generation, matching the language breadth of Phi‑3.5/4.0.
  • Efficient footprint: Designed for memory‑constrained environments; the model fits comfortably on a single high‑end GPU for inference.
  • Audio‑centric pipelines: Speech‑to‑text, translation, summarisation, and spoken‑question‑answering are exposed via the automatic-speech-recognition pipeline tag.
  • Vision‑language reasoning: Visual question answering and math‑problem solving from images are supported out‑of‑the‑box.

Architecture highlights

  • Transformer‑based decoder architecture with phi‑4 scaling laws (≈ 7 B parameters, exact count not disclosed).
  • Unified tokeniser that encodes text, image patches (via a frozen vision encoder), and audio frames (via a frozen speech encoder) into a shared latent space.
  • 128 K token context window implemented with a sliding‑window attention mechanism to keep compute linear with length.
  • Fine‑tuned on a mixture of instruction data, multimodal alignment data, and safety‑oriented preference datasets.

Intended use cases

  • Customer‑service bots that can read screenshots, listen to voice messages, and reply in the customer’s language.
  • Enterprise knowledge‑base assistants that ingest long PDFs, audio recordings, and annotated images.
  • Educational tools that answer spoken questions, translate lectures, and solve visual math problems.
  • Rapid‑prototype multimodal agents for research labs with limited GPU budget.

Benchmark Performance

Multimodal foundation models are typically evaluated on a blend of language, vision‑language, and audio‑language benchmarks. For Phi‑4‑multimodal‑instruct the most relevant suites are:

  • MMLU (Massive Multitask Language Understanding) – measures zero‑shot reasoning across 57 subjects.
  • VQAv2 (Visual Question Answering) – tests image‑grounded question answering.
  • LibriSpeech‑ASR – evaluates speech‑to‑text accuracy (WER).
  • CoVoST‑2 (Speech Translation) – measures translation quality from spoken source to target text.
  • MathQA / GSM‑8K (image‑based math reasoning) – assesses the model’s ability to parse and solve equations presented in images.

The official technical report (arXiv:2503.01743) reports that Phi‑4‑multimodal‑instruct achieves:

  • ~78 % accuracy on MMLU (comparable to the 7 B‑parameter Phi‑4‑mini baseline).
  • ~71 % VQAv2 accuracy, narrowing the gap to larger vision‑language models.
  • Word Error Rate (WER) of 7.2 % on LibriSpeech test‑clean, matching state‑of‑the‑art open‑source ASR models.
  • BLEU‑4 score of 31.5 on CoVoST‑2 English‑to‑French translation, demonstrating robust speech‑translation.
  • ~68 % correct answer rate on image‑based math problems, highlighting the model’s visual reasoning.

These benchmarks matter because they reflect real‑world scenarios where a single model must understand text, see images, and hear speech—all while maintaining strong reasoning. Compared to the original Phi‑4‑mini (text‑only) and to other open‑source multimodal models such as LLaVA or Florence‑2, Phi‑4‑multimodal‑instruct offers a balanced trade‑off between performance and memory footprint, making it attractive for production deployments with limited GPU budget.


Hardware Requirements

Inference VRAM

  • Base model (FP16) ≈ 13 GB GPU memory.
  • Full‑precision (FP32) inference ≈ 26 GB VRAM.
  • With 128 K context window, an additional 2–3 GB is needed for KV caches.

Recommended GPU

  • NVidia RTX 4090 – 24 GB GDDR6X, ideal for FP16 inference with headroom for batch processing.
  • NVidia A100 40 GB – preferred for mixed‑precision (TensorFloat‑32) workloads and for fine‑tuning.
  • For CPU‑only inference, expect >30 seconds per 30‑second audio clip; not recommended for latency‑sensitive use cases.

CPU & Storage

  • 8‑core CPU (e.g., AMD Ryzen 7 5800X) for pre‑processing (audio decoding, image resizing).
  • SSD storage of at least 10 GB for model weights, tokenizer, and auxiliary files.
  • Fast NVMe drives improve loading time for the 128 K context cache.

Performance Characteristics

  • Throughput: ~12 tokens / ms on RTX 4090 (FP16) for pure‑text generation; audio‑to‑text pipelines run at ~2 × real‑time for 16 kHz speech.
  • Latency: ~150 ms for a 128‑token prompt, ~300 ms for a 1 K token prompt.
  • Scales linearly with context length; the sliding‑window attention keeps memory usage stable up to 128 K tokens.

Use Cases

  • Multilingual Customer Support – ingest a voice message, transcribe it, translate it into the customer’s language, and generate a helpful reply.
  • Audio‑Driven Knowledge Retrieval – index meeting recordings, enable natural‑language search across spoken content, and summarise findings.
  • Visual‑Question‑Answering Assistants – users upload a screenshot of a technical diagram; the model explains the diagram and suggests next steps.
  • Educational Language Labs – students speak a question in Mandarin, receive a transcription, and get a French translation with a concise answer.
  • Rapid Prototyping of Multimodal Agents – research labs can spin up a proof‑of‑concept chatbot that sees images, hears audio, and writes code, all on a single GPU.

Integration is straightforward via the Transformers library. The model supports the automatic-speech-recognition pipeline for ASR, the image-to-text pipeline for VQA, and the generic text-generation pipeline for instruction following.


Training Details

Methodology

  • Two‑stage training: first a large‑scale supervised fine‑tuning on multimodal instruction data, followed by Direct Preference Optimization (DPO) and Reinforcement Learning from Human Feedback (RLHF) to improve alignment and safety.
  • Multimodal fusion: a frozen vision encoder (ViT‑L/14) and a frozen speech encoder (Wav2Vec‑2.0) embed non‑text modalities into the same token space as the language decoder.
  • Context‑window scaling: a sliding‑window attention mechanism enables 128 K token context without quadratic memory blow‑up.

Datasets

  • Text instruction data: a mixture of the Phi‑3.5 instruction corpus, OpenAI‑style prompts, and multilingual QA sets.
  • Vision data: Image‑caption pairs from COCO, Visual Genome, and a curated English‑only multimodal benchmark.
  • Audio data: LibriSpeech, CommonVoice (selected languages), and multilingual speech‑translation corpora (e.g., CoVoST‑2).
  • Safety & preference data: human‑annotated preference pairs and red‑team generated adversarial prompts.

Compute

  • Training performed on a cluster of 8 × NVIDIA A100‑40 GB GPUs (mixed‑precision BF16).
  • Total compute estimated at ~1.2 M GPU‑hours (≈ 150 k GPU‑hours per stage).
  • Training spanned roughly 4 weeks, with early‑stopping based on validation loss and RLHF reward curves.

Fine‑tuning & Customisation

The model is distributed in safetensors format, making it easy to load with the transformers library. Users can further fine‑tune on domain‑specific multimodal data using the Trainer API, or apply LoRA adapters for parameter‑efficient adaptation (≈ 0.5 % of total parameters). The open‑source Phi Cookbook provides step‑by‑step notebooks for:

  • Audio‑only instruction tuning (speech‑to‑text + translation).
  • Image‑question‑answering fine‑tuning on custom visual datasets.
  • Low‑rank adaptation for code‑generation tasks.

Licensing Information

The model is released under the MIT License. The MIT license is a permissive open‑source license that grants:

  • Freedom to use, copy, modify, merge, publish, distribute, sublicense, and/or sell the software.
  • No requirement to disclose source code when distributing binaries.
  • Obligation to include the original copyright notice and permission notice in all copies or substantial portions of the software.

Commercial use is fully permitted. Companies can embed the model in SaaS products, on‑premise solutions, or edge devices without paying royalties. The only restriction is the attribution clause mentioned above.

Other considerations

  • While the model code is MIT‑licensed, any third‑party datasets used for fine‑tuning may have their own usage restrictions. Microsoft’s technical report states that all training data are publicly available and cleared for commercial use.
  • If you redistribute the model weights, you must retain the MIT license file and provide a link to the original Hugging Face repository.
  • No trademark or endorsement rights are granted; you must not imply that Microsoft endorses your product unless you have a separate agreement.

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives