Evaluating LLM Agents in R&D: A Scenario-Based Methodology
This article presents a scenario-based methodology for evaluating large model agents in R&D settings. It explains why aggregate scores obscure meaningful differences, defines four common scenario categories and five evaluation dimensions, and describes how to build sample sets, design scoring rules, interpret results, and integrate evaluation into engineering workflows.
1. Why Scenario-Specific Evaluation Is Needed
Large model capabilities are not evenly distributed. The same model often performs very differently across interface development, 3D scene scripting, backend service implementation, long-document retrieval, and everyday copywriting. If all tasks are mixed together into a single aggregate score, those differences are averaged away, and model selection conclusions lose their reference value.
Evaluation should therefore begin by splitting tasks according to business scenario, then defining metrics within each scenario. After this split, teams can clearly see which task types a model is reliable on and which task types require human fallback.
2. Scenario Categories and Typical Tasks
In actual business work, common scenarios can be grouped into four categories.
1. Interaction and visual generation
This includes front-end component development, 3D scene scripting, small interaction logic, and game prototypes. Outputs from these tasks can often run directly, so the focus is on runnability, whether interaction behavior meets requirements, and visual fidelity.
2. Engineering implementation
This includes backend API implementation, database access logic, concurrency and exception handling, and incremental modifications within an existing codebase. These tasks place the greatest demands on a model’s depth of requirement understanding, coverage of boundary conditions, and maintainability of the generated code.
3. Information retrieval and research
This includes source summarization, comparison of viewpoints across multiple sources, structured summaries, and citation verification. The focus is on factual accuracy, source traceability, and whether the model fabricates citations that do not exist.
4. Office and content
This includes meeting notes, weekly and monthly reports, product descriptions, and marketing copy. The focus is on format adherence, consistency between facts and source materials, and the cost of manual revision.
3. Defining Evaluation Dimensions
Each scenario can be measured across the following five dimensions.
- Correctness: Whether the output satisfies functional requirements. Code tasks can be judged through unit tests or integration tests, while text tasks can be judged through item-by-item fact checking.
- Completeness: Whether the output covers all sub-items in the requirement. Many failures are not completely wrong; instead, they miss a certain condition.
- Controllability: Whether the model reliably follows constraints such as format, length, field naming, and style. For outputs that need to be connected to downstream systems, controllability is more important than prose quality.
- Cost: The volume of input and output data consumed by a single task, as well as end-to-end latency. Cost needs to be normalized by task volume so that it can be compared with quality on the same scale.
- Stability: The degree of fluctuation in results when the same input is run repeatedly. A model with poor stability is not suitable for automated pipelines, even if a single run performs impressively.
4. Building Evaluation Sample Sets
The quality of the sample set directly determines the credibility of evaluation conclusions. The following principles are recommended.
- Samples should come from real business work. Prioritize tasks extracted from historical tickets, real requirement documents, and existing codebases. Avoid simple questions that are entirely artificially constructed.
- Anonymize data. Remove customer information, internal domains, keys, and accounts, and replace them with placeholders.
- Cover a difficulty gradient. Each scenario should include simple, medium, and hard samples so that performance inflection points can be observed.
- Include acceptance methods. Code samples should be accompanied by test cases, and text samples should be accompanied by checklists or reference answer points.
- Control sample size and update regularly. The sample volume for each scenario should be sufficient to offset randomness, and evaluation set content must be prevented from entering model training data and causing inflated scores.
Below is schematic executor code for aggregating scores by scenario. The model call is abstracted as a function parameter so that it can be replaced with any interface.
from dataclasses import dataclassfrom typing import Callable@dataclassclass EvalCase:scenario: str # Scenario name, e.g. "engineering implementation"prompt: str # Input task descriptionchecker: Callable[[str], float] # Takes model output and returns a score between 0 and 1def run_suite(model_call: Callable[[str], str],cases: list[EvalCase],repeat: int = 3) -> dict[str, float]:"""Run each case repeatedly and output the average score by scenario."""per_scenario: dict[str, list[float]] = {}for case in cases:case_scores = []for _ in range(repeat):output = model_call(case.prompt)case_scores.append(case.checker(output))case_avg = sum(case_scores) / len(case_scores)per_scenario.setdefault(case.scenario, []).append(case_avg)return {scenario: round(sum(scores) / len(scores), 4)for scenario, scores in per_scenario.items()}
The repeat parameter in the code is used to measure stability. If the scores for the same case vary widely across three runs, that case should be recorded separately rather than simply averaged and then dropped from analysis.
5. Designing Scoring Rules
Scoring rules need to combine automation and human judgment.
- Automatable parts: Whether code compiles, whether tests pass, whether output conforms to a JSON structure or field constraints, and whether numerical calculations are correct. These checks should be written as scripts whenever possible to ensure consistent criteria across runs.
- Parts requiring human judgment: Whether the tone of copy is appropriate, whether the logic of research conclusions is rigorous, and whether the interface interaction experience is natural. It is recommended that two reviewers score independently, with a recheck when disagreements are large.
A scoring rubric can be created for each scenario. For example, engineering implementation can allocate weights as follows: functional correctness 40 points, boundary handling 20 points, code structure 20 points, and constraint adherence 20 points. Once the rubric is determined, it should remain unchanged throughout the entire evaluation cycle; otherwise, results across different models cannot be compared horizontally.
6. Interpreting Results and Common Pitfalls
After evaluation results are available, several types of judgment errors are common.
Pitfall 1: Treating a single high score as stable capability. One successful run does not mean every run will succeed. The mean and variance across multiple runs should be examined together.
Pitfall 2: Ignoring cost. A model may perform slightly better, but its cost per task may be several times that of another model, which may not be worthwhile in batch office scenarios. Quality and cost should be compared in the same table.
Pitfall 3: Sample distribution inconsistent with real business work. If algorithm problems account for an excessively high proportion of the evaluation set while the team’s actual work mainly involves maintaining legacy systems, the scores will provide little guidance for the team.
Pitfall 4: Ignoring failure modes. The same low score may come from a syntax error in one model, a logic error in another, or a refusal to execute in a third. Different failure types require different follow-up responses. It is recommended to record failure types separately in the results.
7. Implementation Recommendations
The evaluation method can be incorporated into daily engineering workflows through the following steps.
- Map scenarios and priorities. List the tasks that currently consume the most time for the team, and rank them by usage frequency and impact scope.
- Build an initial sample set. Prepare a batch of samples for each high-priority scenario first, then expand gradually.
- Fix run parameters and prompt templates. Temperature, maximum output length, and system prompts should all be version-controlled to ensure reproducibility.
- Run evaluations and save results. Evaluation results, raw outputs, and run logs should be stored in object storage for later traceability.
- Integrate with continuous integration. When the model version or prompt changes, automatically trigger regression evaluation and notify scenarios with significant score drops through monitoring alerts.
- Review and iterate regularly. Each quarter, check whether samples are outdated, whether the scenario split still fits the business, and adjust the scope of model usage based on results.
Through this process, the team obtains not a single broad ranking but a capability map organized by scenario and dimension. Model selection decisions can therefore be based on specific tasks and specific costs, rather than on impressions from a single experience.
