Architecture Evolution and Inference Deployment Practices for Open-Source Multimodal LLMs
This article explores the ongoing evolution of open-source multimodal large models, focusing on the shift from simple parameter scaling to heterogeneous architecture designs tailored for diverse hardware environments. It provides an in-depth breakdown of key architectural mechanisms, including Per-Layer Embedding (PLE), KV cache sharing, and heterogeneous attention heads. Additionally, it shares practical insights into inference engine adaptation, covering operator fusion strategies, dynamic shape handling, and load balancing, concluding with deployment recommendations for edge, desktop, and cloud environments.
I. The New Trend: From Single Scaling to Architectural Divergence in Open-Source Models
In recent years, the development path of open-source large models has undergone significant changes. Early iterations primarily relied on simple parameter scaling—increasing the number of layers, hidden dimensions, or attention heads to boost model capacity. However, with the explosion of edge AI, multimodal interaction, and efficient inference demands, simply “stacking parameters” is no longer sufficient for diverse deployment scenarios. The latest open-source multimodal LLM series has abandoned this traditional path, adopting a “combination of architectural mechanisms” design philosophy. Instead of simple parameter scaling, models of different sizes within the same series feature deeply customized internal structures tailored for target hardware scenarios, ranging from mobile devices to data centers.
This evolution directly causes the difficulty of adapting inference engines to increase exponentially. An excellent inference engine no longer just needs to optimize matrix multiplication; it must also flexibly support “heterogeneous architectures.” This article documents the adaptation process for the entire range of models in this series (from edge 2B to desktop 31B). It breaks down the three most representative technical mechanisms: Per-Layer Embedding (PLE), KV cache sharing, and heterogeneous attention head design, providing first-hand data and deployment recommendations from actual exports and benchmarks.
II. In-Depth Breakdown of Core Architectural Innovations
This series of models did not appear out of thin air; its technical origins trace back to a transitional version designed specifically for edge devices. The transitional version first introduced PLE and KV cache sharing mechanisms, while the latest series inherits and significantly evolves these features. By comparing the key architectural parameters of three generations of models, the evolution logic of its technical route becomes clear.
2.1 Per-Layer Embedding (PLE): From Direct Lookup Injection to Lookup + Projection Fusion
In traditional Transformer models, token embeddings are typically handled uniformly by the first layer of the network and then passed up layer by layer, a “shared embedding” mode. The PLE mechanism used in this series is entirely different: it no longer limits embedding calculation to the first layer, but allows every layer in the model to independently query embedding vectors directly from token IDs.
- Transitional Version Implementation: The early PLE mechanism was straightforward. Each layer maintained an independent embedding lookup table, directly injecting the queried token vector into the layer’s input. This design effectively shortens the information path and improves the performance of edge models on low-compute devices, but at the cost of a significant increase in parameters.
- Latest Version Evolution: In the latest series, the PLE mechanism has been further upgraded from “direct lookup injection” to “lookup + projection fusion.” Specifically, after obtaining the raw token embedding, each layer passes it through a lightweight projection matrix for size transformation or feature mapping before fusing it with the previous layer’s output features. This design maintains edge inference efficiency while greatly enhancing the model’s ability to extract high-level semantic features. For inference engines, the scheduler must support “near-parallel embedding table access across multiple layers” and specifically optimize this mixed mode of sparse lookup and dense matrix multiplication at the kernel level.
2.2 KV Cache Sharing and Heterogeneous Attention Heads: A New Memory Optimization Paradigm
The KV (Key-Value) cache in the attention mechanism is a critical factor determining memory footprint and latency during inference. In traditional models, each layer has independent K and V projection matrices, and the caches are entirely separate.
This series introduces a highly aggressive KV cache sharing mechanism. In the latest version, several physically adjacent layers (e.g., layers 18-20) share the same KV cache. This means the model strips away the K/V projection calculations for certain layers, allowing multiple heads to read the same cache data for attention computation.
- Advantages: This drastically reduces VRAM/memory pressure during long-context inference, which is particularly important for edge deployment.
- Challenges: This places extremely high demands on the engine’s memory allocation strategy. The engine must accurately identify sharing relationships in the compute graph, avoid repeatedly allocating storage for the same group of KVs, and optimize memory reuse logic.
Accompanying KV sharing is the heterogeneous KV head design. The attention heads inside the model are not uniform: some heads independently compute V vectors, while others directly use the K vector as the V vector (i.e., K=V binding, with no independent v_proj). This design breaks the traditional paradigm where Q, K, and V each have their own paths, forcing the inference engine’s operator library to support “fused attention kernels without V projection” to avoid splitting the K=V binding operation into inefficient DataMove instructions.
2.3 Native Multimodal Support and Dual RoPE Mechanism
Beyond the evolution of the pure text architecture, this series treats multimodal capability as a native design goal. For the vision encoder, the latest version adopts a combination of a high-level semantic vision transformer and a feature pooler. It not only processes images into grid features but also achieves adaptive compression at different context lengths through the pooler, providing significant advantages when processing ultra-high-resolution images. Audio support is implemented via a streamlined speech recognition front-end model.
Particular attention should be paid to the “Dual RoPE (Rotary Position Embedding)” mechanism. For text tokens and image/audio tokens, the model sets two different sets of rotary position embedding parameters. This requires the inference engine to strictly distinguish input modalities during the preprocessing stage. Mixing position embeddings will lead to a cliff-drop in generation quality.
III. Inference Engine Adaptation Records and Quantitative Data
After exporting and adapting all model specifications (E2B, 7B, 13B, 31B), the following key engineering practices were summarized:
3.1 Necessity of Adjusting Operator Fusion Strategies
For K=V bound attention heads, if the traditional flow of “compute K and V first, then compute attention” is used, the K=V binding part alone introduces about 12% extra kernel launch overhead. The correct approach is to fuse the K=V binding logic and the attention score calculation into a single CUDA Kernel. Under the following baseline configuration (input sequence 1024, output sequence 128), the fused operator reduced single-token decoding latency by approximately 9.7%.
3.2 Dynamic Shape Handling
Due to the existence of the dual RoPE mechanism, the length ratio of image tokens to text tokens is uncertain before inference. The inference engine’s frontend compiler must be able to derive graph execution plans based on runtime dynamic shapes. Any attempt to fix shapes at compile time will cause exceptions or execution refusals.
3.3 Load Imbalance Caused by Heterogeneous KV Heads
In large models like the 31B, KV sharing occurs in deeper layers. Because different layers have different numbers of KV heads, during actual parallel decoding, crudely dividing compute thread blocks solely by layer count easily causes uneven GPU streaming multiprocessor (SM) utilization. We observed that on an early engine without fine scheduling, SM utilization was as low as approximately 52%. After micro-scheduling, the load imbalance metric improved to around 73%.
IV. Deployment Selection Recommendations and Future Outlook
From a purely engineering perspective, this generation of open-source multimodal large models provides a “testing ground” for inference infrastructure. For developers, the following points should be noted before actual deployment:
- Edge (2B level): Pay attention to the impact of PLE on memory bandwidth. It is recommended to enable weight sparsification on devices that support hardware compression operators to avoid memory bus overload caused by frequent lookups.
- Desktop (7B-13B): The VRAM savings brought by KV cache sharing can be traded for larger batch sizes, comprehensively improving throughput.
- Cloud (31B level): The combination of heterogeneous KV heads and MoE (Mixture of Experts) structures requires the scheduler to have the capability to heterogeneously partition the vision tower and the text tower.
The release of this series of models marks a key node in the open-source community’s transition from a “one-size-fits-all” architecture to a “cell division” style of diverse architectures. In the future, the competitive edge of inference engines will no longer lie in the extreme optimization of single-point operators, but in the intelligent adaptation capability to “search spaces.” As AI-specific hardware becomes more popular, compilers and runtimes that can flexibly handle multi-layer dynamic sharing, heterogeneous embeddings, and complex modality fusion will become the watershed for performance gaps.
