Talha Mahmood

Mr. Talha Mahmood

Department of Artificial Intelligence, Shifa Tameer-e-Millat University, Islamabad, Islāmābād, Pakistan

Research Focus & Metrics

Academic Career Length

1Year (2026-Present)

(Calculated once Scilit publication data is synced: current year − year of first publication + 1)

Representative Publications

View All Publications
3 November 2026 in Computation
Verified
Journal Article
Open access
PDF file
TMTalha Mahmood
Talha Mahmood
MAMuhammad Tanvir Afzal
Muhammad Tanvir Afzal
Ahmad Sami Al-ShamaylehAhmad Sami Al-Shamayleh
Ahmad Sami Al-Shamayleh
GMGhulam Mustafa
Ghulam Mustafa
Isabel De La Torre DíezIsabel De La Torre Díez
Isabel De La Torre Díez
PGPablo Herrero García
Pablo Herrero García
Large Language Models (LLMs) can translate natural-language instructions into code, but when the input is unstructured clinical protocol text, the generated code may omit doses, monitoring intervals, or safety thresholds that the text states. Such omissions matter because they can propagate into software that supports clinical monitoring. We propose SPE-ECG (Structured Prompt Engineering for Enhanced Code Generation), a transparent, rule-based pipeline that converts unstructured domain text into a JSON prompt using text cleaning, part-of-speech tagging, bigram matching, and hand-built domain dictionaries, without fine-tuning any model. In a case study of 43 rheumatoid arthritis DMARD monitoring protocols, we compared raw and structured prompts on three LLMs (GPT-3.5, LLaMA 2, and Gemma), scoring the generated Python code using version 3.15.1 with BLEU against the raw-prompt code of the other two models. Mean BLEU rose for all three models (relative gains of 55.1%, 32.5%, and 19.9%); the paired differences were significant for GPT-3.5 and LLaMA 2 but not, after correction for multiple comparisons, for Gemma. These results suggest that lightweight input structuring can change how closely different models’ outputs agree, and that it could serve as a low-cost, auditable preparation step for protocol-to-code tools built on free or open models. BLEU does not measure correctness, no ablation or state-of-the-art baseline was run, and clinical validation is required before any use.