A New Approach to Open-Source LLMs: Evaluate Architecture Before Cost

    The focus of open-source large language models (LLMs) is shifting from sheer parameter size to architecture efficiency, training methods, and deployment costs. This article explores common technical directions for these models, including sparse expert architectures, attention mechanisms, training data strategies, inference optimizations, and long-context handling. It also provides a practical checklist for developers to evaluate model architectures, estimate costs, and verify official data before making a selection.

    A New Approach to Open-Source LLMs: Evaluate Architecture Before Cost

    Recently, the discussion around open-source large language models (LLMs) has shifted. While the focus used to be on comparing parameter scales, more teams are now prioritizing architectural efficiency, training methods, and deployment costs. These changes directly impact how developers select models. This article does not target a specific release but rather outlines common technical directions for this category of models, explaining what each technology offers, its prerequisites, and how readers should verify official data.

    Specific figures mentioned in this article, such as parameter counts, context lengths, and memory usage, should be verified against the model’s official documentation or technical reports. The calculation methods provided here can be used for your own estimations.

    1. Sparse Expert Architecture: Large Total Parameters, Low Per-Token Computation

    Mixture-of-Experts (MoE) is currently a common sparse architecture. The model contains multiple expert subnetworks; after a token enters, a router selects a few experts (e.g., top-2) for computation. The total parameter count can be massive, but only a fraction is activated during each forward pass, making the inference computation volume close to that of a dense model with a similar activation scale.

    This design typically needs to address two issues:

    • Routing Imbalance: If a few experts are constantly selected, others receive insufficient training, affecting both performance and efficiency. A common solution is to add a load balancing term to the training loss, such as the auxiliary loss proposed by Switch Transformer, to constrain the distribution ratio among experts.
    • Communication Overhead: In multi-GPU deployments, experts are distributed across devices, and tokens must be routed across GPUs, increasing latency. End-to-end latency should be tested before deployment; theoretical FLOPs are for reference only.

    The total parameter count of a sparse model determines the memory required for weights. Even if only a small portion of experts is activated each time, all expert weights usually need to reside in memory or be split across multiple cards. Therefore, MoE models often have higher memory requirements than dense models with the same number of activated parameters.

    2. Attention Design: Trade-offs Between Local and Global

    The computational complexity of standard self-attention scales quadratically with sequence length. To reduce the cost of long sequences, many models adopt local attention mechanisms like sliding window attention, while retaining global attention in certain layers.

    This hybrid design allows computation and memory to grow more slowly with sequence length. The trade-off is that long-distance information must pass through multiple layers, and the model’s ability to accurately reference across distant paragraphs may be weaker than full-attention models. Selection should be based on the task. For single-paragraph summarization, classification, and extraction, this design is usually sufficient. For tasks requiring precise alignment across long texts, separate testing is necessary.

    3. Training Methods: Data Composition and Feedback Signals

    Much of a model’s capability comes from its training data. Common practices in public materials include:

    • Adding reasoning processes to math and code data to let the model learn intermediate steps.
    • Filtering code data using verifiable signals like compiler errors and unit test pass rates.
    • Increasing the proportion of high-quality data in the later stages of training.

    These methods can improve performance on specific tasks, but the extent of improvement on general capabilities varies by model. When a model shows outstanding results on coding or math leaderboards, readers should verify whether the evaluation set overlaps with the training data and prioritize validating on their own business data.

    4. Inference Optimization: Quantization and KV Cache

    Deployment costs are mainly determined by two factors: the memory occupied by weights and the memory used by the KV Cache during inference.

    Weight memory can be roughly estimated as:

    Weight Memory (GB) ≈ Parameter Count (Billions) × Bytes per Parameter

    For example, a 7B parameter model using FP16 (2 bytes per parameter) requires about 14GB for weights; using INT4 (about 0.5 bytes per parameter), it requires about 3.5GB. Actual usage must also include activations, framework overhead, and KV Cache, so a certain margin should be reserved.

    KV Cache memory is proportional to concurrency and context length. PagedAttention, proposed by the vLLM project, borrows the concept of OS paging to manage KV Cache by splitting it into fixed-size blocks, reducing memory fragmentation and improving batch processing throughput. This is a general inference optimization method supported by mainstream inference engines, though actual effects depend on workload characteristics.

    Quantization saves memory by reducing numerical precision. Common schemes include INT8, INT4, and FP8. Different schemes have varying impacts on accuracy and must be validated on the evaluation set of the target task. Quantization-aware training (QAT) usually retains more precision than post-training quantization at the same bit width, but it incurs higher training costs.

    During deployment, focus on the following measured metrics:

    • Time to First Token (TTFT) and generation time per token.
    • Throughput (tokens/s) under target concurrency.
    • Metric differences on target tasks before and after quantization.
    • Peak memory, including KV Cache usage at maximum context length.

    5. Long Context Capabilities: Window Length Does Not Equal Reasoning Ability

    Many models claim to support 128K or 256K context windows. The window length indicates how much input a model can receive, not whether it can perform complex reasoning across such long content.

    In practice, certain patterns emerge. Long-text retrieval, such as finding a specific number or sentence in a long document, usually performs well. Long-text summarization and information extraction can mostly be completed. Multi-hop logical reasoning across multiple paragraphs often sees accuracy drop as the text lengthens.

    For scenarios involving massive documents, Retrieval-Augmented Generation (RAG) is usually more suitable. First, use retrieval to narrow down the candidate range, then pass the relevant fragments to the model, keeping original text references for manual verification.

    6. Licenses: Check the Original Text Before Commercial Use

    Open-source model licenses vary significantly. Common types include:

    • Permissive licenses like Apache 2.0 and MIT, which allow commercial use and usually require retaining copyright notices.
    • Community licenses with usage conditions, such as restrictions on monthly active users, specific industries, or competitive services.
    • Research-only licenses.

    License terms may change with versions and may restrict the redistribution of fine-tuned models. When enterprises select a model, legal personnel should read the official license text to confirm commercial boundaries rather than relying on second-hand interpretations.

    7. Selection Checklist

    Before deciding to use an open-source model, check the following items:

    1. Memory Budget: Whether the combined usage of weights, KV Cache, and framework overhead fits within the target hardware, with a reserved margin.
    2. Context Length: The distribution of actual business input lengths, including P95 and P99 percentiles.
    3. Quantization Scheme: Whether the metric drop on your own evaluation set after quantization is acceptable.
    4. Concurrency and Latency: Whether the TTFT and throughput under the target QPS meet service requirements.
    5. License: Whether commercial use, redistribution, and post-fine-tuning release are all permitted.
    6. Data Boundaries: Whether long-text tasks require RAG chunking and whether retrieval fragments can retain references.
    7. Evaluation Method: Whether small-scale comparisons have been made using your own business samples, rather than relying solely on public leaderboards.

    8. Conclusion

    The competitive focus of open-source LLMs is shifting from parameter scale to architectural efficiency, deployment costs, and engineering details. For developers, the safest approach is to first clarify the task and budget, then conduct small-scale comparisons using proprietary data, and finally decide based on test results. Public technical introductions can serve as leads, but specific numbers must be verified against official documentation and your own tests.