inference/research
verifiedhigh · 0.90updated 2026-10-03

Phi-3.5-vision-instruct

dense 4.147B

Fields

id
models/phi-3-5-vision-instruct
Family
phi-3.5-vision
Vendor
Microsoft
Release year
2024
Architecture
dense
Params (B)
4.147
Active params (B)
4.147
Hidden size
3,072
Layers
32
KV heads
32
Head dim
96
GQA ratio
1
Max context
131,072
Context scaling
LongRoPE (long_factor, 4096 -> 131072)
Context scaling method
other
Activation
silu
Attention variant
MHA (no GQA)
KV cache (bytes/token)
393,216
FLOPs per active token
8,294,000,000
Open weights
yes
License
mit
notes
TWO-PART MODEL. (1) Vision: openai/clip-vit-large-patch14-336 (img_processor.model_name, image_dim_out 1024), num_img_tokens 144. Per crop: (336/14)^2 = 576 patches pooled 2x2 -> 144 tokens, matching the declared num_img_tokens exactly. DYNAMIC CROPPING / HD TRANSFORM: use_hd_transform true, hd_transform_order 'sub_glb', with_learnable_separator true, projection_cls 'mlp', and preprocessor_config num_crops 4. HD transform emits the global 448-equivalent view plus up to 4 sub-crops of 336, separated by learned separator tokens. VISION TOKENS: 5 views * 144 = 720 tokens per image at the num_crops 4 default, plus separator tokens. DOMINANCE: VISION DOMINATES -- 720 vision tokens vs a ~100-token text prompt, ~7:1. Note this is 2x cheaper than Phi-4-multimodal at its default because num_crops 4 is far below dynamic_hd 36. (2) LLM: Phi-3.5 dense decoder, 32 layers, hidden 3072, 32 heads AND 32 KV heads (MHA, no GQA), head_dim 96 (3072/32, narrower than Phi-4's 128), intermediate 8192, vocab 32,064, max_position 131,072 vs original_max_position_embeddings 4096. ARCHITECTURE = dense. CONTEXT_SCALING = LongRoPE, rope_scaling.long_factor per-dimension array, rope_theta 1e4. KV CACHE: 32 * 32 * 96 * 2 * 2 = 393,216 B/token (384 KiB) -- TIED FOR THE LARGEST KV-PER-TOKEN IN THIS SLICE. The narrow head_dim 96 keeps it from being worse: a conventional MHA at Phi-3.5's width would be 512 KiB/token. Even so, at 131,072 ctx this is 48.0 GiB per sequence at bf16, so Phi-3.5-vision is a short-context model in practice despite the 131k headline. This is the clearest example in the slice of MHA being the wrong default in a modern VLM. params_b 4.147 = HF API safetensors total (4,146,621,440); the Phi-3.5-mini text model is ~3.8B. SERVICEABILITY JOIN (added 2026-10-03; the architecture x engine matrix this record was missing, with a citation per cell in docs/13-model-compatibility.md): FAMILY=multimodal. REQUIRED KERNEL CLASS: an encoder tower (ViT / SigLIP / ConvNet / audio encoder) running on a SEPARATE schedule from the decoder, plus a projector into the decoder's embedding space, plus - for the mrope and DeepStack families - a multi-axis rotary scheme in the decoder rather than plain 1-D RoPE. Three engine-side consequences, all cited. (1) The encoder tower is a separate compute path, so its throughput is a different problem from decode throughput and engines that disclaim encoder throughput are disclaiming this. vLLM says so in its own words: 'We currently support pooling models primarily for convenience. This is not guaranteed to provide any performance improvements over using Hugging Face Transformers or Sentence Transformers directly' [[vllm-pooling-models]] - that is the general statement this class inherits. TRT-LLM's answer is a documented mechanism: a Multimodal Encoder Side Stream that prefetches encoder work on a separate CUDA stream plus a per-model Multimodal Embeddings Cache, currently available only for seven architectures (Gemma4, Gemma4Unified, Mistral3, Qwen3VL, Qwen3VLMoe, Qwen3_5, Qwen3_5Moe) [[mdl2-trtllm-supported-models]]. (2) Several towers carry hard external dependencies: Gemma3nForConditionalGeneration 'depends on timm>=1.0.17 to make use of its MobileNet-v5 vision backbone' and 'is only supported on V1 due to shared KV caching' [[mdl2-vllm-supported-models-2026-10]]; MiniCPM-V 4.6 requires transformers>=5.7.0 because it was upstreamed as a native model type [[mdl2-trtllm-supported-models]]. (3) Hybrid-only multimodal models expose a memory knob unique to this class: vLLM's --language-model-only flag sets all supported multimodal modalities to 0 so the multimodal modules are not loaded, 'to free up more GPU memory for KV cache' for Llama-4, Step3, Mistral-3 and Qwen-3.5 [[mdl2-vllm-supported-models-2026-10]].SUPPORTED BY (cited): vLLM native rows include InternVLChatModel and InternVLForConditionalGeneration, LlavaOnevisionForConditionalGeneration, LlavaNextForConditionalGeneration, MolmoForCausalLM and Molmo2ForConditionalGeneration, PaliGemmaForConditionalGeneration, SmolVLMForConditionalGeneration, Glm4vForConditionalGeneration, Qwen2VL/Qwen3VL, MiniCPMV, Mllama, Phi4MM, Gemma4, NemotronH_Nano_VL_V2, VoxtralForConditionalGeneration (which requires mistral-common[audio]) and Qwen3OmniMoeThinkerForConditionalGeneration [[mdl2-vllm-supported-models-2026-10]]. SGLang's multimodal table covers InternLM2-VL, LLaVA-OneVision, LLaVA-NeXT(-Video), Ling-3.0-flash-VL, LFM2.5-VL, MiniCPM-V-2, GLM-4.5V, GLM-OCR, Qwen3-VL 235B-A22B and 30B-A3B, Qwen3-Omni-30B-A3B, Kimi-VL-A3B, MiMo-VL-7B-RL, Step3-VL-10B, dots.ocr, PaddleOCR-VL, Cosmos3, deepseek-vl2, Janus-Pro-7B, NVILA-8B and gemma-3-4b-it, plus openai/whisper-large-v3 and Qwen3-ASR-1.7B on the audio route [[mdl2-sglang-multimodal-language-models]]. TRT-LLM's multimodal matrix covers a narrower set with an explicit per-row modality string and per-row Untested cells [[mdl2-trtllm-supported-models]]. Older GGUF-side engines reach the class through llama.cpp's projector graph, which llama.cpp-embedding-server states it cannot serve on the embedding route [[llama-cpp-embedding-server]]. PER-MODALITY CAVEATS CITED: TRT-LLM marks Gemma4Unified and MiniCPM-V 4.6 Untested for CUDA Graph / chunked prefill, MiniMax-M3 Untested for attention DP and KV cache reuse, Qwen4Exp Untested across the board, and notes audio requires a checkpoint with a sound_config and is supported only on the full non-disaggregated path [[mdl2-trtllm-supported-models]]. Step-3.7's vision tower runs in BF16 even when the text decoder is quantized [[mdl2-trtllm-supported-models]] - a precision asymmetry that silently costs memory. vLLM's fallback path accepts image inputs only, with video 'to be added in a future release' [[mdl2-vllm-supported-models-2026-10]]. CONTEXT_SCALING_METHOD (other): SCHEME RECLASSIFIED (2026-10-04): was free text 'LongRoPE' had no enum value. rope_scaling type 'longrope' (long_factor from 4096 to 131072).

Notes

TWO-PART MODEL. (1) Vision: openai/clip-vit-large-patch14-336 (img_processor.model_name, image_dim_out 1024), num_img_tokens 144. Per crop: (336/14)^2 = 576 patches pooled 2x2 -> 144 tokens, matching the declared num_img_tokens exactly. DYNAMIC CROPPING / HD TRANSFORM: use_hd_transform true, hd_transform_order 'sub_glb', with_learnable_separator true, projection_cls 'mlp', and preprocessor_config num_crops 4. HD transform emits the global 448-equivalent view plus up to 4 sub-crops of 336, separated by learned separator tokens. VISION TOKENS: 5 views * 144 = 720 tokens per image at the num_crops 4 default, plus separator tokens. DOMINANCE: VISION DOMINATES -- 720 vision tokens vs a ~100-token text prompt, ~7:1. Note this is 2x cheaper than Phi-4-multimodal at its default because num_crops 4 is far below dynamic_hd 36. (2) LLM: Phi-3.5 dense decoder, 32 layers, hidden 3072, 32 heads AND 32 KV heads (MHA, no GQA), head_dim 96 (3072/32, narrower than Phi-4's 128), intermediate 8192, vocab 32,064, max_position 131,072 vs original_max_position_embeddings 4096. ARCHITECTURE = dense. CONTEXT_SCALING = LongRoPE, rope_scaling.long_factor per-dimension array, rope_theta 1e4. KV CACHE: 32 * 32 * 96 * 2 * 2 = 393,216 B/token (384 KiB) -- TIED FOR THE LARGEST KV-PER-TOKEN IN THIS SLICE. The narrow head_dim 96 keeps it from being worse: a conventional MHA at Phi-3.5's width would be 512 KiB/token. Even so, at 131,072 ctx this is 48.0 GiB per sequence at bf16, so Phi-3.5-vision is a short-context model in practice despite the 131k headline. This is the clearest example in the slice of MHA being the wrong default in a modern VLM. params_b 4.147 = HF API safetensors total (4,146,621,440); the Phi-3.5-mini text model is ~3.8B.

SERVICEABILITY JOIN (added 2026-10-03; the architecture x engine matrix this record was missing, with a citation per cell in docs/13-model-compatibility.md): FAMILY=multimodal. REQUIRED KERNEL CLASS: an encoder tower (ViT / SigLIP / ConvNet / audio encoder) running on a SEPARATE schedule from the decoder, plus a projector into the decoder's embedding space, plus - for the mrope and DeepStack families - a multi-axis rotary scheme in the decoder rather than plain 1-D RoPE. Three engine-side consequences, all cited. (1) The encoder tower is a separate compute path, so its throughput is a different problem from decode throughput and engines that disclaim encoder throughput are disclaiming this. vLLM says so in its own words: 'We currently support pooling models primarily for convenience. This is not guaranteed to provide any performance improvements over using Hugging Face Transformers or Sentence Transformers directly' [[vllm-pooling-models]] - that is the general statement this class inherits. TRT-LLM's answer is a documented mechanism: a Multimodal Encoder Side Stream that prefetches encoder work on a separate CUDA stream plus a per-model Multimodal Embeddings Cache, currently available only for seven architectures (Gemma4, Gemma4Unified, Mistral3, Qwen3VL, Qwen3VLMoe, Qwen3_5, Qwen3_5Moe) [[mdl2-trtllm-supported-models]]. (2) Several towers carry hard external dependencies: Gemma3nForConditionalGeneration 'depends on timm>=1.0.17 to make use of its MobileNet-v5 vision backbone' and 'is only supported on V1 due to shared KV caching' [[mdl2-vllm-supported-models-2026-10]]; MiniCPM-V 4.6 requires transformers>=5.7.0 because it was upstreamed as a native model type [[mdl2-trtllm-supported-models]]. (3) Hybrid-only multimodal models expose a memory knob unique to this class: vLLM's --language-model-only flag sets all supported multimodal modalities to 0 so the multimodal modules are not loaded, 'to free up more GPU memory for KV cache' for Llama-4, Step3, Mistral-3 and Qwen-3.5 [[mdl2-vllm-supported-models-2026-10]].SUPPORTED BY (cited): vLLM native rows include InternVLChatModel and InternVLForConditionalGeneration, LlavaOnevisionForConditionalGeneration, LlavaNextForConditionalGeneration, MolmoForCausalLM and Molmo2ForConditionalGeneration, PaliGemmaForConditionalGeneration, SmolVLMForConditionalGeneration, Glm4vForConditionalGeneration, Qwen2VL/Qwen3VL, MiniCPMV, Mllama, Phi4MM, Gemma4, NemotronH_Nano_VL_V2, VoxtralForConditionalGeneration (which requires mistral-common[audio]) and Qwen3OmniMoeThinkerForConditionalGeneration [[mdl2-vllm-supported-models-2026-10]]. SGLang's multimodal table covers InternLM2-VL, LLaVA-OneVision, LLaVA-NeXT(-Video), Ling-3.0-flash-VL, LFM2.5-VL, MiniCPM-V-2, GLM-4.5V, GLM-OCR, Qwen3-VL 235B-A22B and 30B-A3B, Qwen3-Omni-30B-A3B, Kimi-VL-A3B, MiMo-VL-7B-RL, Step3-VL-10B, dots.ocr, PaddleOCR-VL, Cosmos3, deepseek-vl2, Janus-Pro-7B, NVILA-8B and gemma-3-4b-it, plus openai/whisper-large-v3 and Qwen3-ASR-1.7B on the audio route [[mdl2-sglang-multimodal-language-models]]. TRT-LLM's multimodal matrix covers a narrower set with an explicit per-row modality string and per-row Untested cells [[mdl2-trtllm-supported-models]]. Older GGUF-side engines reach the class through llama.cpp's projector graph, which llama.cpp-embedding-server states it cannot serve on the embedding route [[llama-cpp-embedding-server]]. PER-MODALITY CAVEATS CITED: TRT-LLM marks Gemma4Unified and MiniCPM-V 4.6 Untested for CUDA Graph / chunked prefill, MiniMax-M3 Untested for attention DP and KV cache reuse, Qwen4Exp Untested across the board, and notes audio requires a checkpoint with a sound_config and is supported only on the full non-disaggregated path [[mdl2-trtllm-supported-models]]. Step-3.7's vision tower runs in BF16 even when the text decoder is quantized [[mdl2-trtllm-supported-models]] - a precision asymmetry that silently costs memory. vLLM's fallback path accepts image inputs only, with video 'to be added in a future release' [[mdl2-vllm-supported-models-2026-10]].

CONTEXT_SCALING_METHOD (other): SCHEME RECLASSIFIED (2026-10-04): was free text 'LongRoPE' had no enum value. rope_scaling type 'longrope' (long_factor from 4096 to 131072).

Cross-references

This record references no other records — it is a leaf. It is cited by 0.