The Starting Point of Open-Source LLMs: A Technical Breakdown of First-Generation General Language Models

    This article analyzes the first-generation general language model of an open-source series (released in January 2024, in 7B and 67B sizes, with base and chat variants) to extract its engineering lessons. It covers why the initial release sets the technical paradigm, the pragmatic "reproduce first, then improve the data" strategy, the choice between MHA and GQA attention, a three-stage data pipeline (deduplication, filtering, shuffling), two-stage post-training with SFT and DPO, and practical guidance for choosing and deploying a model size and variant.

    1. Introduction: Why the First Generation Deserves a Separate Review

    With open-source LLMs iterating quickly, most attention goes to the parameter counts and benchmark scores of the latest releases, while the technical paradigm established by the first generation is often overlooked. In practice, the first release of an open-source series plays a foundational role: it has to validate whether the technical route is viable, whether the data pipeline is reusable, and whether the training and alignment workflow can converge reliably. Most capabilities of later versions are incremental advances built on top of that foundation.

    This article takes the first-generation general language model of an open-source series (7B and 67B parameter sizes, base and chat variants, released in January 2024) as its subject, abstracts the key technical points, and offers an engineering-oriented interpretation for developers. It does not discuss any specific vendor’s product, and the analysis stays at the general technical level.

    2. Background: A Pragmatic Path from Reproduction to Improvement

    The initial development effort did not start by pursuing a disruptive architecture. Instead, it chose a lower-risk path: first fully reproduce the dense decoder architecture already validated in the industry, solve the engineering problems around training stability, parallelism strategies, mixed precision, and checkpoint resumption, and then invest effort in what actually creates differentiation — training data quality.

    The reasoning is straightforward: as model architectures converge, the quantity and quality of the corpus, the thoroughness of cleaning, and the scientific soundness of data mixtures often deliver greater marginal returns than architectural tweaks. “Reproduce plus a better training set” therefore became the core strategy of the first generation, and the fundamental reason it outperformed open-source baselines of comparable parameter size across several public Chinese and English benchmarks.

    In terms of team composition, projects of this kind usually start with a very small core group, where early members simultaneously lead language model pre-training and later multimodal directions (vision-language models), showing that staffing is highly reused and the technology stack is highly shared at the initial stage.

    3. Model Architecture: A Dense Backbone with Differentiated Attention Choices

    The first generation retains the mainstream dense decoder structure, and the two sizes make a clear distinction in the attention mechanism — an engineering trade-off well worth studying.

    • 7B: standard multi-head attention (MHA). With a small parameter count and low concurrency pressure, MHA is simple to implement, has an intuitive memory layout, and delivers sufficient returns.
    • 67B: grouped-query attention (GQA) instead of MHA. GQA lets multiple query heads share one set of key-value heads, substantially compressing the KV Cache size during inference with almost no loss in quality.

    Why does this difference matter? In autoregressive decoding, KV Cache memory usage is roughly linear in the batch concurrency. With MHA, the cache size can be approximated as:

    1. KV_bytes ≈ 2 × layers × kv_heads × head_dim × seq_len × batch × dtype_bytes

    Here kv_heads equals the number of attention heads under MHA, and is compressed into a number of groups under GQA. Reducing kv_heads by an order of magnitude lowers memory and bandwidth pressure in long-context, high-concurrency scenarios, and significantly increases the number of concurrent requests a single GPU can serve. For teams that need to run services online over the long term, this translates directly into a lower cost per request.

    4. Data Engineering: A Three-Stage Pipeline as the Key Competitive Edge

    The original work reports a pre-training corpus of two trillion tokens covering both Chinese and English, built through three stages — deduplication, filtering, and shuffling — where the deduplication stage removed about 89.8% of duplicate documents. That figure is worth expanding on, because it reveals a counterintuitive fact: raw web-scale corpora are highly redundant, and the share of genuinely useful information is small.

    A reusable three-stage pipeline typically looks like this:

    1. Deduplication
      • Document level: hash/MinHash-based approximate deduplication to remove mirror sites, reposts, and templated pages;
      • Segment level: substring-level cleaning of repeated fragments inside long documents;
      • Value: reduces memorization and overfitting risk, cuts wasted compute, and mitigates benchmark data leakage.
    2. Filtering
      • A quality classifier scores documents, discarding text with low information density, garbled content, or obvious machine-translation traces;
      • Rule-based filtering (length, symbol ratio, language-identification confidence);
      • Safety filtering (private information, violating content), with masking of sensitive information.
    3. Shuffling
      • Global shuffling to avoid consecutive same-source data causing capability skew and catastrophic forgetting;
      • Final calibration of the Chinese-English ratio and domain mixture at this stage.

    The main flow can be described with the following pseudocode:

    1. def build_corpus(raw_docs):
    2. docs = dedup_document_level(raw_docs) # removes about 90% of duplicates
    3. docs = dedup_segment_level(docs)
    4. docs = quality_filter(docs, min_score=0.6) # quality classifier + rules
    5. docs = safety_filter(docs) # privacy and compliance
    6. docs = calibrate_ratio(docs, zh_en="1:1") # language and domain mixture
    7. return shuffle(docs, seed=42) # global shuffling

    It is worth stressing that the deduplication ratio is only an outcome metric and varies widely across corpus sources. What is actually transferable is the order — redundancy removal first, quality tiering second, mixture calibration and shuffling last — because reversing that order wastes large amounts of compute on low-value data.

    5. Post-Training: Two-Stage Alignment with SFT and DPO

    Post-training for the first generation combines supervised fine-tuning (SFT) with direct preference optimization (DPO), which is also the more mainstream approach in the industry today.

    • SFT stage: high-quality instruction-response pairs turn the base model’s “continuation ability” into “instruction-following ability.” The data volume need not be large, but diversity and annotation quality set the ceiling; it is advisable to cover question answering, summarization, rewriting, code, math, and multi-turn dialogue.
    • DPO stage: paired “preferred response / worse response” preference data directly optimizes the model’s output distribution without training a separate reward model, making the workflow shorter and memory overhead more controllable. Its objective can be written as:
    1. L_DPO = -log σ( β · [ (logπ(y_w|x) - logπ_ref(y_w|x))
    2. - (logπ(y_l|x) - logπ_ref(y_l|x)) ] )

    Here y_w is the preferred response, y_l the rejected response, π_ref the reference model, and β controls how far the policy may deviate. In practice, too large a β makes the model overly conservative and its answers stiff, while too small a value can cause style drift, so it needs to be tuned together with the SFT learning rate.

    Releasing the base and chat variants at the same time lets downstream users choose freely: the base variant for those who want to continue with domain pre-training or a second round of fine-tuning, and the chat variant for those who need to put a question-answering service into production directly.

    6. Evaluation Results and Selection Guidance

    The evaluation shows that the 67B version has a clear advantage over open-source baselines of comparable size on public Chinese and English benchmarks, indicating that the investment in data quality did translate into bilingual capability rather than English ability simply spilling over.

    Practical recommendations for developers:

    • Resource-constrained, mainly English or monolingual tasks: prefer the smaller size with MHA, which is simpler to deploy;
    • High-concurrency online services with long-context needs: prefer the larger size with GQA, which is friendlier to memory and throughput;
    • Domain adaptation: start from the base variant for incremental pre-training or instruction tuning, and avoid repeatedly stacking on the chat variant, which leads to capability degradation;
    • Must-do before launch: regression on a private evaluation set, hallucination and refusal rate statistics, and long-text consistency testing.

    If the model is served on general cloud capabilities, you can combine a container platform for elastic inference, object storage for hosting weights and corpora, and logging services with monitoring and alerting for quality observation, so that model capability is reliably converted into business results.

    7. Conclusion

    The historical significance of the first generation does not lie in any single metric, but in what it proved: at a stage where architectures converge, the depth of data engineering and the discipline of the alignment workflow are the main sources of competitiveness for open-source models. Understanding this has more long-term value than memorizing any specific version number.