# Generative LLMs in Organic Chemistry: Transforming
## 4 The Data
While the input data remained predominantly unaltered, the output data saw modifications in instances of duplicated identical actions or instances of incongruent solvent nomenclatures, such as the replacement of \"iso propanol\" with the correct \"isopropanol\". The dataset was shuffled and partitioned into test (100 samples), validation (100 samples), and training sets (1000 samples). Toevaluate the influence of the training dataset size on the algorithm performance, additional training subsets of 500, 150, and 50 samples were created. Notably, the 150-sample dataset encompasses all instances present in the 50-sample set, and similarly, the 500-sample set contains all from the 150-sample set. The exploration of smaller training subsets within our dataset is based on various considerations. In other reaction classes beyond esterification, the number of reactions available may not be as extensive; therefore, it is meaningful to simulate conditions where data scarcity is a factor. Furthermore, there are logistical constraints such as the high costs associated with chemical experiments, limitations in existing data repositories, and the significant effort required to cleanse data of noise, which may impede the collection of large training sets. This reality underscores the value of testing the algorithm's performance with reduced sample sizes. Additionally, this approach is utilized to assess the sufficiency of smaller datasets for model training, leveraging the repetitive nature of sentence structures and recurrent action patterns within procedural texts, which could allow for effective learning and generalization from fewer examples. The input character sequences span a range from 22 to 293 characters in length. The average input lengths across subsets were consistent: validation (85.83 characters), testing (92.38 characters), and training sets of 1000 (87.09 characters), 500 (84.92 characters), 150 (83.17 characters), and 50 samples (82.24 characters). The synthesis procedures (output) ranged from a minimum of 4 actions to a maximum of 29. The average action counts in the outputs across the subsets were also uniform: validation (12.07 actions), testing (11.68 actions), and training sets of 1000 (12.26 actions), 500 (12.34 actions), 150 (11.91 actions), and 50 samples (11.42 actions). Such consistency indicates that the training, validation, and testing subsets are representative, ensuring reliable test scores and confident conclusions regarding the task. The data are presented in Table 2. The full dataset is publicly available in the project repository online: [[https://github.com/Mantas-it/LLM_Esterification](https://github.com/Mantas-it/LLM_Esterification)]([https://github.com/Mantas-it/LLM_Esterification](https://github.com/Mantas-it/LLM_Esterification)) (accessed on 9 November 2023). To establish a baseline for the trained models, random and majority methods were selected. The random method outputs a random output from the training dataset, while the majority method simply outputs the most common sentence (in the training dataset). The BLEU score is calculated using the entire training dataset, which consists of 1000 examples. The majority and random baselines yield BLEU scores of 24.16 and 36.56, respectively. The \begin{table}
\begin{tabular}{c c c} \hline \hline
**Input** & \multicolumn{2}{c}{**Output**} \\ \hline CC(=O)O.OC1(COC2 CCCCCO2)CC1\textgreater{}CC(=O)OC1- & MAKESOLUTION with $R25 and $R15 and DCM; ADD SLN; ADD DMAP at 25 C; STIR for 30 min; ADD DCC at 0 C; QUENCH with water; WAIT for 4 h; FILTER keep filtrate; CONCENTRATE; PURIFY; YTELD SP15. \\ \hline COc1 cenc(C(=O))c1O.CCO\textgreater{}CCOC(=O)c1 nccc(OC)c1O & MAKESOLUTION with $R15 and $R25; ADD SLN; ADD H2 SO4; REFLUX for 3 d 3 h; CONCENTRATE; PH with water to pH neutral; EXTRACT with chloroform; DRYSOLUTION; CONCENTRATE; YTELD SP15. \\ \hline \hline \end{tabular}
\end{table} 
Table 1: An excerpt from the dataset. Two examples of input and output pairs.