Improving Large Language Model Base Architectures: A Practical Guide to Code Capability Benchmarks
This article breaks down why Base model improvements are typically pursued across four parallel tracks—architecture, advanced data mixture tuning, data-level refinements, and kernel optimization—and how these tracks interact within a single iteration loop. It explains why code capability is often measured with bits per byte, including the calculation logic and the limitations of this metric, then outlines a more engineering-relevant approach based on cross-file code prediction. The article closes with reusable engineering recommendations for model selection, inference cost, data contamination checks, and low-level optimization. Readers will gain a clear understanding of benchmark interpretation and evaluation boundaries to guide real-world model choices.
1. Why Base Model Improvements Are Split Into Four Tracks
A Base Model refers to a model that has only completed pre-training and has not yet undergone instruction tuning or alignment. Its capability ceiling largely determines how much potential can be unlocked in the post-training stage. For this reason, when iterating on a Base version, teams typically avoid isolated patches and instead advance four tracks in parallel:
- Model architecture: attention structure, feed-forward layer design, sparse expert (MoE) routing, positional encoding, and context extension strategies;
- Advanced data mixture tuning: the ratio of different corpus domains (code, math, natural language, multilingual), annealing-stage strategies, deduplication, and quality tiering;
- Other data-level improvements: filtering rules, contamination detection, synthetic data, and curriculum-style arrangement;
- Kernel optimization: operator fusion, quantization, and communication-computation overlap at the low level, which directly affect training throughput and inference cost.
These four tracks are not independent. Architecture changes alter the optimal data mixture, and shifts in the data mixture can turn certain operators into new bottlenecks. In engineering practice, they must therefore be evaluated within the same iteration loop.
2. Evaluation Methodology: Why Code Capability Uses Bits per Byte
Code capability evaluation generally falls into two categories: generative tasks (completion, cross-file prediction) and compression-style metrics (language modeling quality). The latter commonly uses bits per byte, which converts cross-entropy loss into “the average number of bits required to encode each UTF-8 byte.”
Its advantage is that it is insensitive to the tokenizer: different models have different vocabulary sizes and segmentation granularity, so comparing per-token loss is not fair. After normalizing by bytes, the metric reflects how well the model fits the real text distribution. Lower is better, because it is equivalent to lower perplexity and stronger compression capability.
The illustrative calculation logic is as follows:
import mathdef bits_per_byte(total_nll, total_bytes):# total_nll: accumulated negative log-likelihood (natural log, base e)# total_bytes: total UTF-8 bytes of the evaluation corpusreturn (total_nll / total_bytes) / math.log(2)
On an evaluation set built from a new code repository, the participating models ranked as follows: a leading model took first place at 0.193, the improved Base model under test ranked second at 0.222, followed by three other models with different technical approaches. It is worth emphasizing that the gap between 0.193 and 0.222 is not statistically significant, and such leaderboards only reflect “fit” and cannot be directly equated with usability in real development scenarios.
3. Cross-File Code Prediction: A Validation Method Closer to Engineering Reality
Closer to real development experience than compression metrics is “repository-level prediction”: given repository context, predicting code snippets that span files and modules. This type of evaluation requires the model to have long-context retrieval, dependency reasoning, and naming consistency capabilities.
A sound evaluation design should include three points:
- Homogeneous control group: the models compared should be large-parameter MoE models with similar parameter scale and sparse architecture, avoiding conclusions polluted by scale differences;
- Temporal isolation: additionally select new repositories released after the training cutoff date as the test set, preventing inflated results from data contamination;
- Diverse metrics: record exact match, compile/unit-test pass rate, and cross-file reference accuracy simultaneously, rather than looking only at a single similarity score.
4. Reusable Engineering Recommendations
- Do not select models based on leaderboards alone: use bits per byte as an initial screen for “base quality,” then run small-scale A/B tests on your own repositories;
- Pay attention to inference cost: sparse architectures have an advantage in total parameters, but activated parameters and memory footprint determine the actual unit cost, which can be stress-tested in combination with container platforms and monitoring/alerting systems;
- Prioritize contamination checks on the data side: self-built evaluation sets must undergo deduplication and leakage detection, otherwise improvement gains cannot be attributed;
- Keep interfaces for low-level optimization: operator-level optimizations should be integrated in a rollback-capable and measurable way, avoiding tight coupling with the training framework.
In summary, Base model iteration is a systems engineering effort that unites “architecture, data, operators, and evaluation.” Understanding metric definitions and evaluation boundaries guides practical model selection better than chasing a single ranking.
