AI Agents: How LLMs Are Evolving from Sounding Good to Getting Things Done
As large language models evolve from conversational tools into systems that complete real tasks, their training objectives are shifting from aligning with human preferences to aligning with task success. This article explains why that shift is happening, what core capabilities an agent needs, and how developers can build production-grade agent applications with well-designed tool abstractions, sandbox isolation, and long-term memory management.
As large language models evolve from conversational tools into systems that can actually complete tasks, their training objectives are changing too. In the past, the main goal was to make models respond fluently and match human expectations. In agent scenarios, models must also complete concrete engineering tasks: making code compile, getting an API to return the correct status code, and making test cases pass. This article explains why this shift is happening, introduces the core capabilities an agent needs, and offers practical guidance developers can apply directly in tool calling, sandbox isolation, and long-term memory.
Why Are Training Objectives Shifting from Preference Alignment to Task Alignment?
For the past few years, one of the core goals of LLM training has been aligning with human preferences. Models were trained to communicate well, write fluently, and produce responses that people find satisfying. But in real engineering work, an answer that sounds good does not mean the task is actually done.
One direction being discussed in the industry is reinforcement learning that uses environment feedback as the reward signal. Traditional RLHF relies on a reward model that scores outputs based on human preferences. In agent scenarios, the reward can come directly from the environment: does the code compile, does the API return the expected status code, do the test cases pass? This success-rate-oriented training approach requires the model to reflect after failures and adjust its strategy across multi-step reasoning.
What Core Capabilities Does an Agent Need?
How Can a Model Break a High-Level Goal into Executable Steps?
The goals agents face are often abstract. For example, “fix a performance issue in production” requires locating relevant logs, confirming the scope of impact, proposing a fix, and finally verifying the result. The model needs to produce a clear plan up front and revise that plan when execution deviates from it.
Newer generations of models have shown notable score improvements on certain reasoning and coding benchmarks. However, specific scores depend on the benchmark version and test conditions, so always check the original entries published by the evaluation organization before citing them.
How Does Multi-Tool Collaboration Enable Continuous Iteration?
Tool calling is the primary way an agent interacts with digital systems. Take a typical DevOps scenario: the agent first calls a logging service to retrieve error messages, then calls a code repository API to modify code, and finally calls a container platform to trigger redeployment. If metrics look abnormal after deployment, the agent must perform a rollback based on the feedback and then attempt the fix again. This “call, observe, correct” loop is the essence of continuous iteration.
Can an Agent Handle the Full Programming Workflow?
Coding ability is a key measure of an agent’s execution capability. A capable coding agent can understand requirements, write code, run automated tests, and fix problems based on error messages. It can also operate build tools in a terminal, read build logs, and locate performance bottlenecks. These capabilities depend on a stable tool environment; the model’s own ability is only one part of the equation.
What Do Low-Level Compute Adaptation Cases Tell Us?
Can a Model Participate in Low-Level Kernel Development?
One category of technical demonstrations shows that LLMs can write and tune compute kernels on domestically developed AI chips that the model never encountered during training. The overall process falls into three steps. First, the model reads the hardware manual and learns the chip’s instruction set and memory model from compiler error messages. Second, it writes a first version of the kernel based on that information. Third, it iteratively adjusts memory access patterns, loop unrolling, and parallel tiling strategies based on profiling reports until performance reaches the target.
The value of these cases lies in demonstrating the importance of toolchains and feedback loops: the model obtains objective signals from profiling tools and modifies code accordingly. The original case cited runtime, invocation counts, and speedup figures, but those numbers lacked a unified measurement methodology, including chip model, kernel type, input scale, data precision, baseline version, and repetition count. This article therefore does not cite those figures. Readers who want to evaluate similar results should define these conditions first and then measure independently.
How Should Developers Build Production-Grade Agent Applications?
How Should the Tool Abstraction Layer Be Designed?
An agent’s capability ceiling is determined by the tools it can call. Developers should wrap internal business systems, object storage, message queues, and logging services behind unified interfaces. Each interface needs a clearly defined input/output format, timeout settings, retry policy, and error messages. Below is a reference implementation of an execution loop. The code first records the tool calls issued by the model, then appends the tool results, so that every tool_call_id maps to a corresponding call record.
def execute_agent_task(task_prompt, model_client, tool_registry, max_steps=50):messages = [{"role": "user", "content": task_prompt}]for _ in range(max_steps):response = model_client.call(messages)if response.finish_reason == "stop":return response.contentif response.finish_reason != "tool_calls":raise RuntimeError(f"Unexpected finish reason: {response.finish_reason}")# Record the model's tool calls first so every tool_call_id# has a corresponding assistant messagemessages.append({"role": "assistant","content": response.content or "","tool_calls": response.tool_calls,})for tool_call in response.tool_calls:try:result = tool_registry.execute(tool_call.name, tool_call.arguments, timeout=30)content = result.logexcept TimeoutError:content = "Tool execution timed out. Narrow the scope or try a different approach."except Exception as exc:content = f"Tool execution failed: {exc}"messages.append({"role": "tool","tool_call_id": tool_call.id,"content": content,})raise RuntimeError("Task not completed within the maximum number of steps")
When a tool times out or throws an error, the loop does not terminate immediately. Instead, it returns the error message to the model and lets the model decide whether to retry or switch approaches. The maximum step limit prevents the model from falling into an infinite retry loop. Different model SDKs define the tool_calls field format slightly differently, so refer to the documentation of the SDK you are using when integrating.
What Sandbox Isolation Settings Matter?
Agents can execute terminal commands and code, so the execution environment must be isolated. It is recommended to run compilation and system operations inside containers, following these practices:
- Do not run as root; grant only the minimum permissions the task requires.
- Set a network allowlist that permits access only to necessary domains and ports.
- Restrict filesystem mount points; do not mount sensitive directories into the container.
- Set quotas for CPU, memory, and disk, and set a timeout for each command, forcibly terminating processes after timeout.
- Write all commands and file changes to an audit log to support post-incident investigation.
How Should Memory and State Be Managed for Long-Running Tasks?
In tasks that run for hours or longer, the context window can easily be filled with historical output. Developers can store task state in a database, including completed steps, key errors, intermediate artifacts, and the plan for the next step. Before each round of inference, inject only the memory fragments most relevant to the current step rather than stuffing the entire history into the context. Historical operations can be periodically compressed into summaries, and failure recovery points should be preserved so the task can resume from its most recent state after an interruption.
Conclusion
Moving from aligning with human preferences to aligning with task objectives is one of the most important directions in agent development. It requires model capabilities, tool environments, and engineering constraints to evolve together. For developers, building solid tool interfaces, sandbox boundaries, and state management usually reduces deployment risk more effectively than chasing any single benchmark metric.
