The Starting Point of Open-Source LLMs: A Technical Breakdown of First-Generation General Language Models
This article examines the first-generation general language model of an open-source series released in January 2024 in 7B and 67B sizes, in both Base and Chat forms. It explains the engineering reasoning behind the mature LLaMA 2-style dense architecture, the use of standard MHA in 7B versus GQA in 67B to reduce KV Cache overhead, the three-stage data pipeline that deduplicates, filters, and shuffles roughly 2 trillion bilingual tokens, and the two-stage SFT plus DPO alignment chain. It also covers open-source delivery formats, cross-language evaluation practices, and common deployment pitfalls, leaving readers with reusable lessons on cost-driven architecture choices, data quality as the performance ceiling, and multilingual evaluation.
1. Introduction: Why the First-Generation Foundation Model Deserves a Retrospective
With open-source LLMs iterating quickly, first-generation foundation models are often treated as transitional artifacts. From an engineering perspective, however, they carry the most fundamental and least replaceable responsibility: verifying that a technical route is reproducible, that a data pipeline can scale, and that training and inference costs stay controllable. The first general language model of a certain open-source series was officially released in January 2024 in two parameter sizes, 7B and 67B, each in both a Base and a Chat form, with the accompanying technical paper published in early January of the same year. It marked both the starting point of the series’ evolution from V1 through multiple later versions and the beginning of its open-source ecosystem and open platform strategy.
Setting aside product specifics, this article treats that generation as a general engineering paradigm: how to build a bilingual (Chinese-English), commercially deployable, cost-controlled foundation model using a mature dense architecture and high-quality corpora.
2. Architecture Choices: The Dense Route and Two Attention Mechanisms
The first-generation model retained the industry-proven LLaMA 2-style dense architecture. Choosing dense over a sparse mixture-of-experts route came down to three considerations:
- High engineering determinism. Dense structures use regular operators, and memory footprint and communication patterns in both training and inference are predictable, which makes capacity planning straightforward on a limited cluster.
- Deployability at small sizes. The 7B model can run inference on a single GPU or a dual-GPU setup, making it suitable for edge scenarios and validation at small-to-medium business scale.
- Low iteration cost. With a uniform structure, changes to the data recipe translate directly into measurable quality differences, which simplifies controlled experiments.
The two sizes took different approaches to attention:
- 7B uses standard multi-head attention (MHA): the structure is intuitive and training is stable.
- 67B replaces MHA with grouped-query attention (GQA), letting multiple query heads share one set of key-value heads and thereby compressing the KV Cache.
The significance of this step is mainly on the inference side. During autoregressive decoding, the memory and bandwidth cost of the KV Cache grows linearly with context length and often becomes the throughput bottleneck. By reducing the number of key-value heads, GQA lowers that overhead and makes the per-unit cost of long-context, high-concurrency scenarios more controllable. The illustrative configuration difference is as follows (structural relationships only, not actual interfaces):
# Small size: standard multi-head attentionmha = Attention(num_q_heads=32, num_kv_heads=32)# Large size: grouped-query attention, multiple Q heads share one KV groupgqa = Attention(num_q_heads=32, num_kv_heads=8) # every 4 Q heads share 1 KV group
3. Data Engineering: A Three-Stage Build of Two Trillion Tokens
The technical route of the first generation can be summarized as “reproduce first, then surpass”: get a mature architecture running and aligned, then open a gap through a better training set. The pretraining corpus was roughly 2 trillion tokens covering both Chinese and English, built in three stages.
The first stage is deduplication. Repeated documents not only waste compute but also amplify the risk of memorization and evaluation leakage. This stage removed about 89.8% of duplicate documents, indicating that the raw crawled corpus was highly redundant. In engineering practice, this is typically done by combining document-level exact matching with near-duplicate detection (such as MinHash/SimHash-based approximate clustering), which requires both thorough recall and controlled false deletion.
The second stage is filtering. The goal is to raise the information density per token, using common rules such as language identification and language-mix ratios, length and symbol-ratio thresholds, perplexity-based scoring, removal of sensitive and low-quality content, and targeted retention of high-quality subsets such as math and code. This stage determines the lower bound of corpus quality.
The third stage is shuffling. Shuffling breaks the correlation between documents and their sources, preventing consecutive appearance of the same topic that can cause catastrophic forgetting and unstable training, while also making data-parallel partitioning more even and reducing load jitter from long-tail batches.
Raw crawled corpus│ (1) Deduplication (exact + approximate, ~89.8% duplicate documents removed)▼Clean document set│ (2) Filtering (language ID / quality scoring / thresholds and blocklists)▼High-quality corpus│ (3) Global shuffle + mixture sampling (Chinese-English ratio, domain ratio)▼Pretraining data stream (~2 trillion tokens)
It is worth stressing that data mixture ratios and deduplication aggressiveness are coupled: the more aggressive the deduplication, the more the share of top-tier high-quality sites tends to rise, so shuffling and sampling weights must rebalance it; otherwise the model develops a skewed distribution on specific topics.
4. Post-Training: An Alignment Chain of SFT and DPO
Pretraining produces a base model with language modeling ability but little aptitude for following instructions. In post-training, the first generation used two families of algorithms, supervised fine-tuning (SFT) and direct preference optimization (DPO), forming a two-stage chain of “teach the format first, then tune the preferences.”
- SFT stage: “instruction-response” samples teach the model task formats, role settings, and output structures, solving the question of whether it can do the task at all.
- DPO stage: paired “better response / worse response” samples for the same prompt directly optimize the model’s relative probability over preference pairs, requiring no separately trained reward model, which shortens the engineering chain and makes it easier to reproduce.
The simplified DPO objective can be expressed as:
# Pseudocode: the core of DPO is raising the relative log-probability of the preferred responseloss = -log_sigmoid(beta * (logp_chosen - logp_ref_chosen)- beta * (logp_rejected - logp_ref_rejected))
In practice, the problems arise on the data side rather than the algorithm side: annotation consistency of preference pairs, length bias (the model’s tendency toward longer responses), and a mismatch between base-model capability and SFT sample difficulty all significantly affect final performance.
5. Open-Source Formats and Division of Labor Between Models
This generation was released as open source, forming the starting point of the later open-source ecosystem and open platform strategy. The two formats have clear roles:
- Base model: aimed at continued pretraining, domain incremental training, and evaluation research; it is the foundation for secondary development.
- Chat model: aimed at direct interaction scenarios such as question answering, writing, summarization, and code assistance, usable out of the box.
The accompanying license, model card, evaluation report, and inference examples are the key materials for judging whether an open-source model can enter production. When selecting a model, enterprises should check whether the license permits commercial use, whether a tokenizer and inference code are provided, the context length and memory requirements, and whether there is a stable update cadence.
6. Evaluation: How Cross-Language Capability Was Verified
Reported results show that the 67B model of this generation outperformed other 70B-class open-source models of comparable size on both Chinese and English evaluations. This points to a methodology: comparing foundation models requires cross-language validation. Looking only at English leaderboards tends to overstate capability, while looking only at Chinese leaderboards can mask multilingual transfer problems.
A recommended evaluation mix:
- General knowledge and time-sensitive question answering, to check factuality;
- Chinese semantics, idioms, and ambiguous-sentence understanding, to check the effect of the corpus mixture;
- Code and math reasoning, to check whether the high-quality subsets took effect;
- Long context and instruction following, to check the gains from GQA and post-training;
- Human preference comparisons, to avoid distortion from a single automated metric.
7. Engineering Deployment Essentials and Common Pitfalls
- Include the KV Cache in memory estimates. When context doubles, the bottleneck in long-sequence inference is usually memory bandwidth rather than compute.
- Fine-tuning data need not be large, but it must be clean. A few hundred to a few thousand high-quality instruction samples often beat tens of thousands of noisy ones.
- Monitor for catastrophic forgetting. After domain incremental training, general capability must be regression-tested; keeping a general evaluation set as a gate is advisable.
- Layer deployment formats. High-concurrency online services should use the chat model with quantization and batching, while offline batch jobs can run the base model with large batches.
- Put observability in place early. Only by wiring logging, monitoring alerts, and call-chain tracing into the inference gateway can you determine whether an issue is a data problem, a parameter problem, or a resource bottleneck.
8. Conclusion
The value of the first-generation general foundation model lies not in parameter count or leaderboard position but in completing the full chain of “architecture reproduction, data governance, post-training alignment, and open-source delivery,” providing a reusable engineering base for later multi-version iterations. For developers, the three most transferable lessons are: architecture choices should follow cost and determinism, data quality sets the model’s ceiling, and evaluation must be cross-language and combine human with automated methods. Enterprises that want to replicate similar capability in their own environments can build training and inference pipelines on general cloud capabilities such as container platforms, object storage, and monitoring alerts; Baidu AI Cloud can provide corresponding support in these general infrastructure categories.
