{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,7,5]],"date-time":"2026-07-05T21:52:40Z","timestamp":1783288360158,"version":"3.54.6"},"reference-count":34,"publisher":"MDPI AG","issue":"7","license":[{"start":{"date-parts":[[2025,7,7]],"date-time":"2025-07-07T00:00:00Z","timestamp":1751846400000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Symmetry"],"abstract":"<jats:p>The rapid progress of Large Language Models (LLMs) has greatly improved natural language tasks like code generation, boosting developer productivity. However, challenges persist. Generated code often appears \u201cpseudo-correct\u201d\u2014passing functional tests but plagued by inefficiency or redundant structures. Many models rely on outdated methods like greedy selection, which trap them in local optima, limiting their ability to explore better solutions. We propose AnnCoder, a multi-agent framework that mimics the human \u201ctry-fix-adapt\u201d cycle through closed-loop optimization. By combining the exploratory power of simulated annealing with the targeted evolution of genetic algorithms, AnnCoder balances wide-ranging searches and local refinements, dramatically increasing the likelihood of finding globally optimal solutions. We speculate that traditional approaches may struggle due to narrow optimization focuses. AnnCoder addresses this by introducing dynamic multi-criteria scoring, weighing functional correctness, efficiency (e.g., runtime\/memory), and readability. Its adaptive temperature control dynamically modulates the cooling schedule, slowing cooling when solutions are diverse to encourage exploration, then accelerating convergence as they stabilize. This design elegantly avoids the pitfalls of earlier models by synergistically combining global exploration with local optimization capabilities. After conducting thorough experiments with multiple LLMs analyses across four problem-solving and program synthesis benchmarks\u2014AnnCoder showcased remarkable code generation capabilities\u2014HumanEval 90.85%, MBPP 90.68%, HumanEval-ET 85.37%, and EvalPlus 84.8%. AnnCoder has outstanding advantages in solving general programming problems. Moreover, our method consistently delivers superior performance across various programming languages.<\/jats:p>","DOI":"10.3390\/sym17071087","type":"journal-article","created":{"date-parts":[[2025,7,7]],"date-time":"2025-07-07T11:19:27Z","timestamp":1751887167000},"page":"1087","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":4,"title":["AnnCoder: A Mti-Agent-Based Code Generation and Optimization Model"],"prefix":"10.3390","volume":"17","author":[{"given":"Zhenhua","family":"Zhang","sequence":"first","affiliation":[{"name":"College of Software, Taiyuan University of Technology, Taiyuan 030024, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jianfeng","family":"Wang","sequence":"additional","affiliation":[{"name":"College of Software, Taiyuan University of Technology, Taiyuan 030024, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0001-9397-2540","authenticated-orcid":false,"given":"Zhengyang","family":"Li","sequence":"additional","affiliation":[{"name":"Department of Computer Science, DigiPen Institute of Technology, Redmond, WA 98052, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"ORCID":"https:\/\/orcid.org\/0009-0002-9387-5895","authenticated-orcid":false,"given":"Yunpeng","family":"Wang","sequence":"additional","affiliation":[{"name":"College of Software, Taiyuan University of Technology, Taiyuan 030024, China"}],"role":[{"vocabulary":"crossref","role":"author"}]},{"given":"Jiayun","family":"Zheng","sequence":"additional","affiliation":[{"name":"College of Engineering, University of Michigan Ann Arbor, Ann Arbor, MI 48104, USA"}],"role":[{"vocabulary":"crossref","role":"author"}]}],"member":"1968","published-online":{"date-parts":[[2025,7,7]]},"reference":[{"key":"ref_1","doi-asserted-by":"crossref","first-page":"3185","DOI":"10.1103\/PhysRevLett.84.3185","article-title":"Self-organized networks of competing boolean agents","volume":"84","author":"Paczuski","year":"2000","journal-title":"Phys. Rev. Lett."},{"key":"ref_2","first-page":"75993","article-title":"On the planning abilities of large language models-a critical investigation","volume":"36","author":"Valmeekam","year":"2023","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_3","first-page":"1","article-title":"Structured chain-of-thought prompting for code generation","volume":"34","author":"Li","year":"2025","journal-title":"ACM Trans. Softw. Eng. Methodol."},{"key":"ref_4","doi-asserted-by":"crossref","first-page":"545","DOI":"10.1080\/08993408.2022.2145549","article-title":"Thinking processes in code. org: A relational analysis approach to computational thinking","volume":"33","author":"Kale","year":"2023","journal-title":"Comput. Sci. Educ."},{"key":"ref_5","first-page":"8634","article-title":"Reflexion: Language agents with verbal reinforcement learning","volume":"36","author":"Shinn","year":"2023","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_6","doi-asserted-by":"crossref","unstructured":"Luo, D., Liu, M., Yu, R., Liu, Y., Jiang, W., Fan, Q., Kuang, N., Gao, Q., Yin, T., and Zheng, Z. (2025). Evaluating the performance of GPT-3.5, GPT-4, and GPT-4o in the Chinese National Medical Licensing Examination. Sci. Rep., 15.","DOI":"10.1038\/s41598-025-98949-2"},{"key":"ref_7","unstructured":"Guo, D., Xu, C., Duan, N., Yin, J., and McAuley, J. (2023, January 23\u201329). Longcoder: A long-range pre-trained language model for code completion. Proceedings of the International Conference on Machine Learning, Honolulu, HI, USA."},{"key":"ref_8","doi-asserted-by":"crossref","unstructured":"Guo, Y., Li, Z., Jin, X., Liu, Y., Zeng, Y., Liu, W., Li, X., Yang, P., Bai, L., and Guo, J. (2024, January 1). Retrieval-augmented code generation for universal information extraction. Proceedings of the CCF International Conference on Natural Language Processing and Chinese Computing, Hangzhou, China.","DOI":"10.1007\/978-981-97-9434-8_3"},{"key":"ref_9","doi-asserted-by":"crossref","unstructured":"Macedo, M., Tian, Y., Cogo, F., and Adams, B. (2024, January 14). Exploring the impact of the output format on the evaluation of large language models for code translation. Proceedings of the 2024 IEEE\/ACM First International Conference on AI Foundation Models and Software Engineering, Lisbon, Portugal.","DOI":"10.1145\/3650105.3652301"},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"107699","DOI":"10.1016\/j.infsof.2025.107699","article-title":"Assessing and improving syntactic adversarial robustness of pre-trained models for code translation","volume":"181","author":"Yang","year":"2025","journal-title":"Inf. Softw. Technol."},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Lalith, P.C., Goel, S., Kakkar, M., and Sharma, S. (2025, January 6). Simplifying code translation: Custom syntax language to C language transpiler. Proceedings of the 2025 2nd International Conference on Computational Intelligence, Communication Technology and Networking (CICTN), ABES Engineering College, Ghaziabad, India.","DOI":"10.1109\/CICTN64563.2025.10932385"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Fan, Z., Gao, X., Mirchev, M., Roychoudhury, A., and Tan, S.H. (2023, January 14\u201320). Automated repair of programs from large language models. Proceedings of the 2023 IEEE\/ACM 45th International Conference on Software Engineering (ICSE), Melbourne, Australia.","DOI":"10.1109\/ICSE48619.2023.00128"},{"key":"ref_13","doi-asserted-by":"crossref","first-page":"42","DOI":"10.1007\/s10515-025-00512-w","article-title":"Context-aware prompting for LLM-based program repair","volume":"32","author":"Li","year":"2025","journal-title":"Autom. Softw. Eng."},{"key":"ref_14","doi-asserted-by":"crossref","unstructured":"Zheng, Q., Xia, X., Zou, X., Dong, Y., Wang, S., Xue, Y., Shen, L., Wang, Z., Wang, A., and Li, Y. (2023, January 6\u201310). Codegeex: A pre-trained model for code generation with multilingual benchmarking on humaneval-x. Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, Long Beach, CA, USA.","DOI":"10.1145\/3580305.3599790"},{"key":"ref_15","doi-asserted-by":"crossref","unstructured":"Xiong, Y., Wang, J., Yan, R., Zhang, J., Han, S., Huang, G., and Zhang, L. (2017, January 20\u201328). Precise condition synthesis for program repair. Proceedings of the 2017 IEEE\/ACM 39th International Conference on Software Engineering (ICSE), Buenos Aires, Argentina.","DOI":"10.1109\/ICSE.2017.45"},{"key":"ref_16","doi-asserted-by":"crossref","unstructured":"Ji, R., Liang, J., Xiong, Y., Zhang, L., and Hu, Z. (2020, January 15\u201320). Question selection for interactive program synthesis. Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation, London, UK.","DOI":"10.1145\/3385412.3386025"},{"key":"ref_17","first-page":"1","article-title":"Scaling instruction-finetuned language models","volume":"25","author":"Chung","year":"2024","journal-title":"J. Mach. Learn. Res."},{"key":"ref_18","doi-asserted-by":"crossref","unstructured":"He, Q., Zeng, J., Huang, W., Chen, L., Xiao, J., He, Q., Zhou, X., Liang, J., and Xiao, Y. (2024, January 20\u201327). Can large language models understand real-world complex instructions?. Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada.","DOI":"10.1609\/aaai.v38i16.29777"},{"key":"ref_19","first-page":"27730","article-title":"Training language models to follow instructions with human feedback","volume":"35","author":"Ouyang","year":"2022","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Gallifant, J., Fiske, A., Levites Strekalova, Y.A., Osorio-Valencia, J.S., Parke, R., Mwavu, R., Martinez, N., Gichoya, J.W., Ghassemi, M., and Demner-Fushman, D. (2024). Peer review of GPT-4 technical report and systems card. PLoS Digit. Health, 3.","DOI":"10.1371\/journal.pdig.0000417"},{"key":"ref_21","doi-asserted-by":"crossref","first-page":"1833","DOI":"10.1093\/jamia\/ocae045","article-title":"PMC-LLaMA: Toward building open-source language models for medicine","volume":"31","author":"Wu","year":"2024","journal-title":"J. Am. Med Inform. Assoc."},{"key":"ref_22","first-page":"1","article-title":"The claude 3 model family: Opus, sonnet, haiku","volume":"1","author":"Anthropic","year":"2024","journal-title":"Claude-3 Model Card"},{"key":"ref_23","doi-asserted-by":"crossref","first-page":"S729","DOI":"10.1016\/j.ekir.2024.11.1294","article-title":"WCN25-359 Comparative Analysis Of ChatGPT-4 and Claude 3 Opus in Answering Acute Kidney Injury and Critical Care Nephrology Questions","volume":"10","author":"Sheikh","year":"2025","journal-title":"Kidney Int. Rep."},{"key":"ref_24","unstructured":"Rodriguez, J.A., Puri, A., Agarwal, S., Laradji, I.H., Rajeswar, S., Vazquez, D., Pal, C., and Pedersoli, M. (March, January 25). StarVector: Generating scalable vector graphics code from images and text. Proceedings of the AAAI Conference on Artificial Intelligence, Philadelphia, PA, USA."},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"52","DOI":"10.56038\/oprd.v4i1.444","article-title":"Benchmarking Llama 3 70B for Code Generation: A Comprehensive Evaluation","volume":"4","author":"Ersoy","year":"2024","journal-title":"Orclever Proc. Res. Dev."},{"key":"ref_26","first-page":"33","article-title":"DeepSeek large-scale model: Technical analysis and development prospect","volume":"7","author":"Liao","year":"2025","journal-title":"J. Comput. Sci. Electr. Eng."},{"key":"ref_27","doi-asserted-by":"crossref","first-page":"1526","DOI":"10.1038\/s41562-023-01659-w","article-title":"Emergent analogical reasoning in large language models","volume":"7","author":"Webb","year":"2023","journal-title":"Nat. Hum. Behav."},{"key":"ref_28","doi-asserted-by":"crossref","unstructured":"Koziolek, H., Gr\u00fcner, S., Hark, R., Ashiwal, V., Linsbauer, S., and Eskandani, N. (2024, January 20). LLM-based and retrieval-augmented control code generation. Proceedings of the 1st International Workshop on Large Language Models for Code, Lisbon, Portugal.","DOI":"10.1145\/3643795.3648384"},{"key":"ref_29","first-page":"1","article-title":"Self-planning code generation with large language models","volume":"33","author":"Jiang","year":"2024","journal-title":"ACM Trans. Softw. Eng. Methodol."},{"key":"ref_30","doi-asserted-by":"crossref","first-page":"675","DOI":"10.1145\/3643757","article-title":"Codeplan: Repository-level coding using llms and planning","volume":"1","author":"Bairi","year":"2024","journal-title":"Proc. ACM Softw. Eng."},{"key":"ref_31","unstructured":"Padurean, V.A., Denny, P., and Singla, A. (March, January 26). BugSpotter: Automated Generation of Code Debugging Exercises. Proceedings of the 56th ACM Technical Symposium on Computer Science Education, Pittsburgh, PA, USA."},{"key":"ref_32","doi-asserted-by":"crossref","first-page":"1","DOI":"10.1145\/3695991","article-title":"Codescore: Evaluating code generation by learning code execution","volume":"34","author":"Dong","year":"2025","journal-title":"ACM Trans. Softw. Eng. Methodol."},{"key":"ref_33","first-page":"24824","article-title":"Chain-of-thought prompting elicits reasoning in large language models","volume":"35","author":"Wei","year":"2022","journal-title":"Adv. Neural Inf. Process. Syst."},{"key":"ref_34","doi-asserted-by":"crossref","unstructured":"Islam, M.A., Ali, M.E., and Parvez, M.R. (2025). CODESIM: Multi-Agent Code Generation and Problem Solving through Simulation-Driven Planning and Debugging. arXiv.","DOI":"10.18653\/v1\/2025.findings-naacl.285"}],"container-title":["Symmetry"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2073-8994\/17\/7\/1087\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T18:06:08Z","timestamp":1760033168000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2073-8994\/17\/7\/1087"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,7,7]]},"references-count":34,"journal-issue":{"issue":"7","published-online":{"date-parts":[[2025,7]]}},"alternative-id":["sym17071087"],"URL":"https:\/\/doi.org\/10.3390\/sym17071087","relation":{},"ISSN":["2073-8994"],"issn-type":[{"value":"2073-8994","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,7,7]]}}}