Model Selection for Long-Running Tasks: Evaluating Cost, Efficiency, and Capability

    Selecting the right model for long-running tasks requires going beyond benchmark scores and subjective experiences. This article explores a structured approach to model selection by evaluating capability, efficiency, and cost. It covers how to build custom evaluation sets from real workflows, implement an evaluation pipeline, and assess model usability for continuous tasks based on tool stability, state consistency, error recovery, and service continuity.

    1. Starting from a Model Release

    When a new model is released, discussions typically focus on two types of information: official benchmark scores and subjective experiences from early users. While both provide reference value, neither is sufficient to directly support engineering model selection. The distribution of questions, scoring methods, and testing conditions of benchmarks often differ from real-world business scenarios. Subjective experiences are easily influenced by deployment states, version differences, and personal usage habits. The same model might correspond to different training phases or deployment versions at different points in time. Stream interruptions or abnormal responses observed during early testing might also stem from temporary server-side issues rather than reflecting the model’s inherent capabilities.

    Therefore, a more reliable approach is to break down model selection into three questions: Can the model complete the target task? How many resources are consumed to complete a task? And are these resource consumptions controllable during long-term operation? These three questions correspond to capability, efficiency, and cost. The following sections discuss the evaluation methods for each question.

    2. Capability Evaluation: From Benchmark Scores to Task-Level Validation

    2.1 Value and Limitations of Benchmark Testing

    Benchmark testing is suitable as a starting point for horizontal comparison, allowing you to quickly filter out obviously mismatched candidate models. However, its limitations are equally clear:

    • Public test sets may overlap with training data, leading to inflated scores that exceed actual performance levels.
    • Single metrics struggle to reflect stability under multi-turn interactions, tool calling, and long-context scenarios.
    • Different teams use varying scoring standards, meaning scores across versions or teams cannot be directly compared.

    Benchmark scores are appropriate for answering “whether a model is worth adding to the candidate list,” but not for directly answering “whether it can replace the existing solution.”

    2.2 Building a Custom Evaluation Set

    The evaluation set should be sourced directly from real workflows. It is recommended to prepare twenty to thirty representative tasks covering the following categories:

    • Single-step Q&A and code generation, to verify baseline accuracy.
    • Multi-file reading/writing and local refactoring, to verify the ability to understand and modify existing content.
    • Tasks requiring external tool calls and handling error responses, to verify the stability of tool usage.
    • Tasks requiring constraints to be maintained across multiple rounds, to verify state consistency.

    Each task should have clearly defined acceptance criteria, such as test case pass rates, content validation rules for output files, or manual scoring based on a rubric. The more specific the acceptance criteria, the more reliable the comparison between different models will be.

    2.3 Evaluation Process Illustration

    Below is an illustrative evaluation framework. The model calling function should be implemented by the user, and the return value needs to include the text result and usage information.

    1. Data structure TaskResult:
    2. task_id Task identifier
    3. passed Whether it passed acceptance
    4. input_tokens Number of input tokens (including cache hits)
    5. cached_tokens Number of cache-hit input tokens
    6. output_tokens Number of output tokens
    7. latency_s Time taken for a single task (seconds)
    8. error Exception information, empty if no exception
    9. Function run_evaluation(tasks, call_model, validate):
    10. results is an empty list
    11. For each task:
    12. Record start time
    13. Try:
    14. resp = call_model(task.prompt)
    15. passed = validate(task, resp.text)
    16. Read various token usages from resp.usage
    17. Append the result to results
    18. On exception:
    19. Record passed = False, and save the exception information
    20. Return results
    21. Function summarize(results):
    22. pass_rate = Number of passed / Total number
    23. error_rate = Number of exceptions / Total number
    24. total_tokens = Sum of input and output tokens for all tasks
    25. Return the three metrics above

    When running this process, the evaluation set and parameter configurations should be fixed, and the service version number and test date should be recorded for each run. Only results obtained under identical conditions can be used for horizontal comparison.

    3. Usability Assessment for Long-Running Tasks

    3.1 Definition of Long-Running Tasks

    Long-running tasks refer to tasks that require multiple steps, multiple turns of interaction, or cross-file and cross-system collaboration to complete. Typical characteristics include:

    • Long execution times, potentially lasting from tens of minutes to several hours.
    • Continuous accumulation of context, where early information needs to be accurately referenced later.
    • The need to maintain intermediate states, such as modified files, completed steps, and pending items.
    • A single-step failure can affect all subsequent steps, so error recovery capability directly determines usability.

    3.2 Four Thresholds for Usability

    To determine if a model is suitable for long-running tasks, evaluate the following four aspects:

    1. Tool calling stability: Observe the accuracy of parameter formats and whether the model can retry or switch to alternative paths after a tool returns an error.
    2. State consistency: Observe whether the model forgets early constraints after multiple turns, or mistakenly modifies content that was already completed and required no changes.
    3. Error recovery capability: Observe whether the model can resume from a breakpoint after encountering a timeout or exception, rather than starting over from scratch.
    4. Service continuity: Observe whether stream interruptions, timeouts, or truncated outputs occur during long conversations.

    3.3 Continuous Workflow Testing

    A complete workflow can be used for continuous testing, such as: reading several files, modifying code according to requirements, running tests, and finally generating a change report. Throughout this process, the following metrics should be recorded:

    Metric Meaning Calculation Method
    Task Completion Rate Proportion of tasks that passed acceptance Passed / Total
    Manual Intervention Count Number of manual corrections needed per task Sum across all tasks
    Interruption Count Number of stream interruptions or timeouts in a session Direct count
    Effective Output Ratio Proportion of output that can be directly used without modification Usable count / Total output count

    Manual intervention count is often overlooked but is one of the most critical metrics.