The invention discloses a
large model adaptive security detection method and
system based on four-order linkage, and the method achieves the security detection of the output content of a
large model through four-stage collaborative linkage: in the context consistency reasoning stage, calculating the
semantic consistency score of a generated text, a multi-round dialogue history, a user prompt word and an external
knowledge base; marking a
potential risk; in the causal chain
risk detection stage, modeling multiple rounds of dialogues into a causal graph, calculating a risk path probability, matching an
attack pattern
library, and marking high risks; in the dynamic game optimization stage, a
game space of a
detector and an attacker is constructed, an optimal
detection threshold value is solved, and parameters of each stage are linked and updated; in the cycle
state switching stage, switching is carried out between a low-power-consumption monitoring state and a dynamic updating state according to
system performance and a risk situation, and a
risk level is output by integrating results of the four stages. According to the method, the problems of low hidden
attack detection rate, high
false alarm, risk non-
traceability and resource waste in the prior art are solved, and self-adaption, low
false alarm,
traceability, high efficiency and
energy conservation are realized.