Long-Horizon Coding Capabilities of Chinese LLMs: From One-Shot Correctness to Iterative Convergence
This article examines the shift in how code-focused large language models are evaluated, moving from single-turn, one-shot benchmarks toward long-horizon coding tasks that require dozens or hundreds of iterative rounds. It explains what long-horizon tasks are, why they reflect real software engineering, and breaks down five key dimensions that support them: constraint retention, tool orchestration, failure diagnosis, context management, and budget awareness. The article also outlines a multi-dimensional evaluation approach combining outcome, process, economic, and stability metrics, practical steps for integrating long-horizon capabilities into R&D workflows, and the risks and boundaries that teams should govern carefully.
1. From “Getting It Right Once” to “Iterating Continuously”: A Shift in Coding Evaluation
Over the past two years, the main way to measure code-focused LLMs has been straightforward: given a function signature or a defect description, can the model produce a runnable answer in a single pass? These benchmarks carry an implicit assumption that the problem is clearly bounded, the acceptance criteria are singular, and the number of turns is very short. Real software engineering rarely works this way. Requirements drift, performance bottlenecks often surface only after the third load test, and dependency conflicts or build script issues can consume a large amount of time.
As a result, the industry has started to focus on long-horizon coding tasks. In these tasks, a model must keep the goal unchanged across dozens or even hundreds of turns, continuously invoke terminals, tests, static analysis, and retrieval tools, and adjust its strategy in response to failure signals. The recent performance of some Chinese LLMs in this direction shows that the center of capability is shifting from first-turn accuracy to long-horizon convergence. For developers, this means the evaluation approach must change too: instead of looking only at a single-point score, you need to look at task completion, convergence speed, and resource cost.
2. What Long-Horizon Tasks Are and Why They Match Engineering Reality
A long-horizon task can be described formally as a stateful iterative process. In each turn, the model observes the current repository state and failure output, chooses the next action (reading files, editing code, running tests, checking dependencies, or running benchmarks), and the environment returns a new state. The loop continues until the acceptance conditions are met or the budget is exhausted.
It differs from traditional evaluation in four main ways:
- Large number of turns: it moves from “one question, one answer” to continuous decision-making over dozens or hundreds of turns.
- Complex state: the model must maintain goals, constraints, completed items, and unresolved issues across turns.
- Sparse and noisy feedback: test failure messages may contradict each other, and performance data is affected by the environment.
- Multi-dimensional acceptance: functional correctness, performance targets, compatibility, and maintainability must be satisfied at the same time.
Optimization tasks in engineering are especially typical. Take vector retrieval optimization as an example: the goal is to improve throughput while keeping recall no lower than a constraint threshold. Such problems have no “standard answer” and can only approach the target through a closed loop of “modify the implementation, run benchmarks, inspect metrics, and modify again.” The value of a model with strong long-horizon capability lies not in getting something right in one pass, but in being able to run this closed loop to completion reliably.
3. Capability Breakdown: Five Key Dimensions Behind Long-Horizon Coding
- Instruction and constraint retention: not forgetting hard constraints in a long context (such as compatibility, unchanged interfaces, or a recall lower bound).
- Tool call orchestration: reasonably selecting terminal, test, retrieval, and benchmark tools, and controlling the number and parallelism of calls.
- Failure diagnosis and strategy switching: distinguishing between “implementation errors,” “environment issues,” and “an approach that does not apply,” and switching paths in time rather than retrying blindly.
- Context and memory management: compressing, summarizing, and extracting key points from long logs to avoid context bloat that leads to degradation.
- Cost and budget awareness: maximizing progress within limited time and call budgets, and delivering intermediate results when necessary.
The following is an illustrative iterative control logic (pseudocode):
state = load_repo()budget = {rounds: N, tool_calls: M}while not accepted(state) and budget.remaining():obs = run_tests(state) or run_benchmark(state)plan = model.plan(goal, constraints, obs, history_summary)action = choose_tool(plan) # edit / test / profile / searchstate = apply(state, action)history_summary = compress(history_summary, obs)return state
4. Evaluation and Acceptance: How to Measure Long-Horizon Coding Scientifically
A combination of “multi-dimensional acceptance plus process metrics” is recommended for enterprises:
- Outcome metrics: functional pass rate, performance improvement factor, and constraint satisfaction rate (such as the recall lower bound).
- Process metrics: number of rounds to convergence, number of tool calls, ratio of ineffective retries, and number of strategy switches.
- Economic metrics: time per task, call cost, and number of human interventions.
- Stability metrics: variance across multiple runs and robustness under environmental perturbations.
For internal adoption, you can use a container platform to unify the build environment, object storage to keep versioned artifacts and benchmark data, a message queue to decouple long-task scheduling, and logging and monitoring services to track turn-level metrics. This makes experiments reproducible and helps pinpoint “which step the model is stuck on.”
5. Enterprise Practices: Integrating Long-Horizon Capability into R&D
- Scenario selection: prioritize tasks with clear acceptance criteria that can be automated, such as performance optimization, dependency upgrades, test completion, and defect fixes.
- Task packaging: write the goal, constraints, acceptance scripts, and budget into a machine-readable task card to reduce ambiguity.
- Sandbox isolation: provide an independent environment for each run in a container platform to avoid polluting the main branch and shared dependencies.
- Human-AI collaboration: set checkpoints and approval gates so that critical changes require human confirmation before merging.
- Observability: record structured data for each turn’s input summary, action, output, and metrics to support review and tuning.
- Gradual rollout: start with low-risk repositories as pilots, then expand to multi-team collaboration and form standards and templates.
General-purpose cloud product categories from Baidu AI Cloud (such as container platforms, object storage, message queues, logging services, and monitoring and alerting) can serve as the underlying foundation, helping teams turn long-horizon tasks into a reproducible, observable, and governable standard process.
6. Risks and Boundaries: A Rational View of Capability Gains
Stronger long-horizon capability also introduces new risks: long-running processes may amplify errors, consume budgets, or make “seemingly reasonable” trade-offs when constraints conflict. Governance recommendations include setting hard budget limits, enforcing constraint validation, requiring human review for changes on critical paths, keeping rollback-capable versions, and maintaining a “verification first” principle for model output. Only by making the verification loop solid can long-horizon capability truly translate into productivity.
7. Conclusion
Moving from exam-style evaluation to a long-horizon engineering loop is a necessary upgrade to the evaluation system for code-focused LLMs. For developers and enterprises, the real benefit is not a leaderboard ranking, but a coding collaboration capability that can iterate continuously, self-correct, and converge under constraints. Building task standards, sandbox environments, and observability systems around this goal is the key path to turning capability into business value.
