Scaling Foundation Models and Agent Engineering: A Practical Guide

    This article reframes the shift from parameter races to capability engineering as three executable technical problems: raising effective FLOPs by an order of magnitude, closing the gap with frontier pretraining, and vertically integrating training with Agent products. It covers data, architecture, and system-level levers, training stability guardrails, small proxy evaluation sets, verifiable rewards, layered Agent architecture, context and tool orchestration, commercialization metrics, cloud deployment with cost governance, and common pitfalls.

    1. Introduction: From Parameter Races to Capability Engineering

    Over the past two years, the narrative in the large model industry has shifted noticeably. Early on, teams competed on parameter counts and leaderboard scores; today the focus is on task completion quality, stability, and output per unit of cost in real workloads. A goal stated by one leading model team in the source material captures this trend well: use technical improvements and further scaling to raise effective FLOPs by at least one order of magnitude, reach the frontier in pretraining, and vertically integrate training with the Agent product experience. Model capability is no longer a single metric but a system engineering problem spanning a pretraining foundation, post-training alignment, agent orchestration, and a commercialization loop.

    This article takes a neutral view, abstracts that goal into three executable technical questions, and offers engineering recommendations. Cloud capabilities mentioned here are described in generic categories, such as object storage, message queues, container platforms, logging services, and monitoring and alerting.

    2. What an Order-of-Magnitude Gain in Effective FLOPs Means

    2.1 Effective compute, not raw compute

    “Effective FLOPs” emphasizes useful computation. With the same floating-point budget, differences in data quality, training stability, and parallel efficiency lead to very different outcomes. An order-of-magnitude gain typically comes from three stacked paths:

    • Data: cleaning high-quality corpora, deduplication, mixture optimization, and curriculum sampling;
    • Architecture: sparse expert structures, attention variants, and long-context extrapolation;
    • Systems: parallelism strategies (data, tensor, pipeline, sequence) with communication overlap and memory reuse.

    2.2 Training stability is an underrated lever

    In large-scale training, a single unrecoverable loss spike can waste days of compute. Common robust practices include gradient clipping and numerical precision policies, anomaly detection with automatic rollback to the most recent healthy checkpoint, and percentile monitoring of key metrics rather than means alone. An illustrative configuration follows (pseudocode, conveying the idea only):

    1. # Pseudocode: training stability guardrails
    2. for step, batch in loader:
    3. loss = model(batch)
    4. if not torch.isfinite(loss):
    5. restore_last_healthy_checkpoint()
    6. reduce_lr(step)
    7. continue
    8. loss.backward()
    9. clip_grad_norm_(model.parameters(), max_norm=1.0)
    10. optimizer.step()
    11. if step % ckpt_interval == 0 and health_check():
    12. save_checkpoint(step)

    2.3 Evaluation must come first

    Before committing large-scale compute, build a “small proxy evaluation set”: a few thousand highly discriminative samples that approximate the relative ranking of a full evaluation set. In practice, if ranking consistency between the small set and the full set (for example, Spearman correlation) is insufficient, it cannot drive training decisions, or compute will be spent in the wrong direction.

    3. Reaching the Pretraining Frontier: Where the Gap Actually Is

    Catching up with the frontier is not only about adding compute; it means filling four categories of “implicit capability”:

    1. Knowledge density and freshness: domain coverage of the corpus and its update mechanism;
    2. Long-range reasoning consistency: keeping constraints from drifting across multi-step derivations;
    3. Instruction following and format stability: structured output and valid tool-call parameters;
    4. Multilingual and code capability: cross-lingual transfer and repository-level understanding.

    Corresponding engineering methods include mixture experiments with synthetic and real data, preference alignment after rejection sampling, and post-training driven by verifiable rewards such as unit test pass rates and format validation pass rates. The value of verifiable rewards is that feedback is objective and harder to exploit through reward hacking.

    4. Vertical Integration: Let the Model and the Agent Product Evolve Together

    4.1 Why integration is necessary

    Most Agent product failures are not because the model “cannot” do something, but because context organization, tool granularity, and failure recovery are poorly designed. If the training side optimizes only general question answering while the product side needs long-horizon tasks, the two will inevitably diverge. The essence of vertical integration is routing real product failures back into training signals.

    4.2 A layered architecture

    • Capability layer: foundation model plus post-training alignment;
    • Orchestration layer: task planning, tool routing, state management;
    • Interface layer: a unified tool description spec (name, purpose, parameter schema, error codes);
    • Data layer: session and trajectory logs, after de-identification, flow into object storage as return corpus;
    • Operations layer: logging services and monitoring and alerting power quality dashboards and anomaly localization.

    4.3 Context and tool orchestration essentials

    • Layer the context budget: separate quotas for system constraints, long-term memory, the current task, and tool return values so they do not crowd each other out;
    • Keep tool granularity moderate: too fine causes an explosion of call rounds, too coarse makes parameters complex and error rates high;
    • Prioritize failure recovery: define retryable, fallback, and human-intervention policies for each tool category;
    • Idempotency and side-effect isolation: write operations need idempotency keys and a dry-run mechanism.
    1. {
    2. "tool": "search_internal_docs",
    3. "params": {"query": "quota policy", "top_k": 5},
    4. "retry": {"max": 2, "backoff": "exponential"},
    5. "on_error": "fallback_to_index_lookup"
    6. }

    5. Commercial Focus on Agents: Measure the Intelligence Ceiling, Not User Counts

    The source material mentions “not targeting absolute user numbers, but continuously pursuing the intelligence ceiling.” In engineering terms this translates to replacing the north star metric: shift from DAU to “task completion rate × value per task.” Common layered metrics include:

    • Task level: first-pass rate, human takeover rate, average completion time;
    • Session level: number of rework rounds across turns, context overflow rate;
    • Cost level: token cost per successful task, share of tool call cost;
    • Revenue level: structural growth in API call volume and retention, rather than one-off promotional spikes.

    It is worth stressing that high growth in paying users and API revenue usually results from word of mouth and scenario expansion driven by capability jumps. These are outcome metrics; treating them as process metrics to “optimize” invites short-term behavior.

    6. Cloud Deployment: Combining Generic Capabilities and Cost Governance

    Hosting this system in the cloud can be assembled from generic categories: container platforms handle elastic scaling for training and inference; object storage holds corpora and trajectories; message queues handle data return flow and asynchronous evaluation; logging services and monitoring and alerting form the observability foundation; key and permission management preserve data boundaries. For cost governance, isolate quotas and set priority queues across the three resource pools of training, evaluation, and inference, and apply tiered caching and result reuse for long-context requests. Baidu AI Cloud offers standardized components for these generic capabilities, and teams can combine them freely with their own stack, avoiding hard lock-in to a single ecosystem.

    7. Common Pitfalls

    • Scaling compute without changing the data mixture, causing marginal returns to decay quickly;
    • Contaminated evaluation sets, inflating metrics while the live experience does not improve;
    • Vague tool descriptions that force the model to guess parameters, keeping error rates high;
    • Ignoring the return flow of failure samples, so product iteration and model iteration fight separate battles;
    • Substituting short-term revenue moves for capability building, overdrawing the long-term intelligence ceiling.

    8. Conclusion

    Taken together, raising effective compute by an order of magnitude, reaching the pretraining frontier, vertically integrating training and product, and focusing commercialization on agents form a loop: a stronger foundation makes more complex tasks achievable, more complex tasks produce more authentic failure samples, and those samples feed back into training, compounding over time. For developers and enterprise users, three things can be started immediately: build a small proxy evaluation set, unify the tool description spec, and connect the failure sample return pipeline.