Comparative Analysis of ChatGPT, DeepSeek, and Gemini for Automated Code Generation

Code generation using artificial intelligence (AI) has revolutionized software development, providing automated coding solutions. This study conducts a systematic comparative analysis of three leading large language models (LLMs) such as ChatGPT (O1), DeepSeek (R1) and Gemini (2.0 Flash thinking), for Python code generation, evaluating their performance in correctness, code quality, and computational efficiency. Using a curated dataset of Codeforces programming problems that span various difficulty levels <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$(\mathbf{8 0 0 - 2 0 0 0}$</tex> complexity), the research employs a rigorous evaluation framework that integrates online judge validation, static code analysis, and runtime profiling. The experimental results reveal that DeepSeek achieves comparatively higher correctness by consistently producing accepted solutions in fewer attempts, although its reasoning time increases with problem complexity. Gemini, on the other hand, is remarkably fast, delivering results in a fraction of the time, but its correctness deteriorates on more complex tasks. ChatGPT offers balanced performance with intermediate correctness and efficiency; however, it sometimes exhibits lower code quality. Overall, our findings underscore the inherent trade-offs between efficiency, accuracy, and quality in AI-generated code. The study provides actionable insights for developers, emphasizing the need to align model selection with project requirements, and contributes a replicable framework for future evaluations of AI code generation tools.

Authors

Institutions

Publication Details

Published
2025-05-29
DOI
https://doi.org/10.1109/emes65692.2025.11045587
Citations
3
Primary Topic
Artificial Intelligence in Healthcare and Education
Type
article
Field-Weighted Citation Impact
1.96
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Comparative Analysis of ChatGPT, DeepSeek, and Gemini for Automated Code Generation

Khuram Shahzad, Sohail Iqbal
3 citations
Artificial Intelligence in Healthcare and Education
1.96
article

Comparative Analysis of ChatGPT, DeepSeek, and Gemini for Automated Code Generation

Khuram Shahzad, Sohail Iqbal
article en
3 citations

Abstract

Code generation using artificial intelligence (AI) has revolutionized software development, providing automated coding solutions. This study conducts a systematic comparative analysis of three leading large language models (LLMs) such as ChatGPT (O1), DeepSeek (R1) and Gemini (2.0 Flash thinking), for Python code generation, evaluating their performance in correctness, code quality, and computational efficiency. Using a curated dataset of Codeforces programming problems that span various difficulty levels <tex xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">$(\mathbf{8 0 0 - 2 0 0 0}$</tex> complexity), the research employs a rigorous evaluation framework that integrates online judge validation, static code analysis, and runtime profiling. The experimental results reveal that DeepSeek achieves comparatively higher correctness by consistently producing accepted solutions in fewer attempts, although its reasoning time increases with problem complexity. Gemini, on the other hand, is remarkably fast, delivering results in a fraction of the time, but its correctness deteriorates on more complex tasks. ChatGPT offers balanced performance with intermediate correctness and efficiency; however, it sometimes exhibits lower code quality. Overall, our findings underscore the inherent trade-offs between efficiency, accuracy, and quality in AI-generated code. The study provides actionable insights for developers, emphasizing the need to align model selection with project requirements, and contributes a replicable framework for future evaluations of AI code generation tools.

National University of Sciences and Technology (PK)
Openalex Percentile: Top 11%
Artificial Intelligence in Healthcare and Education
1.96
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Comparative Analysis of ChatGPT, DeepSeek, and Gemini for Automated Code Generation — Khuram Shahzad, Sohail Iqbal · (2025) | TGRS Research Map | TGRS