Confidence evaluation method, device and equipment of large language model and storage medium

By obtaining a set of prompt words and calculating the confidence of the large language model, the problem of users having difficulty monitoring open source large language service models is solved, and effective evaluation of service quality and identification of degradation behavior are achieved on the user side.

CN120633650APending Publication Date: 2025-09-12TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510786019.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

It is difficult for users to effectively monitor open source large language service models, and it is difficult to provide evidence of degradation in the service models, making it difficult to ensure service quality.

Method used

By obtaining a set of prompt words and inputting them into the large language model to be evaluated, the confidence of each target sequence is calculated, and an evaluation result is generated based on the confidence distribution results. Abnormal sequences are screened out to determine whether the model has degradation behavior.

Benefits of technology

Effectively monitor the service quality of open source large language models on the user side, identify fraudulent behavior of service providers, and provide evidence of degradation of service models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120633650A_ABST
    Figure CN120633650A_ABST
Patent Text Reader

Abstract

The invention discloses a confidence evaluation method and device for a large language model, equipment and a storage medium, and the method comprises the steps: obtaining a cue word set which comprises a plurality of cue words; sequentially inputting a plurality of cue words in the cue word set into the to-be-evaluated large language model to obtain a target sequence generated by the to-be-evaluated large language model based on each cue word, and obtaining the confidence coefficient of each target sequence according to the confidence coefficient of each lexical element in each target sequence; and obtaining a generation number of the target sequences, determining a confidence degree distribution result of the to-be-evaluated large language model according to the confidence degrees of all the target sequences when the generation number reaches a preset number, and generating an evaluation result of the to-be-evaluated large language model according to the confidence degree distribution result. Therefore, the problems that it is difficult for a user to effectively monitor the open source large language service model and it is difficult to provide evidence that the service model has degradation behaviors are solved, and the service quality of the open source large language model can be monitored on the user side.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a confidence assessment method, apparatus, device, and storage medium for a large language model. Background Art

[0002] Open source large language model service providers may downgrade user-specified service models through various means (such as changing model size or model parameter accuracy), thereby reducing the cost of providing services and increasing profit margins. It is difficult for users to monitor the quality of service models and to verify the source of service models.

[0003] In the related art, there are the following methods for the problem of "detecting whether a specific result comes from a certain model": (1) a method based on zero-knowledge proof. This method requires the service provider to not only obtain the result through the model, but also to provide proof for the calculation process of obtaining the result, and return the result and the proof together to the user, so that the user can verify the source of the result; (2) a method based on on-chain verifier. This method introduces a third-party verifier and requires users, service providers, and verifiers to work together through smart contracts on the blockchain system, and use the trust guarantee provided by the consensus system to ensure the trustworthiness of the source of the service content.

[0004] However, the proof generation based on the zero-knowledge proof method requires a lot of computing time, which not only affects the real-time performance of the service, but also increases the cost of providing the service, and ultimately increases the price users need to pay for the service; the method based on the on-chain verifier requires users to pay verification fees for the verifier, which also increases user expenses. In addition, multiple rounds of interactions on the blockchain system will greatly affect the real-time performance of the service. In summary, in order to verify the trustworthiness of the model source, the relevant technologies need to generate proofs on the server side or have a third party verify the results, which introduces additional computing power and increases user expenses. Summary of the Invention

[0005] The present application provides a confidence assessment method, apparatus, device, and storage medium for a large language model to address the problem that it is difficult for users to effectively monitor open source large language service models and provide evidence of degradation behavior in the service model. The method can monitor the service quality of the open source large language model on the user side.

[0006] The first embodiment of the present application provides a confidence assessment method for a large language model, comprising the following steps:

[0007] Acquire a prompt word set, where the prompt word set includes multiple prompt words;

[0008] Inputting multiple prompt words in the prompt word set into the large language model to be evaluated in sequence, obtaining a target sequence generated by the large language model to be evaluated based on each prompt word, and obtaining a confidence score of each target sequence based on the confidence score of each word in each target sequence;

[0009] Obtain the number of target sequences generated, and when the number of generated sequences reaches a preset number, determine a confidence distribution result of the large language model to be evaluated based on the confidence of all target sequences, and generate an evaluation result of the large language model to be evaluated based on the confidence distribution result.

[0010] Optionally, in some embodiments, obtaining the confidence of each target sequence according to the confidence of each word in each target sequence includes:

[0011] For each target sequence, based on a preset window length, the product of the confidences of all word units in the target window is calculated to obtain the confidence of the subsequence, and the target window is slid along the target sequence until the target window covers the entire target sequence, obtaining the confidence of all subsequences in each target sequence;

[0012] The minimum value of the confidence of all subsequences in each target sequence is taken as the confidence of the corresponding target sequence.

[0013] Optionally, in some embodiments, determining a confidence distribution result of the large language model to be evaluated based on the confidences of all target sequences, and generating an evaluation result of the large language model to be evaluated based on the confidence distribution result, includes:

[0014] Based on the confidence levels of all target sequences, abnormal sequences whose confidence levels are not within a preset confidence interval are screened out;

[0015] Determine the abnormal ratio of the abnormal sequence in all target sequences, and judge whether the abnormal ratio is higher than a preset ratio threshold;

[0016] If the abnormal ratio is higher than the preset ratio threshold, it is determined that the evaluation result of the large language model to be evaluated is abnormal.

[0017] Optionally, in some embodiments, after determining that the evaluation result of the large language model to be evaluated is abnormal, the method includes:

[0018] Generate a reminder instruction of an abnormality of the large language model to be evaluated, and issue a reminder based on the reminder instruction.

[0019] Optionally, in some embodiments, after determining the confidence distribution result of the large language model to be evaluated according to the confidences of all target sequences, the method further includes:

[0020] Visualize the confidence distribution results.

[0021] A second embodiment of the present application provides a confidence assessment device for a large language model, comprising:

[0022] An acquisition module, configured to acquire a prompt word set, wherein the prompt word set includes a plurality of prompt words;

[0023] an input module, configured to sequentially input multiple prompt words in the prompt word set into the large language model to be evaluated, obtain a target sequence generated by the large language model to be evaluated based on each prompt word, and obtain a confidence score of each target sequence based on the confidence score of each word in each target sequence;

[0024] An evaluation module is configured to obtain the number of target sequence generations; and when the number of generation reaches a preset number, determine the confidence distribution result of the large language model to be evaluated based on the confidence of all target sequences, and generate an evaluation result of the large language model to be evaluated based on the confidence distribution result.

[0025] Optionally, in some embodiments, the input module includes:

[0026] a calculation unit configured to calculate, for each target sequence, based on a preset window length, the product of the confidences of all word units in a target window to obtain the confidence of a subsequence, and slide the target window along the target sequence until the target window covers the entire target sequence, thereby obtaining the confidence of all subsequences corresponding to each target sequence;

[0027] The generating unit is configured to take the minimum value of the confidences of all subsequences in each target sequence as the confidence of the corresponding target sequence.

[0028] Optionally, in some embodiments, the evaluation module includes:

[0029] a screening unit, configured to screen out abnormal sequences whose confidence levels are not within a preset confidence interval based on the confidence levels of all target sequences;

[0030] A judging unit, configured to determine an abnormal ratio of the abnormal sequence in all target sequences, and to judge whether the abnormal ratio is higher than a preset ratio threshold;

[0031] A determining unit is configured to determine that the evaluation result of the large language model to be evaluated is abnormal when the abnormal proportion is higher than the preset proportion threshold.

[0032] Optionally, in some embodiments, after determining that the evaluation result of the large language model to be evaluated is abnormal, the determining unit includes:

[0033] The reminder unit is used to generate a reminder instruction of an abnormality of the large language model to be evaluated, and to provide a reminder based on the reminder instruction.

[0034] Optionally, in some embodiments, after determining the confidence distribution result of the large language model to be evaluated based on the confidences of all target sequences, the evaluation module includes:

[0035] A visualization unit is used to visualize the confidence distribution result.

[0036] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the program to implement the confidence assessment method for a large language model as described in the above embodiment.

[0037] The fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the confidence assessment method for a large language model as described in the above embodiment.

[0038] Thus, by obtaining a prompt word set, the prompt word set includes multiple prompt words, and sequentially inputting multiple prompt words in the prompt word set into the large language model to be evaluated, a target sequence generated by the large language model to be evaluated based on each prompt word is obtained, and the confidence of each target sequence is obtained based on the confidence of each word in each target sequence, and the number of target sequences generated is obtained. When the number of generated target sequences reaches a preset number, the confidence distribution result of the large language model to be evaluated is determined based on the confidence of all target sequences, and an evaluation result of the large language model to be evaluated is generated based on the confidence distribution result. This solves the problem that it is difficult for users to effectively monitor open source large language service models and difficult to provide evidence of degradation behavior in service models. The service quality of open source large language models can be monitored on the user side.

[0039] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0041] Figure 1 A flowchart of a confidence assessment method for a large language model provided according to an embodiment of the present application;

[0042] Figure 2 A schematic diagram illustrating the principles of a confidence assessment method for a large language model according to one embodiment of the present application;

[0043] Figure 3 A schematic diagram of the principle of a verification algorithm provided according to one embodiment of the present application;

[0044] Figure 4 Schematic diagram of a block diagram of a confidence assessment device for a large language model provided according to an embodiment of the present application;

[0045] Figure 5 A schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0046] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0047] The following describes the confidence assessment method, device, electronic device and storage medium of the large language model of the embodiment of the present application with reference to the accompanying drawings. In response to the problem mentioned in the above background technology that it is difficult for users to effectively monitor the open source large language service model and it is difficult to provide evidence of degradation behavior of the service model, the present application provides a confidence assessment method for a large language model, in which a prompt word set is obtained, the prompt word set contains multiple prompt words, and the multiple prompt words in the prompt word set are sequentially input into the large language model to be evaluated, a target sequence generated by the large language model to be evaluated based on each prompt word is obtained, and the confidence of each target sequence is obtained according to the confidence of each word in each target sequence, and the number of target sequences generated is obtained, and when the number of generated sequences reaches a preset number, the confidence distribution result of the large language model to be evaluated is determined according to the confidence of all target sequences, and the evaluation result of the large language model to be evaluated is generated according to the confidence distribution result. Thus, the problem that it is difficult for users to effectively monitor the open source large language service model and it is difficult to provide evidence of degradation behavior of the service model is solved, and the service quality of the open source large language model can be monitored on the user side.

[0048] Specifically, Figure 1 A flowchart of a confidence assessment method for a large language model provided in an embodiment of the present application.

[0049] like Figure 1 As shown, the confidence evaluation method of the large language model includes the following steps:

[0050] In step S101 , a prompt word set is obtained, where the prompt word set includes a plurality of prompt words.

[0051] In step S102, multiple prompt words in the prompt word set are sequentially input into the large language model to be evaluated to obtain a target sequence generated by the large language model to be evaluated based on each prompt word, and the confidence of each target sequence is obtained according to the confidence of each word in each target sequence.

[0052] Among them, the confidence is used to indicate the possibility that the "generated content" of a sequence is generated by the "large language model to be evaluated" based on the "user prompt word".

[0053] It should be noted that before describing the embodiments of this application, we will first introduce parameter offloading technology. Parameter offloading technology utilizes the computing and storage resources provided by the CPU and hard disk, allowing large models that cannot be run solely through the user-side graphics card to run in collaboration with the "graphics card, CPU, and hard disk." Based on this technology, users can locally deploy the open source large models they need to obtain services, thereby also having the ability to monitor the quality of service content. An important unit of the large model service is the sequence, which consists of a prompt word provided by the user and the subsequent content generated by the model based on the prompt word.

[0054] Specifically, if Figure 2 As shown, the embodiment of the present application obtains multiple prompt words input by the user and inputs the multiple prompt words into the large language model to be evaluated. The large language model to be evaluated will generate a corresponding target sequence based on each prompt word. The user uses the target sequence (prompt word + server model result) output by the large language model to be evaluated (i.e., the server) as the input of the preset local large model, and obtains the output of the preset local large model for each word (token) generated by the service provider. According to the relative size of the actual generated word output in the entire vocabulary, a "word-level confidence index" can be obtained, which indicates the possibility that a certain word is generated by the user-specified model.

[0055] Optionally, in some embodiments, the confidence of each target sequence is obtained based on the confidence of each word in each target sequence, including: for each target sequence, based on a preset window length, calculating the product of the confidences of all word units in the target window to obtain the confidence of the subsequence, and sliding the target window along the target sequence until the target window covers the entire target sequence, to obtain the confidence of all subsequences in each target sequence; and taking the minimum value of the confidences of all subsequences in each target sequence as the confidence of the corresponding target sequence.

[0056] The preset window length may be pre-set by the user, obtained through a limited number of experiments, or obtained through a limited number of computer simulations, and is not specifically limited here.

[0057] For example, users need to purchase the inference service of the first open source model from the service provider (reference price is 0.02 yuan / thousand tokens), but the service provider can actually deploy the second open source model, a weaker model of the same series (reference price is 0.01 yuan / thousand tokens) to complete the user's request, thereby saving costs. Users cannot infer the type of model used by the service provider solely from the text generated by the service provider, and their interests are damaged.

[0058] The user deploys a verification algorithm on the local device and can obtain a sequence-level confidence indicator based on the text generated by the service provider. The distribution of this confidence indicator can indicate whether the text is generated by the user-specified model, thereby enabling the user to identify possible fraudulent behavior of the service provider. Figure 3 As shown, the user side inputs the text output by the large language model (server) to be evaluated into the first open source model running on the user device based on parameter offloading technology, processes the token sampling probability output by it, and obtains a series of token-level confidences. The confidences of adjacent tokens are multiplied according to a specific window length to obtain the subsequence-level confidence. The confidences of all subsequences in a sequence are minimized to obtain the sequence-level confidence.

[0059] In step S103, the number of generated target sequences is obtained, and when the number of generated sequences reaches a preset number, the confidence distribution result of the large language model to be evaluated is determined according to the confidence of all target sequences, and the evaluation result of the large language model to be evaluated is generated according to the confidence distribution result.

[0060] Furthermore, in some embodiments, a confidence distribution result of the large language model to be evaluated is determined based on the confidence of all target sequences, and an evaluation result of the large language model to be evaluated is generated based on the confidence distribution result, including: based on the confidence of all target sequences, screening out abnormal sequences whose confidence is not within a preset confidence interval; determining the abnormal proportion of abnormal sequences in all target sequences, and judging whether the abnormal proportion is higher than a preset proportion threshold; if the abnormal proportion is higher than the preset proportion threshold, determining that the evaluation result of the large language model to be evaluated is abnormal.

[0061] Among them, the preset number, preset confidence interval and preset ratio threshold can be pre-set by the user, can be obtained through a limited number of experiments, or can be obtained through a limited number of computer simulations, and are not specifically limited here.

[0062] It can be understood that if the service provider does use the first open source model specified by the user to generate text, the sequence-level confidence calculated according to the above steps will be very close to 1 (due to the differences in software and hardware platforms between the service-side and user-side devices, the confidence will not be completely equal to 1); if the service provider downgrades the model, such as using the second open source model, the sequence-level confidence calculated according to the above steps will be significantly lower than 1.

[0063] Specifically, after obtaining the confidence metric for each sequence, users cannot yet assess the service quality of each sequence independently. This is because, for simpler user prompts, the downgraded model is fully capable of generating nearly identical results as the original model, and for these sequences, the calculated sequence confidence remains very high. Therefore, it is necessary to monitor service quality based on the distribution of sequence confidence over a larger sample size. Experimental results show that for providers that provide services based on user-specified models, the confidence of the sequences they generate is overwhelmingly higher than 0.99 (confidence values ​​range from 0 to 1). However, for providers that employ various common model downgrading techniques, at best, they achieve high confidence in approximately 40% of sequences—a significant difference that is easily discernible to users.

[0064] During actual execution, the embodiment of the present application traverses all target sequences and checks whether the confidence of each sequence is within a preset confidence interval. If it is not within the preset confidence interval, it is marked as an abnormal sequence, and the data of the abnormal sequences is counted. The total sequence data is also counted. The proportion of abnormal sequences is calculated based on the number of abnormal sequences and the total sequence data. It is determined whether the abnormal proportion is higher than a preset ratio threshold. If the model output has many abnormalities, the evaluation result is abnormal. The service provider may provide a degraded service model.

[0065] Optionally, in some embodiments, after determining that the evaluation result of the large language model to be evaluated is abnormal, the method includes: generating a reminder instruction that the large language model to be evaluated is abnormal, and performing a reminder based on the reminder instruction.

[0066] Specifically, in order to enable users to promptly discover abnormal problems in the large language model to be evaluated, reminder instructions can be generated and reminders can be made in a timely manner. According to the specific content of the abnormal situation, a reminder instruction is automatically generated and sent to the user through an appropriate method (such as email, text message, system notification, etc.) so that they can notice the problem in time and take corresponding measures.

[0067] Optionally, in some embodiments, after determining the confidence distribution result of the large language model to be evaluated according to the confidences of all target sequences, the method further includes: visualizing the confidence distribution result.

[0068] Specifically, the embodiment of the present application can calculate the overall confidence distribution result of the large language model to be evaluated based on the confidence of all target sequences, which may include statistical information such as the mean, variance, and distribution shape of the confidence, and visualize the confidence distribution result. For example, the distribution of confidence can be displayed through a histogram to intuitively present the concentrated area and dispersion of the confidence.

[0069] According to the confidence evaluation method of the large language model proposed in the embodiment of the present application, a prompt word set is obtained, the prompt word set includes multiple prompt words, and the multiple prompt words in the prompt word set are sequentially input into the large language model to be evaluated, and the target sequence generated by the large language model to be evaluated based on each prompt word is obtained, and the confidence of each target sequence is obtained according to the confidence of each word in each target sequence, and the number of generated target sequences is obtained. When the number of generated sequences reaches a preset number, the confidence distribution result of the large language model to be evaluated is determined according to the confidence of all target sequences, and the evaluation result of the large language model to be evaluated is generated according to the confidence distribution result. Thus, the problem that it is difficult for users to effectively monitor the open source large language service model and provide evidence of degradation behavior of the service model is solved, and the service quality of the open source large language model can be monitored on the user side.

[0070] Next, the confidence assessment device for a large language model proposed in an embodiment of the present application will be described with reference to the accompanying drawings.

[0071] Figure 4 4 is a block diagram of a confidence assessment device for a large language model according to an embodiment of the present application.

[0072] like Figure 4 As shown, the confidence evaluation device 10 for a large language model includes: an acquisition module 100 , an input module 200 and an evaluation module 300 .

[0073] The acquisition module 100 is used to acquire a prompt word set, which includes multiple prompt words.

[0074] The input module 200 is used to sequentially input multiple prompt words in the prompt word set into the large language model to be evaluated, obtain a target sequence generated by the large language model to be evaluated based on each prompt word, and obtain the confidence of each target sequence based on the confidence of each word in each target sequence.

[0075] The evaluation module 300 is used to obtain the number of target sequences generated; and when the number of generated sequences reaches a preset number, determine the confidence distribution result of the large language model to be evaluated based on the confidence of all target sequences, and generate an evaluation result of the large language model to be evaluated based on the confidence distribution result.

[0076] Optionally, in some embodiments, the input module 200 includes: a calculation unit and a generation unit.

[0077] Among them, the calculation unit is used to calculate the product of the confidence of all word units in the target window for each target sequence based on a preset window length to obtain the confidence of the subsequence, and slide the target window along the target sequence until the target window covers the entire target sequence to obtain the confidence of all subsequences corresponding to each target sequence.

[0078] The generating unit is configured to take the minimum value of the confidences of all subsequences in each target sequence as the confidence of the corresponding target sequence.

[0079] Optionally, in some embodiments, the evaluation module 300 includes: a screening unit, a judgment unit, and an evaluation unit.

[0080] The screening unit is configured to screen out abnormal sequences whose confidence levels are not within a preset confidence interval based on the confidence levels of all target sequences.

[0081] The judgment unit is used to determine the abnormal ratio of the abnormal sequence in all target sequences and to judge whether the abnormal ratio is higher than a preset ratio threshold.

[0082] The determination unit is configured to determine that the evaluation result of the large language model to be evaluated is abnormal when the abnormality ratio is higher than a preset ratio threshold.

[0083] Optionally, in some embodiments, after determining that the evaluation result of the large language model to be evaluated is abnormal, the determining unit includes: a prompting unit.

[0084] Among them, the reminder unit is used to generate a reminder instruction of the abnormality of the large language model to be evaluated, and to provide a reminder based on the reminder instruction.

[0085] Optionally, in some embodiments, after determining the confidence distribution result of the large language model to be evaluated according to the confidences of all target sequences, the evaluation module 300 includes: a visualization unit.

[0086] Among them, the visualization unit is used to visualize the confidence distribution results.

[0087] It should be noted that the above explanation of the embodiment of the confidence assessment method for a large language model is also applicable to the confidence assessment device for a large language model in this embodiment, and will not be repeated here.

[0088] According to the confidence evaluation device for a large language model proposed in an embodiment of the present application, a prompt word set is obtained, the prompt word set includes multiple prompt words, and multiple prompt words in the prompt word set are sequentially input into the large language model to be evaluated, thereby obtaining a target sequence generated by the large language model to be evaluated based on each prompt word, and obtaining the confidence of each target sequence based on the confidence of each word in each target sequence, and obtaining the number of target sequences generated. When the number of generated sequences reaches a preset number, the confidence distribution result of the large language model to be evaluated is determined based on the confidence of all target sequences, and an evaluation result of the large language model to be evaluated is generated based on the confidence distribution result. Thus, the problem that it is difficult for users to effectively monitor the open source large language service model and provide evidence of degradation behavior of the service model is solved, and the service quality of the open source large language model can be monitored on the user side.

[0089] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0090] Memory 501 , processor 502 , and computer programs stored in the memory 501 and executable on the processor 502 .

[0091] When the processor 502 executes the program, the confidence assessment method for the large language model provided in the above embodiment is implemented.

[0092] Furthermore, the electronic device further includes:

[0093] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0094] The memory 501 is used to store computer programs that can be run on the processor 502 .

[0095] The memory 501 may include a high-speed RAM (Random Access Memory) memory, and may also include a non-volatile memory, such as at least one disk memory.

[0096] If the memory 501, the processor 502, and the communication interface 503 are implemented independently, the communication interface 503, the memory 501, and the processor 502 can be connected to each other via a bus and communicate with each other. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0097] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0098] The processor 502 may be a CPU (Central Processing Unit), or an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application.

[0099] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the confidence assessment method for a large language model as described above.

[0100] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0101] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of this application, "N" means at least two, for example, two, three, etc., unless otherwise specifically defined.

[0102] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present application belong.

[0103] It should be understood that various parts of the present application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiment, the N steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array, a field programmable gate array, etc.

[0104] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.

[0105] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A confidence assessment method for a large language model, characterized in that: The following steps are involved: Acquire a prompt word set, where the prompt word set includes multiple prompt words; Inputting multiple prompt words in the prompt word set into the large language model to be evaluated in sequence, obtaining a target sequence generated by the large language model to be evaluated based on each prompt word, and obtaining a confidence score of each target sequence based on the confidence score of each word in each target sequence; Obtain the number of target sequences generated, and when the number of generated sequences reaches a preset number, determine a confidence distribution result of the large language model to be evaluated based on the confidence of all target sequences, and generate an evaluation result of the large language model to be evaluated based on the confidence distribution result.

2. The method according to claim 1, characterized in that The step of obtaining the confidence of each target sequence according to the confidence of each word in each target sequence includes: For each target sequence, based on a preset window length, the product of the confidences of all word units in the target window is calculated to obtain the confidence of the subsequence, and the target window is slid along the target sequence until the target window covers the entire target sequence, obtaining the confidence of all subsequences in each target sequence; The minimum value of the confidence of all subsequences in each target sequence is taken as the confidence of the corresponding target sequence.

3. The method according to claim 1, characterized in that Determining a confidence distribution result of the large language model to be evaluated based on the confidences of all target sequences, and generating an evaluation result of the large language model to be evaluated based on the confidence distribution result, includes: Based on the confidence levels of all target sequences, abnormal sequences whose confidence levels are not within a preset confidence interval are screened out; Determine the abnormal ratio of the abnormal sequence in all target sequences, and judge whether the abnormal ratio is higher than a preset ratio threshold; If the abnormal ratio is higher than the preset ratio threshold, it is determined that the evaluation result of the large language model to be evaluated is abnormal.

4. The method according to claim 3, characterized in that After determining that the evaluation result of the large language model to be evaluated is abnormal, the method includes: Generate a reminder instruction of an abnormality of the large language model to be evaluated, and issue a reminder based on the reminder instruction.

5. The method according to claim 1, wherein After determining the confidence distribution result of the large language model to be evaluated based on the confidence of all target sequences, the method includes: Visualize the confidence distribution results.

6. A confidence assessment device for a large language model, characterized in that: include: An acquisition module, configured to acquire a prompt word set, wherein the prompt word set includes a plurality of prompt words; an input module, configured to sequentially input multiple prompt words in the prompt word set into the large language model to be evaluated, obtain a target sequence generated by the large language model to be evaluated based on each prompt word, and obtain a confidence score of each target sequence based on the confidence score of each word in each target sequence; Evaluation module, used to obtain the number of generated target sequences; When the generated number reaches a preset number, the confidence distribution result of the large language model to be evaluated is determined according to the confidence of all target sequences, and the evaluation result of the large language model to be evaluated is generated according to the confidence distribution result.

7. The device according to claim 6, characterized in that The input module comprises: a calculation unit configured to calculate, for each target sequence, based on a preset window length, the product of the confidences of all word units in a target window to obtain the confidence of a subsequence, and slide the target window along the target sequence until the target window covers the entire target sequence, thereby obtaining the confidence of all subsequences corresponding to each target sequence; The generating unit is configured to take the minimum value of the confidences of all subsequences in each target sequence as the confidence of the corresponding target sequence.

8. The device according to claim 6, characterized in that The evaluation module includes: a screening unit, configured to screen out abnormal sequences whose confidence levels are not within a preset confidence interval based on the confidence levels of all target sequences; A judging unit, configured to determine an abnormal ratio of the abnormal sequence in all target sequences, and to judge whether the abnormal ratio is higher than a preset ratio threshold; A determining unit is configured to determine that the evaluation result of the large language model to be evaluated is abnormal when the abnormal proportion is higher than the preset proportion threshold.

9. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the confidence assessment method for a large language model according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the confidence assessment method for a large language model as described in any one of claims 1 to 5.