LLM Leaderboard Selection: Coding, Hallucination, Long Context, Cost, and Instruction Following

    When multiple mainstream large language models cluster within the same benchmark score band, a single ranking stops being a reliable selection signal. This article explains how to choose a model for production by reading capability structure rather than overall rank, across five dimensions: agentic coding (where completion and timeout rates matter), hallucination control, ultra-long context, per-task cost, and precise instruction following. It includes reusable Python frameworks for timeout-bounded task execution, token-budgeted context building, per-task cost estimation, and strict JSON parsing with validation and retry, along with a practical selection workflow and an FAQ for teams that validate models against their own business data.

    1. How to Read Benchmark Results: Ties Reflect Differences in Capability Structure

    A new round of general-purpose LLM capability evaluations has been published, and several mainstream models landed within the same overall score range. By the evaluation rules, models within a 1-point spread can be treated as tied, so “tied for first” is better understood as “in the same tier” rather than “identical in capability.”

    For developers, this carries two implications:

    1. Overall capability is no longer the main differentiator. A composite score is usually aggregated from sub-scores such as knowledge, reasoning, coding, and long context, weighted by importance. When weighted totals converge, selection has to return to the business scenario and check whether each sub-score can support the specific task.
    2. The structure of weaknesses differs. Models with similar scores can have very different strength distributions. One may be stronger at hallucination control, another at long context. Selection should look at the metric structure, not just the rank.

    Also keep the leaderboard’s limitations in mind. A leaderboard is typically a static snapshot under a specific test set, specific prompts, and a specific evaluation time; scores are only an initial screening signal and cannot replace validation on your own business data.

    To avoid ambiguous references, this article consistently calls the higher-scoring model in hallucination control the “hallucination-control leader” and the higher-scoring model in long context the “long-context leader.”

    Source and methodology note: The scores cited here are used only to illustrate the evaluation method. When citing them, note the evaluating organization, leaderboard name, release date, link, test set size, and scoring basis. An example basis could read: a general-purpose LLM capability evaluation (May 2026; organization: a public evaluation center; link: leaderboard page; ~800 tasks; 100-point scale; models within a 1-point spread treated as tied). For formal selection, use verifiable official sources and record the test set composition, question distribution, scoring rules, and release date.

    2. Five Key Dimensions Behind the Evaluation

    General-purpose capability evaluations usually examine the following dimensions:

    Dimension Focus Typical question types
    General capability & knowledge reasoning Subject knowledge, common-sense understanding, logical reasoning Multiple choice, Q&A, reasoning questions
    Agentic coding Completing code tasks in multi-turn, tool-enabled environments Bug fixing, code generation, tool-calling tasks
    Ultra-long context Locating and using key information within long documents Long-document QA, cross-paragraph summarization, retrieval tasks
    Hallucination control Staying cautious about uncertain content and reducing factually incorrect output Fact-checking, controversial questions, missing-information questions
    Precise instruction following Strictly obeying explicit constraints on format, fields, and values Structured extraction, formatted output, rule-constrained tasks

    The most notable aspect of this round’s results is not the rankings but the structural changes: capability represented by agentic coding is rising quickly, and the timeout and cost metrics that affect engineering usability have also improved. Let’s break these down one by one.

    3. Agentic Coding: Timeout Rate and Per-Task Cost Are the Bottom Line for Engineering Usability

    Agentic coding refers to a model using tool calls, multi-step reasoning, and self-correction to complete programming tasks, typically represented by code assistants and automated coding tools. These tasks often go through multiple rounds of reasoning and tool interaction, forming a long chain where any single step getting stuck can cause an overall timeout.

    The source notes that two new models both scored 57.69 on agentic coding, up 15.38 from the previous version. More importantly, the two models previously had timeout rates of about 69.23% and 26.92% respectively; in the new version both dropped to 0% and completed all tasks. In production systems, timed-out requests can usually only be retried or discarded and produce no business value, so timeout rate typically reveals engineering usability risk earlier than average score.

    When evaluating agentic coding, watch these metrics together:

    • Completion rate and timeout rate: timed-out samples don’t count as valid output.
    • Task pass rate: only tasks completed within the time limit participate in accuracy statistics.
    • Latency percentiles: focus on P90 and P99 latency, not just average latency.
    • Average interaction rounds and tool-call count: reflect whether the model needs more trial and error to finish.
    • Per-task cost: determined jointly by input/output token volume and billing unit price.

    During evaluation, set a clear timeout ceiling for each task and attribute failures and timeouts separately. The example code below provides a reusable task-execution framework.

    Running instructions: The example requires Python 3.8+. model_call should be an async function with a signature like model_call(task, history) returning a (reply, usage) tuple; usage should contain at least prompt_tokens and completion_tokens. Each call should pass the current task, message history, and any necessary error information to support multi-round correction.

    1. import asyncio
    2. import json
    3. import time
    4. # Total latency budget: reference the real business's latency requirement
    5. TIMEOUT_SECONDS = 120
    6. # Per-step latency budget: prevent a single model call from blocking too long
    7. STEP_TIMEOUT_SECONDS = 15
    8. # Prevent self-correction infinite loops within a task
    9. MAX_STEPS = 30
    10. async def eval_agent_task(model_call, task):
    11. start = time.perf_counter()
    12. steps = 0
    13. tokens_in = 0
    14. tokens_out = 0
    15. history = [
    16. {"role": "system", "content": "You are a coding agent. Complete the task as instructed."},
    17. {"role": "user", "content": task["prompt"]},
    18. ]
    19. def make_result(status, reply=None):
    20. base = {
    21. "task_id": task["id"],
    22. "status": status,
    23. "steps": steps,
    24. "tokens_in": tokens_in,
    25. "tokens_out": tokens_out,
    26. "elapsed": round(time.perf_counter() - start, 2),
    27. }
    28. if reply is not None:
    29. base.update({
    30. "passed": reply.get("result") == task.get("expected"),
    31. "reply": reply,
    32. })
    33. return base
    34. async def run_loop():
    35. nonlocal steps, tokens_in, tokens_out
    36. for step in range(MAX_STEPS):
    37. # Each step passes history to avoid degenerating into repeated calls
    38. reply, usage = await asyncio.wait_for(
    39. model_call(task, history),
    40. timeout=STEP_TIMEOUT_SECONDS,
    41. )
    42. steps += 1
    43. tokens_in += usage.get("prompt_tokens", 0)
    44. tokens_out += usage.get("completion_tokens", 0)
    45. history.append({
    46. "role": "assistant",
    47. "content": json.dumps(reply, ensure_ascii=False),
    48. })
    49. if reply.get("done"):
    50. return make_result("finished", reply)
    51. return make_result("error")
    52. try:
    53. # Outer total latency ceiling, to avoid one task dragging down the whole batch
    54. return await asyncio.wait_for(run_loop(), timeout=TIMEOUT_SECONDS)
    55. except asyncio.TimeoutError:
    56. return make_result("timeout")
    57. except Exception as exc:
    58. # Catch-all exception so one task's error doesn't interrupt the whole batch
    59. return make_result("error", {"error": str(exc)})

    The evaluation shows that the model that previously had a ~69.23% timeout rate (i.e., its previous version) also saw its per-task output token volume drop in the new version. In the new version, one model did not lead on composite score but outperformed the other on both timeout rate (0%) and per-task cost. This shows that in agentic coding scenarios, stability and cost are necessary conditions, and score is a bonus on top of them.

    Engineering can reduce timeout rate from three angles:

    1. Limit tool calls and reasoning steps. Set a maximum number of rounds; when the ceiling is reached, return the current best result with a note on uncertainty rather than retrying indefinitely.
    2. Set a total latency budget. Assign each task an end-to-end time limit and reserve headroom for fallback strategies.
    3. Control the context size of each request. Send only the code snippets, logs, and error information relevant to the current subtask to reduce ineffective reasoning.

    4. Hallucination Control: How to Evaluate It and How to Reduce It

    A hallucination is content a model generates that conflicts with facts, the input material, or reliable knowledge. When information is missing, a typical manifestation is fabricating details and presenting a plausible-looking answer in a confident tone.

    In this round of evaluation, hallucination control showed the clearest divergence: the hallucination-control leader scored 73.61, up 40.56 from the previous version, topping this category; another model improved by just over 20 points from its own preview version but still trailed the hallucination-control leader by more than 20 points. Clearly, hallucination control is not a by-product that comes naturally with general capability improvement—it is a capability that needs dedicated optimization and validation.

    Hallucinations typically come from three types of scenarios:

    • Knowledge-based hallucination: for time-sensitive or deeply specialized knowledge, the model tends to “answer wrongly with confidence.”
    • Material-based hallucination: in long-document QA, the model cites non-existent content as if it were from the source.
    • Reasoning-based hallucination: an incorrect assumption enters a multi-step reasoning chain, and the model keeps deriving along the wrong path.

    Engineering measures to reduce hallucinations include:

    • Retrieval-augmented generation (RAG): retrieve reference material first and generate answers grounded in it, requiring verifiable citations.
    • Uncertainty expression mechanism: instruct the model in the prompt to explicitly say “cannot determine” for missing or contradictory information rather than guessing.
    • Post-generation verification: compare key entities, numbers, and dates in conclusions against the source material one by one, and trigger regeneration or human handoff on mismatch.
    • Secondary confirmation: independently review high-risk conclusions to avoid bias from a single judgment path.

    The core principle: better to abstain than to answer wrongly. For businesses with zero tolerance for incorrect information—such as medical, financial, and legal consultation—model output should be clearly marked as reference information and reviewed by professionals.

    5. Ultra-Long Context: Window Length Is a Threshold, Effective Context Is the Capability

    The context length a model can process is not the same as the information it can effectively use within it. In the evaluation, ultra-long context scores were generally low: the long-context leader scored 88.86 on ultra-long context, while the hallucination-control leader scored 73.61 on hallucination control, and another model scored more than 20 points lower on hallucination control. This shows that even in the era of long context, “accurately finding and using key information within long material” remains a common weakness.

    Real-world long-text processing can be broken into four layers:

    1. Segmentation and recall: split a long document by chapter or semantic boundary, build a vector index, and retrieve the most relevant fragments for a question.
    2. Layered summarization: first produce a structured summary of an ultra-long document that preserves the table of contents, key conclusions, and key data, then have the model answer based on the summary.
    3. Context budget management: reserve separate quotas for system instructions, retrieved fragments, conversation history, and model output, prioritizing the most relevant content.
    4. Conclusion traceability check: require the model to cite the source paragraph when answering, and ensure key data in the answer maps back to the original text one by one.

    A reference approach for context budget allocation follows. Here we estimate by tokens rather than by characters alone, and deduct space for system instructions and output.

    1. def estimate_tokens(text):
    2. # Simplified estimate: for Chinese, conservatively treat 1 character as ~1 token
    3. # In production, replace this with a real tokenizer
    4. return int(len(text))
    5. def build_context(question, chunks, model_window_tokens):
    6. # Reserve space for system instructions, the user question, and model output
    7. system_prompt_budget = 500
    8. question_budget = min(estimate_tokens(question), 1000)
    9. answer_reserve = 2000
    10. budget = (
    11. model_window_tokens
    12. - system_prompt_budget
    13. - question_budget
    14. - answer_reserve
    15. )
    16. selected = []
    17. used = 0
    18. # Assume chunks are already sorted by relevance to the question, high to low
    19. for chunk in chunks:
    20. chunk_tokens = estimate_tokens(chunk)
    21. if used + chunk_tokens > budget:
    22. break
    23. selected.append(chunk)
    24. used += chunk_tokens
    25. context = "\n\n".join(selected)
    26. meta = {
    27. "system_prompt_budget": system_prompt_budget,
    28. "question_tokens": estimate_tokens(question),
    29. "selected_tokens": used,
    30. "remaining_tokens": max(budget - used, 0),
    31. }
    32. return context, meta

    Note that a longer context means more input tokens per call, and both latency and cost rise accordingly. So “send only what is necessary” is not just an effectiveness issue but a cost issue.

    6. Cost and Precise Instruction Following: Two Hard Constraints for Scaled Deployment

    1. Account for Cost Per Task

    LLM call cost is usually calculated from input and output token unit prices separately; agentic applications also add the cumulative overhead of tool calls and multi-turn dialogue. Evaluations often use “average cost per task” to compare model economics side by side, calculated as: average cost per task = (total input tokens × input unit price + total output tokens × output unit price) ÷ number of completed tasks.

    1. def avg_cost_per_task(prompt_tokens, completion_tokens,
    2. price_in, price_out, finished_count):
    3. if finished_count == 0:
    4. return float("inf") # With no valid output, cost is treated as infinite
    5. # price_in / price_out are unit prices per 1,000 tokens
    6. # so divide by 1000 first, then divide by the number of completed tasks
    7. total_cost = (
    8. prompt_tokens * price_in + completion_tokens * price_out
    9. ) / 1000
    10. return total_cost / finished_count

    Example calculation: with 500,000 input tokens, 50,000 output tokens, an input price of 1 unit per 1,000 tokens, an output price of 2 units per 1,000 tokens, and 100 completed tasks, the total cost is 500 × 1 + 50 × 2 = 600 units, giving an average cost per task of 6 units. At 500 tasks per day, that is about 3,000 units per day, and roughly 90,000 units per month estimated over 30 days, on top of which you can add a safety factor and usage alerts.

    Looking at this round’s results, the cost decline comes from three sources:

    • Lower model pricing: directly reduces unit token cost.
    • More concise output: a clear drop in per-task output tokens often means less ineffective reasoning and redundant expression.
    • More stable execution: dropping the timeout rate from a high level to zero avoids wasted consumption.

    To judge whether a model suits production, put cost, latency, and stability on equal footing with capability scores.

    Common mistakes:

    • Discarding timed-out samples and excluding them from the pass-rate denominator, which inflates the pass rate.
    • Reporting only average latency, not P90/P99, and ignoring tail latency.
    • Choosing a model by unit price alone, ignoring output length, retry count, and tool-call overhead.
    • When requiring “output no explanation at all,” the model still emits refusal text or explanatory text, causing json.loads to fail; this should count as a failure with the reason recorded.
    • Comparing only per-request cost without estimating daily volume and monthly budget.

    2. Precise Instruction Following: Constraints and Verification for Structured Output

    Precise instruction following requires the model to strictly obey explicit constraints, such as output must be valid JSON, all fields must be present, values must fall within a specified range, and no extra text is allowed. In the evaluation, one model’s precise-instruction-following score rose noticeably from its own preview version and reached the top of this category. This capability directly determines whether scenarios such as structured extraction and automated pipelines can be deployed.

    A common engineering approach combines “schema constraints + post-generation verification + limited retries.” On retry, you cannot simply clear the original text; you must hand the original output, the error reason, and the format requirements back to the model, otherwise the so-called retry is just spinning.

    1. import json
    2. SCHEMA = {
    3. "type": "object",
    4. "required": ["category", "amount", "confidence"],
    5. "properties": {
    6. "category": {"type": "string", "enum": ["Meals", "Transport", "Office", "Other"]},
    7. "amount": {"type": "number"},
    8. "confidence": {"type": "number"},
    9. },
    10. }
    11. def validate_record(obj):
    12. if not isinstance(obj, dict):
    13. return False
    14. for key in SCHEMA["required"]:
    15. if key not in obj:
    16. return False
    17. if obj["category"] not in SCHEMA["properties"]["category"]["enum"]:
    18. return False
    19. if not isinstance(obj["amount"], (int, float)):
    20. return False
    21. if not 0 <= obj["confidence"] <= 1:
    22. return False
    23. return True
    24. def regenerate(text, err):
    25. # Example: in production this should call the model to regenerate, passing in the original text and error
    26. # Here we just do a simple cleanup to demonstrate the retry flow
    27. repaired = text.strip()
    28. if repaired.startswith("```"):
    29. repaired = repaired.strip("`").strip()
    30. if repaired.lower().startswith("json"):
    31. repaired = repaired[4:].strip()
    32. return repaired
    33. def parse_strict(text, max_retry=2, regenerate_fn=regenerate):
    34. attempts = 0
    35. last_err = None
    36. current_text = text
    37. for attempt in range(max_retry + 1):
    38. attempts += 1
    39. try:
    40. obj = json.loads(current_text)
    41. if validate_record(obj):
    42. return obj, attempts, None
    43. last_err = "schema_invalid"
    44. except json.JSONDecodeError as exc:
    45. last_err = str(exc)
    46. if attempt == max_retry:
    47. break
    48. # Preserve the original text and error, and trigger a real regeneration or repair
    49. current_text = regenerate_fn(current_text, last_err)
    50. return None, attempts, last_err

    If the platform offers structured output capabilities, you can constrain the output format at the decoding level to reduce format errors at the source. Even so, the business side should keep verification logic as a “constraints + fallback” double safeguard.

    7. Back to Selection: How to Decide Among Multiple “Tied” Models

    Combining the dimensions above, here is a recommended selection workflow:

    1. Initial screening: shortlist models with the top composite scores.
    2. Scenario matching: for high-frequency business tasks, check sub-dimension capabilities one by one. For format-sensitive tasks, prioritize precise instruction following; for long-document tasks, prioritize ultra-long context; for public-facing scenarios, prioritize hallucination control.
    3. Stability validation: use your own test set to validate timeout rate, latency percentiles, and task pass rate. Sample at least 100–200 tasks per model and repeat 2–3 times; only models whose pass rate, P99 latency, and per-task cost meet business thresholds advance. Timed-out samples should be counted in the denominator honestly, not discarded.
    4. Cost estimation: combine real call volume to calculate per-task cost, daily cost, and monthly budget, and set usage alerts. Estimate the monthly budget as “per-task cost × daily volume × 30,” then reserve a safety factor.
    5. Continuous regression: after a model iteration, re-evaluate with a fixed test set and compare key metric changes. You can set regression criteria—for example, block release if pass rate drops by more than 2%, P99 latency rises by more than 20%, per-task cost rises by more than 15%, or key-task pass rate falls below a threshold; when comparing multiple times, apply statistical correction to avoid being misled by random fluctuation.

    The test set should closely match real business—for example, extract desensitized samples from production logs, covering typical scenarios and edge cases. Scoring can use “rule checks + automated scoring + manual spot-checks” to reduce subjective bias.

    Evaluation engineering can be hosted on a cloud platform: use a container platform to batch-schedule evaluation tasks, use object storage to save desensitized test sets and results, and use monitoring and alerts to continuously track pass rate, timeout rate, and cost changes.

    In summary, leaderboard scores are just a starting point. For “tied” models, what really determines production success is the stability of coding tasks, the reliability of hallucination control, the effectiveness of long-text processing, the economics of unit cost, and the strictness of instruction following. Developers should fold these metrics into their own evaluation system and let data drive selection, rather than being led by a single leaderboard’s rankings.

    8. FAQ: Common Selection Questions

    1. How should I choose among models “tied for first”?
    Look at the business scenario first, then sub-dimension capabilities. For format-sensitive tasks, look at precise instruction following; for long-document tasks, look at long context; for public-facing output, look at hallucination control; for automated coding tasks, look at timeout rate, P99 latency, and per-task cost.

    2. How do you evaluate hallucination capability?
    Focus on fact-checking, missing-information questions, controversial questions, and material-citation tasks. Check whether the model can clearly say “cannot determine,” whether it fabricates citations, and whether its key numbers, entities, and dates stay consistent with the source.

    3. Is longer context always better?
    No. Window length is only a threshold; effective context is the capability. You need to check whether the model can locate key information in long documents and cite source paragraphs in its answers.

    4. Can I just discard timed-out samples during evaluation?
    Not recommended. Timed-out samples should count in the denominator, with timeout rate, reason distribution, and token consumption tracked separately. Discarding them directly inflates the pass rate and misleads selection.

    5. What are common causes of precise-instruction-following failures?
    Common causes include non-JSON output, missing fields, enum values out of range, malformed numeric formats, refusal text, and mixed-in explanatory text. Engineering should record the failure reason and reduce risk by combining schema constraints, post-generation verification, and limited retries.