Theft attack behavior detection method and device, equipment and storage medium

By conducting topic and logical continuity analysis on the large language model user dialogue data, combined with sliding window updates, the theft attack behavior is detected, which solves the problem that traditional technology is difficult to effectively detect the theft attack, and significantly enhances the security of the large language model.

CN119357952AActive Publication Date: 2025-01-24SHENZHEN DIBO ENTERPRISE RISK MANAGEMENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411900875.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-01-24
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

When facing theft attacks of malicious users, traditional access control and encryption technologies are difficult to effectively detect, resulting in the leakage of core intellectual property rights and economic losses of the model.

Method used

By performing the theme of the historical dialogue data between the user and the big language model, the theme is like graive and the logical continuity is likelihood, and the dialog data is updated in combination with the sliding window method to detect the stolen attack behavior.

Benefits of technology

Effectively enhance the security of large language models, can identify and identify the stealing attacks of users, and prevent the leakage of intellectual property rights and economic losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357952A_ABST
    Figure CN119357952A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of natural language processing, and discloses a stealing attack behavior detection method and device, equipment and a storage medium. The method comprises the steps of obtaining historical dialogue data between a user and a large language model; performing topic correlation likelihood estimation on the dialogue content data to obtain a topic likelihood estimation result representing topic correlation intensity between the dialogue content data; performing logical continuity likelihood estimation on the dialogue content data to obtain a logical likelihood estimation result representing logical continuity strength among the dialogue content data; performing joint estimation on the subject likelihood estimation result and the logic likelihood estimation result to obtain a joint estimation result representing subject correlation strength and logic continuity strength between the dialogue content data; and analyzing a joint estimation result to detect a stealing attack behavior. According to the embodiment of the invention, the stealing attack behavior can be detected according to the theme and logic of the dialogue content, and the security of the large language model is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of natural language processing technology, and in particular to a theft attack behavior detection method, device, equipment and storage medium. Background Art

[0002] Large language models are deep learning models trained on huge data sets to understand human language. However, when malicious users repeatedly interact with the model and ask different questions, they can gradually infer the model's structure and function, thereby obtaining the model's core intellectual property. This theft attack not only threatens the company's technical secrets, but may also lead to intellectual property leakage and even significant economic losses.

[0003] In related technologies, defense mechanisms for large language models mainly focus on traditional access control and encryption technologies. However, malicious users can simulate the conversation behavior of ordinary users, constantly ask questions to the model, and use the characteristics of model conversation generation to obtain information and infer the internal mechanism of the model. For example, they can disguise themselves through daily template conversations to evade the monitoring of traditional detection mechanisms, which greatly affects the security of large language models. Summary of the invention

[0004] The purpose of this application is to provide a theft attack behavior detection method, device, equipment and storage medium, which can detect theft attack behavior according to the topic and logic of the conversation content and enhance the security of large language models.

[0005] The present invention provides a method for detecting a theft attack, including: Acquire historical conversation data between the user and the large language model; the historical conversation data includes multiple rounds of conversation content data; Performing topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data; Performing logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result representing the strength of logical continuity between the conversation content data; Jointly estimating the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic correlation strength and the logical continuity strength between the conversation content data; The joint estimation result is analyzed to detect theft attack behavior.

[0006] In some embodiments, the theft attack behavior detection method further includes: The historical conversation data is updated by adopting a sliding window method, so as to add the latest conversation data to the historical conversation data and remove part of the earliest conversation data.

[0007] In some embodiments, the performing topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data includes: splicing the historical conversation data and a preset first prompt word to obtain first spliced ​​data; Inputting the first concatenated data into the large language model to perform topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation probability distribution of the large language model; According to the topic likelihood estimation probability distribution, the probability that the topic correlation strength between each of the conversation content data is less than a preset topic correlation strength threshold is calculated to obtain the topic likelihood estimation result.

[0008] In some embodiments, the performing logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result characterizing the strength of logical continuity between the conversation content data includes: splicing the historical conversation data and a preset second prompt word to obtain second spliced ​​data; Inputting the second concatenated data into the large language model to perform a logical continuity likelihood estimation on the conversation content data to obtain a logical continuity estimation probability distribution of the large language model; According to the logical continuity estimation probability distribution, the probability that the logical continuity strength between each of the conversation content data is less than a preset logical continuity strength threshold is used to obtain the logical likelihood estimation result.

[0009] In some embodiments, the jointly estimating the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result characterizing the topic correlation strength and the logical continuity strength between the historical conversation data includes: Based on the topic likelihood estimation result and the logical likelihood estimation result, the probability that the topic correlation strength between the conversation content data is less than a preset topic correlation strength threshold and the logical continuity strength between each conversation content data is less than a preset logical continuity strength threshold is calculated to obtain the joint estimation result.

[0010] In some embodiments, analyzing the joint estimation result to detect theft attack behavior includes: According to the joint estimation result, it is determined whether the joint estimation probability exceeds a preset probability threshold; the joint estimation probability is the probability that the topic correlation strength between the conversation content data is less than a preset topic correlation strength threshold and the logical continuity strength between each of the conversation content data is less than a preset logical continuity strength threshold; If it exceeds, a prompt message is generated indicating that the theft attack behavior is detected; If it does not exceed the limit, a prompt message is generated indicating that no theft attack behavior is detected.

[0011] In some embodiments, analyzing the joint estimation result to detect theft attack behavior further includes: Get prompt information generated at multiple different times within a preset time period; When the number of the prompt information of the detected theft attack behavior exceeds a preset number threshold, it is determined that the attack behavior exists.

[0012] The present application also provides a theft attack behavior detection device, including: The first module is used to obtain historical conversation data between the user and the large language model; the historical conversation data includes multiple rounds of conversation content data; The second module is used to perform topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data; The third module is used to perform a logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result representing the strength of the logical continuity between the conversation content data; A fourth module is used to jointly estimate the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic correlation strength and the logical continuity strength between the conversation content data; The fifth module is used to analyze the joint estimation result to detect theft attack behavior.

[0013] An embodiment of the present application further provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned theft attack behavior detection method when executing the computer program.

[0014] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and is characterized in that when the computer program is executed by a processor, the above-mentioned theft attack behavior detection method is implemented.

[0015] The beneficial effects of the present application are as follows: by performing topic relevance likelihood estimation and logical continuity likelihood estimation on historical conversation data between a user and a large language model, a topic likelihood estimation result representing the topic relevance strength between conversation content data and a logical likelihood estimation result representing the logical continuity strength between conversation content data are obtained, and by jointly estimating the topic likelihood estimation result and the logical likelihood estimation result, a joint estimation result representing the topic relevance strength and the logical continuity strength between conversation content data is obtained, and then theft attack behavior is detected based on the joint estimation result. Since the topic likelihood estimation result and the logical likelihood estimation result between each round of conversation content data in the historical conversation data are used as the basis for detecting theft attack behavior, it is possible to identify whether the user's behavior is malicious for theft attack, thereby enhancing the security of the large language model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 It is a flow chart of the theft attack behavior detection method provided in an embodiment of the present application.

[0017] Figure 2 It is a flowchart of the specific method of step S102 provided in an embodiment of the present application.

[0018] Figure 3 It is a flowchart of the specific method of step S103 provided in an embodiment of the present application.

[0019] Figure 4 It is a flowchart of the specific method of step S105 provided in an embodiment of the present application.

[0020] Figure 5 It is a structural diagram of the theft attack behavior detection device provided in an embodiment of the present application.

[0021] Figure 6 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0022] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0023] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown can be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second" and the like in the specification, claims and drawings are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0025] Figure 1 is a flow chart of the theft attack behavior detection method provided by the embodiment of the present application. Figure 1 In some embodiments, the method may include but is not limited to steps S101 to S105.

[0026] It should be noted that the execution subject of the theft attack behavior detection method provided in the embodiments of this specification can be applied to terminal-side devices or cloud-side devices, and this embodiment does not limit this.

[0027] Step S101, obtaining historical conversation data between the user and the large language model.

[0028] The execution entity can obtain historical conversation data between the user and the large language model.

[0029] The historical conversation data includes multiple rounds of conversation content data between the user and the large language model. Each round of conversation content data consists of question data input by the user and answer data replied by the large language model. The historical conversation data is updated as the user interacts with the large language model.

[0030] In some embodiments, the theft attack behavior detection method further includes the following steps: using a sliding window method to update the historical conversation data to add the latest conversation data to the historical conversation data and remove some of the earliest conversation data.

[0031] By adopting the sliding window method to update the historical conversation data, the timeliness of the historical conversation data can be ensured. In the specific implementation, when new conversation content data is generated, the earliest conversation round will be removed to keep the number of conversation content data in the historical conversation data constant, thereby ensuring that the analyzed historical conversation data can accurately reflect the user's most recent interactive behavior. More specifically, the number of conversation content data in the historical conversation data has an important impact on the accuracy and efficiency of the detection. The historical conversation data can be set to include 20 rounds of conversation content data to achieve a balance between retaining sufficient context information and controlling computational complexity. In order to optimize storage and processing efficiency, the execution entity can only retain the currently acquired historical conversation data, and the previously acquired historical conversation data will be automatically cleared to ensure the analysis of the latest user behavior.

[0032] Step S102, performing topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data.

[0033] In a specific implementation, it is possible to first extract keywords from each round of conversation content data in the historical conversation data, and then determine the similarity between each keyword of each round of conversation content data. Based on the similarity between each keyword of each round of conversation content data, obtain the topic correlation strength distribution that characterizes the conversation content data, and then obtain the corresponding topic likelihood estimation result based on the topic correlation strength distribution.

[0034] Figure 2 is a flowchart of the specific method of step S102 provided in the embodiment of the present application. Figure 2 In some embodiments, the method includes but is not limited to steps S201 to S203.

[0035] Step S201, splicing historical conversation data and a preset first prompt word to obtain first spliced ​​data.

[0036] In a specific implementation, the historical conversation data and the preset first prompt word are spliced ​​according to a preset format to form a corresponding data sequence to obtain first spliced ​​data.

[0037] Exemplarily, the concatenation may be performed in the order of historical conversation data first and the first prompt word later, and the first prompt word may be "Please read the above historical conversation data to determine whether the topics of the conversation content data of each round are related. If the topics of most conversation rounds are related to each other, please answer "related"; if the topics of the conversation rounds are constantly changing and unrelated, please answer "unrelated.".

[0038] Step S202: input the first concatenated data into a large language model to perform topic relevance likelihood estimation on the conversation content data, and obtain a topic likelihood estimation probability distribution of the large language model.

[0039] In a specific implementation, the large language model obtains the first spliced ​​data, extracts topics for each round of conversation content data in the historical conversation data according to the instruction of the first prompt word, and performs similarity evaluation on the topics of each extracted conversation content data to obtain a topic similarity evaluation result, and then determines the topic similarity distribution between each round of conversation content data based on the topic similarity evaluation result, that is, the topic correlation intensity distribution, and then determines the topic likelihood estimation probability distribution of the large language model based on the topic correlation intensity distribution.

[0040] It can be understood that the topic likelihood estimation probability distribution of the large language model includes the similarity probability between the topics of each conversation content data, and the probability value of the similarity probability is positively correlated with the topic correlation strength between the conversation content data. The large language model processes the topic likelihood estimation probability distribution and outputs the corresponding topic similarity evaluation result, which may be a topic similarity evaluation result related to the topics of each conversation content data, or it may be a topic similarity evaluation result unrelated to the topics of each conversation content data.

[0041] Step S203, based on the topic likelihood estimation probability distribution, calculate the probability that the topic correlation strength between each conversation content data is less than a preset topic correlation strength threshold, and obtain a topic likelihood estimation result.

[0042] In a specific implementation, a likelihood estimation function is introduced to estimate the topic likelihood estimation probability distribution of the large language model, so as to calculate the probability that the large language model determines that each conversation content data is topic-related and the probability that the large language model determines that each conversation content data is topic-irrelevant in the topic likelihood estimation probability distribution of the large language model, wherein the probability that the large language model determines that each conversation content data is topic-related refers to the probability that the topic correlation strength between each conversation content data is not less than a preset topic correlation strength threshold, and the probability that the large language model determines that each conversation content data is topic-irrelevant refers to the probability that the topic correlation strength between each conversation content data is less than a preset topic correlation strength threshold, and the topic likelihood estimation result is obtained according to the probability that the topic correlation strength between each conversation content data is less than the preset topic correlation strength threshold.

[0043] Step S103, performing logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result representing the strength of logical continuity between the conversation content data.

[0044] In a specific implementation, the context semantics of each round of conversation content data in the historical conversation data may be first extracted, and then the correlation strength between the context semantic features of each round of conversation content data is determined. According to the correlation strength between the context semantic features of each round of conversation content data, the logical continuity strength distribution characterizing the conversation content data is obtained, and then the corresponding logical likelihood estimation result is obtained according to the logical continuity strength distribution.

[0045] Figure 3 is a flowchart of the specific method of step S103 provided in the embodiment of the present application. Figure 3 In some embodiments, the method includes but is not limited to steps S301 to S303.

[0046] Step S301, splicing the historical conversation data and the preset second prompt word to obtain second spliced ​​data.

[0047] In a specific implementation, the historical conversation data and the preset second prompt words are spliced ​​according to a preset format to form a corresponding data sequence to obtain second spliced ​​data.

[0048] Exemplarily, the historical conversation data may be spliced ​​in the order of first and second prompt words in the second order, and the second prompt words may be "Please read the following historical conversation data to determine whether there is logical continuity between the content data of each round of conversation. That is, determine whether each round of conversation can carry forward the content of the previous round and start a discussion, rather than just repeating questions around the same topic. If there is a relationship of continuity between each round of conversation, please answer "there is continuity"; if there is no relationship of continuity between each round of conversation, please answer "there is no continuity.".

[0049] Step S302: input the second concatenated data into the large language model to perform logical continuity likelihood estimation on the conversation content data, and obtain the logical continuity estimation probability distribution of the large language model.

[0050] In a specific implementation, the large language model obtains the second spliced ​​data, performs context semantic extraction on the content data of each round of conversation in the historical conversation data according to the instruction of the second prompt word, and performs relevance evaluation on the context semantic features of the extracted content data of each conversation to obtain a context relevance evaluation result, and then determines the logical continuity similarity distribution between each round of conversation content data according to the context relevance evaluation result, that is, the logical continuity correlation intensity distribution, and then determines the logical continuity likelihood estimation probability distribution of the large language model according to the logical continuity correlation intensity distribution.

[0051] It can be understood that the logical continuity likelihood estimation probability distribution of the large language model includes the correlation probability between the contextual semantic features of each dialogue content data, and the probability value of the correlation probability is positively correlated with the correlation strength between the dialogue content data. The large language model processes the logical continuity likelihood estimation probability distribution and outputs the corresponding context correlation evaluation result, which may be the context correlation evaluation result that there is logical continuity between the dialogue content data, or it may be the context correlation evaluation result that there is no logical continuity between the dialogue content data.

[0052] Step S303, according to the probability distribution of logical continuity estimation, the probability that the logical continuity strength between each dialogue content data is less than a preset logical continuity strength threshold is obtained to obtain a logical likelihood estimation result.

[0053] In a specific implementation, a likelihood estimation function is introduced to estimate the probability distribution of logical continuity estimation of the large language model, so as to calculate the probability that the large language model determines that each dialogue content data has logical continuity and the probability that the large language model determines that each dialogue content data does not have logical continuity in the probability distribution of logical continuity estimation of the large language model, wherein the probability that the large language model determines that each dialogue content data has logical continuity refers to the probability that the logical continuity strength between each dialogue content data is not less than a preset logical continuity strength threshold, and the probability that the large language model determines that each dialogue content data does not have logical continuity refers to the probability that the logical continuity strength between each dialogue content data is less than a preset logical continuity strength threshold, and the logical likelihood estimation result is obtained according to the probability that the logical continuity strength between each dialogue content data is less than the preset logical continuity strength threshold.

[0054] Step S104, jointly estimate the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic correlation strength and the logical continuity strength between the conversation content data.

[0055] In some embodiments, step S104 includes the following steps: based on the topic likelihood estimation results and the logical likelihood estimation results, calculating the probability that the topic correlation strength between each conversation content data is less than a preset topic correlation strength threshold and the logical continuity strength between each conversation content data is less than a preset logical continuity strength threshold, and obtaining a joint estimation result.

[0056] In a specific embodiment, the product of the probability that the topic correlation strength between each conversation content data is less than a preset topic correlation strength threshold and the probability that the logical continuity strength between each conversation content data is less than a preset logical continuity strength threshold is calculated to obtain a joint estimation result. The joint estimation result includes a joint estimation probability, which is the probability that the topic correlation strength between the conversation content data is less than the preset topic correlation strength threshold and the logical continuity strength between the conversation content data is less than the preset logical continuity strength threshold.

[0057] It can be understood that the embodiment of the present application uses the probability that the subject correlation strength between each conversation content data is less than the preset subject correlation strength threshold and the logical continuity strength between each conversation content data is less than the preset logical continuity strength threshold as the basis for detecting the theft attack behavior. Specifically, if the subject correlation strength between each round of conversation content data is not less than the preset subject correlation strength threshold and the logical continuity strength between each round of conversation content data is not less than the preset logical continuity strength threshold, that is, the conversation between the user and the large language model is subject-related and there is logical continuity, then it is considered that the historical conversation data constituted conforms to the normal human communication mode and belongs to normal user behavior, rather than malicious theft attack behavior. On the contrary, if the subject correlation strength between each round of conversation content data is less than the preset subject correlation strength threshold and the logical continuity strength between each round of conversation content data is less than the preset logical continuity strength threshold, that is, the conversation between the user and the large language model is irrelevant to the subject and there is no logical continuity, then it is considered that the historical conversation data constituted does not conform to the normal human communication mode and does not belong to normal user behavior, but to malicious theft attack behavior. The reason is that normal users usually have clear purposes or topics when talking to the big model, and the content of the conversation will have a certain logical coherence. Even in the case of casual chatting, the communication between normal users can often maintain a certain degree of topic relevance and logical continuity. The main purpose of malicious users is to obtain as much knowledge or data as possible from the big language model. To achieve this goal, they will try to use various different inputs to trigger the big language model to output as much information as possible, and these inputs may not have actual topics or logical continuity.

[0058] Step S105: analyzing the joint estimation result to detect theft attack behavior.

[0059] Figure 4 is a flowchart of the specific method of step S105 provided in the embodiment of the present application. Figure 4 In some embodiments, the method includes but is not limited to steps S401 to S403.

[0060] Step S401, judging whether the joint estimation probability exceeds a preset probability threshold according to the joint estimation result. If it exceeds, executing step S402; if it does not exceed, executing step S403.

[0061] The joint estimation probability is the probability that the topic correlation strength between the conversation content data is less than a preset topic correlation strength threshold and the logic continuity strength between the conversation content data is less than a preset logic continuity strength threshold.

[0062] Preferably, the probability threshold is set to 0.7.

[0063] Step S402, generating prompt information that a theft attack behavior is detected; Step S403: Generate prompt information indicating that no theft attack behavior is detected.

[0064] In some embodiments, step S105 further includes the following steps: obtaining prompt information generated at multiple different times within a preset time period; and determining that an attack behavior exists when the number of prompt information of theft attack behavior detected exceeds a preset number threshold.

[0065] In a specific implementation, it may be possible to determine at different moments within a preset time period whether the joint estimated probability exceeds a preset probability threshold to generate multiple prompt messages. If the number of prompt messages indicating theft attack behaviors is detected exceeds a preset number threshold, it is determined that an attack behavior exists and an alarm is triggered.

[0066] See also Figure 5 The present application also provides a stealing attack behavior detection device, which can implement the above-mentioned stealing attack behavior detection method, and the device includes: The first module 501 is used to obtain historical conversation data between the user and the large language model; the historical conversation data includes multiple rounds of conversation content data; The second module 502 is used to perform topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data; The third module 503 is used to perform logic continuity likelihood estimation on the conversation content data to obtain a logic likelihood estimation result representing the strength of logic continuity between the conversation content data; The fourth module 504 is used to jointly estimate the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic correlation strength and the logical continuity strength between the conversation content data; The fifth module 505 is used to analyze the joint estimation result to detect theft attack behavior.

[0067] The specific implementation of the theft attack behavior detection device is basically the same as the specific implementation of the theft attack behavior detection method described above, and will not be repeated here.

[0068] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment.

[0069] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present disclosure is described. Figure 6 The electronic device 600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0070] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0071] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present disclosure described in the above-mentioned theft attack behavior detection method part of this specification.

[0072] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .

[0073] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0074] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.

[0075] The electronic device 600 may also communicate with one or more external devices 600' (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0076] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned theft attack behavior detection method is implemented.

[0077] The stealing attack behavior detection method, device, equipment and storage medium provided in the embodiment of the present application perform topic relevance likelihood estimation and logical continuity likelihood estimation on the historical conversation data between the user and the large language model to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data and a logical likelihood estimation result representing the logical continuity strength between the conversation content data, and perform joint estimation on the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic relevance strength and the logical continuity strength between the conversation content data, and then detect the stealing attack behavior based on the joint estimation result. Since the topic likelihood estimation result and the logical likelihood estimation result between each round of conversation content data in the historical conversation data are used as the basis for detecting the stealing attack behavior, it is possible to identify whether the user's behavior is malicious for theft attack, thereby enhancing the security of the large language model.

[0078] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the implementation of the present disclosure.

[0079] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0080] Computer readable storage media may include data signals propagated in baseband or as part of a carrier wave, wherein readable program codes are carried. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program codes contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.

[0081] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.

[0082] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.

Claims

1. A theft attack behavior detection method, characterized in that: include: Obtain historical conversation data between users and large language models; The historical conversation data includes multiple rounds of conversation content data; Performing topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data; Performing logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result representing the strength of logical continuity between the conversation content data; Jointly estimating the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic correlation strength and the logical continuity strength between the conversation content data; The joint estimation result is analyzed to detect theft attack behavior.

2. The theft attack behavior detection method according to claim 1, characterized in that: The theft attack behavior detection method further includes: The historical conversation data is updated by adopting a sliding window method, so as to add the latest conversation data to the historical conversation data and remove part of the earliest conversation data.

3. The theft attack behavior detection method according to claim 1, characterized in that: The performing of topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data includes: splicing the historical conversation data and a preset first prompt word to obtain first spliced ​​data; Inputting the first concatenated data into the large language model to perform topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation probability distribution of the large language model; According to the topic likelihood estimation probability distribution, the probability that the topic correlation strength between each of the conversation content data is less than a preset topic correlation strength threshold is calculated to obtain the topic likelihood estimation result.

4. The theft attack behavior detection method according to claim 1, characterized in that: The performing logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result characterizing the logical continuity strength between the conversation content data includes: splicing the historical conversation data and a preset second prompt word to obtain second spliced ​​data; Inputting the second concatenated data into the large language model to perform a logical continuity likelihood estimation on the conversation content data to obtain a logical continuity estimation probability distribution of the large language model; According to the logical continuity estimation probability distribution, the probability that the logical continuity strength between each of the conversation content data is less than a preset logical continuity strength threshold is used to obtain the logical likelihood estimation result.

5. The theft attack behavior detection method according to claim 1, characterized in that: The jointly estimating the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result characterizing the topic correlation strength and the logical continuity strength between the historical conversation data includes: Based on the topic likelihood estimation result and the logical likelihood estimation result, the probability that the topic correlation strength between the conversation content data is less than a preset topic correlation strength threshold and the logical continuity strength between each conversation content data is less than a preset logical continuity strength threshold is calculated to obtain the joint estimation result.

6. The theft attack behavior detection method according to claim 1, characterized in that: The analyzing the joint estimation result to detect the theft attack behavior includes: According to the joint estimation result, judging whether the joint estimation probability exceeds a preset probability threshold; the joint estimation probability is the probability that the topic correlation strength between the conversation content data is less than a preset topic correlation strength threshold and the logic continuity strength between each of the conversation content data is less than a preset logic continuity strength threshold; If it exceeds, a prompt message is generated indicating that the theft attack behavior is detected; If it does not exceed the limit, a prompt message is generated indicating that no theft attack behavior is detected.

7. The theft attack behavior detection method according to claim 6, characterized in that: The analyzing the joint estimation result to detect the theft attack behavior also includes: Get prompt information generated at multiple different times within a preset time period; When the number of the prompt information of the detected theft attack behavior exceeds a preset number threshold, it is determined that the attack behavior exists.

8. A theft attack behavior detection device, characterized in that: include: The first module is used to obtain historical conversation data between users and the large language model; The historical conversation data includes multiple rounds of conversation content data; The second module is used to perform topic relevance likelihood estimation on the conversation content data to obtain a topic likelihood estimation result representing the topic relevance strength between the conversation content data; The third module is used to perform a logical continuity likelihood estimation on the conversation content data to obtain a logical likelihood estimation result representing the strength of the logical continuity between the conversation content data; A fourth module is used to jointly estimate the topic likelihood estimation result and the logical likelihood estimation result to obtain a joint estimation result representing the topic correlation strength and the logical continuity strength between the conversation content data; The fifth module is used to analyze the joint estimation result to detect theft attack behavior.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the theft attack behavior detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the theft attack behavior detection method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for estimating relationships between topics, and system

    CN104239385A

  • Method and device for evaluating language logicality of interviewer

    CN116522956A

  • Prompt word attack detection method and device for large language model

    CN118445815A