Human-AI Collaboration in Data-Driven Software Engineering: A Seq2Seq Model with Attention for Automated Code Debugging
Automated code correction remains a challenging yet essential task in modern software development. With the exponential growth in code volume and the demand for high-quality, error-free code, traditional rule-based debugging tools struggle to keep up with diverse syntax and context-specific errors. This paper presents a novel approach leveraging a Sequence-to-Sequence (Seq2Seq) model with Long Short-Term Memory (LSTM) networks, trained on noisy code data from public sources such as Stack Overflow and CodeSearchNet, to automatically correct buggy code. Our model tokenizes code into manageable units and learns sequential dependencies, enabling it to identify and correct common syntax and semantic errors effectively. Our approach addresses limitations in existing systems by capturing nuanced patterns in code structure that static rule-based methods often overlook. We incorporate robust preprocessing steps, including tokenization, vocabulary control, and padding, to prepare the code data for optimal model performance. Additionally, we propose enhancing the model with an attention mechanism to allow for more focused corrections on longer sequences, thereby improving correction accuracy. Experimental evaluations demonstrate that our model achieves competitive results, with significant improvements in validation accuracy and error reduction compared to traditional baseline methods. Sample outputs further illustrate the model’s ability to generalize across different error types, providing meaningful corrections for syntax errors and structural inconsistencies. This work lays the foundation for scalable, automated code correction models, with future work directed towards integrating attention mechanisms and adapting the model for diverse programming languages and complex code patterns.
Authors
- R. Rashid
- Hira Khyzer
- Akhlaq Khizer
Institutions
- Northwestern Polytechnical University (CN)
Publication Details
- Journal
- International Journal of Sciences and Emerging Technologies
- Published
- 2025-03-11
- DOI
- https://doi.org/10.56536/ijset.v3i1.62
- Primary Topic
- Business Process Modeling and Analysis
- Type
- article
- Field-Weighted Citation Impact
- 0.00