Nemotron-CORTEXA: Enhancing LLM Agents for Software Engineering Tasks via Improved Localization and Solution Diversity

Atefeh Sohrabizadeh, Jialin Song, Mingjie Liu, Rajarshi Roy, Chankyu Lee, Jonathan Raiman, Bryan Catanzaro

TL;DR

NEMOTRON-CORTEXA is a novel agentic framework designed to tackle complex, repository-level software engineering tasks. By combining a specialized code embedding model for high-precision file retrieval, a graph-aware localization agent, and a strategy that prioritizes "solution diversity," it achieves state-of-the-art results on the SWE-bench benchmark. The system resolves up to 52.6% of issues at a significantly lower cost ($0.51/issue) than previous methods.

The Challenge of Real-World Codebases

While Large Language Models (LLMs) excel at writing isolated functions, they often struggle with real-world software engineering. Real bugs are rarely confined to single snippets; they are buried within massive repositories containing thousands of files.

Current LLM agents face two primary hurdles in these environments:

  1. The "Needle in a Haystack" Problem: Repositories frequently exceed the context window of even the largest LLMs. Pinpointing the exact file and the specific line of code (localization) is incredibly difficult.
  2. Brittle Reasoning: Standard autoregressive decoding (generating one token at a time) is prone to hallucinations or logical slips. If an agent only attempts one path to fix a bug, a single minor error in the prompt or context can lead to complete failure.

The NEMOTRON-CORTEXA Pipeline

To address these challenges, the authors introduce NEMOTRON-CORTEXA (Code Optimization for Repository Tasks with EXecution Agents), a multi-stage pipeline built on three foundational pillars.

NEMOTRON-CORTEXA Pipeline

1. High-Precision File Retrieval (NV-EmbedCode)

Instead of relying on simple keyword searches (like BM25) or generic text embeddings, the team developed NV-EmbedCode. This specialized embedding model is fine-tuned specifically for code retrieval using contrastive learning and hard-negative mining to distinguish between similar-looking but irrelevant code chunks. Crucially, the system uses an LLM to summarize messy GitHub issues into concise technical queries before searching, which significantly boosts retrieval accuracy.

2. Graph-Aware Localization Agent

Once the relevant files are retrieved, a "Localization Agent" takes over. Rather than just reading the code linearly, the agent navigates the repository using a Code Knowledge Graph. This graph maps out "contain" (files containing classes) and "use" (functions calling other functions) relationships using Abstract Syntax Trees (AST) and Language Server Protocol (LSP) tools. The agent can actively "forage" for information by calling tools like get_definition or get_incoming_dependency, mimicking how a human developer navigates an Integrated Development Environment (IDE).

3. Solution Diversity and Ensembling

The paper argues that how you ask the model to fix a bug matters just as much as what you ask it to fix. NEMOTRON-CORTEXA generates multiple candidate patches by varying:

  • Context: Providing the entire file versus just the specific localized entities.
  • Edit Format: Requesting a search/replace block versus using a structured edit_file API.
  • Model Ensemble: Utilizing a mix of models (e.g., DeepSeek, GPT-4o, Llama, Qwen) for localization to cover each other's blind spots.
Impact of Solution Diversity

Key Insights and Innovations

  • Diversity Over Sampling: Most researchers attempt to improve results by increasing "temperature" (randomness) during generation. This paper demonstrates that varying the prompt format and contextual information is a far more efficient strategy for finding the correct solution.
  • Summarization is a Force Multiplier: Raw GitHub issues are often noisy. Using a high-capacity model (like Llama-3.1 405B) to create a "technical summary" of the issue prior to retrieval improved the Recall@k of their embedding model from 67.6% to 70.3%.
  • Ensembles for Localization: Different LLMs possess different "intuitions" regarding where a bug might reside. By ensembling four different models during the localization phase, the authors boosted recall by over 20% compared to the best individual model.

Performance and Results

NEMOTRON-CORTEXA was rigorously evaluated against Agentless, a popular and highly competitive baseline, using the SWE-bench dataset (Lite & Verified), which consists of real-world GitHub issues from popular open-source Python repositories.

  • Resolution Rate: The framework achieved 42.00% on SWE-bench Lite (vs. 40.67% for Agentless) and 52.60% on SWE-bench Verified (vs. 50.80% for Agentless).
  • Cost Efficiency: The system is remarkably cost-effective, averaging only $0.51 per issue. For comparison, Agentless (using GPT-4o) costs roughly $0.70, and other high-performing agents often cost significantly more due to a massive number of inference calls.
  • Retrieval Superiority: The custom NV-EmbedCode model outperformed state-of-the-art models like SFR-Embedding-2R and OpenAI’s embeddings in identifying the "oracle" (correct) files for a given bug.

Limitations and Future Work

While highly effective, the framework has areas for potential improvement:

  • Suboptimal Selection: Currently, the final patch selection relies on majority voting and basic test filtering. The authors acknowledge that using an LLM to "rank" or "score" the patches could further improve the resolution rate.
  • Scaling Test-Time Compute: Resolution rates have not yet plateaued; simply generating more diverse patches (scaling compute at "test time") would likely yield even higher scores, albeit at a higher cost.
  • Language Support: The current evaluation focuses heavily on Python (via SWE-bench). Expanding the graph-based localization to other languages with different LSP implementations remains an exciting future challenge.

Summary updated

BibTeX
@inproceedings{sohrabizadeh2025nemotron,
  author = {Atefeh Sohrabizadeh and Jialin Song and Mingjie Liu and Rajarshi Roy and Chankyu Lee and Jonathan Raiman and Bryan Catanzaro},
  title = {{Nemotron-CORTEXA: Enhancing LLM Agents for Software Engineering Tasks via Improved Localization and Solution Diversity}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=k6p8UKRdH7},
}
Figure