The invention relates to a question and answer model training method and device, a question and answer method and device,
computer equipment, a computer readable storage medium and a
computer program product. The method comprises the steps that a
training set is constructed, and cue words of a first category with a known
attack category
label and cue words of a second category with an unknown
attack category
label are arranged in the
training set; training an initial reward model according to the cue word to obtain a reward model which is used for outputting a reward
signal; inputting the cue word into the large
language model, outputting to obtain predicted reply data, and inputting the predicted reply data and the cue word into a reward model to obtain a reward
signal for the predicted reply data; and determining an updating strategy of the large
language model according to the reward
signal of the predicted reply data, and updating the large
language model based on the updating strategy to obtain a trained question and answer model. By adopting the method, the recognition precision of the question and answer model for known
attack types can be improved, and the omission ratio for unknown attack types can be reduced.