How to Evaluate and Select LLM Agents: A Scenario-Based Approach
This article presents a practical framework for evaluating and selecting large language model (LLM) agents based on scenario fit rather than benchmark rankings. It explains why controlled comparisons using isomorphic agents—where memory, skills, system constraints, and tools stay fixed and only the underlying model changes—provide more reliable engineering insights. The evaluation is organized into five progressive tasks: skill packaging, web development, content and copywriting, knowledge base management, and browser automation. The article outlines key process metrics such as task success rate, constraint adherence, token efficiency, long-chain stability, and skill recognition, along with common failure modes and troubleshooting strategies. It concludes with selection principles and a layered scheduling approach for balancing stability, capability, and cost in production environments.
1. Why Model-Only Benchmarks Offer More Engineering Value
In real-world agent engineering, model capability is never an isolated variable. Memory mechanisms, skill libraries, system prompts, tool permissions, context length, and retry strategies all significantly affect final performance. If every evaluation changes multiple variables at once, the resulting conclusions are difficult to attribute to any single cause.
A more rigorous approach is to build a set of isomorphic agents: identical memory content, the same set of callable skills, the same system constraints, and the same accessible tools, with the underlying reasoning model as the only variable. This is essentially the controlled-variable method applied to agent evaluation. It answers not “which model is smarter,” but “under the same engineering constraints, which model is better suited to run the agent’s main loop over the long term.”
Agent scenarios differ from single-turn Q&A or code completion in three key ways:
- Long-chain stability: Tasks often involve a dozen to dozens of tool calls, and the model must stay aligned with the goal across many turns.
- Constraint adherence: Prohibitions, formatting requirements, and confirmation mechanisms defined in the system prompt must be respected continuously.
- Predictable cost: Token consumption and task success rate must be evaluated together; otherwise, a “capable but expensive” approach is hard to sustain.
2. Evaluation Design: Five Progressive Challenges Instead of Ad Hoc Test Cases
To keep conclusions close to production reality, the evaluation tasks are structured as five progressive challenges, each mapping to a typical capability dimension in agent deployment.
Challenge 1: Skill Packaging
The model must turn a long prompt file into a publishable skill package that others can install and use directly. The goal is not to copy the original text but to abstract it: define trigger conditions, inputs and outputs, dependencies, and failure fallback paths, then self-check for potential failure points.
This challenge tests experience consolidation. If a model cannot reliably convert implicit knowledge into structured assets, the maintainability of later complex tasks is out of the question.
Challenge 2: Web Development
Given a requirements description, the model must generate a well-structured, runnable front-end page that follows the specified directory organization, style conventions, and accessibility requirements. The evaluation focuses on whether the model keeps naming consistent across multiple files, proactively fills in missing resources, and asks for clarification when uncertain instead of inventing APIs.
Challenge 3: Content Design and Copywriting
This includes presentation structure planning and marketing copywriting. Such tasks have no single correct answer; evaluation focuses on structural completeness, information hierarchy, terminology accuracy, and strict adherence to word-count and formatting constraints.
Challenge 4: Knowledge Base Management
This covers document chunking, metadata tagging, retrieval strategy design, and incremental update workflows. The model must understand the full “write–index–retrieve–rerank” pipeline rather than just producing plausible-looking pseudocode.
Challenge 5: Browser Automation
This is the most token-intensive challenge and the one that best exposes framework flaws. Tasks include page element location, state detection, exception retries, and confirmation of high-risk actions. If the model fails to request confirmation before a critical write operation or cannot recognize locally defined skills, it signals a break in how the agent framework propagates constraints.
3. Observation Dimensions: Look Beyond “Did It Get It Right”
The most valuable insights in evaluation come from process metrics. At minimum, record the following five categories:
| Dimension | What to Observe | Engineering Implication |
|---|---|---|
| Task success rate | First-pass rate and pass rate after retries | Determines whether human fallback is needed |
| Constraint adherence | Formatting, prohibitions, confirmation mechanisms | Determines suitability for high-risk scenarios |
| Token efficiency | Consumption multiplier for the same task | Sets the long-term cost ceiling |
| Long-chain stability | Whether the goal drifts after 20 steps | Determines the complexity of tasks the agent can handle |
| Skill recognition | Whether local skill definitions load correctly | Determines whether the framework actually works |
Token efficiency is the most easily overlooked. Consumption for the same task can vary by several times across models, which means that under a fixed budget, the number of concurrent tasks the system can support can differ by an order of magnitude. When selecting a model, use cost per successful task as the core metric rather than unit price.
4. Common Failure Modes and Troubleshooting
Most issues observed in practice are not “the model can’t do it” but broken links in the chain. Three typical cases:
- Skills not recognized: The local skill file path, naming, or metadata does not match the convention, so the model cannot load it. First print the actual loaded list, then inspect the model output.
- Missing confirmation for high-risk actions: System constraints never enter the effective context or get diluted by long history. Add a mandatory confirmation hook at critical points as a fallback.
- Abnormal token growth: Multi-turn tool outputs are not truncated or summarized, causing the context to swell repeatedly. Set length limits on tool results and apply structured compression.
Example constraint-validation logic:
def guardrail(action, context):if action.risk_level == "high" and not context.get("confirmed"):return {"status": "pending", "message": "User confirmation required before execution"}if action.skill_name not in context["loaded_skills"]:return {"status": "rejected", "message": "Skill not loaded"}return {"status": "ok"}
5. Selection Conclusions: Match the Scenario, Not the Leaderboard
Across the five challenges, three practical principles emerge:
- Prioritize stability for the main model: For an agent main loop that stays online for long periods and calls tools continuously, choose a model that does not drift on long chains and adheres to constraints reliably.
- Prioritize capability ceiling for hard tasks: Complex refactoring and cross-file generation can go to a model with a higher capability ceiling, but limit call frequency to control cost.
- Deploy interactive scenarios separately: Creative work that is sensitive to latency and quota and requires frequent human involvement is better placed in an interactive environment rather than consuming the agent main loop’s budget.
For cost structure, adopt layered scheduling: a lightweight model handles intent recognition and routing, a more capable model handles critical steps, and tool outputs are uniformly compressed. If combined with general capabilities such as the container platform, log service, and monitoring and alerting offered by Baidu AI Cloud, it becomes possible to add call-chain tracing and cost attribution, turning model selection from subjective experience into a continuously optimizable data loop.
Ultimately, model selection is not a one-time conclusion but a continuous tuning process that evolves with the task distribution. Building an isomorphic evaluation set, fixing variables, and recording process metrics are the keys to keeping agents stable in production over the long term.
