Comparison of different LLMs in code translation
Uložené v:
| Názov: | Comparison of different LLMs in code translation |
|---|---|
| Autori: | Güzel, Emre Cemil |
| Prispievatelia: | Tekniikan ja luonnontieteiden tiedekunta - Faculty of Engineering and Natural Sciences, Tampere University |
| Rok vydania: | 2025 |
| Predmety: | Bachelor's Programme in Science and Engineering, programming, Python (programming languages), programming languages, artificial intelligence, C++ (programming language), language models, translations |
| Popis: | This thesis investigates the capabilities of modern large language models (LLMs) in translating programming code between languages, specifically from Python to C++. As LLMs are increasingly integrated into software development workflows, understanding their strengths and limitations in practical tasks like code translation is crucial. The study compares three prominent LLMs, OpenAI’s ChatGPT 4o, Google’s Gemini, and DeepSeek, by providing each with the same Python-based program and analyzing the resulting C++ code in terms of functionality, syntax correctness, and quality of commenting. The base Python program, designed as a Student Grades Manager, was selected for its moderate complexity and incorporation of common programming constructs. Each LLM’s output was tested and evaluated both manually and through practical compilation and execution. ChatGPT 4o produced largely correct output with a minor formatting issue. Gemini's translation initially failed due to a missing header, which was resolved with minor prompting. DeepSeek generated fully functional code without requiring any corrections and was the only model whose output did not trigger runtime antivirus interference. Commenting styles varied among the models: Gemini provided extensive inline documentation, DeepSeek offered a concise but well-structured commentary, and ChatGPT’s comments were functional but minimal. The results highlight that while all three models can produce usable C++ translations from Python, differences exist in reliability, output clarity, and error resilience. The findings suggest that LLMs are powerful tools for code translation tasks, although human oversight remains essential for ensuring code quality and correctness. |
| Druh dokumentu: | bachelor thesis |
| Popis súboru: | fulltext |
| Jazyk: | English |
| Relation: | https://trepo.tuni.fi/handle/10024/228842 |
| Dostupnosť: | https://trepo.tuni.fi/handle/10024/228842 |
| Rights: | This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited. ; openAccess |
| Prístupové číslo: | edsbas.7F5B15ED |
| Databáza: | BASE |
| Abstrakt: | This thesis investigates the capabilities of modern large language models (LLMs) in translating programming code between languages, specifically from Python to C++. As LLMs are increasingly integrated into software development workflows, understanding their strengths and limitations in practical tasks like code translation is crucial. The study compares three prominent LLMs, OpenAI’s ChatGPT 4o, Google’s Gemini, and DeepSeek, by providing each with the same Python-based program and analyzing the resulting C++ code in terms of functionality, syntax correctness, and quality of commenting. The base Python program, designed as a Student Grades Manager, was selected for its moderate complexity and incorporation of common programming constructs. Each LLM’s output was tested and evaluated both manually and through practical compilation and execution. ChatGPT 4o produced largely correct output with a minor formatting issue. Gemini's translation initially failed due to a missing header, which was resolved with minor prompting. DeepSeek generated fully functional code without requiring any corrections and was the only model whose output did not trigger runtime antivirus interference. Commenting styles varied among the models: Gemini provided extensive inline documentation, DeepSeek offered a concise but well-structured commentary, and ChatGPT’s comments were functional but minimal. The results highlight that while all three models can produce usable C++ translations from Python, differences exist in reliability, output clarity, and error resilience. The findings suggest that LLMs are powerful tools for code translation tasks, although human oversight remains essential for ensuring code quality and correctness. |
|---|
Nájsť tento článok vo Web of Science