Architecture and Training Practices of First-Generation General-Purpose LLMs
This article examines how first-generation general-purpose large language models were designed and trained, using a representative open-weight release with 7B and 67B parameter variants as the reference case. It covers the choice of a dense decoder architecture, the trade-off between multi-head and grouped-query attention, a three-stage data pipeline for roughly two trillion bilingual tokens, two-stage post-training with supervised fine-tuning and direct preference optimization, evaluation design for Chinese and English comparability, and the cloud infrastructure needed for training and inference. Readers will find practical engineering guidance on KV cache sizing, data deduplication and filtering, alignment pitfalls, and deployment red lines such as time-to-first-token, output tokens per second, and memory limits.
1. Introduction: Why First-Generation Models Deserve a Second Look
As general-purpose LLMs iterate quickly, many teams focus only on the capability boundaries of the newest release and overlook the engineering paradigm established by first-generation foundation models. A first-generation model usually serves three purposes: proving that a technical route is viable, establishing a data governance process, and creating a comparable evaluation baseline. Its value lies not in having the largest parameter count, but in getting every step from zero to usable to work end to end.
According to public information, one model family released its first generation in early 2024 in two sizes, 7B and 67B parameters, each offered as both a base and a chat variant, distributed as open weights. This combination later became a common industry practice: the smaller version targets on-device and low-cost inference, while the larger one explores the upper bound of quality; the base variant supports continued pre-training and fine-tuning, while the chat variant is ready for direct interaction. Understanding the logic behind this split is more valuable in the long run than memorizing a specific model name.
2. Architecture Choices: Dense Design and Attention Trade-offs
The first generation kept the mature dense decoder architecture: each layer stacks a normalization step, an attention sub-layer, and a feed-forward sub-layer in sequence, with residual connections running throughout. A dense structure offers stable training, a mature operator ecosystem, and simple inference implementations; the cost is higher inference compute than sparse mixture-of-experts designs at comparable quality. For a first-generation project, prioritizing stability over peak cost efficiency is a reasonable choice.
The more interesting difference is in the attention mechanism. The smaller version uses multi-head attention, where each head has its own key and value projections. The larger version switches to grouped-query attention, letting multiple query heads share one set of key and value heads. The benefit shows up during inference: KV cache size shrinks in proportion to the number of key-value heads, easing both memory pressure and memory bandwidth demand, which noticeably improves throughput for long-context and high-concurrency workloads.
# Illustration: key-value head sharing in grouped-query attentionnum_query_heads = 64 # number of query headsnum_kv_heads = 8 # number of key-value heads, far fewer under GQAgroup_size = num_query_heads // num_kv_heads# Query head i reuses key-value group i // group_sizedef kv_head_of(q_head_idx: int) -> int:return q_head_idx // group_size
One engineering caveat: grouped-query attention is not a free lunch. During training, gradients must be sufficiently distributed within each group, otherwise heads in the same group tend to converge to similar functions. During inference, the cache layout must reflect the grouping so keys and values are not stored redundantly for every query head. If a team is migrating from multi-head attention, run small-scale alignment experiments first and confirm that the loss curve and downstream metrics show no regression before switching over completely.
3. Data Engineering: A Governance Pipeline for Trillion-Token Bilingual Corpora
The first-generation model used roughly two trillion tokens of Chinese-English pre-training data, built through three stages: deduplication, filtering, and shuffling. Deduplication alone removed nearly 90% of duplicate documents. That number highlights a frequently underestimated fact: at the trillion-token scale, redundant data not only wastes compute but also amplifies memorization and evaluation contamination risks.
The three stages divide responsibilities as follows:
- Deduplication: identify near-duplicates at both document and paragraph granularity, covering identical text as well as templated rewrites. The common approach uses MinHash plus locality-sensitive hashing for candidate recall, then exact comparison to confirm candidate pairs.
- Filtering: combine rules with a lightweight classifier to remove low-quality content. Rules cover abnormal length, imbalanced symbol ratios, garbled text, and ad templates; the classifier scores content on language intelligibility and structural completeness.
- Shuffling: scatter data sources and topic distributions globally so the same source does not appear in long consecutive runs, which would cause distribution drift late in training, while also balancing the ratio across languages.
Raw crawl -> language identification -> document-level dedup -> paragraph-level dedup-> rule filtering -> quality-score filtering -> ratio shuffling -> training shards
Note that ratio and shuffling strategy directly affect the balance of bilingual capability. If one language is overrepresented, gains in that language come with degradation in the other. In practice, teams set a target ratio range based on the intended use case and monitor both sides with small-scale probe evaluations during training.
4. Post-Training: From Base Model to Chat Model
Post-training used two methods: supervised fine-tuning and direct preference optimization. Supervised fine-tuning converts continuation ability into instruction following, with data in instruction-response pairs covering question answering, summarization, rewriting, code, and reasoning. Direct preference optimization uses pairwise comparisons of better and worse responses to adjust the model’s output distribution directly, without training a separate reward model, which shortens the pipeline and lowers memory overhead.
Three pitfalls come up often in practice: instruction data that is too homogeneous, leaving the model able to fill in templates only; preference pairs where the good and bad responses differ too little, producing a weak optimization signal; and over-alignment that causes general capability to regress. Practical mitigations include broadening task types, quality-stratifying preference pairs, and running general benchmarks as regression tests after each alignment round.
5. Evaluation: Designing for Comparability Across Chinese and English
Public results show that the 67B version of this generation outperformed contemporaneous open-source models in the 7B class on both Chinese and English benchmarks. For developers, the evaluation methodology matters more than the conclusion: coverage should span four areas, namely knowledge QA, reading comprehension, math and code, and long-context handling, with prompt templates, decoding parameters, and sample counts held strictly consistent, otherwise cross-model comparison does not hold. It is also worth keeping a private, unreleased test set to detect corpus contamination.
6. Engineering Foundation: Training and Inference on the Cloud
Because the first-generation weights are open, enterprises can do secondary development on general-purpose cloud infrastructure. A typical setup uses object storage for corpora and checkpoints, a container platform to schedule distributed training and inference jobs, a message queue to decouple the data processing pipeline, and logging plus monitoring with alerting to track loss, throughput, and memory watermarks. General compute, storage, and operations products from Baidu AI Cloud can serve as the foundation for such a setup; refer to the official documentation for specific specifications and pricing.
For inference, split traffic by scenario: low-concurrency offline jobs can use the larger version with batching enabled, while high-concurrency online services should favor the smaller grouped-query attention version, combined with quantization and continuous batching to raise throughput. Before launch, complete load testing and fix three red lines: time to first token, output tokens per second, and the memory ceiling.
7. Conclusion
The significance of a first-generation general model is that it gets architecture, data, alignment, and evaluation working at the same time, producing a reusable methodology. For enterprises today, copying a specific model is not the best option. A more pragmatic path is to borrow the stability of the dense architecture, the inference economics of grouped-query attention, the three-stage data governance process, and the two-stage alignment workflow, then combine them with your own scenario data and general engineering capabilities on the cloud to build your own foundation model and evaluation system.
