## 3 Materials and Methods
### Assessing Models  
We evaluated a total of seven models: four open-source small LLMs (i.e., from 7 to 8 billion parameters [25]) and three open-access commercial LLMs. Open-access commercial LLMs are developed by private companies and made available to the public, typically through web interfaces or APIs. While users can interact with these models, sometimes for free, the underlying code and training data are not openly shared, and their use is governed by specific terms of service. Open-source LLMs, on the other hand, are released with open licenses, allowing broader access to their architecture, weights, and in some cases, their training datasets [26]. This openness facilitates transparency, customization, and reproducibility in research. Among the four open-source models evaluated, two were specifically designed as reasoning models. These models are fine-tuned or architecturally optimized to enhance their ability to handle tasks that require multi-step reasoning, logical inference, or complex problem-solving [27]. These capabilities are particularly important in answering medical exam questions that go beyond surface-level recall. The third phase of the study involved submitting the 771 previously selected questions (from the 2017 to 2023 exams) as input to the following LLMs:  
* Open-source models:
* LLaMA 3.1 with 8B parameters (Meta) [15]: LLaMA (Large Language Model Meta AI) is an open-source model family developed by Meta. The 3.1 version with 8 billion parameters is designed for high efficiency and general-purpose language understanding;
* Qwen 2.5 with 7B parameters (Alibaba) [16]: Qwen is an open-source multilingual LLM developed by Alibaba Cloud. Version 2.5, with 7 billion parameters, provides competitive performance in language understanding and generation;
* LLaMA 3.1-R-8B, distilled from DeepSeek-R1 (DeepSeek) [17]: This reasoning-optimized variant of LLaMA 3.1 was distilled from DeepSeek-R1 to enhance its performance on tasks requiring logical inference and multi-step reasoning;
* Qwen 2.5-R-7B, distilled from DeepSeek-R1 (DeepSeek) [17]: This model is a reasoning-focused variant of Qwen 2.5, also distilled from DeepSeek-R1;
* Open-access commercial models:
* GPT-3.5 (OpenAI) [28]: released in 2022, it is a general-purpose model designed to perform a wide range of natural language understanding and generation tasks;
* GPT-4o (OpenAI) [29]: released in 2024, it is a multimodal LLM, achieving parity with GPT-4 Turbo in text tasks while significantly reducing latency and computational costs;
* Gemini 1.0 Pro (Google) [30]: developed by Google DeepMind and launched in late 2023. The open-source LLMs utilized in this study were executed within Google Colaboratory (Colab), a cloud-based platform offering accessible computational resources for machine learning tasks. Specifically, the models ran on a virtual machine equipped with an NVIDIA Tesla T4 GPU, which features 16 GB of RAM. To optimize resource utilization and enable the execution of large models within Colab's memory constraints, we employed 4-bit quantization using the Unsloth library [31]. This quantization technique reduces the precision of model weights from the standard 32-bit floating-point format to 4 bits, significantly decreasing memory usage and computational load. While lower precision can introduce some loss in model accuracy, 4-bit quantization has been shown to maintain performance levels close to full-precision models for many tasks [32]. Regarding hyperparameters, Unsloth's default settings [31] were utilized to maintain consistency and reproducibility across experiments. Prompt engineering refers to the process of crafting optimized inputs to effectively leverage LLMs across various applications and research domains [33]. A systematic approach to input design is essential to guide LLM responses in a coherent and contextually appropriate manner, while also ensuring consistent performance [34; 35]. To fully harness the capabilities of LLMs, prompt engineering plays a critical role [36].