From Foundation Models to AI Agents: The Evolution and Engineering Practice of LLM Reasoning

    This article traces how large language models evolved across three connected stages: foundation model pretraining, reasoning capability enhancement, and agent productization for real-world use. It explains the engineering factors behind each stage—from data quality, training stability, and tokenization in pretraining, to reinforcement-learning-based post-training that teaches models to reason, to the equivalent-FLOPs view of scaling. It then shows how these capabilities become usable products through the agent perceive-plan-act-feedback loop, covers the vertical integration of model training and product taste, outlines a value-driven commercialization path, and offers practical guidance for teams deploying LLMs and agents, including retrieval augmentation, evaluation discipline, observability, and cost-performance trade-offs. The central thesis: what matters is not chasing a single "best model," but a methodology that reliably converts equivalent compute into effective intelligence.

    1. Introduction: Understanding the Three Stages of Large Model Evolution

    The evolution of large language model capabilities can be broadly divided into three connected stages: foundation model pretraining, reasoning capability enhancement, and agent productization for real-world scenarios. Industry discussion of individual model releases tends to focus on isolated technical terms, but what actually determines whether a model creates value is the coupling between these three stages. Understanding this through-line is more useful for engineering than chasing a single “strongest model.”

    It is worth emphasizing that any single model’s lead is temporary. What is truly sustainable is a methodology that continuously iterates and consistently converts “equivalent compute” into “effective intelligence.” This article is built around that methodology.

    2. Foundation Models: The Bedrock of All Capabilities

    A foundation model learns the statistical patterns of language, grammatical structure, and the world knowledge implicit in text through self-supervised pretraining on massive corpora. It is the bedrock on which all subsequent capabilities are built, and the quality of its pretraining directly determines the model’s capability ceiling and breadth of knowledge.

    In engineering practice, foundation model quality is shaped by several factors:

    • Data quality and mix: High-quality, deduplicated, contamination-free training data often improves downstream performance more than simply scaling up volume.
    • Training stability: Numerical stability, gradient explosion/vanishing, and similar issues in large-scale distributed training require rigorous engineering safeguards.
    • Tokenization and context length: A sound tokenization strategy and a longer context window directly determine how well the model handles long documents and multi-turn tasks.

    In short, the foundation stage solves the question of “what the model knows,” while the next stage addresses “how the model thinks.”

    3. The Leap in Reasoning: How Reinforcement Learning Shapes “Thinking” Models

    If pretraining gives a model knowledge, the reasoning enhancement stage gives it the ability to apply that knowledge to solve problems. The core technical approach here is “post-training,” exemplified by reinforcement learning (RL).

    Unlike traditional supervised fine-tuning, reinforcement learning does not require a ground-truth answer for every intermediate step. Instead, it optimizes the model’s overall behavior through a reward signal. A typical workflow includes:

    1. Having the model generate multiple candidate reasoning paths for the same problem;
    2. Scoring each path using a reward model or verifiable reward rules (for example, whether the answer is correct or whether the code passes tests);
    3. Using a policy optimization algorithm (such as various policy gradient methods) to adjust the model so it favors higher-reward reasoning paths.

    The value of this paradigm is that it encourages the model to “think” more thoroughly and in a more structured way before producing a final answer. At inference time, the model can generate a long chain of thought, internally decomposing the problem, exploring paths, and self-verifying—leading to more robust performance on complex tasks such as math, logic, and code.

    It is important to view this rationally: reasoning enhancement is not a master key. It markedly improves performance on tasks that require multi-step derivation, but for factual knowledge and time-sensitive information, it still needs to be combined with retrieval and similar techniques. Reasoning capability and tool use are complementary, not substitutes.

    4. Rethinking Scale: Equivalent FLOPs and the Boundaries of Scaling

    Scaling is an important lever for improving large model capabilities. The industry commonly uses equivalent FLOPs to measure the computational scale of a training or inference effort. When we talk about “raising equivalent FLOPs by an order of magnitude through technical improvements and further scaling,” the meaning is this: not only should we invest more compute, but we should also use architectural, data, and training-method optimizations so that each unit of compute is converted into more “effective intelligence.”

    Several key engineering judgments follow:

    • Scaling is not blindly stacking compute. Scaling laws reveal an approximate relationship between input and results, but marginal returns diminish. Trade-offs must be made among compute, data, energy, and cost.
    • Pretraining quality must catch up to the frontier. This means bringing the foundation model’s knowledge and reasoning ability into the top tier under equal or better compute efficiency.
    • Compute allocation between training and inference must be dynamically optimized. The reasoning enhancement stage often requires large amounts of sampling and scoring. How to schedule resources between training and inference is a core challenge for engineering deployment.

    5. From Model Capability to Agent Product: Making Capability “Usable”

    No matter how strong a model is, if it cannot be packaged into a product form that users can perceive, its value is hard to unlock. An agent is precisely the key vehicle for turning model capability into productivity. A typical agent has a closed loop of “perceive—plan—act—feedback”:

    1. # Illustrative implementation of the agent's "reason-act" loop
    2. def agent_loop(task, model, tools, max_steps=20):
    3. history = [system_prompt(), user_message(task)]
    4. for step in range(max_steps):
    5. # The model generates the next decision based on the current context
    6. response = model.generate(history)
    7. # Exit the loop if a final answer has been reached
    8. if response.is_final_answer:
    9. return response.answer
    10. # Parse the model's intent: call a tool or continue reasoning
    11. action = parse_action(response)
    12. if action.type == "tool_call":
    13. observation = tools[action.name](**action.args) # Call retrieval, code execution, file handling, etc.
    14. history.append(tool_result(observation))
    15. else:
    16. history.append(assistant_message(action.content))
    17. return fallback_answer(history)

    The illustrative code above shows the skeleton of an agent: at each step the model decides whether to “think” or “call a tool,” and the tool’s returned result becomes the input for the next round of reasoning. Around this skeleton, the industry has developed various product forms such as deep research, code generation, document and presentation generation, and task automation. They share the same underlying logic—use tools to fill the model’s gaps, and use loops to extend the boundaries of its capabilities.

    On the engineering side, agent productization also needs to focus on tool reliability and permission control, context management for long-running tasks, failure retry and fallback strategies, and full-process observability (logs, tracing, and monitoring alerts).

    6. Vertical Integration: Aligning the Model and the Product in “Taste”

    A common mistake is to separate model training from product design: the training team only cares about metrics, and the product team only cares about features. But the real source of differentiated capability is the vertical integration of model training and product taste.

    Product taste refers to the judgment about what makes a good interaction and which combinations of capabilities are genuinely useful to users. When this judgment can feed back into the training stage—for example, designing reward signals from real user feedback, or defining evaluation benchmarks from product scenarios—the model grows capabilities “that no one else has defined,” creating a differentiated experience that is hard to replicate. This is precisely the key to moving from “a lead in parameters” to “a lead in experience.”

    7. Commercialization Path: Oriented Toward Value Creation, Not User Scale

    At the commercialization level, a pragmatic path is to focus on agents, pursue the ceiling of intelligence, and create greater productivity value, rather than simply chasing the number of registered users. The reasons are:

    • Value density sets the ceiling on revenue. An agent that can genuinely replace repetitive work and amplify professional capability delivers far higher per-user value than a generalized chat tool.
    • API and platform-based revenue is more sustainable. When model capabilities are integrated into all kinds of applications via interfaces, revenue can often grow by an order of magnitude, with stronger stickiness.
    • Infrastructure supports large-scale deployment. Supporting agent training and inference typically requires a coordinated set of cloud capabilities—for example, object storage to hold training and data assets, message queues to decouple asynchronous tasks, container platforms to provide elastic compute, and logging and monitoring services to ensure observability and stability. The general-purpose capability categories offered by cloud platforms such as Baidu AI Cloud are a common choice for this kind of engineering deployment.

    It is worth viewing this rationally: commercialization data (user growth, API revenue growth, and so on) reflects market feedback from a specific stage and fluctuates with the product cycle. It should not be understood as a permanent indicator of capability.

    8. Engineering Practice Recommendations for Developers

    For teams looking to deploy large model and agent capabilities in their own businesses, the following practices are worth considering:

    1. Define the problem first, then choose the model: Determine whether the task is knowledge-oriented, reasoning-oriented, or tool-oriented, and evaluate whether the model’s capabilities match accordingly.
    2. Use retrieval to fill factual gaps: Combine with general-purpose solutions such as vector retrieval to mitigate the model’s limitations around freshness and hallucination.
    3. Move evaluation upfront: Build a reproducible evaluation set and use data rather than intuition to judge whether model iteration is effective.
    4. Emphasize observability: Establish logging and tracing for every decision an agent makes and every tool call, making issues easier to locate and optimize.
    5. Balance cost and effectiveness: Continuously weigh compute, latency, and results, and avoid paying too high a price for marginal gains.

    9. Conclusion: A Pragmatic Path Toward AGI

    Progress toward artificial general intelligence (AGI) is not a solo performance by any single model, but systems engineering that combines “a stronger foundation + better reasoning + deeper product understanding + more stable engineering + sustainable commercialization.” The foundation sets the ceiling, reasoning enhancement sets the depth, vertical integration sets the differentiation, and commercialization determines whether the next round of iteration can be funded.

    For developers and enterprises, rather than worrying about where a given model ranks, it is better to focus on the methodology: how to reliably convert equivalent compute into effective intelligence, and how to package model capabilities into productivity tools that users genuinely cannot do without. This is where the truly sustainable competitive advantage in this wave of technology lies.