Method and device for enhancing induction capability of large model
By performing observation sample sampling, context learning and low-rank adaptive training on a large language model, an enhanced large model is generated, which solves the problem of insufficient induction capabilities and significantly improves induction performance.
Patent Information
- Application Number
- CN202410669925.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-28
- Publication Date
- 2024-10-01
AI Technical Summary
Existing large-scale language models are weak in induction ability and rely on inherent induction ability, making it difficult to effectively improve their induction performance.
Candidate hypotheses are generated by sampling observation samples of the large model to be enhanced, generating deductive instances based on context learning, performing low-rank adaptive training, adjusting model parameters, and generating an enhanced large model to improve inductive capabilities.
It significantly enhances the induction ability of large models, makes full use of its powerful deduction ability, and improves the induction performance of test samples.
Smart Images

Figure CN118734858A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and more specifically, to a method and device for enhancing the inductive capability of a large model. Background Art
[0002] Currently, induction using Large Language Models (LLMs) typically involves extracting key information, patterns, and structures from large amounts of data and summarizing these into concise and meaningful representations.
[0003] Related technologies usually use methods such as Hypothesis Search and Hypothesis Refinement to perform induction using large language models (also called large models). However, these methods can be summarized as post-processing paradigms, which makes them highly dependent on the inherent inductive ability of large models.
[0004] Therefore, how to enhance the inductive ability of large models has become a technical problem that needs to be solved urgently in the industry. Summary of the invention
[0005] The present application provides a method and device for enhancing the inductive capability of a large model, which are used to solve the technical problem of how to enhance the inductive capability of a large model.
[0006] The present application provides a method for enhancing the inductive ability of a large model, including:
[0007] Based on the large model to be enhanced, the observed samples are sampled inductively to generate multiple candidate hypotheses;
[0008] Learning the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis;
[0009] Based on the deductive examples corresponding to each candidate hypothesis, low-rank adaptive training is performed on the large model to be enhanced, and model parameters of the large model to be enhanced are adjusted to obtain an enhanced large model;
[0010] The test sample is summarized based on the enhanced large model; the test sample and the observed sample correspond to the same hypothesis.
[0011] In some embodiments, the observation sample includes a plurality of first input texts and first output texts corresponding to the first input texts; the first input text includes a semantic text or a symbolic text.
[0012] In some embodiments, the learning of the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis includes:
[0013] Generate the context based on the instruction word corresponding to the preset hypothesis, the input text and the output text corresponding to the instruction word, and the instruction word corresponding to each candidate hypothesis;
[0014] The context is input into the large model to be enhanced to obtain deductive instances corresponding to each candidate hypothesis output by the large model to be enhanced.
[0015] In some embodiments, the low-rank adaptive training of the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, adjusting the model parameters of the large model to be enhanced, and obtaining the enhanced large model includes:
[0016] Connecting multiple deductive instances corresponding to each candidate hypothesis head to tail to generate a first training sample corresponding to each candidate hypothesis;
[0017] Based on the first training samples corresponding to each candidate hypothesis, low-rank adaptive training is performed on the large model to be enhanced, and model parameters of the large model to be enhanced are adjusted;
[0018] The large model to be enhanced after parameter adjustment is used as the enhanced large model.
[0019] In some embodiments, the low-rank adaptive training of the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, adjusting the model parameters of the large model to be enhanced, and obtaining the enhanced large model includes:
[0020] Using each deductive instance corresponding to each candidate hypothesis as each second training sample corresponding to each candidate hypothesis;
[0021] Performing low-rank adaptive training on the large model to be enhanced based on each second training sample corresponding to each candidate hypothesis, and adjusting model parameters of the large model to be enhanced based on the training result;
[0022] The large model to be enhanced after parameter adjustment is used as the enhanced large model.
[0023] In some embodiments, the summarizing the test samples based on the enhanced large model includes:
[0024] Generate multiple test instances based on multiple second input texts in the test sample and second output texts corresponding to the multiple second input texts;
[0025] Input the multiple test instances into the enhanced large model to obtain hypotheses corresponding to the test samples output by the enhanced large model;
[0026] The enhanced large model is used to determine the probability of each output word segment when summarizing each test instance, and perform Bayesian group decoding based on the probability of each output word segment.
[0027] The present application provides a large model inductive capability enhancement device, comprising:
[0028] A generation unit, used for performing inductive sampling on the observed samples based on the large model to be enhanced to generate multiple candidate hypotheses;
[0029] A deductive unit, used to learn the context based on the large model to be enhanced, and generate deductive instances corresponding to each candidate hypothesis;
[0030] An adjustment unit, configured to perform low-rank adaptive training on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, and adjust the model parameters of the large model to be enhanced to obtain an enhanced large model;
[0031] An induction unit is used to summarize the test sample based on the enhanced large model; the test sample and the observed sample correspond to the same hypothesis.
[0032] The present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method for enhancing the large model induction capability when executing the computer program.
[0033] The present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for enhancing the large model induction capability is implemented.
[0034] The present application provides a computer program product, including a computer program, which implements the large model induction capability enhancement method when executed by a processor.
[0035] The method and device for enhancing the inductive ability of a large model provided in the present application perform inductive sampling of observed samples based on the large model to be enhanced to generate multiple candidate hypotheses; learn the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis; perform low-rank adaptive training on the large model to be enhanced based on the deductive instances corresponding to each candidate hypothesis, adjust the model parameters of the large model to be enhanced, and obtain an enhanced large model; perform induction on test samples based on the enhanced large model; since the deductive instances are extended samples generated according to the deductive ability of the large model, the generation of the deductive instances corresponding to each candidate hypothesis obeys the task distribution corresponding to each candidate hypothesis, and the large model is trained and parameters are adjusted through the deductive instances corresponding to each candidate hypothesis, which fully utilizes the advantage of the large model's strong deductive ability and can significantly enhance the inductive ability of the large model. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0037] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0038] Figure 1 One of the flow charts of the method for enhancing the inductive ability of a large model provided in this application;
[0039] Figure 2 The second flowchart of the method for enhancing the inductive ability of a large model provided in this application;
[0040] Figure 3 It is a structural schematic diagram of a large model inductive ability enhancement device provided by the present application;
[0041] Figure 4 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION
[0042] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0043] It should be noted that the terms "first", "second" etc. in the present application are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable in appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, the process, method, system, product or equipment comprising a series of steps or units or modules need not be limited to those steps or units or modules clearly listed, but may include other steps or units or modules that are not clearly listed or inherent to these processes, methods, products or equipment.
[0044] The induction task is to find the correct answer based on a given number of input-output pairs. Predict its consistent hidden transformation f. This transformation maps each input sample to the corresponding output sample, i.e., y i =f(x i ). Among them, x i is the i-th input sample, y i is the i-th output sample, and n is the number of input-output pairs. Inductive ability is an important manifestation of the intelligence of large models and the basis of generalization ability. Existing studies have shown that the inductive ability of current large models is weak.
[0045] Related technologies use methods such as Hypothesis Search and Hypothesis Refinement to perform induction using large language models (also called large models). Hypothesis Search uses the output results of the naive method as candidate hypotheses. For each hypothesis, it is inferred on the observed samples, and high-quality hypotheses are selected based on the accuracy of inference as the final induction results. Hypothesis Refinement further allows the large model to reflect on the hypotheses obtained by Hypothesis Search. The input is the observed samples, the hypotheses obtained by Hypothesis Search, and the inference results on the observed samples, and the output is the further improved hypothesis. However, these methods can be summarized as a post-processing paradigm, which makes them very dependent on the inherent inductive ability of the large model. However, existing studies have shown that the inherent inductive ability of large models is weak, while the deductive ability is strong.
[0046] In order to solve the shortcomings of related technologies, Figure 1 One of the flow charts of the large model inductive ability enhancement method provided in this application is as follows: Figure 1 As shown, the method includes step 110 , step 120 , step 130 and step 140 .
[0047] Step 110: Perform inductive sampling on the observed samples based on the large model to be enhanced to generate multiple candidate hypotheses.
[0048] Specifically, the large model inductive capability enhancement method provided in the embodiment of the present application is applicable to enhancing the inductive capability of large models of various model structures. The large models here may include: Transformer model and its derivative variant models, BERT (Bidirectional Encoder Representations from Transformer) model and GPT (Generative Pre-trained Transformer) model, etc.
[0049] The large model to be enhanced is a large model that needs to enhance its inductive ability. The observation sample can be an input-output pair consisting of an input sample and an output sample, and can specifically consist of text. The observation sample can include multiple input texts and output texts corresponding to each input text. For example, the first input text can be "As soon as you can", and the corresponding output text is "At your earliest convenience", the second input text can be "Sorry Imessedup", and the corresponding output text is "I apologize for my wrongdoings", etc.
[0050] The observed samples can be inductively sampled through the large model to be enhanced, that is, the observed samples are preliminarily inferred and sampled to generate multiple candidate hypotheses. Candidate hypotheses are possible hypotheses. The hypothesis is a hidden transformation from the input text to the output text, which is used to map each input sample to the corresponding output sample. For example, the candidate hypotheses obtained after inductive sampling of the observed samples may include the first candidate hypothesis as "Translate the inputs into more formal language", the second candidate hypothesis as "Translate the inputs into Spanish", and the third candidate hypothesis as "Negate the input sentences".
[0051] Step 120: Learn the context based on the large model to be enhanced, and generate deductive instances corresponding to each candidate hypothesis.
[0052] Specifically, the deductive examples are extended samples generated according to the deductive ability of the large model to be enhanced. For example, for the candidate hypothesis "Translate the inputs into more formal language", the deductive examples generated by the large model to be enhanced may include the input text "wait" and the output text "please wait for me".
[0053] The context can be constructed according to the instruction word, the input text and output text corresponding to the instruction word, and the output format of the expected large model to be enhanced. The context is used as a deductive data generation prompt template for the large model to be enhanced.
[0054] For example, the context can be: "Instruction: describe the major color of the given object. Input: watermelon. Output: green. Input: ocean. Output: blue." Instruction is the instruction word, Input is the input text, and Output is the output text. The large model to be enhanced can learn the context, the mapping relationship between the instruction word, the input text and the output text, and the output format of the input text and the output text.
[0055] Then, multiple candidate hypotheses are taken as instruction words and the context is input into the large model to be enhanced, so as to obtain the deductive instances corresponding to the candidate hypotheses output by the large model to be enhanced.
[0056] Step 130: Based on the deductive instances corresponding to the candidate hypotheses, low-rank adaptive training is performed on the large model to be enhanced, and the model parameters of the large model to be enhanced are adjusted to obtain the enhanced large model.
[0057] Specifically, low-rank adaptive training can be used to fine-tune the model parameters of the large model to be enhanced, which has many benefits such as reducing computational costs, reducing overfitting, accelerating convergence speed, and saving storage space, and can effectively improve the training efficiency and performance of large models. Related algorithms may include low-rank adaptive (LoRA) algorithm and quantized low-rank adaptive (QLoRa) algorithm.
[0058] The deductive instances corresponding to the candidate hypotheses can be used to train the large model to be enhanced. A low-rank adaptive algorithm is used in the training to fine-tune the model parameters of the large model to be enhanced, thereby obtaining the enhanced large model with adjusted parameters.
[0059] Step 140: Inductively summarize the test samples based on the enhanced large model; the test samples and the observed samples correspond to the same hypothesis.
[0060] Specifically, the test sample and the observed sample correspond to the same hypothesis, but the sample content is different. The enhanced large model can be used to summarize the test sample. Since the parameters of the enhanced large model have been adjusted, it has stronger inductive ability than the previous large model to be enhanced.
[0061] The method for enhancing the inductive ability of a large model provided in the embodiment of the present application performs inductive sampling of observed samples based on the large model to be enhanced to generate multiple candidate hypotheses; learns the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis; performs low-rank adaptive training on the large model to be enhanced based on the deductive instances corresponding to each candidate hypothesis, adjusts the model parameters of the large model to be enhanced, and obtains an enhanced large model; summarizes the test samples based on the enhanced large model; since the deductive instances are extended samples generated according to the deductive ability of the large model, the generation of the deductive instances corresponding to each candidate hypothesis obeys the task distribution corresponding to each candidate hypothesis, and the large model is trained and the parameters are adjusted through the deductive instances corresponding to each candidate hypothesis, which fully utilizes the advantage of the large model's strong deductive ability and can significantly enhance the inductive ability of the large model.
[0062] It should be noted that each implementation method of the present application can be freely combined, the order can be changed, or it can be executed separately, and does not need to rely on or depend on a fixed execution order.
[0063] In some embodiments, the observation sample includes a plurality of first input texts and first output texts corresponding to the first input texts; the first input text includes a semantic text or a symbolic text.
[0064] Specifically, the observation sample in the embodiment of the present application may include a plurality of input-output pairs, each of which includes a first input text and a first output text corresponding to the first input text.
[0065] The first input text may be a semantic text or a symbolic text. Accordingly, the first output text may be a semantic text or a symbolic text. Semantic text may be used for common sense inductive reasoning (Instruction Induction), and symbolic text may be used for symbolic inductive reasoning (List Function).
[0066] The method for enhancing the inductive ability of a large model provided in the embodiment of the present application enables the large model to be suitable for processing semantic text or symbolic text and has a strong inductive ability.
[0067] In some embodiments, learning the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis includes:
[0068] Generate a context based on the instruction words corresponding to the preset hypothesis, the input text and the output text corresponding to the instruction words, and the instruction words corresponding to each candidate hypothesis;
[0069] The context is input into the large model to be enhanced, and the deductive instances corresponding to the candidate hypotheses output by the large model to be enhanced are obtained.
[0070] Specifically, a preset hypothesis may be set. For example, the preset hypothesis may include summarizing the main color of a given object and summarizing the capital of a given country. According to the preset hypothesis, an instruction word (Instruction) "describe themajor color of the given object" and an instruction word (Instruction) "answer the capital of the given country" may be generated respectively.
[0071] The input text (Input) and output text (Onput) corresponding to the instruction word (Instruction) "describe the major color of the given object" can be constructed, for example, including "Input:watermelon.Output:green.Input:ocean.Output:blue". The input text (Input) and output text (Onput) corresponding to the instruction word (Instruction) "answer the capital of the given country" can be constructed, for example, including "Input:USA.Output:Washingtion.Input:Russia.Output:Moscow". The number of input texts and output texts can be set as needed. The embodiments of the present application only take 2 pairs as an example for illustration, and it should not be understood as limiting the number of input texts and output texts.
[0072] A context is generated based on the instruction words corresponding to the preset hypothesis, the input text and output text corresponding to the instruction words, and the instruction words corresponding to each candidate hypothesis, and the context is input into the large model to be enhanced so that the large model to be enhanced can learn the context, learn the mapping relationship between the instruction words, input text and output text, and the output format of the input text and output text, and output the deductive instances corresponding to each candidate hypothesis.
[0073] The method for enhancing the inductive ability of a large model provided in the embodiment of the present application learns the context according to the large model to be enhanced, generates deductive instances corresponding to each candidate hypothesis, fully utilizes the advantage of the large model's strong deductive ability, and can significantly enhance the inductive ability of the large model.
[0074] In some embodiments, low-rank adaptive training is performed on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, and the model parameters of the large model to be enhanced are adjusted to obtain the enhanced large model, including:
[0075] Connecting multiple deductive instances corresponding to each candidate hypothesis head to tail to generate a first training sample corresponding to each candidate hypothesis;
[0076] Based on the first training samples corresponding to each candidate hypothesis, low-rank adaptive training is performed on the large model to be enhanced, and model parameters of the large model to be enhanced are adjusted;
[0077] The large model to be enhanced after parameter adjustment is used as the enhanced large model.
[0078] Specifically, each candidate hypothesis may have multiple corresponding deductive instances. When low-rank adaptive training is performed on the large model to be enhanced, a method (Input Output prompt, IO prompt) may be used to input multiple deductive instances corresponding to each candidate hypothesis as a whole into the large model to be enhanced for training.
[0079] The multiple deductive examples corresponding to each candidate hypothesis are concatenated head to tail as the first training sample corresponding to each candidate hypothesis. The samples are input into the large model to be enhanced, and low-rank adaptive training is performed on the large model to be enhanced. The model parameters of the large model to be enhanced are continuously adjusted during the training process. Finally, the large model to be enhanced with adjusted parameters is used as the enhanced large model.
[0080] The method for enhancing the inductive ability of a large model provided in the embodiment of the present application concatenates multiple deductive instances corresponding to each candidate hypothesis, generates a first training sample corresponding to each candidate hypothesis, and performs low-rank adaptive training on the large model to be enhanced, so that the large model to be enhanced can fully learn the mapping relationship between the input text and the output text in each deductive instance, thereby improving the inductive ability of the large model.
[0081] In some embodiments, low-rank adaptive training is performed on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, and the model parameters of the large model to be enhanced are adjusted to obtain the enhanced large model, including:
[0082] Using each deductive instance corresponding to each candidate hypothesis as each second training sample corresponding to each candidate hypothesis;
[0083] Performing low-rank adaptive training on the large model to be enhanced based on each second training sample corresponding to each candidate hypothesis, and adjusting model parameters of the large model to be enhanced based on the training results;
[0084] The large model to be enhanced after parameter adjustment is used as the enhanced large model.
[0085] Specifically, when low-rank adaptive training is performed on the large model to be enhanced, a method (GroupDecoding prompt, GD prompt) can be adopted in which multiple deductive instances corresponding to each candidate hypothesis are input as separate training samples into the large model to be enhanced for training. In this training method, the large model is summarized by Bayesian group decoding.
[0086] Each deductive instance corresponding to each candidate hypothesis is used as the second training sample corresponding to each candidate hypothesis, that is, a deductive instance (including an input text and a corresponding output text) is used as a training sample. The second training samples corresponding to each candidate hypothesis are input into the large model to be enhanced, and low-rank adaptive training is performed on the large model to be enhanced. The model parameters of the large model to be enhanced are continuously adjusted during the training process. Finally, the large model to be enhanced with adjusted parameters is used as the enhanced large model.
[0087] The method for enhancing the inductive ability of a large model provided in the embodiment of the present application uses each deductive instance corresponding to each candidate hypothesis as each second training sample corresponding to each candidate hypothesis, and performs low-rank adaptive training on the large model to be enhanced, so that the large model to be enhanced can fully learn the mapping relationship between each input text and output text in each deductive instance, thereby improving the inductive ability of the large model. Bayesian group decoding is applied for induction during training to improve the generalization ability of the large model.
[0088] When training the large model to be enhanced (GD prompt) and summarizing the test samples, the Bayesian population decoding method can be used to improve the generalization ability of the large model so as to facilitate better summarization. The following is an explanation of summarizing the test samples.
[0089] In some embodiments, summarizing the test sample based on the enhanced large model includes:
[0090] Generate multiple test instances based on multiple second input texts in the test sample and second output texts corresponding to the multiple second input texts;
[0091] Input multiple test instances into the enhanced large model to obtain hypotheses corresponding to the test samples output by the enhanced large model;
[0092] Among them, the enhanced large model is used to determine the probability of each output word segment when summarizing each test instance, and perform Bayesian group decoding based on the probability of each output word segment.
[0093] Specifically, the test sample includes multiple second input texts and second output texts corresponding to the multiple second input texts. A second input text and the second output text corresponding to the second input text can be used as a test instance. According to the method, multiple test instances can be generated according to the test sample.
[0094] Multiple test instances are input into the enhanced large model, so that the enhanced large model summarizes each test instance separately, and determines the probability of each output token during the summarization, performs Bayesian group decoding according to the probability of each output token, and finally obtains the hypothesis corresponding to the test sample.
[0095] The method for enhancing the inductive ability of a large model provided in an embodiment of the present application determines the probability of each output word segment when summarizing each test instance, and performs Bayesian group decoding based on the probability of each output word segment, thereby improving the generalization and inductive ability of the large model.
[0096] Figure 2 The second flow chart of the method for enhancing the inductive ability of a large model provided in this application is as follows: Figure 2 As shown, the method includes:
[0097] Step 210: The large model performs inductive sampling on the observed samples to obtain multiple candidate hypotheses.
[0098] Step 220: The large model performs sample expansion on each candidate hypothesis based on its own deductive ability through context learning, and generates deductive instances corresponding to each candidate hypothesis.
[0099] Step 230: Use the candidate hypotheses and deductive examples generated in the previous two steps as data to train the large model and fine-tune the large model to obtain stronger inductive ability. The training method can adopt two methods: GD prompt and IO prompt.
[0100] Step 240: When using GD prompt training, the large model applies Bayesian group decoding during induction to better perform induction, thereby improving the generalization and induction capabilities of the large model.
[0101] The large model with enhanced inductive ability was experimentally explored on datasets of two different tasks, including common sense inductive reasoning (Instruction Induction) and symbolic inductive reasoning (List Function).
[0102] The execution effects of the inductive ability enhancement method provided in the present application and the inductive method in the related art can be compared, as shown in Table 1.
[0103] Table 1 Execution effect comparison
[0104]
[0105] By comparison:
[0106] (1) Compared with the performance of existing methods on various tasks, the method provided in this application more effectively improves the inductive ability of large models.
[0107] (2) Compared with the IO prompt, the GD prompt has a more obvious improvement in the inductive ability of large models, which reflects the effectiveness of Bayesian group decoding under the same number of observation samples.
[0108] In addition, as the number of observation samples increases, the improvement effect of GD prompt becomes more obvious.
[0109] The inductive ability enhancement method provided in this application can be applied to large models of different scales, as shown in Table 2.
[0110] Table 2 Comparison of execution effects of different large models
[0111]
[0112]
[0113] By comparison:
[0114] Large models of different scales use the method provided by this application, and the inductive ability is significantly enhanced.
[0115] The device provided in the embodiment of the present application is described below. The device described below and the method described above can be referenced to each other.
[0116] Figure 3 is a schematic diagram of the structure of the large model inductive ability enhancement device provided by the present application, such as Figure 3 As shown, the device comprises:
[0117] A generating unit 310 is used to perform inductive sampling on the observed samples based on the large model to be enhanced to generate multiple candidate hypotheses;
[0118] A deduction unit 320, configured to learn the context based on the large model to be enhanced, and generate deduction instances corresponding to each candidate hypothesis;
[0119] An adjustment unit 330 is used to perform low-rank adaptive training on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, adjust the model parameters of the large model to be enhanced, and obtain the enhanced large model;
[0120] The induction unit 340 is used to summarize the test samples based on the enhanced large model; the test samples and the observed samples correspond to the same hypothesis.
[0121] The large model inductive ability enhancement device provided in the embodiment of the present application performs inductive sampling on the observed samples based on the large model to be enhanced to generate multiple candidate hypotheses; learns the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis; performs low-rank adaptive training on the large model to be enhanced based on the deductive instances corresponding to each candidate hypothesis, adjusts the model parameters of the large model to be enhanced, and obtains the enhanced large model; summarizes the test samples based on the enhanced large model; since the deductive instances are extended samples generated according to the deductive ability of the large model, the generation of the deductive instances corresponding to each candidate hypothesis obeys the task distribution corresponding to each candidate hypothesis, and the large model is trained and the parameters are adjusted through the deductive instances corresponding to each candidate hypothesis, which fully utilizes the advantage of the large model's strong deductive ability and can significantly enhance the inductive ability of the large model.
[0122] In some embodiments, the observation sample includes a plurality of first input texts and first output texts corresponding to the first input texts; the first input text includes a semantic text or a symbolic text.
[0123] In some embodiments, the deduction unit is used to:
[0124] Generate a context based on the instruction words corresponding to the preset hypothesis, the input text and the output text corresponding to the instruction words, and the instruction words corresponding to each candidate hypothesis;
[0125] The context is input into the large model to be enhanced, and the deductive instances corresponding to the candidate hypotheses output by the large model to be enhanced are obtained.
[0126] In some embodiments, the adjustment unit is configured to:
[0127] Connecting multiple deductive instances corresponding to each candidate hypothesis head to tail to generate a first training sample corresponding to each candidate hypothesis;
[0128] Based on the first training samples corresponding to each candidate hypothesis, low-rank adaptive training is performed on the large model to be enhanced, and model parameters of the large model to be enhanced are adjusted;
[0129] The large model to be enhanced after parameter adjustment is used as the enhanced large model.
[0130] In some embodiments, the adjustment unit is configured to:
[0131] Using each deductive instance corresponding to each candidate hypothesis as each second training sample corresponding to each candidate hypothesis;
[0132] Performing low-rank adaptive training on the large model to be enhanced based on each second training sample corresponding to each candidate hypothesis, and adjusting model parameters of the large model to be enhanced based on the training results;
[0133] The large model to be enhanced after parameter adjustment is used as the enhanced large model.
[0134] In some embodiments, the induction unit is configured to:
[0135] Generate multiple test instances based on multiple second input texts in the test sample and second output texts corresponding to the multiple second input texts;
[0136] Input multiple test instances into the enhanced large model to obtain hypotheses corresponding to the test samples output by the enhanced large model;
[0137] Among them, the enhanced large model is used to determine the probability of each output word segment when summarizing each test instance, and perform Bayesian group decoding based on the probability of each output word segment.
[0138] Figure 4 is a schematic diagram of the structure of the electronic device provided by this application, such as Figure 4 As shown, the electronic device may include: a processor (Processor) 410, a communication interface (Communications Interface) 420, a memory (Memory) 430 and a communication bus (Communications Bus) 440, wherein the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logic command in the memory 430 to execute the method described in the above embodiment, for example:
[0139] Based on the large model to be enhanced, the observed samples are inductively sampled to generate multiple candidate hypotheses; based on the large model to be enhanced, the context is learned to generate deductive instances corresponding to each candidate hypothesis; based on the deductive instances corresponding to each candidate hypothesis, the large model to be enhanced is low-rank adaptively trained to adjust the model parameters of the large model to be enhanced to obtain the enhanced large model; based on the enhanced large model, the test samples are summarized; the test samples and the observed samples correspond to the same hypothesis.
[0140] In addition, the logic commands in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several commands to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0141] The processor in the electronic device provided in the embodiment of the present application can call the logic instructions in the memory to implement the above method. Its specific implementation method is consistent with the implementation method of the aforementioned method and can achieve the same beneficial effects, which will not be repeated here.
[0142] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the methods provided in the above embodiments are implemented.
[0143] Its specific implementation is consistent with the aforementioned method implementation and can achieve the same beneficial effects, so it will not be repeated here.
[0144] An embodiment of the present application provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0145] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for enhancing the inductive ability of a large model, characterized in that: include: Based on the large model to be enhanced, the observed samples are sampled inductively to generate multiple candidate hypotheses; Learning the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis; Based on the deductive examples corresponding to each candidate hypothesis, low-rank adaptive training is performed on the large model to be enhanced, and model parameters of the large model to be enhanced are adjusted to obtain an enhanced large model; Inducing the test samples based on the enhanced large model; The test sample and the observed sample correspond to the same hypothesis.
2. The method for enhancing the inductive ability of a large model according to claim 1, characterized in that: The observation sample includes a plurality of first input texts and first output texts corresponding to the first input texts; the first input text includes a semantic text or a symbolic text.
3. The method for enhancing the inductive ability of a large model according to claim 1, characterized in that: The learning of the context based on the large model to be enhanced to generate deductive instances corresponding to each candidate hypothesis includes: Generate the context based on the instruction word corresponding to the preset hypothesis, the input text and the output text corresponding to the instruction word, and the instruction word corresponding to each candidate hypothesis; The context is input into the large model to be enhanced to obtain deductive instances corresponding to each candidate hypothesis output by the large model to be enhanced.
4. The method for enhancing the inductive ability of a large model according to claim 1, characterized in that: The step of performing low-rank adaptive training on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, adjusting the model parameters of the large model to be enhanced, and obtaining the enhanced large model includes: Connecting multiple deductive instances corresponding to each candidate hypothesis head to tail to generate a first training sample corresponding to each candidate hypothesis; Based on the first training samples corresponding to each candidate hypothesis, low-rank adaptive training is performed on the large model to be enhanced, and model parameters of the large model to be enhanced are adjusted; The large model to be enhanced after parameter adjustment is used as the enhanced large model.
5. The method for enhancing the inductive ability of a large model according to claim 1, characterized in that: The step of performing low-rank adaptive training on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, adjusting the model parameters of the large model to be enhanced, and obtaining the enhanced large model includes: Using each deductive instance corresponding to each candidate hypothesis as each second training sample corresponding to each candidate hypothesis; Performing low-rank adaptive training on the large model to be enhanced based on each second training sample corresponding to each candidate hypothesis, and adjusting model parameters of the large model to be enhanced based on the training result; The large model to be enhanced after parameter adjustment is used as the enhanced large model.
6. The method for enhancing the inductive ability of a large model according to claim 1, characterized in that: The summarizing the test samples based on the enhanced large model includes: Generate multiple test instances based on multiple second input texts in the test sample and second output texts corresponding to the multiple second input texts; Input the multiple test instances into the enhanced large model to obtain hypotheses corresponding to the test samples output by the enhanced large model; The enhanced large model is used to determine the probability of each output word segment when summarizing each test instance, and perform Bayesian group decoding based on the probability of each output word segment.
7. A device for enhancing the inductive ability of a large model, characterized in that: include: A generation unit, used for performing inductive sampling on the observed samples based on the large model to be enhanced to generate multiple candidate hypotheses; A deductive unit, used to learn the context based on the large model to be enhanced, and generate deductive instances corresponding to each candidate hypothesis; An adjustment unit, configured to perform low-rank adaptive training on the large model to be enhanced based on the deductive examples corresponding to each candidate hypothesis, and adjust the model parameters of the large model to be enhanced to obtain an enhanced large model; An induction unit, used for summarizing the test samples based on the enhanced large model; The test sample and the observed sample correspond to the same hypothesis.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for enhancing the large model induction capability as described in any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for enhancing the large model induction capability as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for enhancing the large model induction capability as described in any one of claims 1 to 6 is implemented.
