In this section, three experiments are conducted to illustrate the selection process for the principal features in LLMs and the hyperparameters in SVM. Specifically,Β the parameters πΆ and ππππππ in the SVMβs polynomial kernel, and the sampling rate πΎ require elucidation.Β
The parameter πΆ, commonly referred to as the regularization parameter, controls the trade-off between achieving a low error on the training data and minimizingthe model complexity for better generalization to new data. A higher value of πΆ tries to fit the training set as well as possible (higher model complexity), while a lower value leads to a model that might not perform as well on the training set but is better at generalizing.
On the other hand, ππππππ pertains to the degree of the polynomial kernel function and is crucial for defining the complexity of the decision surface. A higher ππππππ results in more complex decision boundaries, capable of capturing more intricate patterns in the data. However, this also increases the risk of overfitting, particularly in scenarios with noise and limited data samples.
As depicted in the table above, no significant differences are observed in the time consumption across various groups of hyper-parameters and features. Therefore, the average F1-score is considered for comparison. The comparison of the F1-score without post-processing is chosen as it more accurately reflects the inherent effectiveness of the different features and hyper-parameters. This following figure clearly shows that the hyperparameter group in the lower right corner achieves the highest F1-score of 0.6117 without post-processing, which is noteworthy. Consequently, πΆ = 1 and ππππππ = 3 are selected as the hyperparameters for SVM, and all three features are chosen for the detection and fix process.
GlitchProber adopts a random sampling strategy to select samples from the modelβs token vocabulary π to form the sample set π. The choice of sampling rate πΎ needs to balance between sample size and computational efficiency. A larger πΎ leads to a larger sample size and more accurate detection results but also incurs higher computational costs. Conversely, a smaller πΎ results in a smaller sample size and faster computation but may affect the detection performance.
Based on the experimental results obtained from testing the Llama2 model at various πΎ settings, it is evident that while increasing πΎ leads to improvements in recall and F1 scores, it also significantly raises the computational time. Specifically, the recall increases from 0.6922 at πΎ=0.1 to 0.7457 at πΎ=0.3, and the F1 score similarly rises from 0.8181 to 0.8543.
However, the time required for processing escalates from 61 minutes and 38 seconds to 74 minutes and 30 seconds. Beyond πΎ=0.3, the gains in recall and F1 score continue to increase, reaching 0.7812 and 0.8772, respectively, at πΎ=0.7, but at a disproportionate cost in time, extending up to 100 minutes and 41 seconds.
Thus, selecting a πΎ value within the range of 0.1 to 0.3 strikes a favorable balance between detection accuracy and computational efficiency. This range efficiently leverages the increase in recall and F1 scores without incurring the high time penalties observed at higher πΎ levels. This strategy ensures that GlitchProber remains practical and effective, optimizing the modelβs performance and operational feasibility within a reasonable computational budget.