Open-Source LLM Architecture Selection: Benefits and Boundaries of Four Key Designs
As training budgets approach a plateau, the performance gaps between large language models increasingly stem from architectural design. This article explores four key architectural directions in open-source LLMs: position encoding, linear attention, Mixture of Experts (MoE), and reinforcement learning training. By analyzing representative works like Qwen2-VL, Kimi Linear, DeepSeekMoE, and DeepSeek-R1, we evaluate the problems each design solves, their applicable boundaries, and how to verify their performance to guide your model selection process.
1. Selection Overview: Identify the Problem, Then Check the Version
As training budgets approach a plateau, the performance gaps between models increasingly stem from structural design. Position encoding determines how a model understands sequence order and spatial relationships; attention design determines the caching cost during long-text inference; Mixture of Experts (MoE) determines the balance between parameter scale and per-token computation; and reinforcement learning determines how a model’s reasoning capabilities on verifiable tasks are trained.
This article covers these four public architectural directions. For each, we explain the problem solved, representative models, applicable boundaries, and verification sources. Model iteration is fast; the release dates mentioned are based on official project pages, papers, and model cards. Please re-verify before use.
| Architectural Direction | Problem Solved | Representative Works | Applicable Boundaries | Verification Source |
|---|---|---|---|---|
| Position Encoding (RoPE & M-RoPE) | Lets the model understand sequence order and recover spatial/temporal structures in images and videos | RoFormer (proposed 2021); Qwen2-VL (released Aug 2024) | M-RoPE benefits depend on training data and evaluation tasks; public results focus on visual understanding benchmarks | RoFormer paper; Qwen2-VL model card and Transformers documentation |
| Linear Attention | Reduces state cache footprint during long-context inference | Kimi Linear (Moonshot AI, 2025); Qwen3-Next (Qwen team, Sep 2025) | State capacity is fixed; earlier information may be overwritten; retrieval tasks need separate testing | Technical reports and model cards of respective projects |
| Mixture of Experts (MoE) | Trade-off between total parameter scale and per-token activated computation | DeepSeekMoE (2024); DeepSeek-V2 & V3; Qwen1.5-MoE; Qwen3 MoE series | Routing imbalance can slow down training and inference; deployment still requires loading all expert weights | Papers and Hugging Face model cards |
| Reinforcement Learning Training | Improves reasoning in math and code tasks, relying on verifiable reward signals | GRPO proposed by DeepSeekMath; DeepSeek-R1 (Jan 2025); Qwen3 post-training pipeline | Clear benefits on automatically verifiable tasks; reward design for open-ended tasks is challenging | DeepSeek-R1 paper; Qwen3 technical report |
The judgments in this article are based on three criteria: whether open-source weights and inference code are available, whether community deployment is mature, and whether public evaluations cover a wide range of tasks. Based on these standards, the open-source ecosystems for M-RoPE and MoE are currently mature, linear attention is still in a rapid validation phase, and the benefits of reinforcement learning are mainly concentrated on verifiable tasks.
2. Position Encoding: From 1D Sequences to Space and Time
2.1 What RoPE Solves and What It Leaves Behind
Rotary Position Embedding (RoPE) was proposed by Su Jianlin et al. in the 2021 RoFormer paper. It uses a rotation matrix to inject relative position information into the attention computation. RoPE is widely used in mainstream open-source large language models, but its original form only handles one-dimensional sequences.
Patches in an image have top-bottom and left-right relationships, and videos add a temporal dimension. If these contents are flattened into a 1D sequence, the model needs to learn from the data to recover the spatial and temporal structures.
2.2 How M-RoPE Works
The Alibaba Tongyi team adopted Multimodal Rotary Position Embedding (M-RoPE) in Qwen2-VL, released in August 2024. M-RoPE splits position information into three components: time, height, and width. These are rotated separately and then combined into the attention computation. For text tokens, the three components take the same value, so the text portion is still processed as a 1D position.
This design allows the model to distinguish between frames at different time points in a video, as well as different spatial positions within the same frame. The weights and inference code for Qwen2-VL are publicly available, and a corresponding implementation exists in the Hugging Face Transformers library.
2.3 Applicable Boundaries
M-RoPE is built on top of RoPE as an extension design. Public comparisons are mainly concentrated on visual understanding benchmarks, and these results cannot be directly extrapolated to pure-text long-context tasks. If your business is primarily text-based, you should test both RoPE and M-RoPE using your own data and compare the results.
3. Linear Attention: Trading Fixed-Size State for Long Contexts
3.1 The Cost of Standard Attention
Standard Transformers must cache the Key and Value of all historical tokens during inference, known as the KV cache. The longer the context, the larger this memory footprint becomes, and the more data needs to be read for each new token generated. This is the primary cost source in long-text scenarios.
3.2 The Concept Behind Linear Attention
Linear attention compresses historical information into a state matrix of fixed size. No matter how long the context is, the state scale remains constant, so the cache footprint no longer grows linearly with sequence length. The trade-off is that the state capacity is limited, and earlier written information may be overwritten by subsequent content.
3.3 Representative Works
Kimi Linear, introduced by Moonshot AI, presents a hybrid linear attention design in its technical report. Qwen3-Next uses a structure that alternates between linear attention layers and standard attention layers, paired with MoE. The specific module names and inter-layer ratios should be verified against their respective technical reports.
3.4 Applicable Boundaries and Testing Checklist
The testing focus for linear attention is not on average performance, but on the following three points:
- Long-context retrieval: Place key information at the beginning, middle, and end of the context to test whether the model can accurately retrieve it.
- Early information overwriting: Construct tasks that require remembering very early content and observe how accuracy changes with distance.
- Throughput and memory trade-off: At the target context length, compare the time-to-first-token, tokens generated per second, and peak memory usage.
4. Mixture of Experts (MoE): Trade-off Between Parameter Scale and Computation
4.1 The Problem and Approach
A dense model activates all parameters to generate each token. MoE splits the feedforward network into multiple experts, and a router selects a few experts for each token to participate in computation. The total parameters can be very large while the activated parameters per token are small, allowing the model to accommodate more knowledge under the same compute budget.
4.2 Representative Works
DeepSeekMoE, proposed in 2024, introduced a design with fine-grained experts and shared experts. DeepSeek-V2 and DeepSeek-V3 continued and expanded this route. Alibaba’s Qwen1.5-MoE and Qwen3 MoE series provide MoE models at different scales, making it easier to choose based on your budget.
4.3 Applicable Boundaries
MoE has two often-overlooked costs. First, when routing is imbalanced, some experts become overloaded, slowing down both training and inference. Second, during deployment, all expert weights must still be loaded into memory, even if only a small portion is activated at a time. Therefore, the memory requirement for MoE models is typically higher than what the activated parameter count suggests.
When selecting an MoE model, verify three things: whether the target hardware can hold all expert weights, whether the inference framework supports the chosen model’s parallelism method, and whether the concurrency of your business requests can keep the expert load balanced.
5. Reinforcement Learning Training: Verifiable Rewards are the Prerequisite
5.1 The Problem and Approach
Reinforcement learning uses reward signals to guide models to generate better answers. In math and coding tasks, whether an answer is correct can be checked by a program, making the reward signal quite reliable. DeepSeekMath proposed Group Relative Policy Optimization (GRPO). This method samples a group of answers for the same question and uses the relative scores within the group to estimate the advantage, eliminating the overhead of training a separate value model. Building upon this, DeepSeek-R1 demonstrates how reinforcement learning can be used to enhance a model’s reasoning capabilities.
