Evaluating Large Language Models for Long-Horizon Software Engineering: Capabilities and Boundaries

    This article evaluates the practical performance of next-generation open-source large language models on long-horizon coding tasks. It examines their ability to understand complex repositories, coordinate cross-module changes, build applications from requirements, and complete runnable workflows. The analysis also highlights a critical gap between functional implementation and secure delivery, along with best practices for enterprise adoption.

    Introduction: A New Paradigm for Evaluating LLM Coding Capabilities

    In modern software development, large language models are evolving from code-completion tools into full-stack engineering assistants. Traditionally, the coding ability of a model was assessed mainly through algorithmic problems or the accuracy of isolated function generation. However, as model scores on established benchmarks approach a performance ceiling, it has become increasingly clear that benchmark results do not necessarily translate into production engineering capability.

    For enterprise developers, the most valuable evaluation dimension is the long-horizon task. Long-horizon coding refers to a model’s ability to work continuously within a project that contains substantial historical context, make changes across multiple modules, and ultimately bring the task to a runnable and testable state. Recent hands-on evaluations of a new generation of open-source models have helped clarify both the current engineering capabilities and the safety boundaries of large language models.

    Why Long-Horizon Coding Is the Real Test

    Modern software engineering commonly takes place in complex monorepos that may include web frontends, backend APIs, database contracts, task queues, and various worker nodes. Short-range code generation can address local correctness, but long-horizon engineering requires a global understanding of the system.

    1. Persistent understanding of complex context
      The model must locate the correct modification points in codebases containing tens or even hundreds of thousands of lines, while understanding implicit dependencies between modules.

    2. Cross-module state synchronization
      From a database schema change to an API contract update and then to frontend adaptation, the model must maintain consistency across multiple steps.

    3. A complete path from “can write” to “can run”
      Generating syntactically valid code is not enough. The model must also handle browser validation, environment dependencies, and automated test repair.

    Scenario One: Modernizing a Legacy System Under Security Constraints

    To evaluate how well a model understands a complex existing system, we designed a typical refactoring task: adding secure user image-asset importing and HTML animation-scene references to a legacy project containing substantial historical code and technical debt. The task tested not only compatibility with the existing architecture, but also the model’s ability to handle security as an implicit system constraint.

    Task Performance

    After taking over the task, the model demonstrated impressive contextual understanding. It accurately analyzed the legacy database contracts and existing task state machine, then successfully connected the complete workflow from asset upload and animation rendering to frontend presentation.

    During the frontend animation-video generation process, the model was able to operate worker nodes and the HTML renderer effectively. The end-to-end workflow was completed in a relatively short period, and the application initially ran successfully during basic validation.

    The Boundary That Emerged

    However, runnable code does not automatically qualify as production-ready code. During subsequent security review and human acceptance testing, we identified a serious P1-level authorization isolation issue. Although the model implemented image uploading and storage, it overlooked cross-tenant and cross-role resource isolation checks, creating a risk of unauthorized access.

    This reveals a fundamental limitation of current large language models. They tend to implement the happy path of a feature, but often lack proactive awareness of the fine-grained security rules and permission models accumulated over years of business development. Without targeted prompting or external static application security testing (SAST), a model may not automatically generate the enterprise-grade authorization logic required by the system.

    Scenario Two: Building an Application from Requirements

    The second scenario evaluated the model’s ability to deliver a product from zero to one. We provided only a technical learning resource and a product requirements document (PRD), then asked the model to build an AI-agent knowledge-learning game that users could complete from beginning to end.

    Task Performance

    In this scenario, the model acted both as an architect and a full-stack engineer. It first segmented and extracted knowledge from the learning material, converting the results into an in-game question bank and knowledge graph. It then planned the frontend and backend architecture based on the PRD and progressively implemented the game logic, user interface, and backend data persistence.

    The resulting application was functionally complete and could be completed successfully. This demonstrated strong end-to-end fidelity across requirements understanding, source-material analysis, and code implementation.

    Key Takeaway

    The success of this from-scratch development task shows that large language models are highly suitable as “super developers” for innovative projects and prototype validation. When requirements and boundaries are clearly defined, they can significantly compress development timelines.

    However, when the task involves deep maintenance of an existing system, the model’s security blind spots become much more visible.

    Why Performance Improved: The Impact of Post-Training Scaling

    Compared with earlier baseline models, the new generation achieved a substantial improvement in long-horizon coding without replacing the underlying model with a larger, trillion-parameter-scale architecture. The progress appears to come primarily from scaling during post-training rather than from a fundamental architectural change.

    1. Much larger long-horizon task environments
      The scale of training environments expanded by several dozen times, with a wider range of environment types. During training, the models were exposed to complex monorepo interactions, multiple rounds of tool calls, and state maintenance. These experiences helped them internalize more engineering-oriented workflows.

    2. Broader security capabilities
      The models’ abilities have expanded beyond business-code generation into white-box code review and basic vulnerability reasoning. Although they still lag behind leading closed-source models in complex, end-to-end exploit scenarios, they already show practical value for detecting common code security defects.

    Best Practices and Security Defenses for Enterprise Adoption

    Based on these evaluations, organizations adopting large language models for production software engineering should establish a robust human-in-the-loop process and layered security controls.

    1. Define clear human–model boundaries

      Large language models are ready to be tested on real projects, especially for long-horizon coding and rapid prototyping. They can provide significant engineering leverage. However, human engineers must remain directly involved in authorization, data isolation, and final acceptance.

      Manual code review remains the last line of defense against P1-level security vulnerabilities.

    2. Use cloud infrastructure to establish security guardrails

      When handling asset imports and resource management, organizations should not rely entirely on the model to implement low-level authorization controls. Mature cloud services can help compensate for the model’s security blind spots.

      For asset storage, Baidu AI Cloud Object Storage BOS can be used for centralized asset management, with its ACL capabilities and multi-tenant isolation mechanisms providing infrastructure-level protection against unauthorized access. For code review, organizations can integrate security detection and logging services from Baidu AI Cloud to perform automated white-box scanning and runtime monitoring of model-generated code. This moves protection from post-development manual acceptance toward automated interception during development and operation.

    3. Provide structured requirements

      Regardless of model capability, the quality of the input sets an upper bound on the quality of the output. For long-horizon tasks, clearly defined architecture diagrams, detailed API contracts, and explicit security baselines can significantly reduce hallucinations and security vulnerabilities.

    Conclusion and Outlook

    The latest generation of open-source large language models has made meaningful progress in long-horizon coding. These models can understand complex context, coordinate changes across modules, and deliver runnable code. They are particularly effective for prototyping, full-stack assistance, and other scenarios where engineering speed is a priority.

    Nevertheless, a significant gap remains between “the code runs” and “the code is safe to deliver.” Models are still vulnerable when they must infer implicit security constraints in legacy systems. As white-box security reasoning and automated test repair continue to improve—and as mature infrastructure guardrails such as those provided by Baidu AI Cloud are combined with model-generated code—we may eventually achieve an intelligent development loop in which fully passing tests provide much stronger confidence for delivery.

    Until then, developers should adopt a cautiously optimistic approach. Large language models are powerful copilots, but they are not yet complete replacements for experienced software engineers.