The invention relates to the technical field of
data expansion, in particular to a malicious prompt
data set expansion method based on Mongolian. According to the method, high-frequency roots and affixes in a Mongolian basic malicious prompt corpus and a universal corpus are extracted,
morphological analysis is combined, targeted malicious prompt samples can be constructed, the diversity and authenticity of a Mongolian safety
evaluation data set are enhanced, candidate malicious prompt samples are optimized by adopting a
genetic algorithm, and the safety evaluation accuracy of the Mongolian safety
evaluation data set is improved. According to the method, the expansion sample is enabled to better conform to
syntax and semantic rules of the Mongolian, effectiveness of the
attack sample in the Mongolian scene is ensured, the expansion
data set is enhanced by using the
antagonism generation strategy, robustness and
antagonism of the
data set are improved,
attack behaviors possibly occurring in a real scene can be simulated, and the robustness and the
antagonism of the data set are improved. Therefore, an effective sample generation tool is provided for safety evaluation in a Mongolian scene, and the anti-
attack capability of the Mongolian model is improved.