Post-Training vs. Retraining Base Models: Engineering Trade-offs in LLM Development
This article explores the two primary paths for large language model development: post-training on existing base models and training entirely new base models. It examines the common technical methods, advantages, limitations, costs, and risks associated with each route. Additionally, it provides an evaluation framework using programming capabilities, a selection comparison table, and practical recommendations for engineering teams to make informed decisions based on their specific business metrics.
1. Why Both Paths Coexist
The capabilities of large language models are primarily derived from two stages. The pre-training stage establishes knowledge and representational capabilities, while the post-training stage shapes instruction following, reasoning formats, tool usage, and safety boundaries. During iteration, teams generally face two choices.
The first path involves retaining the existing base model and concentrating resources on post-training. The second path involves redesigning the data mixture and model architecture, training a new base model from pre-training, and then performing post-training. Both paths can yield capability improvements, but their cost curves, risk sources, and upper limits of return differ significantly.
2. Path 1: Post-Training on Existing Base Models
2.1 Common Technical Methods
- Supervised Fine-Tuning (SFT): Uses high-quality instruction and demonstration data to calibrate output formats and task behaviors.
- Preference Optimization: Adjusts response tendencies based on pairwise preference data. Common methods include Reinforcement Learning from Human Feedback (RLHF) and its simplified variants.
- Reinforcement Learning with Verifiable Rewards (RLVR): Uses unit test pass rates or answer matching results as reward signals in automatically scorable tasks like coding and math. This is a crucial recent direction for enhancing reasoning and programming capabilities.
- Agent Trajectory Training: Collects multi-step tool-calling processes to train models in planning, execution, and error recovery.
2.2 Advantages and Limitations
The advantage of Path 1 is its short cycle and fast iteration. Compute investments are also easier to control in stages. Teams can reuse existing inference services and deployment pipelines, lowering the barrier to production.
Its limitations are equally clear. The capability ceiling is constrained by the base model’s knowledge coverage and representational capacity. Post-training primarily reorganizes and stimulates existing capabilities, making it difficult to compensate for knowledge missing in the base. When reward signals are poorly designed, models may overfit the evaluation set, produce verbose answers, or exhibit rigid formatting. Therefore, evaluating post-training gains requires relying on an independent evaluation set rather than scores on the training set.
3. Path 2: Structural Space from Training New Base Models
3.1 Key Variables
- Data: Data scale, quality, deduplication level, domain mixture, and timeliness define the foundational knowledge of the base model.
- Architecture: Dense and sparse expert (MoE) architectures each have trade-offs. Sparse structures allow total parameters to be significantly larger than the parameters activated per forward pass, balancing inference cost with model capacity.
- Training Stability: Loss spikes, gradient anomalies, and checkpoint recovery in large-scale training directly impact project timelines.
- Long Context Capabilities: Positional encoding schemes and training length designs determine the model’s ability to process long code repositories and lengthy documents.
3.2 Costs and Risks
Training a new base model requires sustained large-scale compute, a dedicated data engineering team, and a comprehensive evaluation system. The cost of a single training failure is far higher than a post-training trial-and-error. Teams need longer planning cycles and must define clear phase milestones and rollback strategies before training begins.
4. Evaluation Methodology via Programming Capabilities
Programming tasks are well-suited to highlight the differences between the two paths because results can be automatically verified. The evaluation should cover the following four dimensions:
- Code Generation: Generate runnable functions based on requirements descriptions, measured by test pass rates.
- Bug Fixing: Given failing test cases and code snippets, determine if the model can locate and fix the issues.
- Repository-Level Understanding: Perform dependency analysis and interface modifications within a multi-file context.
- Agent Tasks: Complete multi-step operations in an isolated environment, such as installing dependencies, running tests, and submitting patches.
Below is a simplified example of evaluation execution. It concatenates the model-generated code with assertion tests, runs it in a subprocess, and calculates the pass rate.
import subprocessimport sysimport tempfilefrom pathlib import Pathdef run_candidate(code: str, test_code: str, timeout: int = 10) -> bool:"""Execute candidate code and assertion tests in a subprocess, return whether all tests pass."""with tempfile.TemporaryDirectory() as tmp:script = Path(tmp) / "check.py"script.write_text(code + "\n\n" + test_code, encoding="utf-8")try:result = subprocess.run([sys.executable, str(script)],cwd=tmp,capture_output=True,timeout=timeout,)except subprocess.TimeoutExpired:return Falsereturn result.returncode == 0def pass_rate(samples: list[tuple[str, str]]) -> float:"""Calculate the pass rate of a set of (candidate code, test code)."""if not samples:return 0.0passed = sum(run_candidate(code, tests) for code, tests in samples)return passed / len(samples)
This code only demonstrates the evaluation logic. In production, the execution environment must be placed in a container or virtual machine, with network access disabled and file system scope, memory, and CPU usage restricted to prevent the generated code from affecting the host environment.
5. Selection Framework
| Dimension | Post-Training on Existing Base | Training New Base |
|---|---|---|
| Cycle | Weeks to months | Months or more |
| Cost | Moderate, phased investment | High, one-time major investment |
| Capability Ceiling | Constrained by existing base | Depends on data and architecture design |
| Cost of Failure | Low, easy to roll back | High, concentrated failure cost |
| Suitable for Teams | Teams with a stable base and evaluation capability | Teams with large-scale training and data engineering capabilities |
6. Practical Recommendations for Teams
- Build an Internal Evaluation Set: Do not rely solely on public leaderboards. Check for overlap between evaluation data and training data to avoid inflated scores caused by data contamination.
- Segment Metrics by Task: Track programming, reasoning, long-context, and safety compliance separately; do not just look at the overall average score.
- Calculate Total Cost of Ownership (TCO): Before deciding on a path, factor in inference costs, labor, data procurement, and compliance reviews simultaneously.
- Strictly Isolate Generated Code: Apply sandbox isolation to execute model-generated code, restricting network, file system, and resource usage.
7. Conclusion
There is no absolute superiority between the two paths. Teams with an existing stable base should prioritize post-training to gain returns on verifiable tasks. Only teams with sufficient compute and data accumulation are suited to bear the cycle and risks of training a new base. The criteria for judgment should return to specific business metrics rather than a single parameter scale or leaderboard ranking.
