LLM Technology Landscape: From General Language to Million-Token Context

    This article maps the main technical threads behind large language models—parameter efficiency, data and training strategy, reasoning capability, context length, and modality coverage—and traces how general language models, mixture-of-experts architectures, code and math specialization, critic-free policy optimization, multimodal and document understanding, formal theorem proving, and attention compression build on one another. It also summarizes the engineering implications and common pitfalls for deployment.

    1. Why a Technical Thread Matters More Than a Pile of Papers

    The number of papers in the large language model field is growing rapidly, but only a few main lines tend to influence engineering decisions: parameter efficiency, data and training strategy, reasoning capability, context length, and modality coverage. Reading individual papers in isolation can easily lead to getting lost in details. Reconstructing the thread over time makes one thing clear: almost every subsequent result addresses a shortcoming left by the previous one.

    The thread below covers general language models, code intelligence, mathematical reasoning, multimodal understanding, formal theorem proving, and document understanding. Its technical focus is concentrated in two areas: architectural efficiency, represented by sparse attention and mixture of experts, and reasoning capability, represented by policy optimization algorithms.

    2. Starting Point: The “Long-Termism” Baseline for General Language Models

    The series began with a group of general language models ranging from 7B to 67B parameters, pretrained on about 2 trillion tokens, and explicitly proposed a “long-termism” training philosophy: focus optimization on the long-term returns from data quality and training strategy, rather than chasing fluctuations in short-term benchmark metrics.

    The engineering implications of this philosophy are very concrete:

    • Data mixture and cleaning are long-term assets, and their benefits continue to pay off across all downstream tasks.
    • Training strategies must be reproducible; details such as learning rate scheduling, data order, and repetition epochs need to be managed as first-class citizens.
    • The scale ladder must be complete; a continuous range from 7B to 67B makes it easier to fit capability-cost curves instead of betting on a single size.

    At the results level, the 67B dense model surpassed mainstream open-source 70B-class baselines of the same period on code, math, and reasoning tasks, and reached the entry level of closed-source general models at the time. This proved a key judgment: under a reasonable budget, the open-source route can approach closed-source capability, and the gap mainly comes from data and engineering details rather than an insurmountable barrier.

    3. The First Strike in Architectural Efficiency: Fine-Grained Experts + Shared Experts

    The second stage introduced a Mixture of Experts (MoE) architecture for the first time, but made two key modifications.

    Fine-grained expert segmentation: traditional MoE uses a small number of “large experts,” each token is routed to 1–2 experts, and expert capacity is large but specialization is low. The fine-grained approach cuts experts into smaller and more numerous units, the number of routing combinations grows combinatorially, and expert division of labor becomes clearer.

    Shared expert mechanism: a portion of experts remains constantly open to all tokens to carry common capabilities such as general knowledge and grammar; the remaining routed experts are responsible only for differentiated knowledge. This alleviates the redundancy of “public knowledge being learned repeatedly in every expert.”

    Illustrative routing logic (pseudocode, structure only):

    1. # shared experts: all tokens pass through constantly
    2. h_shared = sum(shared_expert_i(x) for shared_expert_i in shared_experts)
    3. # routed experts: top-k fine-grained routing
    4. scores = router(x) # [num_tokens, num_experts]
    5. topk = scores.topk(k=2).indices
    6. h_routed = 0
    7. for e in unique(topk):
    8. mask = (topk == e).any(dim=-1)
    9. h_routed[mask] += gate(scores, e)[mask] * experts[e](x[mask])
    10. y = h_shared + h_routed

    In terms of results, a sparse model with 145B total parameters activates only about 28.5% of its parameters per token, yet can match the 67B dense model in the same series. This architecture became the technical foundation for all subsequent MoE work. From an engineering perspective, it directly determines the focus of memory and communication optimization: total parameter count determines storage and all-to-all communication volume, while activation volume determines actual compute cost.

    4. Domain Specialization: Code and Math

    For code, dedicated models from 1.3B to 33B were trained from scratch, pretrained on about 2 trillion tokens of code corpora, covering 87 programming languages. They surpassed all open-source code models of the time on public code generation benchmarks and outperformed early closed-source code generation models and general closed-source models. The methodological value lies in this: the scale of domain corpora and the breadth of language coverage are more decisive for the upper bound of code capability than simply stacking parameters.

    For math, this was one of the most academically influential works in the line (with more than 5,000 citations). Its core contribution was a reinforcement learning algorithm that requires no critic model.

    5. Reasoning Capability: Policy Optimization Without a Value Network

    Traditional PPO requires maintaining both an actor and a critic. The critic usually has a parameter count comparable to the actor, doubling memory and compute overhead. The idea of Group Relative Policy Optimization is to sample a group of outputs for the same prompt and use relative advantages within the group to replace the absolute value estimates produced by a critic.

    1. # Illustration: group-relative advantages, no critic required
    2. group = [policy.generate(prompt) for _ in range(G)]
    3. rewards = [reward_fn(prompt, y) for y in group]
    4. mean, std = rewards.mean(), rewards.std()
    5. advantages = [(r - mean) / (std + 1e-6) for r in rewards]
    6. # Then update the policy with a PPO-style clipped objective

    The benefit of this approach is significantly lower memory usage and a simpler training pipeline. The cost is that it requires a reasonable sampling number G and a stable reward design; otherwise, too little variance within the group can cause the advantage signal to degenerate. The algorithm later became a core method for reasoning-enhanced training and achieved open-source SOTA on public mathematical reasoning benchmarks.

    6. Multimodality, Document Understanding, and Formal Proof

    The first vision-language model in the multimodal direction aligned a visual encoder with a language model, with emphasis on data construction and alignment rather than structural stacking. Document understanding focuses on information extraction under layouts, tables, and multi-column formatting; the difficulty lies in positional encoding and cross-page references in long documents. The formal theorem proving direction maps natural language reasoning into a machine-checkable formal language and replaces subjective rewards with deterministic feedback from a compiler, making it naturally complementary to the reinforcement learning methods in the previous section.

    7. The Through Line: Attention Efficiency and Million-Token Context

    Multi-head Latent Attention (MLA) uses low-rank compression of KV representations to substantially reduce KV cache usage during inference, making the serving cost of long context controllable. Combined with positional encoding extrapolation and a long-sequence curriculum during training, the context window is pushed to the million-token scale. From an engineering perspective, note that increasing context length brings memory and bandwidth pressure rather than compute pressure, so optimization should focus on cache compression, paged management, and batching scheduling.

    8. Deployment Recommendations and Common Pitfalls

    • Pitfall 1: Looking only at total parameters. For sparse models, also look at activated parameters and communication overhead.
    • Pitfall 2: Treating long context as free. Compare retrieval-augmented generation and long context on cost before choosing.
    • Pitfall 3: Treating reinforcement learning as a universal solution. When reward design is unstable, algorithmic advantages are swallowed by noise.
    • Deployment combination: place model serving on a container platform, store corpora and weights in object storage, decouple training and inference tasks with a message queue, and use logging and monitoring/alerting for observability. Baidu AI Cloud’s capabilities in these general categories can serve as a reference baseline; refer to the official documentation for specific specifications.

    9. Conclusion

    The internal logic of this thread is very clear: first build a general baseline with long-termism, then use sparse architectures to address parameter efficiency, use domain corpora to tackle code and math, use critic-free policy optimization to lower the barrier to reasoning training, and finally use attention compression to push context to the million-token level. Understanding what shortcoming each link addresses is more valuable over the long term than memorizing any single paper.