?
JavaCapsule: Итеративная генерация и отладка Java-кода на основе структурированной обратной связи
Large language models demonstrate limitations in tasks that require precise information retrieval from very long input sequences. This limitation affects code generation in large object-oriented systems, where correctness depends on complex inter-class dependencies and the analysis of long execution traces that exceed standard context window sizes. This paper presents JavaCapsule, a technology for automated generation and iterative debugging of Java code based on structured feedback. The approach incorporates unit test results and execution traces into an iterative refinement loop. For reliable evaluation, JavaBench+ is introduced as an improved benchmark with corrected structural inconsistencies and extended feedback that includes access to test specifications and execution logs. In addition, the Associative Recurrent Memory Transformer (ARMT) is investigated as a mechanism for accurate information retrieval from long sequences. The study is based on controlled experiments using JavaBench+ and comparative evaluation with a strong baseline model. The results show that JavaCapsule improves Pass@1 by 20 percentage points compared to Google Gemma-3-27B-it on medium-complexity tasks and demonstrates consistent improvements on larger projects. In addition, experiments with ARMT demonstrate accurate information retrieval from sequences of up to one million tokens. The obtained results characterize the capabilities of iterative debugging and long-context processing as two complementary components of the proposed approach.