Manuscript Offprint

arXiv:2609.03635

Analysis of Prompt Engineering for Drug Toxicity Prediction

Mia MacGregor, Aakash Welgamage Don, Mark Bartlett

Abstract

Clinical trials in the UK can cost up to £1.3 million, with an approximately 90% drug failure rate. Toxicity is a main contributing factor in drug failure. Traditional toxicity testing is time and cost intensive. In recent years, the use of artificial intelligence has been increasingly explored to aid in the prediction of drug toxicity, with extensive use of large language models (LLMs), such as ChatGPT. However, LLMs outputs can show considerable variation when minor changes are made to the prompts given to them. The aim of the paper is to investigate how important prompt phrasing is in relation to drug toxicity prediction. A machine learning pipeline was created that involved prompting LLMs at two points in the process. The experiments show that the natural variance which occurs in the outputs of LLMs outweighed any fine-tuning of prompts. There were, however, substantial improvements in model performance when using chemoinformatic code to extract features instead of using LLM generated values, which are common in the field. The proposed analysis methodology is applicable to a wide range of prompt types across different areas of bioinformatics.

1 Introduction

UK Clinical trials can cost up to £1.3 million [1] with only approximately 10% of drugs included in phase I clinical trials reaching UK markets [2]. One of the main reasons for failure in clinical trials is toxicity [3], which is a measure of harm that a chemical can cause to living organisms. Wet-lab toxicity prediction is associated with considerable time and cost burdens [4].

In recent years, scientists have begun using AI methods to predict toxicity prior to clinical trials, enhancing toxicity prediction by use of interdisciplinary tools, utilizing in silico drug toxicity prediction [5]. One method in recent literature is to use large language models (LLM) [6, 7, 8, 9]. The responses that LLMs provide can vastly differ depending on the prompt they are provided [6], but the impact of the phrasing of the prompt used is often not considered in these studies. This paper addresses this gap by proposing a method to analyse prompt engineering used for drug toxicity prediction. Prompt engineering is the method used to optimise an LLM output [10]. We investigate the impact of prompt engineering on the variation of LLM outputs generated, as well as on the accuracy of the subsequent toxicity prediction task.

Drug toxicity can be classified in different ways depending on the training data. Using different datasets allows our approach to investigate specific toxicity types, with toxic and non-toxic classifications determined by the machine learning (ML) models training data.

Article version: 4th September 2026 h00:51 CET

References (12)

  • Why 90% of clinical drug development fails and how to improve it? Acta Pharmaceutica Sinica B, 12(7):3049–3062, 2022
  • Acute, subacute, subchronic, and chronic general toxicity testing for preclinical drug development
  • Artificial intelligence-driven drug toxicity prediction: Advances, challenges, and future directions
  • Advancements in large language models (LLMs): Empowering drug discovery
  • Exploring the efficacy of large language models in predicting chemical toxicity
  • Large language models as tools for molecular toxicity prediction: AI insights into cardiotoxicity
  • Large language models for scientific discovery in molecular property prediction
  • Prompt engineering in medical education
  • Gemma: Open Models Based on Gemini Research and Technology
  • DeepSeek-R1 incentivizes reasoning in LLMs through reinforcement learning
  • Llama: Open and efficient foundation language models, 2023
  • Mistral 7b, 2023