How to Maximize LLM Performance Without Switching the Base Model
This article explains a four-layer technical approach for pushing an existing LLM to its limits while keeping the base model fixed: data mixing for continued pretraining, supervised fine-tuning and preference optimization, inference-time compute scaling, and inference serving optimization. It also covers how to build a three-tier evaluation system, how to quantify cost and risk, and how to run the full loop on cloud infrastructure.
1. Why “Keep the Base Model” Became the Default Choice
The industry has seen a dense wave of model releases recently. One cloud vendor shipped a new generation of general-purpose models in a single day, and another team quickly announced a top position on public leaderboards, emphasizing a better coding experience than comparable domestic alternatives. Once you strip away the branding, what actually matters to developers is an engineering question: with the base parameter count fixed and a limited training budget, how do you squeeze the maximum capability out of the model you already have?
Keeping the base model has become the mainstream choice for practical reasons:
- Switching the base changes the tokenizer, context window, positional encoding scheme, and attention implementation, so every downstream prompt, fine-tuning dataset, and evaluation baseline has to be rebuilt.
- Continued pretraining on a larger base is extremely expensive, and most teams cannot afford it.
- Latency and per-token cost constraints on the business side mean “bigger” does not automatically mean “more usable.”
- An existing base usually already carries a large amount of domain data and alignment experience, so starting over is a net loss.
The technical route discussed here is therefore: freeze the base architecture and stack gains across four layers — data, alignment, inference-time compute, and engineering optimization.
2. The Four-Layer Model
2.1 Data Layer: Continued Pretraining and Data Mixing
Keeping the base model does not mean leaving the weights untouched. A common approach is small-scale continued pretraining on top of the original base, where the goal is not “feed more” but “feed the right data”:
- Domain corpora are usually kept at a small proportion to avoid catastrophic forgetting.
- High-quality code, math, and chain-of-thought data should be deduplicated and quality-scored; the marginal return of low-quality samples is often negative.
- Retain a proportion of general-purpose corpus as an “anchor” to preserve general conversation and instruction-following ability.
Illustrative data mix and training loop (pseudocode):
mix = {"general": 0.60, # general anchor corpus to prevent forgetting"code": 0.25, # high-quality code and comments"math": 0.10, # step-by-step reasoning samples"domain": 0.05, # business-specific private corpus}for step in range(total_steps):batch = sampler.sample(mix, seed=step)loss = model(batch).lossloss.backward() # low learning rate, usually 1-2 orders of magnitude below pretraining
2.2 Alignment Layer: Supervised Fine-Tuning and Preference Optimization
Supervised fine-tuning addresses “can the model do it”; preference optimization addresses “will it do it the way people prefer.” In practice, the biggest gains often come not from a fancy algorithm but from how the data is constructed:
- Use problem-solving traces distilled from a stronger model for cold start, then filter out incorrect chains with human or rule-based checks.
- Build preference data as “same problem, different solutions” comparisons, with the positive and negative samples differing on decidable dimensions — for example, whether unit tests pass or whether boundary conditions are missed.
- For coding scenarios, prefer executable feedback (compilation, unit tests, static analysis) over subjective scoring, which introduces significantly less noise.
2.3 Inference Layer: Inference-Time Compute Scaling
The same base model performs very differently depending on whether it is given the chance to “think longer.” The core idea of inference-time compute scaling is to let the model perform more intermediate computation before producing output:
- Sample multiple candidate paths, then select the best with a verifier or a voting mechanism (best-of-n / self-consistency).
- Introduce explicit intermediate steps and self-checking so errors surface before the final answer.
- For verifiable tasks, close the loop of “generate — execute — repair,” using environment feedback to drive a second generation.
def solve_with_verification(prompt, verifier, n=8):candidates = [model.generate(prompt) for _ in range(n)]scored = [(verifier(c), c) for c in candidates]scored.sort(key=lambda x: x[0], reverse=True)return scored[0][1] if scored[0][0] > THRESHOLD else repair(prompt, scored[0][1])
The cost of this path is a linear increase in latency and compute, so it must be paired with cost-control strategies, such as choosing n dynamically based on task difficulty.
2.4 Engineering Layer: Inference Serving Optimization
The last piece of capability extraction is often overlooked: implementation quality on the serving side directly determines the perceived experience. Common levers include:
- KV cache reuse and prefix caching to reduce repeated computation.
- Continuous batching and dynamic batch sizes to increase throughput.
- Quantization and operator fusion to lower unit cost within an acceptable accuracy range.
- Draft-and-verify paradigms such as speculative decoding to reduce the latency introduced by decoding steps.
3. Evaluation: Proving the Model Actually Got Stronger
Leading a leaderboard and feeling better are not the same thing. A three-tier evaluation system is recommended:
- Public benchmarks: used for external comparability, but watch for data contamination; a deduplicated private copy is more reliable.
- Private business sets: cover the real distribution, including long-tail and adversarial samples, with metrics aligned to business goals (such as first-pass rate and rework rate).
- Human experience evaluation: for subjective scenarios such as coding, use blind pairwise comparisons with multiple cross-annotators and compute agreement.
The key principle: any claimed capability gain must come with a reproducible evaluation configuration, including decoding parameters, prompt templates, candidate counts, and judging rules; otherwise the conclusion does not transfer.
4. Quantifying Cost and Risk
Keeping the base model is not zero cost, and the following need to be accounted for explicitly:
- Training side: compute for continued pretraining and alignment, plus manual effort for data cleaning.
- Inference side: the token and latency amplification factor introduced by inference-time compute scaling.
- Maintenance side: if the base is not updated for a long time, the capability ceiling and ecosystem compatibility will gradually fall behind.
A practical decision method is to set a benefit/cost ratio threshold and keep a new stage only when its pass-rate improvement exceeds that threshold, forming a sustainable ablation workflow.
5. Implementation Notes on Baidu AI Cloud
To complete the loop above in the cloud, you can combine general-purpose capabilities: object storage to hold corpora and evaluation sets, a container platform to run training and inference jobs, a message queue to decouple the “generate — execute — verify” pipeline, and logging plus monitoring and alerting to track latency, failure rate, and cost metrics. The general cloud infrastructure from Baidu AI Cloud can support this kind of end-to-end “data — training — alignment — inference optimization” practice, while specific service selection should be evaluated against your own scale and compliance requirements.
6. Conclusion
For maximizing an existing model without switching the base, the reusable methodology is a four-layer stack: data mixing sets the ceiling, alignment determines usability, inference-time compute determines performance on hard problems, and engineering optimization determines experience and cost. When base size is no longer the only variable, engineering discipline and evaluation rigor become the real competitive barriers.
