Architecture and Training Practices of a First-Generation Open-Source General-Purpose LLM

    This article analyzes the architecture selection, data engineering, training methodology, and inference optimization behind a vendor's first-generation open-source large language model released in January 2024. Covering its dual-size (7B/67B) and dual-form (Base/Chat) release strategy, the three-stage construction of a 2-trillion-token corpus, GQA-based inference efficiency design, and the SFT+DPO alignment pipeline, it offers practical engineering lessons for teams building or fine-tuning their own foundation models.

    Architecture and Training Practices of a First-Generation Open-Source General-Purpose LLM

    Introduction

    In the rapid evolution of large language models, a first-generation general-purpose foundation model typically plays a “groundbreaking” role: it validates the team’s end-to-end technical pipeline—from data construction and pretraining to alignment tuning—while establishing a reusable engineering paradigm for subsequent model generations. This article examines a vendor’s first-generation open-source LLM released in January 2024, analyzing it across four dimensions: architecture selection, data engineering, training methodology, and inference optimization. The goal is to help developers understand the key technical decisions involved in building a general-purpose foundation model from scratch.

    The model was released in two parameter sizes—7B and 67B—and in two forms: a base model and a chat model, all fully open-sourced. This “dual-size + dual-form” release strategy later became common practice in the open-source community: the smaller size allows researchers to reproduce and fine-tune with limited compute, while the larger size benchmarks capability ceilings against top-tier industry models.

    1. Architecture Selection: Why Stick with a Proven Dense Architecture

    1.1 Reproduce First, Innovate Later

    The first-generation model followed a pragmatic development philosophy: first fully reproduce the mainstream dense Transformer architecture already validated by the industry (the widely adopted LLaMA-style technical route), ensuring a stable training pipeline and predictable convergence behavior, then focus effort on improving training data quality. The engineering logic behind this strategy:

    • Reduce systemic risk: Pursuing architectural innovation and data engineering simultaneously makes root-cause analysis difficult. Fixing the architecture as a constant makes data quality the only controlled variable.
    • Establish comparable evaluation baselines: Using a mainstream architecture enables direct comparison with same-scale open-source models on public benchmarks, quickly verifying whether the data pipeline actually delivers gains.
    • Pave the way for future innovation: Once the team has a deep understanding of training dynamics, introducing architectural changes such as sparsity and long-context extensions in second- and third-generation models has a much higher success rate.

    1.2 Differentiated Attention Design Across the Two Sizes

    Notably, the two sizes adopted different attention mechanisms:

    • The 7B model uses standard multi-head attention (MHA). At this scale, KV cache memory usage is not yet an inference bottleneck, and standard MHA provides the best expressiveness.
    • The 67B model replaces MHA with grouped-query attention (GQA). GQA lets multiple query heads share the same set of key-value heads, reducing KV cache memory consumption by several times and significantly lowering inference cost and latency during autoregressive decoding.

    This “small model for accuracy, large model for efficiency” combination reflects forward-looking consideration of inference-side cost structure—for models intended for large-scale deployment, inference cost often far exceeds training cost, and GQA dramatically improves serving economics with minimal accuracy loss.

    2. Data Engineering: Building a 2-Trillion-Token Corpus in Three Stages

    The first-generation model was pretrained on roughly 2 trillion tokens of Chinese-English bilingual data. Data construction followed a classic three-stage pipeline: deduplication, filtering, and shuffling.

    2.1 Deduplication

    Deduplication is one of the highest-yield stages in the entire data pipeline. This stage eliminated approximately 89.8% of duplicate documents—a figure that illustrates how redundant raw web-crawled corpora are. Deduplication typically combines two approaches:

    • Exact deduplication: Removing identical documents based on document hashes (e.g., MD5/SHA).
    • Near deduplication: Using locality-sensitive hashing techniques such as MinHash and SimHash to identify highly similar documents (e.g., reposted articles, templated pages).

    Thorough deduplication not only saves training compute but also mitigates the model’s rote memorization of high-frequency text, reduces overfitting risk during training, and minimizes data leakage in evaluation.

    2.2 Filtering

    The filtering stage removes low-quality content through a combination of rules and models. Common techniques include language identification and language-ratio control, perplexity-based quality scoring, spam and harmful-content filtering, and format validation for code and text. Designing filtering criteria is essentially about finding the balance between data quantity and data quality.

    2.3 Shuffling

    Shuffling ensures that data from different sources and domains is evenly distributed throughout training, preventing the model from over-favoring a single data source at any stage—which could cause catastrophic forgetting or distribution shift. Combined with a sensible data mixture (Chinese-to-English ratio, code-to-natural-language ratio, knowledge versus conversational corpus proportions), shuffling is the foundation for balanced development across multiple capabilities.

    3. Post-Training: The SFT + DPO Alignment Combination

    A base model only has text-completion capability; turning it into a usable conversational assistant requires post-training alignment. This model adopted a two-stage “SFT + DPO” approach:

    3.1 Supervised Fine-Tuning (SFT)

    The SFT stage uses high-quality instruction-response pairs for supervised training, teaching the model to follow instructions and organize dialogue format. The key at this stage is the diversity and annotation quality of instruction data, not simply volume.

    3.2 Direct Preference Optimization (DPO)

    After SFT, the model undergoes human preference alignment via DPO. Compared with the traditional three-stage “reward model + PPO reinforcement learning” pipeline, DPO learns directly from preference-pair data without training a separate reward model or complex online RL sampling, offering several engineering advantages:

    • A simpler training workflow with lower hyperparameter sensitivity.
    • No dependence on online sampling, resulting in significantly better training stability.
    • Far lower compute consumption than a full RLHF pipeline.

    Illustrative pseudocode for the training workflow:

    1. # Stage 1: SFT
    2. for batch in sft_dataloader:
    3. loss = cross_entropy(model(batch["prompt"] + batch["response"]),
    4. batch["response_labels"])
    5. loss.backward()
    6. optimizer.step()
    7. # Stage 2: DPO
    8. for batch in preference_dataloader:
    9. chosen_logp = log_prob(model, ref_model, batch["chosen"])
    10. rejected_logp = log_prob(model, ref_model, batch["rejected"])
    11. loss = -log_sigmoid(beta * (chosen_logp - rejected_logp))
    12. loss.backward()
    13. optimizer.step()

    4. Evaluation Results and Engineering Takeaways

    Public evaluations show that the 67B version of this model demonstrated clear advantages over the widely used 70B-class open-source dense model of the same period across multiple Chinese and English benchmarks. This result confirms the core judgment of the first-generation development strategy: with a mature architecture in place, data quality is the primary variable that differentiates models.

    For developers, this case offers several transferable engineering lessons:

    1. Reproduce first, then innovate: With limited resources, pushing a validated technical route to its limits is more likely to yield reliable results than blindly chasing architectural novelty.
    2. Data pipelines deliver the highest ROI: Deduplication, filtering, and shuffling may seem “unsexy,” but they are the core stages that determine a model’s ceiling.
    3. Choose attention mechanisms by model size: Deployment cost should be factored in at the model design stage; inference-friendly designs like GQA have become standard for large models.
    4. Alignment methods trend toward simplicity and efficiency: The emergence of DPO-style methods lowers the engineering barrier to preference alignment, enabling even small and mid-sized teams to train high-quality chat models at a manageable cost.

    Conclusion

    The value of a first-generation general-purpose foundation model lies not only in its benchmark scores but also in validating a complete methodology—from data governance and pretraining to alignment tuning—while establishing an engineering baseline for rapid subsequent iterations. For teams looking to train or fine-tune their own models, general-purpose cloud platforms offering object storage, container orchestration, and distributed training acceleration can be used to build similar data pipelines and training environments, putting the practical experience outlined in this article to work in real business scenarios.