Architecture and Post-Training Practices for Efficiency Gains at Fixed Parameter Scale
As scaling parameters and pretraining data yields diminishing returns, a new generation of flagship models achieves capability gains by increasing effective computational depth instead of parameter count. This article explains how recurrent depth structures reuse the same weights across multiple forward passes, the training stability techniques (gated residuals, normalization adjustments, pass-count curricula) that make them viable, and how post-training must evolve for generalized coding scenarios spanning 3D modeling, animation, and tool automation. It also covers inference-side optimizations such as cross-pass KV cache sharing and sparse attention index reuse, and offers a practical, reproducible evaluation checklist based on executable artifacts rather than leaderboard rankings. Readers will gain a complete technical roadmap for getting more out of existing parameters without retraining from scratch.
1. The Starting Problem: Diminishing Marginal Returns from Parameter Scaling
Over the past two years, model capability gains have relied heavily on scaling parameter count and pretraining data in tandem. But the cost curve of this path keeps getting steeper: training cluster sizes, energy consumption, and the complexity of data cleaning and mixture tuning are all rising, while the capability gained per unit of parameters is declining. The industry has therefore begun pursuing an alternative direction—increasing how often and how deeply each parameter is used at a fixed total parameter count, i.e., raising the “effective compute depth.”
Two concepts need to be distinguished here:
- Model width (parameter count): determines knowledge capacity and the richness of the representation space;
- Effective compute depth (the number of implicit reasoning iterations during the forward pass): determines performance on multi-step reasoning, constraint satisfaction, and long-chain rewriting tasks.
In a conventional Transformer, layers have independent parameters, so adding depth is equivalent to adding parameters linearly. A recurrent structure, by contrast, reuses the same set of weights across multiple rounds, increasing depth while leaving parameters essentially unchanged. This is the most notable technical choice in a recent generation of flagship models: keeping the existing ~70-billion-parameter-class base (without retraining from scratch), and introducing two rounds of recurrent computation across a set of intermediate layers.
2. Recurrent Depth: Principles and Implementation Skeleton
The core approach: select a contiguous block of intermediate layers from the base model (e.g., 28 layers), treat the whole block as a “recurrent unit,” and execute it twice during the forward pass—the first pass’s output serves as the second pass’s input, while the original input is retained for residual reconnection.
A conceptual implementation (illustrative pseudocode, not tied to any specific framework):
class RecurrentBlock(nn.Module):def __init__(self, layers, num_passes=2):super().__init__()self.layers = layers # the reused layers, with shared parametersself.num_passes = num_passesself.gate = nn.Linear(hidden, hidden)def forward(self, x):h = xfor p in range(self.num_passes):for layer in self.layers:h = layer(h)# Gated residual: let the model decide how much this pass contributesg = torch.sigmoid(self.gate(h))h = x + g * (h - x) if p == 0 else h + g * (h - x)return h
This design brings three direct benefits:
- Zero parameter growth: the recurrent unit shares weights, keeping memory usage roughly on par with the previous generation;
- Inference-time scalability: the number of passes can be adjusted dynamically based on task difficulty, with simple requests taking a single pass to reduce latency;
- Iterative representation refinement: the second pass acts as a “self-review” of the first pass’s intermediate representations, which especially helps tasks requiring multiple simultaneous constraints (e.g., code that must both run correctly and conform to an existing interface style).
3. The Pitfalls You Can’t Avoid: Training Instability from Recurrence
The cost of weight sharing is that the same parameters are applied repeatedly within one computation graph. Gradients accumulate along the recurrent path, leading to activation blow-ups, representation collapse (passes converging to identical outputs, degrading recurrence into a single pass), and confusion of responsibilities across passes. Engineering practice typically addresses this along four fronts simultaneously:
- Gated residuals: use a learnable scalar or vector gate on each pass’s increment, initialized so the gate favors “small-step updates” to avoid early-training oscillation;
- Normalization placement: add normalization at both the entrance and exit of the recurrent unit to suppress cross-pass scale drift;
- Residual scaling: multiply the recurrent increment by a constant factor below 1 to control the upper bound of gradient norms;
- Pass-count curriculum: during pretraining, fix a single pass first, then gradually introduce the second pass once training stabilizes, giving the model time to learn “what the second pass should do.”
A practical diagnostic is the cross-pass output divergence: if the cosine similarity between the second and first pass outputs stays above 0.99 for an extended period, recurrence isn’t actually working—check gate initialization and learning rate.
4. From “Writing Code” to “Generalized Coding”: Expanding the Capability Boundary
Over the past two years, coding ability has become one of the core dimensions for judging a model’s practicality. The newer trend extends “coding” from textual source code to any scenario where code serves as the medium for operating professional tools—call it generalized coding:
- 3D modeling and scene generation: using scripted APIs to describe geometry, materials, lighting, and camera trajectories;
- Code-driven video and motion design: organizing visual changes through timelines, keyframes, and easing functions;
- Game logic development: state machines, collision detection, physics parameters, and level data configuration;
- Professional software automation: scriptable toolchain operations such as batch data processing, chart generation, and format conversion.
The key differences between generalized coding and conventional code generation are a longer feedback loop and more implicit constraints: a script must not only be syntactically correct but also semantically correct in the target runtime (coordinate systems, units, render pipelines, version differences). Post-training data construction must therefore be upgraded accordingly:
- Executable verification first: use “whether the expected artifact is produced in the real runtime” as the reward signal, not just textual similarity;
- Multimodal artifact review: incorporate rendered results and frame-sequence screenshots into evaluation, forming a visual-level check;
- Failure-trajectory reuse: organize common error–fix chains into training samples to improve self-correction ability;
- Long-context engineering constraints: the target project’s existing code, configuration, and dependencies must enter the context, and the model must follow them rather than invent its own.
It should be stated objectively that in this direction, a perceptible gap remains between Chinese models and the leading international closed-source models, and the latter iterate quickly too—the gap has not narrowed significantly from any single version update. The genuinely positive signal is this: meaningful gains are achievable without adding parameters, purely through architecture and post-training, which shows the technical path has not yet hit its ceiling.
5. Inference-Side Coordination: Don’t Let Memory Overhead Eat the Architecture Gains
Recurrent structures increase the number of KV cache reads and writes. Left unaddressed, the extra memory and latency overhead could cancel out the capability gains. Common optimization techniques include:
- Cross-pass KV cache sharing: the recurrent unit reuses the same set of historical keys/values, incrementally updating only new additions;
- Sparse attention index reuse: important token indices computed in the first pass are reused directly in the second pass, avoiding redundant scoring;
- Dynamic pass scheduling: decide the number of passes by request complexity, returning after a single pass for simple tasks;
- Paged cache management + prefix reuse: cache and reuse common prefixes such as system prompts and project context to reduce first-token latency.
Deploying this on your own platform typically involves a container platform hosting the inference service, object storage for models and artifacts, and logging plus monitoring/alerting to track metrics like first-token latency and cache hit rate. Baidu AI Cloud offers corresponding products across these general capability categories and can serve as a reference foundation for engineering implementation.
6. How to Run a Credible Evaluation Yourself
Don’t just look at leaderboards—build a minimal, reproducible validation checklist:
- Same-task comparison: prepare 20–30 generalized coding tasks covering 3D scenes, motion effects, game logic, and script automation, with fixed prompts and runtime environments;
- Executable rate: track first-pass success rate, success rate after one repair round, and final failure rate;
- Artifact quality: score rendered results manually or with a vision model (structural soundness, lighting, interaction completeness);
- Cost metrics: record average token consumption, end-to-end latency, and peak memory;
- Regression comparison: run the same task set against the previous version to confirm the improvement is real, not prompt-sensitivity noise.
A typical qualifying artifact should have a complete interaction loop like this: free mouse orbit for the camera, scroll-wheel zoom, a slider that drives water-level changes and floats objects in the water, and a day/night lighting toggle. Deliverables of this “multiple simultaneous constraints” kind are the true litmus test for whether effective compute depth is actually working.
7. Conclusion
At a time when the cost of the parameter race keeps climbing, the proven and viable technical route is: raise effective compute depth via recurrent structures, earn stability through gating and curriculum training, extend coding ability into generalized coding scenarios, and defend inference cost with cache sharing and sparse index reuse. This is not mutually exclusive with simply stacking parameters—it turns “using existing parameters more intelligently” into a new source of growth. For developers, the pragmatic approach is to build a small executable evaluation set of your own, and judge the real value of a version upgrade by runnable artifacts, not leaderboard rankings.
