Three Architectural Tiers of Open-Weight LLMs and KV Cache Reuse Explained

    This article examines why open-weight large language model families have split into three architectural tiers: ultra-small models for mobile and embedded devices, Mixture-of-Experts (MoE) models for efficient local inference, and dense models for high-quality output and easier post-training. It analyzes the trade-offs behind each architecture, explains how shared KV Cache reduces memory footprint and compute cost in long-context inference with an implementation example, and provides a practical selection framework mapping each architecture to its ideal deployment scenario.

    Three Architectural Tiers of Open-Weight LLMs and KV Cache Reuse Explained

    1. Background: Why Open-Weight Models Are Going “Layered and Differentiated”

    In recent years, a clear trend has emerged in the open-weight model ecosystem: a single general-purpose model can no longer simultaneously satisfy three very different needs—high-quality cloud inference, efficient local inference, and deployment on embedded devices. As a result, new generations of open-weight model families generally adopt a “one family, multiple architectures” strategy, roughly dividing their product lines into three categories:

    1. Ultra-small models for mobile and embedded (IoT) devices: typically a few billion parameters, emphasizing low memory footprint, low power consumption, and real-time on-device response;
    2. Mixture-of-Experts (MoE) models for efficient local inference: large total parameter counts, but only a subset of experts is activated per inference step, balancing model capacity against inference cost;
    3. Dense models for high-quality output and convenient post-training: built on traditional dense architectures, pursuing higher generation quality and simpler fine-tuning pipelines.

    This differentiation is no accident—it is the result of a three-way trade-off among hardware constraints, inference cost, and training difficulty. Understanding the logic behind these architectural choices is the first step for developers selecting a model for real-world projects.

    2. Core Trade-offs of the Three Architectures

    2.1 On-Device Small Models: Engineering Under Extreme Compression

    The core tension for on-device models is that device memory is extremely limited (often just a few gigabytes of shared memory), while generation quality must remain acceptable. Models in this tier typically combine several techniques:

    • Tiered parameter sizes: for example, offering both ~2B and ~4B variants so developers can choose based on available device memory;
    • Quantization-friendly design: accounting for accuracy degradation under low-bit quantization during training, so the model remains stable even at 4-bit or lower precision;
    • Shared KV Cache mechanism: an important architectural change for on-device models, discussed in detail later.

    2.2 MoE Models: Trading Sparse Activation for Inference Efficiency

    The idea behind MoE is “large capacity, small activation.” The model contains multiple expert networks and a router; each token is routed to only a few experts. This yields two direct benefits:

    • Controllable inference cost: per-token compute approximates the activated parameter count rather than the total parameter count;
    • No capacity loss: the total knowledge is carried by all experts collectively, so the model can “know” far more than a dense model with equivalent inference cost.

    But MoE has clear costs: all expert parameters must reside in memory; more importantly, sparse routing makes post-training (such as SFT and RLHF) harder—activation frequency across experts is imbalanced, and fine-tuning can lead to undertrained experts and degraded output stability. This is where the third architecture comes in.

    2.3 Dense Models: Built for Quality and Post-Training

    Although dense architectures cost more at inference time, their advantages are equally clear:

    • Simple, mature post-training pipelines: all parameters participate uniformly in computation, so fine-tuning data affects the model globally and predictably; the engineering complexity of SFT and preference alignment is significantly lower than with MoE;
    • Higher output quality ceiling: at equal activated parameter counts, dense models typically deliver more stable generation coherence and instruction-following.

    Therefore, if a team plans deep customization (e.g., domain knowledge injection, style alignment), a dense architecture is usually the safer starting point; if the goal is high throughput in local deployment, MoE is the more economical choice.

    3. Deep Dive: The Shared KV Cache Mechanism

    3.1 The Problem: Why KV Cache Is the Memory Bottleneck for Long Contexts

    Autoregressive Transformer inference uses a KV Cache to store the Key and Value states of past tokens, avoiding recomputation of the full history for every generated token. However, cache size grows linearly with context length and can be estimated as:

    1. KV Cache memory ≈ 2 × num_layers × sequence_length × num_KV_heads × head_dim × bytes_per_value × batch

    For deep models with long contexts, the KV Cache can even exceed the memory footprint of the model weights themselves—fatal on memory-constrained edge devices.

    3.2 How Shared KV Cache Works

    The idea of shared KV Cache is: let some later layers reuse the Key-Value states already computed by earlier layers, instead of maintaining an independent cache per layer. Because representations in adjacent Transformer layers are highly correlated, the KV states of intermediate layers are strongly reusable. Cross-layer sharing can cut KV Cache memory usage by nearly half with controllable accuracy loss.

    The benefits show up in two dimensions:

    • Reduced memory footprint: directly eases memory pressure in long-context scenarios, enabling longer windows on small devices;
    • Reduced compute cost: some layers skip redundant KV projection computation, improving inference throughput.

    3.3 An Implementation Sketch

    At the inference framework level, the core change for cross-layer sharing is the cache indexing logic, as sketched below:

    1. class LayerSharedKVCache:
    2. def __init__(self, num_layers, share_interval=2):
    3. # Every 2 layers share one KV cache, halving cache entries
    4. self.cache = [None] * (num_layers // share_interval)
    5. def fetch(self, layer_idx):
    6. return self.cache[layer_idx // 2]
    7. def update(self, layer_idx, k, v):
    8. if layer_idx % 2 == 0: # Only "anchor layers" write to cache
    9. self.cache[layer_idx // 2] = (k, v)
    10. # Shared layers read the anchor layer's KV directly; no separate cache

    It is worth noting that cross-layer state reuse has been explored in the industry for some time and is not the invention of any single model; it fundamentally belongs to the general research direction of “inter-layer redundancy elimination.”

    4. Selection Guide: Matching the Three Model Types to the Right Scenarios

    Based on the analysis above, here is a practical selection framework:

    Scenario Recommended Architecture Key Rationale
    Real-time interaction on phones/embedded devices Ultra-small on-device model KV sharing + quantization-friendly design fits memory-constrained environments
    High-throughput inference on local servers/workstations MoE model Sparse activation lowers per-token inference cost
    Deep customization such as domain fine-tuning and alignment training Dense model Mature post-training pipeline with predictable fine-tuning behavior

    5. Conclusion

    The “three-way split” of open-weight models reflects the maturing of LLM engineering: instead of chasing one model that does everything, architectures are now precisely matched to target hardware and task requirements. For developers, understanding the underlying mechanisms—shared KV Cache, sparse activation, and differences in post-training difficulty—is far more valuable in the long run than memorizing any particular model’s name, because these architectural trade-off logics will remain valid no matter how model families evolve. When deploying models as services in cloud environments, teams can also combine general-purpose cloud capabilities such as object storage, container platforms, and monitoring/alerting to build a complete pipeline from model download and inference deployment to performance observability.