## 5 Experimental Procedure
### Training Process  
As illustrated in Figure 4, our framework involves training the discriminator model BERT\({}_{large}\) and the generator model GPT-2\({}_{medium}\) in a training loop. Firstly, we identify common text word-initial words and use GPT-2\({}_{medium}\) to complete the sentences. Subsequently, the completed sentences are fed into the fine-tuned BERT\({}_{large}\) model to evaluate their grammatical plausibility. This evaluation result is then utilized to conduct supervised fine-tuning of the GPT-2\({}_{medium}\) model. To avoid the discriminator model's errors significantly affecting the generator model, we adopt a minimal learning rate and train the generator model only one round. \begin{table}
\begin{tabular}{l c c c c c c c c c} \hline \hline \multirow{2}{*}{**Model Input**} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} & \multicolumn{1}{c}{} \\ \cline{2-11}  & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} & \multicolumn{1}{c}{**lr =**} \\  & \multicolumn{1}{c}{**5 \(\times\) 10\({}^{-3}\)**} & \multicolumn{1}{c}{**5 \(\times\) 10\({}^{-3}\)**} & \multicolumn{1}{c}{**5 \(\times\) 10\({}^{-3}\)**} & \multicolumn{1}{c}{**1 \(\times\) 10\({}^{-2}\)**} & \multicolumn{1}{c}{**1 \(\times\) 10\({}^{-2}\)**} & \multicolumn{1}{c}{**1 \(\times\) 10\({}^{-2}\)**} & \multicolumn{1}{c}{**2 \(\times\) 10\({}^{-2}\)**} & \multicolumn{1}{c}{**2 \(\times\) 10\({}^{-2}\)**} & \multicolumn{1}{c}{**2 \(\times\) 10\({}^{-2}\)**} \\ \cline{2-11}  & \multicolumn{1}{c}{**Epoch = 5**} & \multicolumn{1}{c}{**Epoch = 10**} & \multicolumn{1}{c}{**Epoch = 15**} & \multicolumn{1}{c}{**Epoch = 5**} & \multicolumn{1}{c}{**Epoch = 10**} & \multicolumn{1}{c}{**Epoch = 5**} & \multicolumn{1}{c}{**Epoch = 10**} & \multicolumn{1}{c}{**Epoch = 15**} \\ \hline Token & 2.3275 & 2.3275 & 2.3275 & 2.3275 & 2.3275 & 2.3275 & 2.3275 & 2.3275 & 2.3275 & 2.3275 \\ Token+mask attention & 0.6910 & 0.6825 & 0.6722 & 0.6810 & **0.6721** & 0.6730 & 0.6754 & 0.6772 & 0.6772 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: With all Transformer block parameters of GPT-2 frozen, only the linear layer is trained to validate the results of the set on the CoLA task. Table 4 presents some examples of text generated by GPT-2\({}_{medium}\). Subsequently, we fed this data to a discriminator model to assess their syntactic plausibility. The discriminator model's output value of 1 or 0 indicates whether the modified sentence is grammatically valid or invalid, respectively. Next, we used these labeled data to perform supervised fine-tuning of the GPT-2\({}_{medium}\) model. Figure 5 shows that we used a learning rate of \(1\times 10^{-4}\) and a minibatch size of 64 for fine-tuning. \begin{table}
\begin{tabular}{l l c} \hline \hline \(G\) Input & \(G\) Output & \(D\) Output \\ \hline That & That doesn’t have any significance, right? & 0 \\ It & It was a beautiful night of sunshine with some gorgeous light falling. & 1 \\ He & He said. “[W]ith this being an attack of our religion I do feel the time will not have arrived.” & 0 \\ We & We have already started the implementation phase and will keep the project in mind throughout. & 1 \\ I & I’ve done all those jobs. & 1 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: We did not fine-tune the text generated by the previous GPT-2\({}_{medium}\) model. Then, it is input to the discriminator for judgment. The red marker denotes the data generated by the generator, while a D Output of 0 indicates that the statement is not grammatically correct, and 1 indicates that it is grammatically correct. Figure 4: Training process of discriminator (BERT\({}_{large}\)) and generator (GPT-2\({}_{medium}\)) in EvoText.