NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

SEAlign: Alignment Training for Software Engineering Agent

Kechi Zhang, Huangzhao Zhang, Ge Li, Jinliang You, Jia Li, Yunfei Zhao, Zhi JinarXiv 2025

Abstract

Recent advances in code generation models have demonstrated impressive capabilities in automating software development tasks, yet these models still struggle in real-world software engineering scenarios. Although current training methods, particularly post-training, excel at solving competitive programming problems, they fail to adequately prepare models for the complexities of practical software development. This misalignment raises the critical question: Are existing alignment training methods well suited for real-world software engineering tasks? In this study, we identify this issue and propose SEAlign, a novel alignment framework designed to bridge the gap between code generation models and real-world software development tasks. SEAlign leverages the unique characteristics of software engineering processes, including high-quality workflow steps, to enhance model capabilities. Our framework further employs Monte Carlo Tree Search for fine-grained alignment in multi-step decision processes, followed by preference optimization on critical actions to ensure models meet real-world requirements. We evaluate SEAlign on three standard agentic benchmarks for real-world software engineering, including HumanEvalFix, SWE-Bench-Lite, and SWE-Bench-Verified. Experimental results demonstrate state-of-the-art performance with minimal training overhead. In addition, we develop an agent-based software development platform using SEAlign, which successfully automates the creation of several small applications. Human evaluations of these applications highlight significant improvements in both task performance and user experience. Our findings underscore the potential of SEAlign to accelerate the adoption of large code models in real-world software development. We believe that this research makes a meaningful step towards fully automated software engineering.

Introduction: The Misalignment in Software Engineering Agents

While modern "Code LLMs" are proficient at solving isolated algorithmic puzzles, they often falter when acting as autonomous agents in complex, real-world repositories. When tasked with fixing bugs in massive codebases, these models frequently exhibit "agentic pathologies": they may ignore system instructions, invoke tools incorrectly, or fall into infinite loops—repeatedly attempting the same failing action without recovery.

This research identifies these failures as a fundamental misalignment issue. Standard post-training techniques like Supervised Fine-Tuning (SFT) or Direct Preference Optimization (DPO) typically focus on "one-shot" code generation. However, software engineering is inherently a trajectory—a sequence of searches, file edits, and test executions. Existing methods fail to teach models how to navigate these long-term decision processes or recover from errors.

The SEAlign Framework

SEAlign introduces a four-stage pipeline designed to teach models the "art of the trajectory" by identifying and optimizing the most impactful decisions within a task.

The SEAlign framework overview, illustrating the transition from trajectory collection and tree construction to node scoring and final preference optimization.
  1. Trajectory Dataset Collection: High-performing models (e.g., GPT-4o) generate thousands of agentic trajectories on software tasks using execution environments like SWE-Gym.
  2. Trajectory Tree Construction: Linear attempts are merged into a hierarchical tree. This structure highlights exactly where a successful path diverges from a failure.
  3. Node Scoring & Critical Action Identification: Using a Monte Carlo Tree Search (MCTS) approach, nodes are scored based on the success rate of subsequent paths. A "Critical Action" is identified where a specific choice leads to a high success rate while an alternative leads to a dead end (defined by a score difference > 0.5).
  4. Alignment Training: The model first undergoes SFT on successful trajectories to learn the agent framework's language. It then undergoes fine-grained DPO specifically on the identified "Critical Action" pairs, forcing the model to prioritize the specific decision-making steps that determine success.

Experimental Results

SEAlign was evaluated on major benchmarks including SWE-Bench-Lite and SWE-Bench-Verified, which consist of real-world GitHub issues requiring repository-level understanding. The results for the SEAlign-14B model (built on Qwen2.5-Coder-14B) demonstrate a significant leap in performance.

Performance results on SWE-Bench benchmarks, showing the dramatic increase in resolved tasks and reduction in agentic failures compared to baseline models.

On SWE-Bench-Lite, the resolved rate for the 14B model jumped from a baseline of 3.7% to 17.7%. On SWE-Bench-Verified, the rate increased from 2.8% to 21.8%. Notably, SEAlign-14B achieved performance comparable to commercial giants like GPT-4o (which resolved 21.0% on Lite in the same setup), despite being a much smaller, open-source model.

Key Insights and Resilience

A core finding of the study is that the "pivotal moment" matters more than the total volume of data. In a typical 40-step trajectory, only a few steps are truly decisive. By focusing the optimization budget on these critical actions, SEAlign achieves state-of-the-art results with minimal training overhead. Furthermore, the method significantly reduced "stuck-in-loop" rates and "empty patch" rates, proving that proper alignment makes agents more resilient and less likely to give up prematurely.

Limitations and Future Directions

Despite its success, SEAlign faces challenges regarding execution overhead; running tests for every trajectory to generate scores is computationally intensive and requires significant storage. Additionally, while SEAlign-14B is highly effective within its trained framework (OpenHands), its performance can vary when moved to different agentic environments. Future work will focus on improving cross-framework adaptability and finding more efficient ways to estimate node scores without full execution.

Summary updated

BibTeX
@misc{zhang2025sealign,
  author = {Kechi Zhang and Huangzhao Zhang and Ge Li and Jinliang You and Jia Li and Yunfei Zhao and Zhi Jin},
  title = {{SEAlign: Alignment Training for Software Engineering Agent}},
  year = {2025},
  eprint = {2503.18455},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2503.18455},
}
Figure