ODEL: An Experience-Augmented Self-Evolving Framework for Efficient Python-to-C++ Code Translation
Source abstract
Abstract
Automated code translation plays an important role in improving software reusability and supporting system migration, particularly in scenarios where Python implementations need to be converted into efficient C++ programs. However, existing approaches often rely heavily on large external models or static inference pipelines, which limits their ability to improve translation quality over time.To address these challenges, this paper proposes ODEL, an On-Demand Experience-enhanced Learning framework for Python-to-C++ code translation. ODEL adopts a hybrid inference architecture in which a lightweight internal model performs routine translation, while a more capable external model is selectively invoked upon verification failure to conduct error analysis and generate structured experience records. These experience records are accumulated and reused across subsequent translation phases, enabling progressive improvement through a closed-loop workflow that integrates generation, verification, consideration, and experience refinement. Experiments on the HumanEval-X benchmark demonstrate that ODEL significantly improves translation accuracy compared with competitive baselines. Specifically, the framework increases Pass@1 from 71.82% to 81.10% and Pass@10 from 74.30% to 89.02%, and exhibits a consistent performance improvement across multiple translation phases. These results indicate that experience reuse within a continuous task stream can effectively enhance automated code translation without modifying model parameters.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Software Testing and Debugging Techniques · Software Engineering Research · Parallel Computing and Optimization Techniques
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
Institute of Big Data Science and Industry, Shanxi University, Taiyuan 030006, China
Chumin School, Shanxi University, Taiyuan 030006, China
Funding
Key R&D Program of Shanxi Province · National Natural Science Foundation of China
References (33)
Show source-provided references
1. Search-Based Software Engineering: Trends, Techniques, and Applications10.1145/2379776.2379787 ↗
2. Roziere, B., Lachaux, M.-A., Chanussot, L., and Lample, G. (2020, January 6–12). Unsupervised Translation of Programming Languages. Proceedings of the 34th International Conference on Neural Information Processing Systems (NIPS ’20), Vancouver, BC, Canada.
3. Nguyen, A.T., Nguyen, T.T., and Nguyen, N.T. (2013, January 18–26). Lexical Statistical Machine Translation for Language Migration. Proceedings of the 2013 9th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2013), Saint Petersburg, Russia.10.1145/2491411.2494584 ↗
4. Chen, X., Liu, C., and Song, D. (2018, January 3–8). Tree-to-Tree Neural Networks for Program Translation. Proceedings of the 32nd International Conference on Neural Information Processing Systems (NIPS ’18), Montreal, QC, Canada.
5. Karaivanov, S., Raychev, V., and Vechev, M. (2014, January 20–24). Phrase-Based Statistical Translation of Programming Languages. Proceedings of the 2014 ACM International Symposium on New Ideas, New Paradigms, and Reflections on Programming & Software (Onward! 2014), Portland, OR, USA.10.1145/2661136.2661148 ↗
6. Nijkamp, E., Pang, B., Hayashi, H., Tu, L., Wang, H., Zhou, Y., Savarese, S., and Xiong, C. (2022). CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesis. arXiv.
7. Zheng, Z., Ning, K., Wang, Y., Zhang, J., Zheng, D., Ye, M., and Chen, J. (2023). A Survey of Large Language Models for Code: Evolution, Benchmarking, and Future Trends. arXiv.
8. Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity
9. Ahmad, W., Chakraborty, S., Ray, B., and Chang, K.W. (2021, January 6–11). Unified Pre-training for Program Understanding and Generation. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Online.10.18653/v1/2021.naacl-main.211 ↗
10. de Masson d’Autume, C., Ruder, S., Kong, L., and Yogatama, D. (2019, January 8–14). Episodic Memory in Lifelong Language Learning. Proceedings of the 33rd International Conference on Neural Information Processing Systems, Vancouver, BC, Canada.
11. Shinn, N., Cassano, F., Berman, E., Gopinath, A., Narasimhan, K., and Yao, S. (2023). Reflexion: Language Agents with Verbal Reinforcement Learning. arXiv.
12. Madaan, A., Tandon, N., Gupta, P., Hallinan, S., Gao, L., Wiegreffe, S., Alon, U., Dziri, N., Prabhumoye, S., and Yang, Y. (2023). Self-Refine: Iterative Refinement with Self-Feedback. arXiv.
13. Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., and Rocktäschel, T. (2020, January 6–12). Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Proceedings of the 34th International Conference on Neural Information Processing Systems (NIPS ’20), Vancouver, BC, Canada.
14. Chen, M., Tworek, J., Jun, H., Yuan, Q., de Oliveira Pinto, H.P., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., and Brockman, G. (2021). Evaluating Large Language Models Trained on Code. arXiv.
15. Competition-Level Code Generation with AlphaCode10.1126/science.abq1158 ↗
16. Rozière, B., Gehring, J., Gloeckle, F., Sootla, S., Gat, I., Tan, X.E., Adi, Y., Liu, J., Sauvestre, R., and Remez, T. (2023). Code Llama: Open Foundation Models for Code. arXiv.
17. Bai, J., Bai, S., Chu, Y., Cui, Z., Dang, K., Deng, X., Fan, Y., Ge, W., Han, Y., and Huang, F. (2023). Qwen Technical Report. arXiv.
18. Wang, Y., Le, H., Gotmare, A.D., Bui, N.D.Q., Li, J., and Hoi, S.C.H. (2023). CodeT5+: Open Code Large Language Models for Code Understanding and Generation. arXiv.10.18653/v1/2023.emnlp-main.68 ↗
19. Li, R., Allal, L.B., Zi, Y., Muennighoff, N., Kocetkov, D., Mou, C., Marone, M., Akiki, C., Li, J., and Chim, J. (2023). StarCoder: May the Source Be with You!. arXiv.
20. Austin, J., Odena, A., Nye, M., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C., Terry, M., and Le, Q. (2021). Program Synthesis with Large Language Models. arXiv.
21. Wang, D., and Li, L. (2023, January 6–10). Learning from Mistakes via Cooperative Study Assistant for Large Language Models. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP 2023), Singapore.10.18653/v1/2023.emnlp-main.659 ↗
22. Zheng, Z., Yin, P., Lu, C.T., and Huang, X. (2021, January 1–5). CodeTrans: Towards Cracking the Language Barrier in Code Translation. Proceedings of the 30th ACM International Conference on Information & Knowledge Management, Virtual Event.
23. Wang, Z., Zhou, S., Li, X., and Zhang, Y. (2024, January 14–20). Continual Learning for Code Generation. Proceedings of the IEEE/ACM 46th International Conference on Software Engineering, Lisbon, Portugal.
24. Chen, Z., Kommrusch, S.J., and Monperrus, M. (2022, January 16–17). CERT: Continual Pre-training on Sketches for Library-Oriented Code Generation. Proceedings of the 30th IEEE/ACM International Conference on Program Comprehension, Pittsburgh, PA, USA.
25. Cassano, F., Gouwar, J., Nguyen, D., Nguyen, S., Phipps-Costin, L., Pinckney, D., Yee, M., Zi, Y., Anderson, C.J., and Feldman, M.Q. (2022). MultiPL-E: A Scalable and Extensible Approach to Benchmarking Neural Code Generation. arXiv.10.1109/TSE.2023.3267446 ↗
26. Parvez, M.R., Chakraborty, S., Ray, B., and Chang, K.-W. (2021, January 7–11). Retrieval Augmented Code Generation and Repair. Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, Virtual Event.10.18653/v1/2021.findings-emnlp.232 ↗
27. Lu, S., Xu, D., Alon, U., Neubig, G., and Hellendoorn, V. (2023, January 14–20). ReACC: Retrieval-Augmented Code Completion. Proceedings of the IEEE/ACM 45th International Conference on Software Engineering (ICSE), Melbourne, Australia.
28. Karanjai, R., Blackshear, S., Xu, L., and Shi, W. (2025, January 23–28). Collaboration is all you need: LLM Assisted Safe Code Translation. Proceedings of the 33rd ACM International Conference on the Foundations of Software Engineering, Trondheim, Norway.10.1145/3696630.3728521 ↗
29. Athiwaratkun, B., Gouda, S.K., Wang, Z., Li, X., Tian, Y., Tan, M., Ahmad, W., Wang, S., Sun, Q., and Shang, M. (2022). Multi-lingual Evaluation of Code Generation Models. arXiv.
30. Ellis, K., Wong, C., Nye, M.I., Sablé-Meyer, M., Morales, L., Hewitt, L.B., Cary, L., Solar-Lezama, A., and Tenenbaum, J.B. (2021, January 20–25). DreamCoder: Bootstrapping Inductive Program Synthesis with Wake-Sleep Library Learning. Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI ’21), Online.10.1145/3453483.3454080 ↗
31. Hui, B., Yang, J., Cui, Z., Yang, J., Liu, D., Zhang, L., Liu, T., Zhang, J., Yu, B., and Lu, K. (2024). Qwen2.5-Coder Technical Report. arXiv.
32. Exploring and unleashing the power of large language models in automated code translation10.1145/3660778 ↗
33. Guo, D., Zhu, Q., Yang, D., Xie, Z., Dong, K., Zhang, W., Chen, G., Bi, X., Wu, Y., and Li, Y.K. (2024). DeepSeek-Coder: When the Large Language Model Meets Programming—The Rise of Code Intelligence. arXiv.