Architecture and Development Practices of a First-Generation Open-Source Large Language Model
This article reviews the technical architecture and development process of a first-generation open-source large language model, released in early 2024 in 7B and 67B parameter sizes. It covers the dense Transformer design, the use of multi-head attention in the 7B model and grouped-query attention in the 67B model, a three-stage data pipeline of deduplication, filtering, and shuffling, and the SFT and DPO post-training steps. It ends with practical lessons for developers building and deploying LLMs.
1. Background and Positioning
Large language model development usually follows a clear progression. Teams first reproduce a mature open-source architecture to verify that their training pipeline works correctly. They then widen the performance gap through data quality improvements and architectural changes. The first-generation general-purpose model that a research team released in early 2024 is a typical example of this path. It serves as the foundation for a model series and comes in two parameter sizes, 7B and 67B. Each size is released in a base version and a chat version, so the models fit both research and application needs.
From an engineering standpoint, the main goal of a first-generation model is not to reach peak performance. It is to build a complete loop covering data, pretraining, post-training, and evaluation. The experience gained in this stage often sets the ceiling for later iterations.
2. Model Architecture Design
2.1 Why a Dense Architecture
The model uses the dense Transformer architecture that is standard across the industry. Compared with mixture-of-experts (MoE) designs, a dense architecture has a simpler structure, trains more stably, and makes inference behavior easier to analyze. These properties make it a good starting point for a model series. The overall design includes the following components:
- A stack of Transformer decoder layers: The model generates text autoregressively and uses rotary position embedding (RoPE) to encode position information for long sequences.
- RMSNorm normalization: RMSNorm costs less to compute than LayerNorm and stays stable during large-scale pretraining.
- SwiGLU activation: A gating mechanism in the feed-forward network improves the model’s expressive power.
2.2 Different Attention Configurations by Size
The two model sizes use different attention schemes:
- The 7B version uses multi-head attention (MHA): Each attention head has its own Key and Value projections. This gives strong expressiveness and simple implementation, which suits the compute budget of a small model.
- The 67B version uses grouped-query attention (GQA): Several Query heads share one group of Key and Value heads. This significantly reduces the KV cache used during inference.
This trade-off is useful for engineers. The KV cache is the main memory bottleneck in long-sequence inference. GQA compresses the cache several times over with very little loss in accuracy. For high-concurrency inference services, this means lower deployment costs and higher throughput. The following sketch shows the difference between the two schemes:
# MHA: each query head has its own KV headkv_heads = num_heads# GQA: multiple query heads share one KV headkv_heads = num_heads // group_size# For example, with num_heads=64 and group_size=8, the KV cache shrinks to 1/8 of its original size
3. Training Data Construction
Data quality is the single largest factor in model performance. The pretraining corpus for this model contains 2 trillion tokens, primarily in Chinese and English. The data is processed in three stages:
- Deduplication: Document-level and paragraph-level deduplication algorithms remove repeated content. The team removed about 89.8% of duplicate documents. Duplicate data causes a model to memorize training samples and overfit, so deduplication is the most direct investment in better generalization.
- Filtering: Quality models and heuristic rules remove low-quality pages, garbled text, and advertising content, which keeps the noise level under control.
- Shuffling: The corpus is thoroughly shuffled before training. This prevents topic clustering from causing training instability and catastrophic forgetting.
This deduplication, filtering, and shuffling pipeline has become a common industry practice. Its underlying principle is that, with a fixed compute budget, investment in data engineering often returns more than simply scaling up the parameter count.
4. Post-Training and Alignment
After pretraining, the model gains conversational ability through two stages:
- Supervised fine-tuning (SFT): High-quality instruction-response data teaches the model to follow instructions. The data covers question answering, coding, summarization, reasoning, and other task types.
- Direct preference optimization (DPO): Preference pairs are used to optimize the model’s outputs directly toward human preferences. Compared with reinforcement learning-based alignment methods, DPO does not require training a separate reward model. Its training process is more stable and has fewer hyperparameters, and it has become one of the mainstream alignment approaches for open-source models.
5. Evaluation and Results
Third-party general evaluations show that the 67B version clearly outperforms open-source models of similar size on both Chinese and English benchmarks. The results support two conclusions. First, with the same architecture, improving data quality alone can deliver substantial performance gains. Second, careful processing of Chinese corpora is essential for better Chinese-language ability.
Developers should keep one point in mind during evaluation. Benchmark scores only reflect average capability. Before choosing a model, teams should validate it on their own domain-specific evaluation sets, paying attention to specific areas such as long-context processing, code, and mathematics.
6. Open-Source Strategy and Ecosystem Impact
The model releases its weights and some technical details as open source. This strategy offers several benefits:
- Lower barriers to entry: Small and medium-sized teams can fine-tune and deploy the model privately using the open weights, without pretraining from scratch.
- Faster technology diffusion: Publishing the architecture and training methods gives the community a reproducible research baseline.
- A reinforcing ecosystem: Community feedback, tooling, and downstream applications feed back into and accelerate later model iterations.
The release pattern of open weights combined with base and chat versions, first established by this generation of models, has since become a common practice in the open-source LLM ecosystem.
7. Practical Takeaways for Developers
Based on this model’s technical approach, the following lessons can be applied to other projects:
- Choose the architecture based on deployment goals: For cost-sensitive inference, prioritize cache-compression techniques such as GQA.
- Prioritize data engineering over parameter scaling: Strict deduplication and filtering are among the most cost-effective ways to improve performance.
- DPO is a practical starting point for alignment: Without large-scale reinforcement learning infrastructure, DPO can align preferences at a lower cost.
- Validate the design with a dual-size release: Small models can be used to quickly verify a training recipe before scaling it to larger training runs.
Overall, the value of this first-generation model lies not only in its performance. It also demonstrates a complete path of “reproduce, optimize, and open-source” for LLM development, which offers a solid methodological reference for later technical work and industry practice.
