Infringement detection method, system, device and medium based on context learning examples
By directly inputting example prefixes and neighbor prefixes into a large language model for infringement detection, the problem of insufficient stability and accuracy in existing technologies is solved, and more efficient infringement detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, when performing infringement detection on context-learned examples in large language models, it is necessary to access the internal parameters of the model, resulting in low stability and accuracy of example infringement detection.
By traversing the private context learning example library, neighbor prefix text is generated and input into a large language model for detection, avoiding access to the model's internal parameters and directly using example prefixes and neighbor prefixes for infringement detection.
This improves the stability and accuracy of example infringement detection, avoiding instability and low accuracy issues caused by accessing internal model parameters.
Smart Images

Figure CN120930630B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of infringement detection technology, and in particular relates to an infringement detection method, system, device and medium based on context learning examples. Background Technology
[0002] With the rapid development of artificial intelligence technology, large language models have attracted much attention due to their powerful context learning capabilities. Large language models can complete new reasoning tasks based on a limited number of given examples by analyzing contextual information, without requiring additional fine-tuning. The Data Protection Centre explicitly advocates that large language models should only be trained on text data intended for public use to protect data privacy; however, some large language models still steal private text data for training. Furthermore, current technologies for infringement detection using context-learned examples from large language models require access to the model's internal parameters. If these internal parameters are incorrect, the accuracy of example infringement detection will be low, thus compromising the stability of example infringement detection.
[0003] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0004] The main objective of this invention is to provide a method, system, device, and medium for infringement detection based on contextual learning examples, aiming to solve the technical problem of how to improve the stability and accuracy of example infringement detection.
[0005] To achieve the above objectives, the present invention provides an infringement detection method based on context-learning examples, the infringement detection method based on context-learning examples comprising:
[0006] Iterate through multiple context learning example samples in the private context learning example library, and use the currently iterated context learning example sample as the context learning example sample to be detected;
[0007] Based on the example prefix text corresponding to the example sample in the context to be detected, a preset number of neighbor prefix texts are generated;
[0008] The example prefix text and the preset number of neighbor prefix texts are respectively input into the large language model so that the large language model outputs multiple context learning prediction examples, and calculates the similarity deviation based on the multiple context learning prediction examples and the context learning example sample to be detected;
[0009] After the traversal is completed, the output content of the large language model is subjected to example infringement detection based on the similarity deviation of example samples learned from each context.
[0010] Optionally, the step of generating a preset number of neighbor prefix texts based on the example prefix text corresponding to the example sample learned from the context to be detected includes:
[0011] The example prefix text corresponding to the context learning example sample to be detected is segmented to determine multiple example prefix segmentation;
[0012] Construct example prefix embedding vectors based on word segmentation of multiple example prefixes;
[0013] The example prefix embedding vector is subjected to Dropout processing, and a preset number of neighbor prefix texts are generated using the BERT model based on the mask embedding vector after Dropout processing.
[0014] Optionally, the step of generating a preset number of neighbor prefix texts using the BERT model based on the mask embedding vector processed by Dropout includes:
[0015] Based on the mask embedding vector processed by Dropout, multiple synonymous prefix word segments are predicted using the BERT model.
[0016] Based on the example prefix text, multiple alternative prefix texts are generated by segmenting multiple alternative prefixes, and the multiple alternative prefix texts are vectorized respectively to obtain multiple alternative prefix embedding vectors;
[0017] The example prefix embedding vector is compared with each alternative prefix embedding vector to calculate the alternative prediction score for each alternative prefix text.
[0018] Based on the homonymous prediction score of each homonymous prefix text, a preset number of neighboring prefix texts are selected from multiple homonymous prefix texts.
[0019] Optionally, the step of generating multiple alternative prefix texts based on the example prefix text according to multiple alternative prefix word segmentation includes:
[0020] Based on the example prefix text, multiple synonym prefix segments and multiple example prefix segments are replaced according to the preset segmentation replacement rules to generate multiple synonym prefix texts.
[0021] Optionally, the step of selecting a preset number of neighboring prefix texts from multiple synonymous prefix texts based on the synonymous prediction score corresponding to each synonymous prefix text includes:
[0022] Sort the predicted scores of each text with the same prefix from high to low to obtain the prediction score ranking result.
[0023] Based on the predicted score ranking results, a preset number of neighboring prefix texts are selected from multiple texts with the same prefix.
[0024] Optionally, the step of calculating the similarity deviation based on multiple context-learned prediction examples and the context-learned example sample to be detected includes:
[0025] Multiple context learning prediction examples are converted into corresponding prediction example embedding vectors, and the detection example embedding vector corresponding to the context learning example sample to be detected is determined.
[0026] The similarity between the embedding vector of the example to be detected and the embedding vector of each predicted example is calculated.
[0027] Similarity bias is calculated by learning the similarity of predicted examples from multiple contexts.
[0028] Optionally, the step of performing example infringement detection on the output content of the large language model based on the similarity deviation of example samples learned from each context includes:
[0029] Determine whether the similarity deviation of each context learning example sample is within the preset similarity threshold range;
[0030] If so, select context learning example similar samples from multiple context learning example samples whose similarity deviation is within the preset similarity threshold range, and determine the sample example similarity of the context learning example similar samples;
[0031] The sample example similarity ratio is calculated based on the number of similar sample examples and the total number of sample examples in the private context learning example library;
[0032] Based on the sample example similarity ratio, the output content of the large language model is subjected to example infringement detection.
[0033] Furthermore, to achieve the above objectives, the present invention also proposes an infringement detection system based on context-learning examples, wherein the infringement detection system based on context-learning examples includes:
[0034] The traversal module is used to traverse multiple context learning example samples in the private context learning example library and use the currently traversed context learning example sample as the context learning example sample to be detected.
[0035] The generation module is used to generate a preset number of neighbor prefix texts based on the example prefix texts corresponding to the example samples learned from the context to be detected.
[0036] The calculation module is used to input the example prefix text and the preset number of neighbor prefix texts into the large language model, so that the large language model outputs multiple context learning prediction examples, and calculates the similarity deviation based on the multiple context learning prediction examples and the context learning example sample to be detected;
[0037] The detection module is used to perform example infringement detection on the output content of the large language model after the traversal is completed, based on the similarity deviation of example samples learned from each context.
[0038] Furthermore, to achieve the above objectives, the present invention also proposes an infringement detection device based on context learning examples, the device comprising: a memory, a processor, and an infringement detection program based on context learning examples stored in the memory and executable on the processor, the infringement detection program based on context learning examples being configured to implement the steps of the infringement detection method based on context learning examples as described above.
[0039] Furthermore, to achieve the above objectives, the present invention also proposes a medium storing an infringement detection program based on context-learning examples, wherein the infringement detection program based on context-learning examples, when executed by a processor, implements the steps of the infringement detection method based on context-learning examples as described above.
[0040] This invention first traverses multiple context learning example samples within a private context learning example library, using the currently traversed context learning example sample as the context learning example sample to be detected. Then, it generates a preset number of neighbor prefix texts based on the example prefix text corresponding to the context learning example sample to be detected. Next, the example prefix texts and the preset number of neighbor prefix texts are input into a large language model, causing the large language model to output multiple context learning prediction examples. A similarity deviation is calculated based on the multiple context learning prediction examples and the context learning example sample to be detected. Finally, after the traversal is complete, example infringement detection is performed on the output content of the large language model based on the similarity deviation of each context learning example sample. Compared to existing technologies that require access to internal model parameters and analyze these parameters for infringement detection, which cannot guarantee the stability and accuracy of example infringement detection, this invention directly inputs the example prefix and neighbor prefixes into the large language model, allowing the output examples to directly participate in the algorithm's infringement detection process without accessing internal model parameters, thus improving the stability and accuracy of example infringement detection. Attached Figure Description
[0041] Figure 1 This is a schematic diagram of the structure of an infringement detection device based on a context learning example of the hardware operating environment involved in the embodiments of the present invention;
[0042] Figure 2 This is a flowchart illustrating the first embodiment of the infringement detection method based on context learning examples of the present invention;
[0043] Figure 3 This is a schematic diagram of the overall detection process of the context learning example sample in the first embodiment of the infringement detection method based on context learning examples of the present invention;
[0044] Figure 4 This is a structural block diagram of the first embodiment of the infringement detection system based on context learning examples of the present invention.
[0045] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0046] It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention.
[0047] Reference Figure 1 , Figure 1 This is a schematic diagram of the infringement detection device structure, which is an example of a context-learning-based hardware operating environment involved in the embodiments of the present invention.
[0048] like Figure 1 As shown, the infringement detection device based on context learning can include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. The communication bus 1002 is used to enable communication between these components. The user interface 1003 can include a display screen or an input unit such as a keyboard; optionally, the user interface 1003 can also include a standard wired interface or a wireless interface. The network interface 1004 can optionally include a standard wired interface or a wireless interface (such as a Wireless-Fidelity (Wi-Fi) interface). The memory 1005 can be high-speed random access memory (RAM) or stable non-volatile memory (NVM), such as a disk drive. Optionally, the memory 1005 can also be a storage system independent of the aforementioned processor 1001.
[0049] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the infringement detection device based on context learning examples, and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0050] like Figure 1 As shown, the memory 1005, which serves as a medium, may include an operating system, a network communication module, a user interface module, and an infringement detection program based on context learning examples.
[0051] exist Figure 1 In the infringement detection device based on the context learning example shown, the network interface 1004 is mainly used for data communication with the network server; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the infringement detection device based on the context learning example of the present invention can be set in the infringement detection device based on the context learning example. The infringement detection device based on the context learning example calls the infringement detection program based on the context learning example stored in the memory 1005 through the processor 1001 and executes the infringement detection method based on the context learning example provided in the embodiment of the present invention.
[0052] This invention provides an infringement detection method based on context learning examples, referring to... Figure 2 , Figure 2 This is a flowchart illustrating the first embodiment of the infringement detection method based on context learning examples of the present invention.
[0053] In this embodiment, the infringement detection method based on context learning examples includes the following steps:
[0054] Step S10: Traverse multiple context learning example samples in the private context learning example library, and use the currently traversed context learning example sample as the context learning example sample to be detected.
[0055] It is easy to understand that the execution subject of this embodiment can be an infringement detection system based on context learning examples with functions such as data processing, network communication and program execution, or other computer devices with similar functions. This embodiment does not limit it.
[0056] It should also be noted that Large Language Models (LLMs) include open-source and closed-source models, as well as general and domain-specific models, such as the Llama model (Large Language Model Meta AI), the ChatGPT model (Chat Generative Pre-trained Transformer), and the Qwen model. In this embodiment, the open-source model Llama3-8B is used as an example.
[0057] The private context learning example library includes multiple context learning example samples, which are private context learning examples designed, developed, and researched by the user. Examples of context learning example samples include:
[0058] Review: Delicious food!
[0059] Sentiment: Positive
[0060] Review: The food is awful.
[0061] Sentiment: Negative
[0062] Review: Terrible dishes!
[0063] Sentiment: Negative
[0064] In this embodiment, it is necessary to randomly or sequentially traverse multiple context learning example samples in the private context learning example library, and use the currently traversed context learning example sample as the context learning example sample to be detected. .
[0065] Step S20: Generate a preset number of neighbor prefix texts based on the example prefix text corresponding to the example sample of the learning example sample to be detected context.
[0066] Furthermore, the processing method for generating a preset number of neighbor prefix texts based on the example prefix texts corresponding to the example samples of the learning context to be detected can be to perform word segmentation processing on the example prefix texts corresponding to the example samples of the learning context to be detected using the BERT model (Bidirectional Encoder Representations from Transformers) word segmenter or based on user-preset word segmentation rules to determine multiple example prefix word segments; construct example prefix embedding vectors based on multiple example prefix word segments; perform dropout processing on the example prefix embedding vectors; and generate a preset number of neighbor prefix texts based on the mask embedding vectors after dropout processing through the mask prediction module of the BERT model.
[0067] In this embodiment, reference Figure 3 , Figure 3 This is a schematic diagram of the overall process for detecting context-learned example samples in the first embodiment of the infringement detection method based on context-learned examples of the present invention. It requires the word segmenter of the BERT model to process the context-learned example samples to be detected (i.e., Figure 3 Samples to be judged The text is truncated according to a preset ratio and used as the example prefix text p0 and the example suffix text.
[0068] It should be noted that the preset ratio can be customized by the user. It can be set to example prefix text: example suffix text = 1:4, or example prefix text: example suffix text = 2:3, etc.
[0069] In the specific implementation, the tokenizer of the BERT model is used to process the example prefix text. Perform word segmentation and convert to example prefix embedding vectors L is The length of the segmentation word in the BERT model is affected by the inherent characteristics of the segmenter itself. All are examples of prefix segmentation. Dimensional vector.
[0070] It should also be noted that the positions corresponding to the words undergoing synonym conversion (i.e., prefix segmentation) are marked as mask positions, i.e., the positions of the words. Each word position; the embedding vector for the mask position. Perform the Dropout operation, which involves randomly selecting an embedding vector. 30% or a preset percentage of the dimensional components are set to zero to obtain the mask embedding vector after Dropout processing. The mask prediction model of the BERT model is then used to predict the mask embedding vector after Dropout processing.
[0071] Furthermore, the process of determining a preset number of neighboring prefix texts based on the mask embedding vectors processed by Dropout using the BERT model's mask prediction module involves: predicting multiple synonymous prefix segments using the mask embedding vectors processed by Dropout; generating multiple synonymous prefix texts based on the example prefix texts and the multiple synonymous prefix segments, and performing vector transformations on each of the multiple synonymous prefix texts to obtain multiple synonymous prefix embedding vectors; calculating the synonymous prediction score for each synonymous prefix text by comparing the example prefix embedding vectors with each synonymous prefix embedding vector; and selecting a preset number of neighboring prefix texts from the multiple synonymous prefix texts based on the synonymous prediction scores for each synonymous prefix text.
[0072] The synonymous prefix segmentation can be understood as the segmentation that replaces the corresponding example prefix.
[0073] In the specific implementation, it is necessary to replace multiple synonymous prefix segments and multiple example prefix segments according to preset segmentation replacement rules based on the example prefix text to generate multiple synonymous prefix texts. Synonymous prefix texts can be represented as follows: Predicting words (i.e., replacing the original word at the corresponding position with a prefix participle) (i.e., example prefix segmentation).
[0074] The preset word segmentation replacement rule can be understood as one or more words in multiple example prefix segments in the example prefix text being replaced by the corresponding synonymous prefix segment.
[0075] The method for calculating the synonym prediction score for each synonymous prefix text by comparing the example prefix embedding vector with each synonymous prefix embedding vector is as follows:
[0076]
[0077]
[0078] Among them, let In equation (1), Example prefix embedding vector for example prefix text. For the same prefix participle Replace the prefix segmentation of the original example at the corresponding position. The proposal score, for The The result of each token being processed by Dropout For a given In the case of BERT model predicting the first Each word segment is The probability, For a given In the case of BERT model predicting the first The word is The probability of.
[0079] In equation (2), This is the embedding vector of the synonym prefix text. BERT evaluation and Contextualization represents similarity, and L represents sentence length. It is BERT's approach to sentences The Middle Contextualized representation of words, Let cosine similarity represent the similarity between vectors a and b. express From the middle The word to the 1st The average self-attention score of each word across all heads in all layers of the BERT model, used to determine its attention to... The semantic dependencies are weighted for each position;
[0080] Taking into account both scores, the equivalent prediction score is calculated using the following formula:
[0081]
[0082] in, For the same substitution prediction score, The weight of the proposal score.
[0083] In this embodiment, it is also necessary to sort the prediction scores of each synonymous prefix text from high to low to obtain the prediction score ranking result; based on the prediction score ranking result, a preset number of neighboring prefix texts are selected from multiple synonymous prefix texts. .
[0084] The preset quantity is a user-defined quantity, which can be 9, 10, etc.
[0085] Step S30: Input the example prefix text and the preset number of neighbor prefix texts into the large language model, so that the large language model outputs multiple context learning prediction examples, and calculates the similarity deviation based on the multiple context learning prediction examples and the context learning example sample to be detected.
[0086] In this embodiment, the prefix of the sample to be judged is... and its generated neighbor sample prefix Input large model Predictive completion is represented by the following formula:
[0087]
[0088] In the formula, For large language models, For prefix text, Example of context-based learning prediction.
[0089] Furthermore, the method for calculating the similarity bias based on multiple context-learning predicted examples and the context-learning example samples to be detected is as follows: convert the multiple context-learning predicted examples into corresponding predicted example embedding vectors, and determine the detected example embedding vector corresponding to the context-learning example sample to be detected; calculate the similarity between the detected example embedding vector and each predicted example embedding vector; and calculate the similarity bias based on the similarity of multiple context-learning predicted examples.
[0090] In the specific implementation, context-learning prediction examples are calculated separately. With the sample to be judged similarity It is calculated using the following formula:
[0091]
[0092] in, This represents a text encoder, used to convert samples into embedding vectors. Indicates calculation and A function of similarity.
[0093] Calculate similarity deviation It is calculated using the following formula:
[0094]
[0095] in, This represents the number of neighbor prefixes generated.
[0096] Step S40: After the traversal is completed, the output content of the large language model is subjected to example infringement detection based on the similarity deviation of the example samples learned from each context.
[0097] Furthermore, the method for detecting copyright infringement of the output content of the large language model based on the similarity deviation of each context learning example sample is as follows: determine whether the similarity deviation of each context learning example sample is within a preset similarity threshold range; if so, select context learning example similar samples whose similarity deviation is within the preset similarity threshold range from multiple context learning example samples, determine the sample example similarity of the context learning example similar samples, and calculate the sample example similarity ratio based on the sample example similarity ratio and the total number of example samples in the private context learning example library; then, perform example copyright infringement detection on the output content of the large language model based on the sample example similarity ratio.
[0098] In practical implementation, based on similarity deviation and preset similarity threshold range judge Does the context learning example sample exist in the private context learning example library? The following criteria shall be used to determine this:
[0099]
[0100] in, The result of the judgment that loading exists.
[0101] It should also be noted that, if so, the number of similar sample examples is determined, that is, the number of similar sample examples corresponding to context learning example similar samples whose similarity deviation is within the preset similarity threshold range; then, the sample example similarity ratio is calculated based on the number of similar sample examples and the total number of example samples in the private context learning example library. When the sample example similarity ratio is greater than or equal to the preset infringement threshold, it is determined that the context learning example in the large language model has infringing behavior; when the sample example similarity ratio is less than the preset infringement threshold, it is determined that the context learning example in the large language model has no infringing behavior. The preset infringement threshold can be user-defined, and can be 60%, 40%, etc.
[0102] In this embodiment, multiple context learning example samples within a private context learning example library are first traversed, and the currently traversed context learning example sample is used as the context learning example sample to be detected. Then, a preset number of neighbor prefix texts are generated based on the example prefix text corresponding to the context learning example sample to be detected. The example prefix text and the preset number of neighbor prefix texts are then input into a large language model, causing the large language model to output multiple context learning prediction examples. A similarity deviation is calculated based on the multiple context learning prediction examples and the context learning example sample to be detected. Finally, after the traversal is complete, example infringement detection is performed on the output content of the large language model based on the similarity deviation of each context learning example sample. Compared to existing technologies that require access to internal model parameters and analyze these parameters for infringement detection, which cannot guarantee the stability and accuracy of example infringement detection, this embodiment directly inputs the example prefix and neighbor prefixes into the large language model, allowing the output examples to directly participate in the algorithm's infringement detection process without accessing internal model parameters, thus improving the stability and accuracy of example infringement detection.
[0103] Reference Figure 4 , Figure 4 This is a structural block diagram of the first embodiment of the infringement detection system based on context learning examples of the present invention.
[0104] like Figure 4 As shown, the infringement detection system based on context learning examples proposed in this embodiment of the invention includes:
[0105] The traversal module 4001 is used to traverse multiple context learning example samples in the private context learning example library and use the currently traversed context learning example sample as the context learning example sample to be detected.
[0106] The generation module 4002 is used to generate a preset number of neighbor prefix texts based on the example prefix texts corresponding to the example samples learned from the context to be detected.
[0107] The calculation module 4003 is used to input the example prefix text and the preset number of neighbor prefix texts into the large language model, so that the large language model outputs multiple context learning prediction examples, and calculates the similarity deviation based on the multiple context learning prediction examples and the context learning example sample to be detected;
[0108] The detection module 4004 is used to perform example infringement detection on the output content of the large language model after the traversal is completed, based on the similarity deviation of example samples learned from each context.
[0109] Other embodiments or specific implementations of the infringement detection system based on context learning examples of the present invention can be referred to the above-described method embodiments, and will not be repeated here.
[0110] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.
[0111] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0112] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as read-only memory / random access memory, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0113] The above are merely preferred embodiments of the present invention and do not limit the scope of the patent. Any equivalent structural or procedural transformations made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the scope of patent protection of the present invention.
Claims
1. A method for detecting infringement based on context learning examples, characterized in that, The context-based learning example infringement detection method comprises the following steps: traverse a plurality of context learning example samples in a private context learning example library, and take the currently traversed context learning example sample as a context learning example sample to be detected; generate a preset number of neighbor prefix texts according to the example prefix text corresponding to the context learning example sample to be detected; input the example prefix text and the preset number of neighbor prefix texts into a large language model respectively, so that the large language model outputs a plurality of context learning prediction examples, and calculates a similarity deviation according to the plurality of context learning prediction examples and the context learning example sample to be detected; after the traversal is completed, the output content of the large language model is detected for example infringement according to the similarity deviation of each context learning example sample; the step of generating a preset number of neighbor prefix texts according to the example prefix text corresponding to the context learning example sample to be detected comprises: performing word segmentation processing on the example prefix text corresponding to the context learning example sample to be detected to determine a plurality of example prefix wordings; constructing an example prefix embedding vector according to the plurality of example prefix wordings; performing Dropout processing on the example prefix embedding vector; predicting a plurality of same-replacement prefix wordings through a BERT model according to the mask embedding vector after the Dropout processing; generating a plurality of same-replacement prefix texts according to the plurality of same-replacement prefix wordings based on the example prefix text, and performing vector conversion on the plurality of same-replacement prefix texts respectively to obtain a plurality of same-replacement prefix embedding vectors; calculating a same-replacement prediction score corresponding to each same-replacement prefix text by taking the example prefix embedding vector and each same-replacement prefix embedding vector respectively; selecting a preset number of same-replacement prefix texts from the plurality of same-replacement prefix texts according to the same-replacement prediction score corresponding to each same-replacement prefix text as neighbor prefix texts; the step of detecting example infringement according to the similarity deviation of each context learning example sample to the output content of the large language model comprises: respectively judging whether the similarity deviation of each context learning example sample is within a preset similarity threshold range; if yes, selecting a context learning example sample with the similarity deviation within the preset similarity threshold range from the plurality of context learning example samples, and determining a sample example similarity number of the context learning example sample; calculating a sample example similarity ratio according to the sample example similarity number and a total number of example samples in the private context learning example library; detecting example infringement according to the output content of the large language model according to the sample example similarity ratio.
2. The method of claim 1, wherein, the step of generating a plurality of same-replacement prefix texts according to the plurality of same-replacement prefix wordings based on the example prefix text comprises: replacing a plurality of same-replacement prefix wordings and a plurality of example prefix wordings according to a preset word segmentation replacement rule based on the example prefix text to generate a plurality of same-replacement prefix texts.
3. The method of claim 1, wherein, the step of selecting a preset number of neighbor prefix texts from the plurality of same-replacement prefix texts according to the same-replacement prediction score corresponding to each same-replacement prefix text comprises: Sort the same replacement prediction scores corresponding to each same replacement prefix text from high to low to obtain a prediction score sorting result; Select a preset number of neighbor prefix texts from the plurality of same replacement prefix texts based on the prediction score sorting result.
4. The method according to any one of claims 1 to 3, characterized in that, The step of calculating the similarity deviation according to the plurality of context learning prediction examples and the context learning example sample to be detected comprises: Respectively convert the plurality of context learning prediction examples into corresponding prediction example embedding vectors, and determine a to-be-detected example embedding vector corresponding to the context learning example sample to be detected; Calculate the similarity of each context learning prediction example by respectively calculating the to-be-detected example embedding vector and each prediction example embedding vector; Calculate the similarity deviation according to the similarity of the plurality of context learning prediction examples.
5. A system for detecting infringement based on contextually learning examples, the system comprising: The infringement detection system based on context learning examples comprises: A traversal module configured to traverse a plurality of context learning example samples in a private context learning example library, and take a currently traversed context learning example sample as a context learning example sample to be detected; A generation module configured to generate a preset number of neighbor prefix texts according to an example prefix text corresponding to the context learning example sample to be detected; A calculation module configured to input the example prefix text and the preset number of neighbor prefix texts into a large language model respectively, so that the large language model outputs a plurality of context learning prediction examples, and calculates a similarity deviation according to the plurality of context learning prediction examples and the context learning example sample to be detected; A detection module configured to, after the traversal is completed, perform example infringement detection on the output content of the large language model according to the similarity deviation of each context learning example sample. The infringement detection system based on context learning examples is configured to implement the steps of the infringement detection method based on context learning examples as claimed in any one of claims 1 to 4.
6. A device for detecting infringement based on context learning examples, characterized by The device comprises a memory, a processor, and a context learning example based infringement detection program stored on the memory and executable on the processor, and the context learning example based infringement detection program is configured to implement the steps of the context learning example based infringement detection method as claimed in any one of claims 1 to 4.
7. A medium characterized by, The medium has a context learning example based infringement detection program stored thereon, and the context learning example based infringement detection program is executed by a processor to implement the steps of the context learning example based infringement detection method as claimed in any one of claims 1 to 4.
Citation Information
Patent Citations
Text watermark embedding and detecting method based on model context learning
CN118349970A
Question-answering method and apparatus based on large language model
WO2025098195A1