Open-Source LLM Selection Guide: From Architecture Differences to Deployment
Selecting the right open-source Large Language Model (LLM) goes beyond simply comparing parameter sizes. This guide explores key architectural differences between Dense and Mixture-of-Experts (MoE) models, explains the distinction between effective and total parameters, and provides a multi-dimensional evaluation framework covering multimodal inputs, context length, function calling, and multilingual capabilities to help you make informed deployment decisions.
1. Check Architecture Types Before Selection
Many teams only compare parameter scales during model selection, which can lead to mistakes. Two models with the same parameter count can differ significantly in inference speed, VRAM usage, and deployment difficulty. The first step in selection is to confirm the model’s architecture type, primarily distinguishing between Dense architecture and Mixture-of-Experts (MoE) architecture, and to understand the “effective parameters” metric commonly found in small model documentation.
2. Differences Between Dense and Mixture-of-Experts Architectures
In a Dense architecture, every token passes through all parameters during forward computation. The computational cost is roughly proportional to the parameter count. These models behave more stably and are relatively easy to deploy and tune.
A Mixture-of-Experts (MoE) architecture splits the feed-forward layer into multiple expert sub-networks. A router selects a few experts for each token to participate in the computation, commonly using top-k routing, where k is typically 1 or 2. Its characteristics can be summarized in three points:
- Total parameter count determines VRAM usage, as all experts must reside in memory.
- Activated parameter count determines single-step computational cost, making single inference generally faster.
- Routing requires load balancing; otherwise, some experts will be overloaded while others remain idle, simultaneously affecting both output quality and throughput.
The computation required to generate each token can be estimated using the following approximation:
FLOPs_per_token ≈ 2 × N_active
Assuming a model has 100 billion total parameters and 10 billion activated parameters, its computational cost per step is about one-tenth that of a Dense model of the same scale. However, its VRAM still needs to accommodate all 100 billion parameters. Therefore, MoE models are suitable for scenarios with abundant VRAM, high concurrency, and sensitivity to latency. Dense models, on the other hand, are better suited for scenarios with limited VRAM, a need for stable quality, and a preference for a simple deployment pipeline.
3. Understanding “Effective Parameters” and Embedding Parameters
Some small models provide both “effective parameters” and total parameters, which include the embedding table. These correspond to different resources and must be understood separately.
Embedding lookup reads vectors by index without involving matrix multiplication, so the computational overhead is minimal, but the embedding table consumes storage and memory. Per-Layer Embeddings technology equips each decoding layer with a small embedding table. This design increases storage size but adds almost no computational cost. Therefore, “effective parameters” generally refer to the scale of parameters involved in matrix calculations, while “total parameters” include storage usage.
During selection, verify your requirements using the following approach:
- For throughput and single-step computational cost, refer to effective or activated parameters.
- For model file size, VRAM loading, and cold start time, refer to total parameters, including the embedding table.
The statistical criteria for “effective parameters” are not unified across different publishers. When comparing, you should require the provider to clarify their calculation method; otherwise, the numbers from two different models cannot be directly compared.
4. Multi-Dimensional Evaluation Framework
4.1 Multimodal Input
- Images: Images are usually split into patches and converted into tokens. Higher resolution consumes more context. Testing should cover both low-resolution and high-resolution samples to observe changes in recognition accuracy.
- Video: Frames are generally extracted at a fixed frame rate or a fixed frame count. You need to confirm the frame extraction strategy, as it directly affects the retention of temporal information.
- Audio: Speech recognition and audio understanding are two distinct capabilities that require separate test sets for verification.
It is recommended to prepare dozens of samples or more for each modality and record the types of failed samples to facilitate targeted optimization of input preprocessing.
4.2 Context Length
The nominal context window of a model does not equal its effective utilization rate in long texts. Long context primarily introduces two types of costs: first, attention computation increases with length; second, the VRAM occupied by the KV cache grows linearly with length and concurrency. The KV cache can be roughly estimated using the formula:
KV_cache_bytes ≈ 2 × num_layers × num_kv_heads × head_dim × sequence_length × bytes_per_element × concurrency
When evaluating long context, it is recommended to insert known information at different length intervals to check if the model can accurately retrieve it. What should be recorded is the accuracy curve as it changes with length, rather than just the result at a single maximum length.
4.3 Function Calling and Structured Output
Agent-based applications rely on the model to output parsable call instructions. During evaluation, three aspects should be checked: whether the called function name is correct, whether the parameters are complete, and whether the output is in a legal structured format. Below is a pseudo-code example:
tools = [{name: "query_order",description: "Query order status by order ID",parameters: { order_id: string, required: true }}]passed = 0for case in test_cases:output = model.generate(prompt=case.prompt, tools=tools)call = parse_tool_call(output) # Parse failure counts as not passedif call is not None and call.name == case.expected_tool \and validate_schema(call.arguments, tools[0].parameters):passed += 1success_rate = passed / len(test_cases)
In addition to the overall success rate, you should also separately track the function name accuracy, the completeness rate of required parameters, the JSON validity rate, and consistency across multi-turn conversations. These granular metrics can help pinpoint exactly which stage a problem occurs in.
4.4 Multilingual and Code Capabilities
Multilingual capabilities should be tested separately by target language. Tokenization efficiency varies significantly across different languages; texts of the same length may result in several times the difference in token count. This will directly impact call costs and the available context window.
