Augmented and Programmatically Optimized LLM Prompts Reduce Chemical Hallucinations

02 January 2025, Version 1
This content is a preprint and has not undergone peer review at the time of posting.

Abstract

Utilizing Large Language Models (LLMs) for handling scientific information comes with risk of the outputs not matching expectations, commonly called hallucinations. To fully utilize LLMs in research requires improving their accuracy, avoiding hallucinations, and extending their scope to research topics outside their direct training. There is also a benefit to getting the most accurate information from an LLM at the time of inference without having to create and train custom new models for each application. Here, augmented generation and machine learning driven prompt optimization are combined to extract performance improvements over base LLM function on a common chemical research task. Specifically, an LLM was used to predict the topological polar surface area (TPSA) of molecules. By using augmented generation and machine learning optimized prompts, the error in the prediction was reduced to 7.44 root mean squared error (RMSE) from 59.41 RMSE with direct calls to the same LLM.

Keywords

LLM
Augmented Generation

Supplementary materials

Title
Description
Actions
Title
Figures of Molecules Used in LLM calls
Description
Molecules from each model that have > 1 difference between the direct LLM predicted value and the calculated TPSA.
Actions

Comments

Comments are not moderated before they are posted, but they can be removed by the site moderators if they are found to be in contravention of our Commenting Policy [opens in a new tab] - please read this policy before you post. Comments should be used for scholarly discussion of the content in question. You can find more information about how to use the commenting feature here [opens in a new tab] .
This site is protected by reCAPTCHA and the Google Privacy Policy [opens in a new tab] and Terms of Service [opens in a new tab] apply.