Background: This study aimed to evaluate the performance of Large Language Models (LLMs) in answering ophthalmology residency exam questions, comparing their accuracy to human residents, and determine current models’ potential for use in medical education and clinical work. OpenAI’s latest model, GPT-4o, is of particular interest due to being significantly faster than its predecessor; however, it is yet unknown how it compares in terms of knowledge and accuracy. Therefore, our objective was to assess GPT-4o’s performance in various metrics against other LLMs (GPT-4 and Gemini Advanced) and the human group, specifically in ophthalmology, a specialized topic with limited training data, to explore how well these artificial intelligence (AI) models handle subspecialty-specific content. Methods: A dataset of 600 questions, derived from Israeli ophthalmology residency exams conducted between 2020 and 2023, and based on content from the Basic and Clinical Science Course (BCSC) textbooks, was utilized, covering 12 ophthalmologic subspecialties, in text-only (379 questions) and image-based (221 questions) formats. GPT-4o, GPT-4, and Gemini Advanced were tested on this dataset to measure overall accuracy, with additional analyses by exam year, subspecialty topics, and image-processing capabilities based on categorization of images according to their content, including labeled images, pathology, fundus photographs, and complex visuals like graphs and multi-image questions. Chi-squared tests were used to determine statistical significance across different metrics. Results: GPT-4o achieved the highest overall accuracy (74.2%), significantly outperforming GPT-4 (61.9%) and Gemini Advanced (65.8%). While variations in year-to-year exam performance were statistically insignificant, GPT-4o’s accuracy was comparable to human residents, even exceeding the national average in 2021. In text-only questions, GPT-4o demonstrated superior performance, with an accuracy of 82.3% compared to GPT-4’s 73.8% and Gemini Advanced’s 72.3%. Image-based performance was also higher for GPT-4o (60.5%), surpassing GPT-4 (41.8%) and Gemini Advanced (39.3%), surpassing them in every metric, and particularly in labeled images, pathology, and fundus images. However, the model’s ability to process complex visuals, such as abstract drawings and multi-image prompts, remained limited. Performance across subspecialty topics also varied, with GPT-4o still excelling in most categories; statistical significance was lower in topics with fewer questions, like uveitis and refractive surgery, making for less notable differences when compared to the overall comparison. Conclusions: The study anticipates further advancements in this field, with improvements in all metrics expected as the technology is refined to meet individual needs in the medical industry, particularly in ophthalmology. GPT-4o’s improvements in clinical reasoning and image analysis mark a substantial leap in performance. The model approached human-level performance in our testing, suggesting increased potential for integration into ophthalmology clinical settings compared to previous generations. Future research should focus on assessing and evaluating image interpretation capabilities, enhanced accuracy, and addressing ethical considerations to ensure safe, effective AI integration into clinical practice.