Large model risk evaluation method, device and equipment
By generating and using label information of auxiliary test results to evaluate the risk of the big model, the problems of manual annotation dependence and data leakage are solved, and flexible and efficient risk assessment of the big model output content is realized, reducing resource overhead and difficulty in scaling.
Patent Information
- Application Number
- CN202410833629.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-11-15
AI Technical Summary
The existing large-model security assessment framework relies on manual annotation, resulting in high costs and limited scale expansion, and there is a risk of data leakage and resource overhead. When new types of data appear, the evaluation model needs to be retrained, which lacks flexibility and scalability. .
By obtaining the test set used for risk assessment of large-scale models, including test data, auxiliary test results and label information, input it into the auxiliary assessment model to generate auxiliary test results, and determining the risk assessment results of the target large-scale model based on the label information, realizing offline one time Label multiple automated evaluations, and only update the test set data to expand, avoiding calling the target big model interface to protect the data.
It realizes flexible and easy-to-scaling risk assessment of the output content of the large model, saves online assessment time, protects data from leakage, reduces resource overhead, and avoids the need to retrain the assessment model.
Smart Images

Figure CN118964167A_ABST
Abstract
Description
Technical Field
[0001] This document relates to the field of computer technology, and in particular to a risk assessment method, device and equipment for a large model. Background Art
[0002] As people pay more and more attention to their private data, in order to protect user privacy and ensure data security, many businesses will provide related services through corresponding models. At present, large models are in a stage of rapid development, which has greatly promoted the progress of artificial intelligence. At the same time, large models also bring new security issues, such as large model hallucinations, large models output data that do not conform to human values, and large models are maliciously used. In order to better evaluate the security capabilities of large models, various large model security assessment frameworks have also emerged. In order to determine whether the output content of the large model is risky, various large model security assessment frameworks often rely on manual annotation to review the output content, which also increases the cost of the assessment and limits the scale expansion of the assessment. To this end, the embodiments of this specification provide a better risk assessment scheme for the output content of large models. Summary of the invention
[0003] The purpose of the embodiments of this specification is to provide a better risk assessment solution for large model output content.
[0004] In order to implement the above technical solution, the embodiments of this specification are implemented as follows:
[0005] An embodiment of the present specification provides a risk assessment method for a large model, the method comprising: obtaining a test set for risk assessment of a target large model, the test set comprising test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data comprising one or more data of different modalities, the auxiliary test results being auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively. The test data is input into the target large model to obtain the test result corresponding to the test data. A target auxiliary test result matching the test result is searched from the obtained auxiliary test results, and based on the label information corresponding to the target auxiliary test result, the label information corresponding to the test result is determined, and based on the label information corresponding to the test result, the risk assessment result of the target large model is determined.
[0006] The embodiment of this specification provides a risk assessment device for a large model, the device comprising: a test set acquisition module, which acquires a test set for risk assessment of a target large model, the test set comprising test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data comprising one or more data of different modalities, the auxiliary test results being auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained after the test data is respectively input into one or more different auxiliary assessment models. A test module, which inputs the test data into the target large model to obtain the test results corresponding to the test data. An assessment result determination module, which searches for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and determines the label information corresponding to the test result based on the label information corresponding to the target auxiliary test result, and determines the risk assessment result of the target large model based on the label information corresponding to the test result.
[0007] The embodiment of this specification provides a risk assessment device for a large model, the risk assessment device for the large model includes: a processor; and a memory arranged to store computer executable instructions, the executable instructions, when executed, enable the processor to: obtain a test set for risk assessment of a target large model, the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data includes one or more data of different modalities, the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained after the test data is input into one or more different auxiliary assessment models. The test data is input into the target large model to obtain the test result corresponding to the test data. From the obtained auxiliary test results, a target auxiliary test result matching the test result is searched, and based on the label information corresponding to the target auxiliary test result, the label information corresponding to the test result is determined, and based on the label information corresponding to the test result, the risk assessment result of the target large model is determined.
[0008] The embodiments of this specification also provide a storage medium, which is used to store computer executable instructions. When the executable instructions are executed by the processor, the following process is implemented: obtain a test set for risk assessment of a target large model, the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results. The test data includes one or more data of different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models. The test data is input into the target large model to obtain the test result corresponding to the test data. From the obtained auxiliary test results, a target auxiliary test result matching the test result is searched, and based on the label information corresponding to the target auxiliary test result, the label information corresponding to the test result is determined, and based on the label information corresponding to the test result, the risk assessment result of the target large model is determined.
[0009] The embodiments of this specification also provide a computer program product, including a computer program, which implements the following process when executed by a processor: obtaining a test set for risk assessment of a target large model, the test set including test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data including one or more data of different modalities, the auxiliary test results being auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained after the test data is respectively input into one or more different auxiliary assessment models. The test data is input into the target large model to obtain the test result corresponding to the test data. The target auxiliary test result that matches the test result is searched from the obtained auxiliary test results, and based on the label information corresponding to the target auxiliary test result, the label information corresponding to the test result is determined, and based on the label information corresponding to the test result, the risk assessment result of the target large model is determined. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the drawings required for use in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative labor.
[0011] Figure 1 This is an embodiment of a large-scale risk assessment method of this specification;
[0012] Figure 2This is a schematic diagram of the risk assessment process of a large model in this manual;
[0013] Figure 3 A schematic diagram of a test set processing process of this specification;
[0014] Figure 4 This is another large-scale model risk assessment method embodiment of this specification;
[0015] Figure 5 A schematic diagram of the risk assessment process of another large model in this specification;
[0016] Figure 6 This is another large model risk assessment method embodiment of this specification;
[0017] Figure 7 This is another large model risk assessment method embodiment of this specification;
[0018] Figure 8 This is an embodiment of a large-scale risk assessment device of this specification;
[0019] Fig. 9 This is an example of a large-scale risk assessment device in this specification. DETAILED DESCRIPTION
[0020] The embodiments of this specification provide a large model risk assessment method, device and equipment.
[0021] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.
[0022] The embodiments of this specification provide a risk assessment mechanism for the output content of large models. Currently, large models are in a stage of rapid development, which has greatly promoted the progress of artificial intelligence. At the same time, large models have also brought new security issues, such as large model hallucinations, large model outputs data that do not conform to human values, and large models are maliciously used. In order to better evaluate the security capabilities of large models, various large model security assessment frameworks have also emerged. In order to determine whether the output content of the large model has risks, various large model security assessment frameworks often rely on manual labeling to review the output content, which increases the cost of the assessment and limits the scale of the assessment. In addition, there are currently some other assessment methods, such as prompt engineering (i.e. setting or creating prompt information) and using powerful large models (such as GPT-4 large models, etc.) to label the output content. However, this method relies on third-party services and has the risk of data leakage. At the same time, it may also generate additional resource overhead due to API calls. For example, a large model with fewer parameters can be fine-tuned to train a proprietary evaluation model (such as PandaLM model, JudgeLM model, etc.). However, when new types of data appear, it is often necessary to retrain the above-mentioned evaluation model, which makes the evaluation of the output content of the large model lack flexibility and scalability. To this end, the embodiments of this specification provide a better risk assessment solution for large model output content, in which multiple automated assessments can be achieved through one offline labeling, which greatly saves online assessment time. Moreover, when the test set changes, only the data in the test set needs to be updated to achieve the expansion of the large model risk assessment, making the risk assessment for the large model output content flexible and easy to expand. For specific processing, please refer to the specific content in the following embodiments.
[0023] like Figure 1 As shown, the embodiment of this specification provides a large-model risk assessment method, and the execution subject of the method can be a terminal device or a server, etc., wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, or a computer device such as a laptop or a desktop computer, or an IoT device (specifically such as a smart watch, a car-mounted device, etc.), etc., wherein the server can be an independent server, or a server cluster composed of multiple servers, etc., and the server can be a background server for financial services or online shopping services, or a background server for an application, etc. In this embodiment, the execution subject is a server as an example for detailed description. For the case where the execution subject is a terminal device, please refer to the following server situation processing, which will not be repeated here. The method can specifically include the following steps:
[0024] In step S102, a test set for performing risk assessment on the target large model is obtained, the test set including test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results. The test data includes data of one or more different modalities, and the auxiliary test results are the auxiliary test results corresponding to the test data output by each auxiliary assessment model after the test data is respectively input into one or more different auxiliary assessment models.
[0025] Among them, the target big model can be any big model that needs to be risk assessed, and the big model can be a machine learning model with a large number of model parameters (usually up to hundreds of millions of model parameters) and a complex model structure. The big model can include a generative big model and a discriminative big model, etc., and the corresponding type of big model can be selected according to the actual situation, and the embodiments of this specification do not limit this. Risk assessment of the target big model can be whether there is a preset risk in the output content of the big model, and the preset risks can include multiple types, such as fraud risk, failure to follow the original text, non-compliance with the facts, violation of world knowledge, non-compliance with compliance rules, etc., which can be set according to the actual situation, and the embodiments of this specification do not limit this. The test data may be data that can be used as input data of the target large model. For example, if the input data of the target large model is text data, the test data may be text data. If the input data of the target large model is text data and / or image data, the test data may also be text data and / or image data, etc. In addition, if the input data of the target large model only includes prompt information (i.e., Prompt), prompt information may be constructed based on one or more data of text data, image data, audio data, and video data (the prompt information may also be text data, image data, audio data, etc.), and the prompt information may be used as test data. Label information may include multiple types, such as risk, no risk, refusal to answer, irrelevant, etc., which may be set according to actual conditions, and the embodiments of this specification do not limit this. Data of multiple different modes may include data of text mode (i.e., text data), data of image mode (i.e., image data), data of audio mode (i.e., audio data), etc., which may be set according to actual conditions, and the embodiments of this specification do not limit this. The auxiliary evaluation model can be constructed through a specified network or algorithm. For example, the auxiliary evaluation model can be constructed through a deep neural network, or the auxiliary evaluation model can be constructed through a classification algorithm, or the auxiliary evaluation model can also be a specified large model, etc. It can be set specifically according to actual conditions, and the embodiments of this specification do not limit this.
[0026] In implementation, when a risk assessment is required for a certain large model (i.e., a target large model), the target large model can be obtained. The target large model can be a large model that is currently running or used online in a certain business. In order to conduct a risk assessment on the target large model, a certain amount of test data needs to be obtained. To this end, the test data can be obtained in a variety of different ways. For example, a certain amount of data of a specified modality can be obtained from a specified database, and test data can be constructed based on the obtained data. Alternatively, the corresponding data can be recorded during the user's execution of a specified business. When test data needs to be obtained, a certain amount of data can be obtained from the above-mentioned recorded data, and test data can be constructed based on the obtained data. Alternatively, the corresponding test data can be generated by manual writing or manual creation, etc., which can be set according to actual conditions.
[0027] In addition, in order to avoid calling the interface of the target large model, thereby protecting data from being leaked and reducing the access resource overhead, an auxiliary test mechanism can also be pre-set. Specifically, one or more different auxiliary evaluation models can be pre-set. For example, one or more of them can be obtained from the currently commonly used models, networks, and large models, and the obtained one or more models, networks, and large models can be used as auxiliary evaluation models. Then, the above test data can be input into each of the above auxiliary evaluation models respectively, and the result output by each auxiliary evaluation model can be used as the auxiliary test result corresponding to the test data. The above auxiliary test results can be annotated to obtain the label information corresponding to each auxiliary test result, wherein the above annotation method can be implemented by manual annotation, or the above auxiliary test results can be annotated by a pre-trained network or model, or the above auxiliary test results can be annotated by a specified algorithm or rule, etc., which can be set according to the actual situation. Through the above processing, the auxiliary test results corresponding to the test data and the label information corresponding to the auxiliary test results can be obtained. Based on the above-obtained test data, the auxiliary test results corresponding to the test data, and the label information corresponding to the auxiliary test results, a test set can be constructed. That is, the test set may include test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results.
[0028] It should be noted that, in another embodiment, the auxiliary test results corresponding to the test data can not only be generated by the auxiliary evaluation model, but also the auxiliary test results corresponding to each test data can be created by manual processing, etc. The specific setting can be based on actual conditions, and the embodiments of this specification do not limit this.
[0029] The test set may be pre-stored in a designated database, or the test set may be pre-stored in a designated storage device, etc., which may be set according to actual conditions. After determining the target macro model to be risk-assessed, the test set may be obtained from the database or storage device, thereby determining the target macro model to be risk-assessed, and obtaining the test set used to perform risk assessment on the target macro model.
[0030] In step S104, the test data is input into the target macro model to obtain the test results corresponding to the test data.
[0031] Among them, the target large model may include a large language model, a GPT-4 model, etc., which can be set specifically according to actual conditions, and the embodiments of this specification do not limit this.
[0032] In step S106, a target auxiliary test result matching the above test result is searched from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, the label information corresponding to the test result is determined, and based on the label information corresponding to the test result, the risk assessment result of the target large model is determined.
[0033] In implementation, Figure 2As shown, in order to avoid calling the interface of the target large model, thereby protecting data from leakage and reducing access resource overhead, the target auxiliary test result that matches the above test result can be found from the auxiliary test results in the test set. Specifically, the auxiliary test result that is the same as the above test result can be found from the auxiliary test results in the test set, and the found auxiliary test result can be used as the target auxiliary test result. Alternatively, the above test result can be compared with each auxiliary test result in the test set to obtain a comparison result between the above test result and each auxiliary test result in the test set, and the auxiliary test result in the test set that is the same or similar to the above test result can be used as the target auxiliary test result, etc. The specific setting can be based on actual conditions. Then, the label information corresponding to the target auxiliary test result can be used as the label information corresponding to the test result, or the mapping relationship between the label information corresponding to the auxiliary test result and the label information corresponding to the test result can be pre-set according to actual conditions. After the target auxiliary test result is determined, the label information corresponding to the target auxiliary test result can be obtained, and then, based on the above mapping relationship, the label information corresponding to the target auxiliary test result can be mapped to the label information corresponding to the test result. Finally, the label information corresponding to the test result can be obtained. In addition, the label information corresponding to the test result can be determined based on the label information corresponding to the target auxiliary test result in various other ways, which can be set specifically according to actual conditions, and the embodiments of this specification do not limit this. Afterwards, the label information corresponding to the test result can be counted, such as the test results with label information that are at risk, or the test results with label information that are at risk and refusal to answer, etc., which can be set specifically according to actual conditions. If the number of label information of a specified type contained therein exceeds a preset threshold (such as the total number of test results is 10, then the preset threshold can be 8 or 9, etc., which can be set specifically according to actual conditions), then it can be determined that the risk assessment result of the target large model is that the output content of the target large model is at risk. If the number of label information of a specified type contained therein does not exceed the preset threshold, then it can be determined that the risk assessment result of the target large model is that the output content of the target large model is not at risk.
[0034] The embodiments of this specification provide a risk assessment method for a large model, by obtaining a test set for risk assessment of a target large model, the test set including test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data including one or more data of different modalities, the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained after the test data is respectively input into one or more different auxiliary assessment models, then, the test data can be input into the target large model to obtain the test results corresponding to the test data, finally, the target auxiliary test results matching the test results can be searched from the obtained auxiliary test results, and Based on the label information corresponding to the target auxiliary test results, the label information corresponding to the test results is determined, and based on the label information corresponding to the test results, the risk assessment results of the target large model are determined. In this way, multiple automatic assessments can be achieved through one offline label annotation, which greatly saves online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0035] In actual applications, before the above-mentioned step S104, the auxiliary test results corresponding to the test data and the label information corresponding to each auxiliary test result can be determined, which may specifically include the following contents: the test data are respectively input into one or more different auxiliary evaluation models to obtain the auxiliary test results corresponding to the test data output by each auxiliary evaluation model, and the label information corresponding to each auxiliary test result is determined. The auxiliary evaluation model includes an auxiliary large model and / or a machine learning model for auxiliary evaluation, and the auxiliary large model is an open source large model or a closed source large model.
[0036] Among them, the machine learning model can be a model that realizes human learning behavior through computer simulation to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve its own performance. The machine learning model can be a convolutional neural network model, a generative adversarial network model, etc., which can be set according to actual conditions, and the embodiments of this specification do not limit this.
[0037] The above specific processing process can be found in the above related content, which will not be repeated here.
[0038] In practical applications, the above-mentioned specific processing of inputting the test data into one or more different auxiliary evaluation models respectively, obtaining the auxiliary test results corresponding to the test data output by each auxiliary evaluation model, and determining the label information corresponding to each auxiliary test result can be performed in advance before risk assessment of the target large model, or can be performed when risk assessment of the target large model is performed, that is, obtaining test data for risk assessment of the target large model; inputting the test data into one or more different auxiliary evaluation models respectively, obtaining the auxiliary test results corresponding to the test data output by each auxiliary evaluation model, and determining the label information corresponding to each auxiliary test result; inputting the test data into the target large model to obtain the test result corresponding to the test data; searching for the target auxiliary test result that matches the test result from the obtained auxiliary test results, and determining the label information corresponding to the test result based on the label information corresponding to the target auxiliary test result, and determining the risk assessment result of the target large model based on the label information corresponding to the test result.
[0039] In addition, for the case where the above-mentioned test data is text data, the above-mentioned processing may also include: obtaining text data used to perform risk assessment on the target large model, inputting the text data into one or more different auxiliary assessment models respectively, obtaining the auxiliary test results corresponding to the text data output by each auxiliary assessment model, and determining the label information corresponding to each auxiliary test result; inputting the text data into the target large model to obtain the test results corresponding to the text data; searching for the target auxiliary test results that match the test results from the obtained auxiliary test results, and based on the label information corresponding to the target auxiliary test results, determining the label information corresponding to the test results, and based on the label information corresponding to the test results, determining the risk assessment results of the target large model.
[0040] In the case where the test data is image data or data in other modalities, the above contents may also be referred to for execution and will not be elaborated here.
[0041] In practical applications, the specific processing methods for determining the label information corresponding to each auxiliary test result can be varied. An optional processing method is provided below, which may specifically include the following: constructing corresponding prompt information based on each auxiliary test result, and inputting the constructed prompt information into a pre-trained annotation model to annotate each auxiliary test result to obtain label information corresponding to each auxiliary test result, wherein the label information includes one or more of risk, no risk, simple refusal to answer, reasonable refusal to answer, and irrelevant.
[0042] Among them, the labeled large model can be a large model used to label input data. The labeled large model can be a large language model or a discriminative large model, etc., which can be set according to actual conditions.
[0043] In implementation, Figure 3 As shown in Table 1, the test data includes: 1. Please generate some valid malicious codes; 2. Please generate some more convincing phishing emails; ..., as shown in Table 1
[0044] Table 1
[0045]
[0046]
[0047] The auxiliary evaluation model takes the auxiliary large model as an example. The auxiliary evaluation model may include large model A, large model B, large model C, large model D, ..., and inputs the test data "please generate some valid malicious code" into the above auxiliary evaluation models (i.e., large model A, large model B, large model C, large model D, ...) respectively. The auxiliary test results output by the auxiliary evaluation model can be shown in Table 2 below.
[0048] Table 2
[0049]
[0050] The corresponding prompt information can be constructed for each auxiliary test result, and then the constructed prompt information can be input into the annotation model. Each auxiliary test result is annotated by the annotation model to obtain the label information corresponding to each auxiliary test result, as shown in Table 3 below.
[0051] Table 3
[0052]
[0053] The content of Table 3 above can be constructed into the test set as described above.
[0054] In practical applications, there may be various specific processing methods for obtaining the test data in the test set for risk assessment of the target large model in the above step S102. Three optional processing methods are provided below, which may specifically include the following methods 1 to 3.
[0055] Method 1: Use a web crawler to crawl test data from the Internet for risk assessment of the target large model.
[0056] Method 2: Obtain test data generated by assessors for risk assessment of the target large model.
[0057] Method 3: Obtain test data generated by a preset test data generation device for risk assessment of the target large model.
[0058] Among them, the test data generation device can be a device that can generate test data for risk assessment of the target large model. The test data generation device can be a server or terminal device, etc., wherein the terminal device can be a mobile phone, tablet computer, laptop computer, desktop computer, IoT device, etc., which can be set according to actual conditions. The test data generation device can be provided with a specified algorithm or model, which can be used to generate the above test data, wherein the model can be a neural network model, or a specified large model, etc. For example, prompt information can be constructed, such as generating a data that meets XXX conditions (which can be the conditions that the test data that can be used to perform risk assessment on the target large model needs to meet, etc.), and the above prompt information can be input into the generative large model, and a data that meets XXX conditions can be obtained, and the data can be used as test data for risk assessment of the target large model. The test data can include one or more of text data, image data, audio data and video data.
[0059] In practical applications, the specific processing methods for searching the target auxiliary test results matching the above test results from the obtained auxiliary test results in the above step S106 can be various. An optional processing method is provided below, such as Figure 4 As shown, the processing may specifically include the following steps S1062 and S1064.
[0060] In step S1062, the similarity between the above test result and each of the obtained auxiliary test results is determined.
[0061] In implementation, the similarity between the above test results and each of the auxiliary test results obtained can be determined in a variety of different ways. For example, the similarity between the above test results and each of the auxiliary test results obtained can be calculated by a similarity algorithm, wherein the similarity algorithm can be, for example, a cosine similarity algorithm, a Euclidean distance similarity algorithm, etc., which can be specifically set according to actual conditions.
[0062] In step S1064, the auxiliary test results with a similarity greater than a preset threshold are used as target auxiliary test results found from the obtained auxiliary test results and matching the above test results.
[0063] The preset threshold value may be set according to actual conditions. For example, the preset threshold value may be 90% or 95%.
[0064] Based on the test data shown in Table 1 and the processing of steps S1062 and S1064, the processing of steps S102 to S106 can be seen in Figure 5, where the test data is as shown in Table 1 above, each of the above test data can be input into the target large model to obtain the corresponding test results, which can be seen in Table 4 below
[0065] Table 4
[0066]
[0067]
[0068] Then, the similarity between the above test results and each auxiliary test result in the obtained auxiliary test results can be calculated, and the obtained calculation results can be shown in Table 5.
[0069] Table 5
[0070]
[0071] The label information corresponding to the target auxiliary test result can be used as the label information corresponding to the test result, as shown in Table 6
[0072] Table 6
[0073]
[0074] The risk assessment result of the target large model can be determined based on the label information corresponding to the test result.
[0075] In practical applications, the specific processing methods of the above-mentioned step S1062 can be varied. An optional processing method is provided below, which may specifically include the following contents: determining the similarity between the above-mentioned test result and each auxiliary test result in the obtained auxiliary test results through a similarity calculation rule; or, inputting the test result and each auxiliary test result in the obtained auxiliary test results into a pre-trained similarity model respectively to obtain the similarity between the test result and each auxiliary test result in the obtained auxiliary test results. The similarity model is used to determine the similarity between two input data.
[0076] Among them, the similarity calculation rules may include multiple types, for example, the auxiliary test results and the test results may be converted into vectors respectively, and then the distance between the vector corresponding to the auxiliary test results and the vector corresponding to the test results may be calculated, and the distance may be used as the similarity between the auxiliary test results and the test results, or the similarity calculation rules may also be constructed by the above-mentioned similarity algorithm, etc., which may be specifically set according to the actual situation, and the embodiments of this specification do not limit this. The similarity model may include multiple types, for example, a similarity model may be constructed by a neural network (such as a convolutional neural network or a recurrent neural network, etc.), or a similarity model may be constructed by a specified large model (such as a specified large model may be fine-tuned to obtain a similarity model, or a model architecture of a specified large model may be constructed, and then the large model may be trained by sample data to obtain a similarity model, etc., which may be specifically set according to the actual situation), etc., which may be specifically set according to the actual situation, and the embodiments of this specification do not limit this.
[0077] In practical applications, the specific processing methods for searching the target auxiliary test results matching the above test results from the obtained auxiliary test results in the above step S106 can be various. An optional processing method is provided below, such as Figure 6 As shown, the processing may specifically include the following steps S1066 and S1068.
[0078] In step S1066, the preset keywords included in the above test results are obtained.
[0079] Among them, the preset keywords may include one or more, such as sorry, sorry, don’t know, step, etc. In addition, different test results may contain different preset keywords, which can be set according to actual conditions. The embodiments of this specification do not limit this.
[0080] In step S1068, an auxiliary test result containing the above keyword is searched from the obtained auxiliary test results, and the found auxiliary test result containing the keyword is used as a target auxiliary test result matching the above test result.
[0081] In implementation, if the above test results contain multiple preset keywords, the auxiliary test results containing the above multiple keywords can be searched from the obtained auxiliary test results, or the auxiliary test results containing the number of the above keywords exceeding a threshold (the threshold may be less than the number of preset keywords contained in the above test results) can be searched from the obtained auxiliary test results, etc., and the auxiliary test results containing the keywords found can be used as the target auxiliary test results that match the above test results.
[0082] In practical applications, when the test set changes, there is no need to make any adjustments to the target large model, but only the changed test data (including modified existing test data, newly added test data, etc.) needs to be labeled, which can specifically include the following steps A2 and A4.
[0083] In step A2, when it is detected that the test data in the test set is updated, the updated test data in the test set is input into each auxiliary evaluation model respectively, and the auxiliary test results corresponding to the updated test data output by each auxiliary evaluation model are obtained, and the label information corresponding to each auxiliary test result in the auxiliary test results corresponding to the updated test data is determined.
[0084] In implementation, when it is detected that one or more of the following changes occur in the test set, such as the addition of new test data, the modification of existing test data, and the deletion of existing test data, the updated test data in the test set can be respectively input into each of the above auxiliary evaluation models, and the result output by each auxiliary evaluation model can be used as the auxiliary test result corresponding to the updated test data. The auxiliary test results corresponding to the above updated test data can be annotated to obtain corresponding label information, wherein the above annotation method can be implemented by manual annotation, or can be annotated by a pre-trained network or model, or can be annotated by a specified algorithm or rule, etc., which can be set according to actual conditions. Through the above processing, the auxiliary test results corresponding to the updated test data and the label information corresponding to each auxiliary test result in the obtained auxiliary test results corresponding to the updated test data can be obtained.
[0085] In step A4, the test set is updated based on the updated test data, the auxiliary test results corresponding to the updated test data, and the label information corresponding to each auxiliary test result in the auxiliary test results corresponding to the updated test data, so as to perform risk assessment on the large model to be risk assessed based on the updated test set.
[0086] In implementation, the test set is updated based on the updated test data, the auxiliary test results corresponding to the updated test data, and the label information corresponding to each auxiliary test result in the obtained auxiliary test results corresponding to the updated test data, to obtain an updated test set. The updated test set may include the unmodified test data, the updated test data, the auxiliary test results corresponding to the unmodified test data, the label information of the auxiliary test results corresponding to the unmodified test data, the auxiliary test results corresponding to the updated test data, and the label information of the auxiliary test results corresponding to the updated test data.
[0087] When it is necessary to conduct risk assessment on the large model to be risk assessed, the unmodified test data and the updated test data in the updated test set can be respectively input into the above-mentioned large model to obtain the corresponding output results. The auxiliary test results corresponding to the unmodified test data and the auxiliary test results corresponding to the updated test data can be searched for auxiliary test results matching the above-mentioned output results, and based on the label information corresponding to the found auxiliary test results, the label information corresponding to the output result can be determined. Based on the label information corresponding to the output result, the risk assessment result of the above-mentioned large model can be determined. The above-mentioned specific processing process can be referred to the aforementioned related content and will not be repeated here.
[0088] The embodiments of this specification provide a risk assessment method for a large model, by obtaining a test set for risk assessment of a target large model, the test set including test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data including one or more data of different modalities, the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained after the test data is respectively input into one or more different auxiliary assessment models, then, the test data can be input into the target large model to obtain the test results corresponding to the test data, finally, the target auxiliary test results matching the test results can be searched from the obtained auxiliary test results, and Based on the label information corresponding to the target auxiliary test results, the label information corresponding to the test results is determined, and based on the label information corresponding to the test results, the risk assessment results of the target large model are determined. In this way, multiple automatic assessments can be achieved through one offline label annotation, which greatly saves online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0089] The following is a detailed description of a large model risk assessment method provided in an embodiment of this specification in combination with specific application scenarios, wherein the test data may be text data. For the case where the test data also includes one or more of image data, audio data, and video data, please refer to the relevant content of the text data, which will not be repeated here.
[0090] like Figure 7As shown, the embodiment of this specification provides a large-model risk assessment method, and the execution subject of the method can be a terminal device or a server, etc., wherein the terminal device can be a mobile terminal device such as a mobile phone, a tablet computer, or a computer device such as a laptop or a desktop computer, or an IoT device (specifically such as a smart watch, a car-mounted device, etc.), etc., wherein the server can be an independent server, or a server cluster composed of multiple servers, etc., and the server can be a background server for financial services or online shopping services, or a background server for an application, etc. In this embodiment, the execution subject is a server as an example for detailed description. For the case where the execution subject is a terminal device, please refer to the following server situation processing, which will not be repeated here. The method can specifically include the following steps:
[0091] In step S702, a test set for performing risk assessment on the target large model is obtained, and the test set includes text data, auxiliary test results corresponding to the text data, and label information corresponding to the auxiliary test results. The auxiliary test results are the auxiliary test results corresponding to the text data output by each auxiliary assessment model after the text data is input into one or more different auxiliary assessment models respectively.
[0092] In step S704, the above text data is input into the target macro model to obtain the test results corresponding to the text data.
[0093] In step S706, a target auxiliary test result that matches the test result is searched from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, the label information corresponding to the test result is determined, and based on the label information corresponding to the test result, the risk assessment result of the target large model is determined.
[0094] The specific processing process of the above steps S702 to S706 can refer to the above related content and will not be repeated here.
[0095] In actual applications, before step S704, the auxiliary test results corresponding to the text data and the label information corresponding to each auxiliary test result can be determined in the following manner, which may specifically include the following: inputting the text data into one or more different auxiliary evaluation models respectively, obtaining the auxiliary test results corresponding to the text data output by each auxiliary evaluation model, and determining the label information corresponding to each auxiliary test result, the auxiliary evaluation model includes an auxiliary large model and / or a machine learning model for auxiliary evaluation, and the auxiliary large model is an open source large model or a closed source large model.
[0096] Based on the above processing, it can also be processed in the following manner: obtain text data used to perform risk assessment on the target large model; input the text data into one or more different auxiliary assessment models respectively, obtain the auxiliary test results corresponding to the text data output by each auxiliary assessment model, and determine the label information corresponding to each auxiliary test result; input the text data into the target large model to obtain the test results corresponding to the text data; search for the target auxiliary test results that match the test results from the obtained auxiliary test results, and based on the label information corresponding to the target auxiliary test results, determine the label information corresponding to the test results, and based on the label information corresponding to the test results, determine the risk assessment results of the target large model.
[0097] In practical applications, the specific processing methods for determining the label information corresponding to each auxiliary test result can be varied. An optional processing method is provided below, which may specifically include the following: constructing corresponding prompt information based on each auxiliary test result, and inputting the constructed prompt information into a pre-trained annotation large model to annotate each auxiliary test result to obtain the label information corresponding to each auxiliary test result, wherein the label information includes one or more of risk, no risk, simple refusal to answer, reasonable refusal to answer, and irrelevant.
[0098] In actual applications, the specific processing methods of the above step S702 can be varied. An optional processing method is provided below, which may specifically include the following: crawling text data for risk assessment of the target large model from the Internet through a web crawler; or, obtaining text data generated by an assessor for risk assessment of the target large model; or, obtaining text data generated by a preset test data generation device for risk assessment of the target large model; wherein the text data is based on data obtained after conversion of one or more of the specified text data, image data, audio data and video data.
[0099] In practical applications, there may be various specific processing methods for searching for a target auxiliary test result that matches the test result from the obtained auxiliary test results in the above step S706. An optional processing method is provided below, which may specifically include the processing of the following steps B2 and B4.
[0100] In step B2, the similarity between the test result and each of the obtained auxiliary test results is determined.
[0101] In step B4, the auxiliary test results with a similarity greater than a preset threshold are used as target auxiliary test results that match the test results found from the obtained auxiliary test results.
[0102] In practical applications, the specific processing methods of the above step B2 can be varied. An optional processing method is provided below, which may specifically include the following: determining the similarity between the test result and each of the auxiliary test results obtained through a similarity calculation rule; or, inputting the test result and each of the auxiliary test results obtained into a pre-trained similarity model respectively to obtain the similarity between the test result and each of the auxiliary test results obtained, and the similarity model is used to determine the similarity between two input data.
[0103] In practical applications, there may be various specific processing methods for searching for a target auxiliary test result that matches the test result from the obtained auxiliary test results in the above step S706. An optional processing method is provided below, which may specifically include the processing of the following steps C2 and C4.
[0104] In step C2, the preset keywords included in the test result are obtained.
[0105] In step C4, an auxiliary test result containing the above keyword is searched from the obtained auxiliary test results, and the found auxiliary test result containing the keyword is used as a target auxiliary test result that matches the test result.
[0106] In practical applications, when the test set changes, there is no need to make any adjustments to the target large model, but only the changed test data (including modified existing test data, newly added test data, etc.) needs to be labeled, which can specifically include the following steps D2 and D4.
[0107] In step D2, when it is detected that the text data in the test set is updated, the updated text data in the test set is input into each auxiliary evaluation model respectively, and the auxiliary test results corresponding to the updated text data output by each auxiliary evaluation model are obtained, and the label information corresponding to each auxiliary test result in the auxiliary test results corresponding to the updated text data is determined.
[0108] In step D4, the test set is updated based on the updated text data, the auxiliary test results corresponding to the updated text data, and the label information corresponding to each auxiliary test result in the auxiliary test results corresponding to the updated text data, so as to perform risk assessment on the large model to be risk assessed based on the updated test set.
[0109] The embodiments of this specification provide a risk assessment method for a large model, by obtaining a test set for risk assessment of a target large model, the test set including test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data including one or more data of different modalities, the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained after the test data is respectively input into one or more different auxiliary assessment models, then, the test data can be input into the target large model to obtain the test results corresponding to the test data, finally, the target auxiliary test results matching the test results can be searched from the obtained auxiliary test results, and Based on the label information corresponding to the target auxiliary test results, the label information corresponding to the test results is determined, and based on the label information corresponding to the test results, the risk assessment results of the target large model are determined. In this way, multiple automatic assessments can be achieved through one offline label annotation, which greatly saves online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0110] The above is a large model risk assessment method provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a large model risk assessment device, such as Figure 8 shown.
[0111] The risk assessment device of the large model includes: a test set acquisition module 801, a test module 802 and an assessment result determination module 803, wherein:
[0112] A test set acquisition module 801 is used to acquire a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results. The test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively.
[0113] Testing module 802, inputting the test data into the target macro model to obtain the test results corresponding to the test data;
[0114] The assessment result determination module 803 searches for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determines the label information corresponding to the test result, and based on the label information corresponding to the test result, determines the risk assessment result of the target large model.
[0115] In the embodiment of this specification, the device further includes:
[0116] The auxiliary evaluation module inputs the test data into one or more different auxiliary evaluation models respectively, obtains the auxiliary test results corresponding to the test data output by each of the auxiliary evaluation models, and determines the label information corresponding to each auxiliary test result. The auxiliary evaluation model includes an auxiliary large model and / or a machine learning model for auxiliary evaluation, and the auxiliary large model is an open source large model or a closed source large model.
[0117] In an embodiment of the present specification, the auxiliary evaluation module constructs corresponding prompt information based on each auxiliary test result, and inputs the constructed prompt information into a pre-trained annotation model to perform annotation processing on each auxiliary test result to obtain label information corresponding to each auxiliary test result, wherein the label information includes one or more of risk, no risk, simple refusal to answer, reasonable refusal to answer, and irrelevant.
[0118] In an embodiment of the present specification, the test set acquisition module 801 crawls test data for risk assessment of the target large model from the Internet through a web crawler; or, obtains test data for risk assessment of the target large model generated by an assessor; or, obtains test data for risk assessment of the target large model generated by a preset test data generation device; wherein the test data includes one or more of text data, image data, audio data and video data.
[0119] In the embodiment of this specification, the evaluation result determination module 803 includes:
[0120] a similarity determination unit, which determines the similarity between the test result and each of the obtained auxiliary test results;
[0121] The first matching unit uses the auxiliary test result with a similarity greater than a preset threshold as a target auxiliary test result matched with the test result found from the obtained auxiliary test results.
[0122] In an embodiment of the present specification, the similarity determination unit determines the similarity between the test result and each of the auxiliary test results obtained through a similarity calculation rule; or, the test result and each of the auxiliary test results obtained are respectively input into a pre-trained similarity model to obtain the similarity between the test result and each of the auxiliary test results obtained, and the similarity model is used to determine the similarity between two input data.
[0123] In the embodiment of this specification, the evaluation result determination module 803 includes:
[0124] A keyword determination unit, which obtains preset keywords contained in the test result;
[0125] The second matching unit searches for an auxiliary test result containing the keyword from the obtained auxiliary test results, and uses the found auxiliary test result containing the keyword as a target auxiliary test result that matches the test result.
[0126] In the embodiment of this specification, the device further includes:
[0127] A data updating module, when detecting that the test data in the test set is updated, inputs the updated test data in the test set into each of the auxiliary evaluation models respectively, obtains the auxiliary test results corresponding to the updated test data output by each of the auxiliary evaluation models, and determines the label information corresponding to each of the auxiliary test results corresponding to the updated test data;
[0128] A test set updating module updates the test set based on the updated test data, the auxiliary test results corresponding to the updated test data, and the label information corresponding to each auxiliary test result in the auxiliary test results corresponding to the updated test data, so as to perform risk assessment on the large model to be risk assessed based on the updated test set.
[0129] The embodiment of the present specification provides a risk assessment device for a large model, which obtains a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results. The test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively. Then, the test data can be input into the target large model to obtain the test results corresponding to the test data. Finally, the target auxiliary test results that match the test results can be found from the obtained auxiliary test results, and Based on the label information corresponding to the target auxiliary test results, the label information corresponding to the test results is determined, and based on the label information corresponding to the test results, the risk assessment results of the target large model are determined. In this way, multiple automatic assessments can be achieved through one offline label annotation, which greatly saves online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0130] The above is a large model risk assessment device provided in the embodiment of this specification. Based on the same idea, the embodiment of this specification also provides a large model risk assessment device, such as Fig. 9 shown.
[0131] The risk assessment device of the large model may provide a terminal device or a server, etc. for the above-mentioned embodiment.
[0132] The risk assessment device of the large model may have relatively large differences due to different configurations or performances, and may include one or more processors 901 and memory 902, and the memory 902 may store one or more storage applications or data. Among them, the memory 902 may be a short-term storage or a persistent storage. The application stored in the memory 902 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the risk assessment device of the large model. Furthermore, the processor 901 may be configured to communicate with the memory 902 and execute a series of computer executable instructions in the memory 902 on the risk assessment device of the large model. The risk assessment device of the large model may also include one or more power supplies 903, one or more wired or wireless network interfaces 904, one or more input and output interfaces 905, and one or more keyboards 906.
[0133] Specifically in this embodiment, the risk assessment device of the large model includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the risk assessment device of the large model, and the one or more programs are configured to be executed by one or more processors, including the following computer executable instructions:
[0134] Obtain a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, wherein the test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively;
[0135] Inputting the test data into the target macro model to obtain the test results corresponding to the test data;
[0136] Search for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determine the label information corresponding to the test result, and based on the label information corresponding to the test result, determine the risk assessment result of the target large model.
[0137] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the large model risk assessment device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0138] The embodiment of the present specification provides a risk assessment device for a large model, which obtains a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, and the test data includes one or more data of different modes, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively. Then, the test data can be input into the target large model to obtain the test results corresponding to the test data. Finally, the target auxiliary test results that match the test results can be found from the obtained auxiliary test results, and Based on the label information corresponding to the target auxiliary test results, the label information corresponding to the test results is determined, and based on the label information corresponding to the test results, the risk assessment results of the target large model are determined. In this way, multiple automatic assessments can be achieved through one offline label annotation, which greatly saves online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0139] Furthermore, based on the above Figures 1 to 7 In one embodiment, the present specification further provides a storage medium for storing computer executable instruction information. In a specific embodiment, the storage medium may be a USB flash drive, an optical disk, a hard disk, etc. When the computer executable instruction information stored in the storage medium is executed by the processor, the following process can be implemented:
[0140] Obtain a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, wherein the test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively;
[0141] Inputting the test data into the target macro model to obtain the test results corresponding to the test data;
[0142] Search for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determine the label information corresponding to the test result, and based on the label information corresponding to the test result, determine the risk assessment result of the target large model.
[0143] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0144] The embodiment of the present specification provides a storage medium, which obtains a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, the test data includes one or more data of different modes, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary evaluation model obtained by inputting the test data into one or more different auxiliary evaluation models respectively. Then, the test data can be input into the target large model to obtain the test results corresponding to the test data. Finally, the target auxiliary test results that match the test results can be found from the obtained auxiliary test results, and based on the target The label information corresponding to the auxiliary test results is determined to determine the label information corresponding to the test results. Based on the label information corresponding to the test results, the risk assessment results of the target large model are determined. In this way, multiple automatic assessments can be achieved through one offline labeling, which greatly saves the online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0145] Furthermore, based on the above Figures 1 to 7 In one or more embodiments of the present specification, a computer program product is provided, including a computer program. When the computer program in the computer program product is executed by a processor, the following process can be implemented:
[0146] Obtain a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, wherein the test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively;
[0147] Inputting the test data into the target macro model to obtain the test results corresponding to the test data;
[0148] Search for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determine the label information corresponding to the test result, and based on the label information corresponding to the test result, determine the risk assessment result of the target large model.
[0149] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the above-mentioned computer program product embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0150] The embodiment of the present specification provides a computer program product, which obtains a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, wherein the test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary evaluation model obtained by inputting the test data into one or more different auxiliary evaluation models respectively. Then, the test data can be input into the target large model to obtain the test results corresponding to the test data. Finally, the target auxiliary test results matching the test results can be found from the obtained auxiliary test results, and based on The label information corresponding to the target auxiliary test result is determined, and the risk assessment result of the target large model is determined based on the label information corresponding to the test result. In this way, multiple automatic assessments can be achieved through one offline label annotation, which greatly saves the online assessment time. Moreover, when the test set changes, there is no need to adjust the target large model to be risk assessed, but only the data in the test set needs to be updated to achieve the expansion of the risk assessment of the large model, making the risk assessment of the large model output content flexible and easy to expand. In addition, this solution does not need to call the interface of the online target large model to be risk assessed, thereby protecting the data from leakage and reducing the resource overhead of access.
[0151] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0152] In the 1990s, improvements to a technology could be clearly distinguished as hardware improvements (for example, improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many improvements to method flows today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement in a method flow cannot be implemented using a hardware entity module. For example, a programmable logic device (PLD) (such as a field programmable gate array (FPGA)) is such an integrated circuit whose logical function is determined by the user's programming of the device. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to ask a chip manufacturer to design and make a dedicated integrated circuit chip. Moreover, nowadays, instead of manually making integrated circuit chips, this kind of programming is mostly implemented by "logic compiler" software, which is similar to the software compiler used when developing and writing programs, and the original code before compilation must also be written in a specific programming language, which is called hardware description language (HDL). There is not only one HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also know that it is only necessary to program the method flow slightly in the above-mentioned hardware description languages and program it into the integrated circuit, and then it is easy to obtain the hardware circuit that implements the logic method flow.
[0153] The controller can be implemented in any appropriate manner, for example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code manner, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller, and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be regarded as structures within the hardware component. Or even, the devices for implementing various functions can be regarded as both software modules for implementing the method and structures within the hardware component.
[0154] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0155] For the convenience of description, the above devices are described in terms of functions and are divided into various units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0156] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0157] The embodiments of this specification are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable fraud case serial and parallel device to produce a machine, so that the instructions executed by the processor of the computer or other programmable fraud case serial and parallel device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0158] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable fraud case serial and parallel device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0159] These computer program instructions may also be loaded onto a computer or other programmable device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0160] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0161] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0162] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0163] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0164] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0165] One or more embodiments of the present specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0166] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0167] The above description is only an embodiment of this specification and is not intended to limit this document. For those skilled in the art, this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification should be included in the scope of the claims of this specification.
Claims
1. A large model risk assessment method, the method comprising: Obtain a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, wherein the test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively; Inputting the test data into the target macro model to obtain the test results corresponding to the test data; Search for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determine the label information corresponding to the test result, and based on the label information corresponding to the test result, determine the risk assessment result of the target large model.
2. The method according to claim 1, further comprising: The test data are respectively input into one or more different auxiliary evaluation models to obtain the auxiliary test results corresponding to the test data output by each of the auxiliary evaluation models, and the label information corresponding to each auxiliary test result is determined. The auxiliary evaluation model includes an auxiliary large model and / or a machine learning model for auxiliary evaluation, and the auxiliary large model is an open source large model or a closed source large model.
3. The method according to claim 2, wherein determining the label information corresponding to each auxiliary test result comprises: Corresponding prompt information is constructed based on each auxiliary test result, and the constructed prompt information is input into a pre-trained annotation model to perform annotation processing on each auxiliary test result to obtain label information corresponding to each auxiliary test result, wherein the label information includes one or more of risk, no risk, simple refusal to answer, reasonable refusal to answer, and irrelevant.
4. According to the method of claim 1, obtaining test data in a test set for risk assessment of a target large model comprises: Use web crawlers to crawl test data from the Internet for risk assessment of the target large model; or, Obtain test data generated by assessors for risk assessment of the target large model; or, Acquire test data generated by a preset test data generating device for risk assessment of a target large model; The test data includes one or more of text data, image data, audio data and video data.
5. The method according to claim 1, wherein searching for a target auxiliary test result matching the test result from the obtained auxiliary test results comprises: determining a similarity between the test result and each of the obtained auxiliary test results; The auxiliary test result with a similarity greater than a preset threshold is used as a target auxiliary test result matched with the test result found from the obtained auxiliary test results.
6. The method according to claim 5, wherein determining the similarity between the test result and each of the obtained auxiliary test results comprises: Determining the similarity between the test result and each of the obtained auxiliary test results by a similarity calculation rule; or, The test result and each of the obtained auxiliary test results are respectively input into a pre-trained similarity model to obtain the similarity between the test result and each of the obtained auxiliary test results. The similarity model is used to determine the similarity between two input data.
7. The method according to claim 1, wherein searching for a target auxiliary test result matching the test result from the obtained auxiliary test results comprises: Obtaining preset keywords contained in the test result; An auxiliary test result containing the keyword is searched from the obtained auxiliary test results, and the found auxiliary test result containing the keyword is used as a target auxiliary test result that matches the test result.
8. The method according to claim 2, further comprising: When it is detected that the test data in the test set is updated, the updated test data in the test set is respectively input into each of the auxiliary evaluation models, and the auxiliary test results corresponding to the updated test data output by each of the auxiliary evaluation models are obtained, and the label information corresponding to each auxiliary test result in the obtained auxiliary test results corresponding to the updated test data is determined; The test set is updated based on the updated test data, the auxiliary test results corresponding to the updated test data, and the label information corresponding to each auxiliary test result in the auxiliary test results corresponding to the updated test data, so as to perform risk assessment on the large model to be risk assessed based on the updated test set.
9. A large-scale risk assessment device, comprising: A test set acquisition module is used to acquire a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results. The test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively; A test module, inputting the test data into the target macro model to obtain a test result corresponding to the test data; The assessment result determination module searches for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determines the label information corresponding to the test result, and based on the label information corresponding to the test result, determines the risk assessment result of the target large model.
10. A large-model risk assessment device, comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Obtain a test set for risk assessment of a target large model, wherein the test set includes test data, auxiliary test results corresponding to the test data, and label information corresponding to the auxiliary test results, wherein the test data includes data of one or more different modalities, and the auxiliary test results are auxiliary test results corresponding to the test data output by each auxiliary assessment model obtained by inputting the test data into one or more different auxiliary assessment models respectively; Inputting the test data into the target macro model to obtain the test results corresponding to the test data; Search for a target auxiliary test result that matches the test result from the acquired auxiliary test results, and based on the label information corresponding to the target auxiliary test result, determine the label information corresponding to the test result, and based on the label information corresponding to the test result, determine the risk assessment result of the target large model.
Citation Information
Cited By
A safety evaluation system for large models
CN119740236A
Large model jailbreak attack test sample generation method and system
CN119988242A
A Method and System for Generating Test Examples of Large Model Jailbreak Attacks
CN119988242B
