The effectiveness of structured prompt optimization using RAG and MIPRO (tpsa model, Figure ) was compared to a basic prompt (direct model) for predicting the TPSA of a set of 140 molecules. The direct model, which uses a simple, non-augmented prompt without RAG or MIPRO optimizations, results in a mean RMSE of 59.41, with predictions showing little alignment to the actual TPSA values. The prompt used was "Predict the numerical value of the topological surface area, TPSA, for a molecule described by the SMILES code, {molecule}," where molecule was one SMILES code selected from a list. This basic prompt leads to poor model performance, as the LLM struggles to reliably relate molecular structure to TPSA without the additional context provided in the optimized prompt. SMILES codes are common but if the training data did not include the specific property connected to that specific form of the SMILES code, as appears to be the case, the LLM cannot infer what the values should be. (Figure ). The tpsa model, incorporating RAG and optimized with MIPRO's prompt structuring and fewshot example selection, achieves an RMSE of 7.44, with most predictions closely matching the calculated values obtained from PubChem. This suggests that incorporating functional group details and other contextual information and optimizing prompts through MIPRO significantly enhances prediction accuracy. For the tpsa model a multi-part prompt structure (Figure ) was used that incorporated RAG components as well as text designed to ensure the response of the LLM followed the request for typed format of a list of float values which were then summed to get the predicted TPSA value. This prompt was used in the MIPRO process which produced examples and a data description that were appended to the prompt at inference. The outliers that had a predicted TPSA > 1 different from the calculated TPSA (supporting info, Figure ) tended to have longer lists of functional groups (6.4 vs 4.6 mean) and more nitrogen and oxygen atoms suggesting that the more complicated molecules were harder to predict. and types of functional groups are removed. Without these critical details, predictions become widely dispersed from actual values. This configuration underscores the importance of functional group and functional group information for minimizing hallucinations and achieving reliable TPSA predictions. The outliers (supporting info, Figure ) contain many of the same molecules as the individual RAG removals as well as some new ones. Next, the text added by the MIPRO optimization was iteratively removed from the full model to assess the contribution of MIPRO to the improvement of the overall model. When the description of the dataset (termed signature in DSPy) was removed (Figure ) the mean RMSE value increased only slightly to 7.47. In contrast, when the bootstrapped examples were removed, the RMSE increased to 18.07 (Figure ). While some predictions remained close to the ideal value, many did not, including 15 values that were exactly doubled over the actual values, a hallucination not observed in the direct prediction.