Evaluation method and device for large model
By constructing evaluation questions and answers that are not included in the training corpus, designing multiple problem templates, and rating them in combination with human preferences, the fairness and deviation problems in large language model evaluation are solved, and a more fair and efficient evaluation is achieved. Effect.
Patent Information
- Application Number
- CN202411109907.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-11-26
AI Technical Summary
It is difficult for the prior art to fairly evaluate the common knowledge and language knowledge ability of large language models, and the evaluation data is easily leaked and embedded in the model, resulting in deviations. Traditional evaluation standards have inherent limitations and affect user experience.
Provide an evaluation method and device, by obtaining knowledge reference data sets, construct evaluation questions and answers that are not included in the training corpus, design multiple problem templates, use preset evaluation standards to evaluate large language models, and combine human preferences. Perform ratings to reduce individual model bias.
A variety of knowledge types of abilities for a more fair evaluation model are achieved, which prevents data pollution, reduces the impact of problem template design on evaluation, and reduces the bias of individual evaluation models and improves user experience.
Smart Images

Figure CN119026593A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure generally relates to the field of data processing technology, and in particular to the field of natural language processing technology. More specifically, it relates to an evaluation method and device for large models. Background Art
[0002] In the related field, the emergence of large language models (LLM) represented by ChatGPT (a chatbot program) (hereinafter referred to as "large models") has triggered a new wave of technological development. Recently, with the continuous development of large models, various types of LLMs (such as Llama3 and ChatGLM3) have demonstrated strong performance and generalization capabilities in various natural language processing tasks. Large models are able to obtain a lot of knowledge, but there will be hallucination problems, for example, LLM may output wrong knowledge as output results.
[0003] Therefore, evaluating the knowledge mastery and knowledge application capabilities of these LLMs is crucial to solving the hallucination problem of large models and further building accurate and stable systems based on LLMs. Therefore, in order to solve the above problems, it is necessary to evaluate the knowledge stored in large models. Summary of the invention
[0004] The embodiments of the present disclosure provide a method and device for evaluating a large model, thereby achieving a more fair evaluation of the various knowledge type capabilities of the large model and making up for the related deficiencies in the field of large model knowledge evaluation.
[0005] In one general aspect, a method for evaluating a large language model is provided, the method comprising: obtaining a knowledge reference dataset, the knowledge reference dataset comprising at least one of a common sense knowledge reference dataset, a world knowledge reference dataset, and a language knowledge reference dataset; constructing evaluation questions that are not included in a training corpus for the large language model and evaluation answers corresponding to the evaluation questions based on the knowledge reference dataset; constructing a plurality of question templates for the knowledge relationship of each evaluation question, so that each evaluation question and its corresponding evaluation answer and the plurality of question templates constitute an evaluation database for the large language model; and evaluating the large language model to be evaluated using the evaluation database according to a preset evaluation standard to obtain an evaluation result of the large language model to be evaluated.
[0006] Optionally, the knowledge reference dataset may include: at least one of: an ATOMIC-based dataset, a Conceptnet-based dataset, a Wikidata-based dataset, and a Wordnet-based dataset.
[0007] Optionally, the step of constructing, based on the knowledge reference dataset, evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions may include: creating multiple evaluation questions including multiple-choice questions, fill-in-the-blank questions, and open-ended generative question-answering questions that are not included in the training corpus for the large language model based on the knowledge reference dataset, and constructing the evaluation questions and evaluation answers corresponding to the evaluation questions.
[0008] Optionally, the step of constructing multiple question templates for the knowledge relationship of each evaluation question may include: for the knowledge relationship of each evaluation question, expanding the question template of the knowledge relationship by utilizing a predetermined large language model to obtain a set of expanded question templates as multiple question templates for each evaluation question.
[0009] Optionally, the step of evaluating the large language model to be evaluated using the evaluation database according to a preset evaluation standard to obtain the evaluation result of the large language model to be evaluated may include: performing the following processing for each evaluation question according to the preset evaluation standard: evaluating multiple large language models using the evaluation database to obtain an evaluation result set for each large language model; performing a correlation analysis on the evaluation result set for each large language model and a predetermined preference data set to determine an evaluation result set for a predetermined number of large language models with relatively high correlation, and using the predetermined number of large language models with relatively high correlation as the large language models to be evaluated; performing a scoring operation on the evaluation result set corresponding to the large language model to be evaluated to obtain the final evaluation result of the large language model to be evaluated, wherein the scoring operation represents: an operation of scoring the evaluation answer corresponding to each evaluation question for each large language model in the large language model to be evaluated based on the preset scoring standard.
[0010] Optionally, when the knowledge reference dataset includes a common sense knowledge reference dataset, the preset evaluation criteria may include: evaluating the ability of the large language model to be evaluated to understand and apply abstract knowledge in a contextualized manner.
[0011] Optionally, when the knowledge reference dataset includes a world knowledge reference dataset, the preset evaluation criteria may include: evaluating the mastery of the number of associations of different frequencies and / or knowledge with timeliness by the large language model to be evaluated.
[0012] Optionally, when the knowledge reference data set includes a language knowledge reference data set, the preset evaluation criteria may include: performing semantic evaluation, grammatical evaluation and pragmatic evaluation on the large language model to be evaluated, wherein the semantic evaluation includes a semantic selection task, a similar word task and an idiom interpretation task, the grammatical evaluation includes a part-of-speech analysis task and a grammar correction task, and the pragmatic evaluation includes a special format generation task, a sentiment analysis task and a writing style imitation task.
[0013] In another general aspect, there is provided an evaluation device for a large language model, the evaluation device comprising: an acquisition module, configured to: acquire a knowledge reference data set, the knowledge reference data set comprising at least one of a common sense knowledge reference data set, a world knowledge reference data set and a language knowledge reference data set; a construction module, configured to: construct, based on the knowledge reference data set, evaluation questions that are not included in a training corpus for the large language model and evaluation answers corresponding to the evaluation questions, and construct a variety of question templates for the knowledge relationship of each evaluation question, so that each evaluation question and its corresponding evaluation answer and the variety of question templates constitute an evaluation database for the large language model; an evaluation module, configured to: evaluate the large language model to be evaluated using the evaluation database according to a preset evaluation standard, and obtain an evaluation result of the large language model to be evaluated.
[0014] Optionally, the knowledge reference dataset may include: at least one of: an ATOMIC-based dataset, a Conceptnet-based dataset, a Wikidata-based dataset, and a Wordnet-based dataset.
[0015] Optionally, the operation of the construction module constructing evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions based on the knowledge reference dataset may include: creating multiple evaluation questions including multiple-choice questions, fill-in-the-blank questions and open-ended generative question-answering questions that are not included in the training corpus for the large language model based on the knowledge reference dataset, and constructing the evaluation questions and evaluation answers corresponding to the evaluation questions.
[0016] Optionally, the construction module may construct multiple question templates for the knowledge relationship of each evaluation question, including: for the knowledge relationship of each evaluation question, expanding the question template of the knowledge relationship by utilizing a predetermined large language model to obtain a set of expanded question templates as the multiple question templates for each evaluation question.
[0017] Optionally, the evaluation module uses the evaluation database to evaluate the large language model to be evaluated according to preset evaluation criteria, and the operation of obtaining the evaluation result of the large language model to be evaluated may include: according to the preset evaluation criteria, for each evaluation question, performing the following processing: using the evaluation database to evaluate multiple large language models to obtain an evaluation result set for each large language model; performing a correlation analysis on the evaluation result set for each large language model and a predetermined preference data set to determine the evaluation result sets for a predetermined number of large language models with relatively high correlation, and using the predetermined number of large language models with relatively high correlation as the large language models to be evaluated; performing a scoring operation on the evaluation result sets corresponding to the large language models to be evaluated to obtain the final evaluation result of the large language model to be evaluated, wherein the scoring operation represents: an operation of scoring the evaluation answer corresponding to each evaluation question for each large language model in the large language models to be evaluated based on the preset scoring criteria.
[0018] Optionally, when the knowledge reference dataset includes a common sense knowledge reference dataset, the preset evaluation criteria may include: evaluating the ability of the large language model to be evaluated to understand and apply abstract knowledge in a contextualized manner.
[0019] Optionally, when the knowledge reference dataset includes a world knowledge reference dataset, the preset evaluation criteria may include: evaluating the mastery of the number of associations of different frequencies and / or knowledge with timeliness by the large language model to be evaluated.
[0020] Optionally, when the knowledge reference data set includes a language knowledge reference data set, the preset evaluation criteria may include: performing semantic evaluation, grammatical evaluation and pragmatic evaluation on the large language model to be evaluated, wherein the semantic evaluation includes a semantic selection task, a similar word task and an idiom interpretation task, the grammatical evaluation includes a part-of-speech analysis task and a grammar correction task, and the pragmatic evaluation includes a special format generation task, a sentiment analysis task and a writing style imitation task.
[0021] In another general aspect, a computer program product is provided, the computer program product comprising a computer program / instructions, which implement the evaluation method described above when executed by a processor.
[0022] In another general aspect, a computer-readable storage medium is provided, which, when instructions in the computer-readable storage medium are executed by a processor of an electronic device / server, enables the electronic device / server to perform the evaluation method as described above.
[0023] In another general aspect, a computer device is provided, comprising: at least one processor; and at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, cause the at least one processor to perform the evaluation method as described above.
[0024] According to the evaluation method and device for large models of the embodiments of the present disclosure, a more fair evaluation of the various knowledge type capabilities of large models is achieved, and the relevant defects in the field of large model knowledge evaluation are compensated. In addition, by proposing new questions and their answers that will not appear in the training corpus based on data sets in multiple fields, data contamination is effectively prevented. In addition, by designing a variety of question templates, the impact of question template design on the evaluation is effectively reduced. In addition, according to the evaluation criteria of the embodiments of the present disclosure, by being consistent with preset preferences (such as human preferences) and adopting a scoring strategy, the inherent bias defects of individual evaluation models are effectively reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The above and other objects and features of the embodiments of the present disclosure will become more apparent through the following description in conjunction with the accompanying drawings showing the embodiments, in which:
[0026] Figure 1 is a flow chart showing an evaluation method for a large model according to an embodiment of the present disclosure;
[0027] Figure 2 is a system architecture diagram showing an exemplary evaluation platform according to an embodiment of the present disclosure;
[0028] Figure 3A is a schematic diagram showing evaluation results according to an embodiment of the present disclosure;
[0029] Figure 3B is a schematic diagram showing evaluation results according to an embodiment of the present disclosure;
[0030] Figure 4 is a structural block diagram showing an evaluation device for a large model according to an embodiment of the present disclosure;
[0031] Figure 5 is a block diagram illustrating a computer device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] The following specific embodiments are provided to help the reader obtain a comprehensive understanding of the methods, devices and / or systems described herein. However, after understanding the disclosure of the present application, various changes, modifications and equivalents of the methods, devices and / or systems described herein will be clear. For example, the order of operations described herein is only an example and is not limited to those orders set forth herein, but can be changed as will be clear after understanding the disclosure of the present application, except for operations that must occur in a specific order. In addition, for greater clarity and simplicity, the description of features known in the art may be omitted.
[0033] Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to like parts throughout. The embodiments will be described below with reference to the drawings in order to explain the present disclosure.
[0034] In related technologies, constructing a reasonable knowledge evaluation standard requires considering the following three factors:
[0035] (1) Most evaluations are limited to world knowledge related to entities and relations, and lack evaluation of common sense knowledge and language knowledge. This limitation arises because these two types of knowledge are usually expressed in the form of events or sentences. Therefore, it is still difficult to conduct fair evaluation of sentences generated by large models.
[0036] (2) Most evaluation platforms have limitations in terms of evaluation data. Specifically, evaluation data is usually leaked and embedded into the target model during pre-training or SFT (i.e., supervised fine-tuning) after being publicly released, so there will be bias in evaluating such data. In addition, existing knowledge exploration strategies usually rely heavily on the given prompts, and existing methods only use one prompt for each piece of knowledge. If the target model cannot understand the given prompts well, good results will not be obtained.
[0037] (3) Using multiple-choice questions and true-or-false questions to evaluate knowledge may obviously introduce certain biases. Using question-and-answer questions to evaluate knowledge requires reasonable evaluation criteria (or "indicators") for the content generated by the model. Traditional evaluation criteria (such as GLUE, ROUGE, and RECALL) have inherent limitations and may cause the evaluation results to greatly reduce the user experience. Although manual evaluation is highly reliable, it is time-consuming and laborious.
[0038] In order to solve the above problems in the related art, the present disclosure constructs a more fair large model knowledge ability evaluation platform (for example, Figure 2 As shown in Figure 2, the purpose is to evaluate the ability of the large model in terms of common sense knowledge, world knowledge and language knowledge. In the process of conceiving the evaluation method, the present disclosure fully considers the influence of the above three factors to avoid the above problems.
[0039] Refer to the following Figures 1 to 5 The evaluation method and device for a large language model according to an embodiment of the present disclosure are described in detail.
[0040] Figure 1 is a flowchart illustrating an evaluation method 100 for a large language model according to an embodiment of the present disclosure.
[0041] Reference Figure 1 According to an embodiment of the present disclosure, in step S101, a knowledge reference dataset is acquired, and the knowledge reference dataset includes at least one of a common sense knowledge reference dataset, a world knowledge reference dataset, and a language knowledge reference dataset.
[0042] Here, in view of the scope of the above-mentioned knowledge reference data set, the present disclosure adopts a knowledge capability evaluation system based on common sense knowledge, world knowledge and language knowledge as the knowledge framework, classifies knowledge, designs tasks for different knowledge types, and evaluates the model's capabilities in this knowledge in a more fine-grained manner.
[0043] Optionally, the knowledge reference dataset may include: at least one of: an ATOMIC-based dataset, a Conceptnet-based dataset, a Wikidata-based dataset, and a Wordnet-based dataset, as a source of knowledge data, but the present disclosure is not limited thereto, and may be a corpus and knowledge graph of multiple other related knowledge fields, that is, knowledge corpora of the above three knowledge types can be obtained from the corpus and knowledge graph to construct evaluation questions.
[0044] Specifically, common sense knowledge is usually implicit in the text, which brings challenges to LLM to directly obtain common sense knowledge in large quantities from the text corpus. Therefore, a deep understanding of common sense is crucial for LLM to generate reasonable responses.
[0045] In addition, with regard to world knowledge, world knowledge plays a key role in the performance of LLM. Based on the memory and manipulation of world knowledge, LLM can provide more accurate and relevant questions and answers to users' questions.
[0046] In addition, for language knowledge, a deep understanding of grammar, semantics, and pragmatics enables LLM to grasp language nuances and effectively process texts. Taking WordNet as a knowledge corpus of language knowledge as an example, the evaluation of language knowledge is divided into three aspects: semantic evaluation, grammatical evaluation, and pragmatic evaluation. By considering the wide range of grammar, semantics, and pragmatics, the present disclosure proposes four knowledge-based tasks and four combined natural language understanding and natural language generation tasks for the language knowledge ability evaluation of large models (described later).
[0047] According to an embodiment of the present disclosure, in step S102, based on the knowledge reference data set, evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions are constructed.
[0048] As an example, step S102 may further include: creating multiple evaluation questions including multiple-choice questions, fill-in-the-blank questions, and open-ended generative question-answering questions based on a knowledge reference data set and not included in a training corpus for a large language model, constructing evaluation questions and evaluation answers corresponding to the evaluation questions.
[0049] Specifically, for example, the above knowledge is usually expressed as a triple, such as,<head,relation,tail> The present disclosure designs question templates for relations, inserts the heads of triples into them, and thus creates questions with answers. A more objective and rigorous knowledge ability assessment dataset is constructed by designing multiple-choice questions, fill-in-the-blank questions, and QA (i.e., question-answering) open generative question-answering questions in a variety of question templates and question forms. Therefore, questions for the target knowledge domain can be automatically generated.
[0050] According to an embodiment of the present disclosure, data contamination is effectively prevented by utilizing knowledge obtained from a corpus and a knowledge graph to construct new questions that are guaranteed not to appear in the training corpus.
[0051] According to an embodiment of the present disclosure, in step S103, a variety of question templates are constructed for the knowledge relationship of each evaluation question, so that each evaluation question and its corresponding evaluation answer and a variety of question templates constitute an evaluation database for a large language model.
[0052] As an example, step S103 may further include: for each evaluation question's knowledge relationship, expanding the question template of the knowledge relationship by using a predetermined large language model to obtain a set of expanded question templates as multiple question templates for each evaluation question.
[0053] Specifically, for example, for each question template of each knowledge relationship, the present disclosure proposes an expansion method for question templates. The expansion method involves enhancing a set of question templates by utilizing four advanced models (e.g., four large models). For each question template group, a predetermined number (e.g., but not limited to, twenty) of general and diverse question templates are selected. Due to the diversity of question templates, data contamination problems are effectively avoided.
[0054] According to the embodiments of the present disclosure, by designing a variety of question templates, the adverse effects of question template design on subsequent evaluations can be effectively mitigated.
[0055] In addition, in order to evaluate the sensitivity of different models to different prompts, the present disclosure can evaluate the entropy of each large model's response to the same knowledge and different prompts. Specifically, assuming that after completing the multiple-choice questions, Ω={...,ω j ,...,ω k} clusters of responses, each cluster ω k The number of k ), then the entropy of the answer distribution is calculated as shown in the following formula (1):
[0056]
[0057] In formula (1), n means: for the same piece of knowledge, n question templates are designed, that is, there are n responses, and q means the set of questions for the preset piece of knowledge.
[0058] According to an embodiment of the present disclosure, in step S104, the large language model to be evaluated is evaluated using an evaluation database according to a preset evaluation standard to obtain an evaluation result of the large language model to be evaluated.
[0059] According to an embodiment of the present disclosure, when the knowledge reference dataset includes a common sense knowledge reference dataset, the preset evaluation criteria may include: evaluating the ability of the large language model to be evaluated to understand and apply abstract knowledge in a contextualized manner.
[0060] For example, we take two common sense knowledge graphs, Atomic and ConceptNet, as examples to obtain common sense knowledge from these two common sense knowledge graphs. Atomic captures various daily relationships and inferences about other people’s mental states in symbolic form, represented by triples, for example,<head,relation,tail> ConceptNet contains general attributes of common entities, which can also be represented by triples. By contextualizing the knowledge in these knowledge graphs, the present disclosure transforms abstract knowledge into specific problems, thereby evaluating the ability of the predetermined model to understand and apply this abstract knowledge in a contextualized manner.
[0061] According to an embodiment of the present disclosure, when the knowledge reference dataset includes a world knowledge reference dataset, the preset evaluation criteria may include: evaluating the mastery of the number of associations of different frequencies and / or knowledge with timeliness by the large language model to be evaluated.
[0062] For example, take the Wikidata knowledge base as a knowledge source for generating world knowledge, which is well-known for its high quality and contains billions of data triples.
[0063] In addition, as mentioned above, the present disclosure provides two sophisticated evaluation indicators to measure the knowledge proficiency of the large model. In order to evaluate the model's understanding of knowledge of different frequencies, the knowledge can be divided into three categories: high-frequency knowledge, which is characterized by more than 1,000 interrelated occurrences; medium-frequency knowledge, which is characterized by between 100 and 1,000 interrelated occurrences; and low-frequency knowledge, which is characterized by less than 100 interrelated occurrences. In order to evaluate the sensitivity of the large model to timeliness, the present disclosure also uses time-related knowledge triples to evaluate the large model's mastery of world knowledge with timeliness.
[0064] According to an embodiment of the present disclosure, when the knowledge reference data set includes a language knowledge reference data set, the preset evaluation criteria may include: performing semantic evaluation, grammatical evaluation and pragmatic evaluation on the large language model to be evaluated, wherein the semantic evaluation includes a semantic selection task, a similar word task and an idiom interpretation task, the grammatical evaluation includes a part-of-speech analysis task and a grammar correction task, and the pragmatic evaluation includes a special format generation task, a sentiment analysis task and a writing style imitation task.
[0065] As an example, step S104 may further include: according to the preset evaluation criteria, for each evaluation question, executing the following steps S1 to S3:
[0066] In step S1, a plurality of large language models are evaluated using an evaluation database to obtain an evaluation result set for each large language model.
[0067] In step S2, a correlation analysis is performed on the evaluation result set for each large language model and the predetermined preference data set to determine the evaluation result sets for a predetermined number of large language models with relatively high correlation, and the predetermined number of large language models with relatively high correlation are used as the large language models to be evaluated.
[0068] In step S3, a scoring operation is performed on the evaluation result set corresponding to the large language model to be evaluated to obtain a final evaluation result of the large language model to be evaluated.
[0069] Here, the scoring operation may refer to an operation in which each large language model in the large language models to be evaluated scores the evaluation answer corresponding to each evaluation question based on a preset scoring standard.
[0070] For example, in order to balance the gap between objective indicators and subjective preferences, the present disclosure proposes a method combining human-computer collaboration, using a scoring strategy similar to voting. Multiple LLMs are used to evaluate a given answer, and some key LLMs are selected as evaluation models because they have a higher correlation with preset preferences (such as human evaluation results). The final evaluation result is obtained by jointly scoring multiple LLMs with high correlation.
[0071] Specifically, the above-mentioned method of combining human-machine collaboration includes two aspects: multi-model scoring evaluation and preference alignment. For example, collaborative evaluation of multiple large models is used to reduce the potential bias of single model evaluation. Specifically, for the set of questions and evaluation models, different models Answers to the same question form a group of answers A set of evaluation results of different models for each answer can be obtained The final evaluation result of each answer is F = argmax(R), where argmax means taking the maximum value of R.
[0072] In addition, for example, since the ultimate goal of the large model is to meet human needs, it is desirable to ensure that outputs that meet human preferences are generated. Specifically, for each type of knowledge, several questions are manually evaluated to obtain a set of manual evaluation results. Then, the present disclosure uses the Pearson correlation coefficient between the manual evaluation result set and the model evaluation result set R to measure the evaluation performance of different models.
[0073] For example, since different large models are good at different types of knowledge, the top several large models that are closest to the manual evaluation results in each type of knowledge can be selected. The final evaluation results will be determined by the scores of these top several large models. In this way, the ability of large models to produce evaluation results that are more in line with human preferences and expectations can be enhanced.
[0074] According to the embodiments of the present disclosure, by proposing the above-mentioned evaluation model scoring method to evaluate the text generated by the model under test, the comprehensive capabilities of LLM can be fully utilized to make the evaluation of the evaluation model consistent with the preset preferences, thereby effectively reducing the inherent bias defects of the individual evaluation model and improving the user experience.
[0075] The following is an example to illustrate the effectiveness of the evaluation method according to the present disclosure.
[0076] As an example, 14 large models were evaluated in detail using the evaluation method disclosed in the present invention, for example, open source models with a parameter scale of approximately 10 billion, such as ChatGLM3-6b, Baichuan2-13B-Chat, Baichuan-13B-Chat, Baichuan2-7B-Chat, Qwen-7B-Chat, Qwen-14B-Chat, Yi-6B-Chat, WizardLM-13B-V1.2, Vicuna-7b-v1.5, Vicuna-13B-v1.5, LLaMa2-7b-Chat, LLaMa2-13bChat, Mistral-7B-Instruct-v0.2, and Mistral-7B-Instruct-v0.1.
[0077] Table 1 below shows the overall performance of the large model tested at this stage. In Table 1, S CQ and S QA represent the scores of multiple-choice questions and essay questions, respectively, and H represents the entropy of each large model’s response to different prompts of the same knowledge.
[0078] Table 1
[0079]
[0080] also, Figure 3A and Figure 3B Schematic diagrams showing evaluation results according to embodiments of the present disclosure. Figure 3A shows a schematic diagram of QA question scoring for multiple large model evaluations, and Figure 3B A schematic diagram of scoring selection questions for multiple large model evaluations is shown.
[0081] Through the above series of exemplary evaluation results, we can conclude that: (1) large models with larger parameters show better prompt robustness; (2) using question-answering questions for evaluation is fairer; (3) large models show preference for texts they generate; (4) scoring evaluation can reduce bias. These results fully demonstrate that the evaluation method disclosed in this disclosure more fairly evaluates the various knowledge types of large models and also makes up for the relevant defects in the field of large model knowledge evaluation.
[0082] Figure 4 4 is a structural block diagram showing an evaluation device 400 for a large model according to an embodiment of the present disclosure.
[0083] Reference Figure 4 According to an embodiment of the present disclosure, the evaluation device 400 for a large model may include an acquisition module 410 , a construction module 420 and an evaluation module 430 .
[0084] According to an embodiment of the present disclosure, the acquisition module 410 is configured to: acquire a knowledge reference dataset, where the knowledge reference dataset includes at least one of a common sense knowledge reference dataset, a world knowledge reference dataset, and a language knowledge reference dataset.
[0085] For example, the knowledge reference dataset may include at least one of an ATOMIC-based dataset, a Conceptnet-based dataset, a Wikidata-based dataset, and a Wordnet-based dataset, but the present disclosure is not limited thereto.
[0086] According to an embodiment of the present disclosure, the construction module 420 is configured to: construct evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions based on the knowledge reference data set, and construct multiple question templates for the knowledge relationship of each evaluation question, so that each evaluation question and its corresponding evaluation answer and multiple question templates constitute an evaluation database for the large language model.
[0087] As an example, the operation of constructing module 420 to construct evaluation questions that are not included in the training corpus for a large language model and evaluation answers corresponding to the evaluation questions based on a knowledge reference dataset may include: creating multiple evaluation questions including multiple-choice questions, fill-in-the-blank questions, and open-ended generative question-answering questions that are not included in the training corpus for a large language model based on the knowledge reference dataset, and constructing the evaluation questions and evaluation answers corresponding to the evaluation questions.
[0088] As an example, the operation of constructing module 420 to construct multiple question templates for the knowledge relationship of each evaluation question may include: for the knowledge relationship of each evaluation question, expanding the question template of the knowledge relationship by utilizing a predetermined large language model to obtain a set of expanded question templates as the multiple question templates for each evaluation question.
[0089] According to an embodiment of the present disclosure, the evaluation module 430 is configured to: evaluate the large language model to be evaluated using the evaluation database according to a preset evaluation standard, and obtain an evaluation result of the large language model to be evaluated.
[0090] According to an embodiment of the present disclosure, when the knowledge reference dataset includes a common sense knowledge reference dataset, the preset evaluation criteria may include: evaluating the ability of the large language model to be evaluated to understand and apply abstract knowledge in a contextualized manner.
[0091] According to an embodiment of the present disclosure, when the knowledge reference dataset includes a world knowledge reference dataset, the preset evaluation criteria may include: evaluating the mastery of the number of associations of different frequencies and / or knowledge with timeliness by the large language model to be evaluated.
[0092] According to an embodiment of the present disclosure, when the knowledge reference data set includes a language knowledge reference data set, the preset evaluation criteria may include: performing semantic evaluation, grammatical evaluation and pragmatic evaluation on the large language model to be evaluated, wherein the semantic evaluation includes a semantic selection task, a similar word task and an idiom interpretation task, the grammatical evaluation includes a part-of-speech analysis task and a grammar correction task, and the pragmatic evaluation includes a special format generation task, a sentiment analysis task and a writing style imitation task.
[0093] As an example, the evaluation module 430 evaluates the large language model to be evaluated using the evaluation database according to the preset evaluation criteria, and the operation of obtaining the evaluation result of the large language model to be evaluated may include: according to the preset evaluation criteria, for each evaluation question, performing the following processes (1) to (3):
[0094] (1) Use the evaluation database to evaluate multiple large language models and obtain an evaluation result set for each large language model.
[0095] (2) performing a correlation analysis on the evaluation result set of each large language model and the predetermined preference data set, determining the evaluation result sets for a predetermined number of large language models with relatively high correlation, and using the predetermined number of large language models with relatively high correlation as the large language models to be evaluated.
[0096] (3) Performing a scoring operation on the evaluation result set corresponding to the large language model to be evaluated, and obtaining the final evaluation result of the large language model to be evaluated.
[0097] Here, the scoring operation may refer to an operation in which each large language model in the large language models to be evaluated scores the evaluation answer corresponding to each evaluation question based on a preset scoring standard.
[0098] It should be noted that the operations performed on the above-mentioned structural frames can be referred to in Figure 1 The related contents described are similar and will not be repeated here.
[0099] Figure 5 is a block diagram illustrating a computer device 500 according to an embodiment of the present disclosure.
[0100] Reference Figure 5According to an embodiment of the present disclosure, a computer device 500 may include a processor 510 and a memory 520. The processor 510 may include (but not limited to) a central processing unit (CPU), a digital signal processor (DSP), a microcomputer, a field programmable gate array (FPGA), a system on a chip (SoC), a microprocessor, an application-specific integrated circuit (ASIC), etc. The memory 520 may store computer executable instructions to be executed by the processor 510. The memory 520 includes a high-speed random access memory and / or a non-volatile computer-readable storage medium. When the processor 510 executes the computer executable instructions stored in the memory 520, the evaluation method described above may be implemented.
[0101] The evaluation method according to the embodiment of the present disclosure can be written as a computer program / instruction to form a computer program product and stored on a computer-readable storage medium. When the computer program / instruction is executed by a processor, the evaluation method as described above can be implemented. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device / server, the electronic device / server is enabled to execute the evaluation method as described above. Examples of computer-readable storage media include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or extreme digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device is configured to store computer program and any associated data, data files and data structures in a non-transitory manner and provide the computer program and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. In one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.
[0102] According to the evaluation method and device for large models of the embodiments of the present disclosure, a more fair evaluation of the various knowledge type capabilities of large models is achieved, and related defects in the field of large model knowledge evaluation are compensated.
[0103] On the other hand, the evaluation method and device for large models according to the embodiments of the present disclosure effectively prevent data contamination by proposing new questions and their answers that will not appear in the training corpus based on data sets in multiple fields.
[0104] On the other hand, according to the evaluation method and device for large models of the embodiments of the present disclosure, by designing a variety of question templates, the impact of question template design on the evaluation is effectively reduced.
[0105] On the other hand, according to the evaluation method and device for large models of the embodiments of the present disclosure, the evaluation criteria according to the embodiments of the present disclosure are consistent with preset preferences (such as human preferences) and adopt a scoring strategy, which effectively reduces the bias defects inherent in individual evaluation models.
[0106] Although some embodiments of the present disclosure have been disclosed and described, it will be appreciated by those skilled in the art that modifications and variations may be made to the embodiments without departing from the concept and spirit of the present disclosure, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for evaluating a large language model, characterized in that: The evaluation method includes: Acquire a knowledge reference dataset, wherein the knowledge reference dataset includes at least one of a common sense knowledge reference dataset, a world knowledge reference dataset, and a language knowledge reference dataset; Based on the knowledge reference dataset, construct evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions; According to the knowledge relationship of each evaluation question, multiple question templates are constructed, so that each evaluation question and its corresponding evaluation answer and multiple question templates constitute an evaluation database for a large language model; According to a preset evaluation standard, the large language model to be evaluated is evaluated using the evaluation database to obtain an evaluation result of the large language model to be evaluated.
2. The evaluation method according to claim 1, characterized in that: The step of constructing, based on the knowledge reference data set, evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions comprises: By creating multiple evaluation questions including multiple-choice questions, fill-in-the-blank questions and open-ended generative question-answering questions based on the knowledge reference data set and not included in the training corpus for the large language model, evaluation questions and evaluation answers corresponding to the evaluation questions are constructed.
3. The evaluation method according to claim 1, characterized in that: The steps of constructing multiple question templates for the knowledge relationship of each evaluation question include: For the knowledge relationship of each evaluation question, a predetermined large language model is used to expand the question template of the knowledge relationship to obtain a set of expanded question templates as multiple question templates for each evaluation question.
4. The evaluation method according to claim 1, characterized in that: The step of evaluating the large language model to be evaluated using the evaluation database according to the preset evaluation criteria to obtain the evaluation result of the large language model to be evaluated comprises: According to the preset evaluation criteria, for each evaluation question, perform the following processing: Using the evaluation database to evaluate multiple large language models, and obtaining an evaluation result set for each large language model; Performing a correlation analysis on the evaluation result set for each large language model and the predetermined preference data set, determining the evaluation result sets for a predetermined number of large language models with relatively high correlation, and using the predetermined number of large language models with relatively high correlation as the large language models to be evaluated; Performing a scoring operation on the evaluation result set corresponding to the large language model to be evaluated to obtain a final evaluation result of the large language model to be evaluated, The scoring operation refers to an operation in which each large language model in the to-be-evaluated large language model scores the evaluation answer corresponding to each evaluation question based on a preset scoring standard.
5. The evaluation method according to claim 1, characterized in that: In the case where the knowledge reference data set includes a common sense knowledge reference data set, the preset evaluation criteria include: evaluating the ability of the large language model to be evaluated to understand and apply abstract knowledge in a contextualized manner.
6. The evaluation method according to claim 1, characterized in that: In the case where the knowledge reference dataset includes a world knowledge reference dataset, the preset evaluation criteria include: evaluating the mastery of the number of associations of different frequencies and / or knowledge with timeliness by the large language model to be evaluated.
7. The evaluation method according to claim 1, characterized in that: In the case where the knowledge reference data set includes a language knowledge reference data set, the preset evaluation criteria include: performing semantic evaluation, grammatical evaluation and pragmatic evaluation on the large language model to be evaluated, Among them, the semantic evaluation includes semantic selection tasks, similar word tasks and idiom interpretation tasks, the grammatical evaluation includes part-of-speech analysis tasks and grammar correction tasks, and the pragmatic evaluation includes special format generation tasks, sentiment analysis tasks and writing style imitation tasks.
8. An evaluation device for a large language model, characterized in that: The evaluation device comprises: An acquisition module is configured to: acquire a knowledge reference dataset, wherein the knowledge reference dataset includes at least one of a common sense knowledge reference dataset, a world knowledge reference dataset, and a language knowledge reference dataset; A construction module is configured to: construct, based on the knowledge reference data set, evaluation questions that are not included in the training corpus for the large language model and evaluation answers corresponding to the evaluation questions, and construct multiple question templates for the knowledge relationship of each evaluation question, so that each evaluation question and its corresponding evaluation answer and multiple question templates constitute an evaluation database for the large language model; The evaluation module is configured to: evaluate the large language model to be evaluated using the evaluation database according to a preset evaluation standard to obtain an evaluation result of the large language model to be evaluated.
9. A computer program product, characterized in that The computer program product comprises a computer program / instruction, and when the computer program / instruction is executed by a processor, the evaluation method according to any one of claims 1 to 7 is implemented.
10. A computer device, characterized in that: The computer device comprises: at least one processor; and at least one memory storing computer executable instructions, wherein the computer executable instructions, when executed by the at least one processor, prompt the at least one processor to execute the evaluation method according to any one of claims 1 to 7.
Citation Information
Cited By
Language model evaluation method and device, equipment, medium and product
CN119337114A
Model evaluation method and device and related product
CN119719322A
Multi-modal large model evaluation system and method based on cognitive psychology
CN120929795A
