Open-Source Multimodal LLMs: Architecture Evolution and Model Selection
This article examines how open-source multimodal LLMs are built and how to evaluate them for production use. It covers decoder-only text backbones combined with vision and audio encoders, dense versus Mixture-of-Experts trade-offs, KV cache budgeting for long context, structured tool calling, and local or edge deployment. Readers gain a practical framework for comparing deployment cost, latency, memory use, output reliability, and hardware constraints without relying on single benchmark scores.
1. Background: Why Multimodal and Agent Capabilities Are Central to Model Selection
The criteria for evaluating LLMs are shifting from “Can it hold a conversation?” to “Can it complete a task?” A model suitable for production usually needs to meet several conditions at once: it must understand non-text inputs such as images and audio, output structured results in an agreed format, call external tools and handle returned values correctly, and run stably within limited VRAM and compute. These capabilities determine whether a model can be integrated into business systems, and they often matter more than scores on a single leaderboard.
Developers commonly face several selection problems: deployment cost and quality are hard to balance; VRAM is quickly exhausted in long-text scenarios; tool-call output formats are unstable; and the same model may behave differently across inference frameworks. This article breaks down common design approaches for current multimodal models to help readers build a judgment framework rather than memorize the parameters of a specific model.
2. Architecture Breakdown: Text Backbone and Multimodal Composition
Most mainstream multimodal models still use a decoder-only Transformer backbone, generating text autoregressively token by token. Multimodal capability is usually added through an “encoder plus projector” design, which mainly includes the following components:
- Vision encoder: splits an image into patches and encodes them into a set of vectors.
- Audio encoder: converts audio into spectral features and then encodes them into a vector sequence.
- Projector: maps vectors from different modalities into the embedding space of the text backbone so the model can process them uniformly.
- Special tokens: mark the start and end of modality segments and assign fixed IDs to placeholders, making the input sequence structure clear and parsable.
Model configuration files usually describe these components in a compositional way. The following is a generic illustration; the values do not correspond to any specific model:
{"model_type": "multimodal_causal_lm","text_config": {"hidden_size": 4096,"num_hidden_layers": 40,"max_position_embeddings": 131072},"vision_config": {"patch_size": 16,"image_size": 896,"pooling_kernel": 4},"audio_config": {"sample_rate": 16000,"frame_shift_ms": 10},"special_tokens": {"image_start": "<image_start>","image_end": "<image_end>","audio_start": "<audio_start>","audio_end": "<audio_end>","image_placeholder_id": 300001,"audio_placeholder_id": 300002}}
The advantage of this composition is clear module boundaries. Vision or audio components can be replaced or upgraded independently, while the inference logic of the text backbone remains unchanged. The cost is a longer input sequence. Even after pooling, an image still occupies a certain number of visual tokens, so multi-image or long-audio inputs significantly increase context overhead. When designing prompts and input strategies, this overhead needs to be included in the budget.
3. Dense vs. Mixture-of-Experts Architectures
A dense model activates all parameters in every forward pass. Its inference path is fixed, latency is easier to predict, and deployment and tuning have a lower barrier.
A Mixture-of-Experts (MoE) model splits the feed-forward layer into multiple expert subnetworks, and a router selects a small number of experts for each token to participate in computation. As a result, an MoE model can have a very large total parameter count while only activating a subset of parameters in a single forward pass.
Note that MoE does not reduce memory usage. The weights of all experts must reside in VRAM or memory; what is saved is computation. Routing can also cause uneven expert load, with some experts overloaded and others idle, which in turn slows throughput. Training usually adds a load-balancing loss to mitigate this problem.
| Evaluation dimension | Dense model | Mixture-of-Experts model |
|---|---|---|
| Per-token computation | Proportional to total parameters | Proportional to activated parameters |
| Memory usage | Related to total parameters | Must hold weights for all experts |
| Throughput characteristics | Easy to optimize with batching | Expert load imbalance may become a bottleneck |
| Deployment complexity | Lower | Requires routing and parallelism strategy considerations |
Selection guidance is as follows. If the deployment environment has sufficient VRAM and stable latency is the priority, a dense model is simpler. If compute cost is sensitive, batch request volume is high, and the inference framework has mature support for expert parallelism, a Mixture-of-Experts model can offer better cost efficiency.
4. Long Context: How to Calculate the VRAM Budget
The main bottleneck for long-context capability is the KV cache. During autoregressive generation, each layer must store key and value vectors for historical tokens. The approximate KV cache usage can be estimated as follows:
KV cache bytes ≈ 2 × layers × KV heads × head dimension × sequence length × bytes per element × batch size
Take an illustrative configuration: 40 layers, 8 KV heads, head dimension 128, sequence length 131072, FP16 (2 bytes per element), and batch size 1. Substituting into the formula gives approximately 2 × 40 × 8 × 128 × 131072 × 2 ≈ 2.1 × 10¹⁰ bytes, or about 20 GiB. This means that even if the weights fit, a single very long request may exhaust VRAM.
Common mitigation methods include:
- Quantize the KV cache: compress the cache from 16 bits to 8 bits or lower, trading precision for capacity.
- Sliding-window attention: keep only the KV within the most recent window, which suits tasks that do not strongly depend on distant information.
- Chunked prefill: split long inputs into smaller chunks and process them step by step to avoid excessively high peak VRAM.
- Limit maximum context: set an input length limit at the application layer and summarize or retrieve slices of over-limit content.
5. Function Calling and Structured Output
The core of agent-style applications is enabling the model to output structured instructions that programs can parse. Engineering practice usually includes three stages: declaring the parameter schema of tools, constraining the model output format, and validating and retrying tool-call results.
Tool declarations generally use JSON Schema to describe parameters. After the model outputs a result, the program must parse it before execution and must not directly trust content generated by the model. Below is a generic agent-loop illustration:
tools = [{"name": "query_order","description": "Query order status by order ID","parameters": {"type": "object","properties": {"order_id": {"type": "string"}},"required": ["order_id"]}}]function run_agent(user_input):messages = [system_prompt(tools), user_message(user_input)]for step in 1..MAX_STEPS:output = model.generate(messages, tools=tools)if output.is_final_answer:return output.textcall = parse_tool_call(output)if call is invalid or not matches_schema(call.arguments, tools[call.name].parameters):messages.append(error_feedback("Invalid argument format. Please regenerate."))continueresult = execute_tool(call.name, call.arguments)messages.append(tool_result(result))raise error("Maximum number of reasoning steps exceeded")
Several points require special attention in implementation. First, parameter validation must be completed on the program side; model-generated content cannot replace type checking. Second, tool execution must have timeouts and permission boundaries to avoid side effects from incorrect calls. Third, the maximum number of steps must be limited to prevent the model from falling into repeated calls. Fourth, tools that perform write operations should include a human confirmation step.
If the inference framework supports constrained decoding, output can be restricted to conform to a grammar during generation, reducing format errors at the source. This approach introduces some additional overhead and should be evaluated against latency requirements.
6. Local and Edge Deployment
Deployment feasibility first depends on weight VRAM. A rough estimate is: parameter count × bytes per parameter, plus activations, cache, and runtime overhead. For example, a 7-billion-parameter model uses about 14 GB for weights in FP16 and about 3.5 GB with 4-bit quantization, but inference overhead still needs to be reserved.
Quantization is a key method for edge deployment. Common options include:
- 8-bit integer quantization: relatively small precision loss, suitable for scenarios with higher quality requirements.
- 4-bit quantization: lowest VRAM usage, but requires dedicated validation for precision-sensitive tasks such as mathematical reasoning and code generation.
- Mixed precision: keep higher precision for sensitive parts such as attention layers and embedding layers, and compress the rest.
For edge devices, power consumption, thermal design, and concurrency capacity also matter. Small-parameter models can run on high-end mobile devices or dedicated accelerators, but context length and output length usually need to be limited together to achieve acceptable response speed.
