An ablation-based large model example selection method

By building a user question representation model and a language model in a large-scale language model and using a database to train and obtain relevant examples, the problem of example selection limitations in existing technologies is solved, and more efficient response accuracy is achieved.

CN117235230BActive Publication Date: 2026-04-14BEIJING HUILAN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING HUILAN TECH CO LTD
Filing Date
2023-10-12
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing large-scale language models have limitations in example selection, resulting in poor performance when responding to user questions and an inability to effectively utilize the features of different test samples.

Method used

By building a user question representation model, training the model on a database to obtain relevant examples, and combining it with first and second language models, appropriate examples are selected to input into the model to improve response accuracy.

Benefits of technology

It improves the accuracy of large models in responding to user questions by selecting appropriate examples from existing databases to help generate better responses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117235230B_ABST
    Figure CN117235230B_ABST
Patent Text Reader

Abstract

The application provides an ablation-based large model example selection method, which comprises the following steps: building a user question representation model, training the user question representation model based on a database, obtaining examples related to a user question through the trained user question representation model, building a first language model and a second language model, and inputting the user question and the related examples into the first language model. The ablation-based large model example selection method provided by the application can obtain suitable examples in an existing database and help a large model generate better replies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large-scale language model technology, and in particular to a method for selecting large model instances based on ablation. Background Technology

[0002] Existing large-scale language models possess surprising in-context learning (ICL) capabilities. This means they can learn human writing styles or thought processes from a few similar (human-annotated) answer examples, achieving performance on tasks the large model has never learned before. However, in typical ICL, the examples input to the model are manually selected from existing labeled data, making them identical for all test samples. This clearly limits the ICL performance of large models. Therefore, we need to find suitable example data from existing labeled data for different test samples to help large models achieve better performance when answering user questions. Thus, designing an ablation-based example selection method for large models is essential. Summary of the Invention

[0003] The purpose of this invention is to provide a method for selecting large model examples based on ablation, which can obtain suitable examples from existing databases to help large models generate better responses.

[0004] A method for selecting large model examples based on ablation includes the following steps:

[0005] Step 1: Build a user problem representation model and train it based on the database;

[0006] Step 2: Obtain examples related to user questions through the trained user question representation model;

[0007] Step 3: Build the first language model and the second language model, and input the user questions and related examples into the first language model.

[0008] Optionally, in step 1, a user problem representation model is built and trained based on the database, specifically as follows:

[0009] Build a user problem representation model M and obtain training samples from the database. , ),in, For the user questions of the training samples, For the questions and answers in the training samples, an inverted index is used to retrieve the questions and answers from the training samples. A set of candidate examples was obtained by searching the database. , ), for candidate example set ( , ) to score, and obtain the example set of the top k scores ( , ),Will( , As a positive example, the score obtained is arrive Example set ( , ),Will( , As negative examples, operations are performed on each training sample, and the positive and negative examples obtained from each training sample are used to represent the user problem in the model. Conduct training.

[0010] Optionally, for the candidate example set ( , The scoring is conducted as follows:

[0011] pass For each set of candidate examples ( , The scores are assigned to obtain the first ranking, where... It is the likelihood function score;

[0012] Select from the first sort and ( , Two adjacent examples are denoted as ( , ), and( , ), and evaluate it with a score:

[0013]

[0014] Get the scores for all candidate example sets.

[0015] Optionally, in step 2, examples related to user questions are obtained through the trained user question representation model, specifically as follows:

[0016] User issues Input the trained user question representation model In the process, obtain the relevant example set, and then address the problems in the example set. And user questions are represented as vectors, cosine similarity is calculated, and the top users with the highest similarity are selected. Problems with a sample set ,get An example related to user issues.

[0017] Optionally, in step 3, a first language model and a second language model are built, and the user's question and related examples are input into the first language model, specifically as follows:

[0018] A first language model and a second language model are built. The user's question and related examples are input into the first language model to generate a response, and the second language model is used to calculate the likelihood function score of the candidate example set.

[0019] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects: The ablation-based large model example selection method provided by the present invention includes building a user question representation model and training it based on a database, obtaining user question-related examples through the trained user question representation model, building a first language model and a second language model, and inputting the user question and related examples into the first language model. This method can find user question-related examples from the existing database and input them into the language model as auxiliary data to help the language model generate better responses and improve response accuracy. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the selection method for a large model based on ablation, as described in an embodiment of the present invention. Detailed Implementation

[0022] The purpose of this invention is to provide a large model example selection method based on ablation, which can obtain suitable examples from existing databases to help large models generate better responses. Through an innovative learning framework, the model can learn to generate dialogue responses that meet human expectations with less training cost.

[0023] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0024] like Figure 1 As shown, the method for selecting large model examples based on ablation provided in this embodiment of the invention includes the following steps:

[0025] Step 1: Build a user problem representation model and train it based on the database;

[0026] Step 2: Obtain examples related to user questions through the trained user question representation model;

[0027] Step 3: Build the first language model and the second language model, and input the user questions and related examples into the first language model.

[0028] In step 1, a user problem representation model is built and trained based on the database, specifically as follows:

[0029] First, it should be noted that the database contains multiple high-quality question-answer pairs that have been manually curated. A user question representation model M is built from this database, and training samples are obtained from the database. , ),in, For the user questions of the training samples, For the questions and answers in the training samples, an inverted index is used to retrieve the questions and answers from the training samples. A set of candidate examples was obtained by searching the database. , ), for candidate example set ( , ) to score, and obtain the example set of the top k scores ( , ),Will( , As a positive example, the score obtained is arrive Example set ( , ),Will( , As negative examples, operations are performed on each training sample, and the positive and negative examples obtained from each training sample are used to represent the user problem in the model. Training the user problem representation model It is a twin-tower model.

[0030] For candidate example set ( , The scoring is conducted as follows:

[0031] pass For each set of candidate examples ( , The scores are assigned to obtain the first ranking, where... It is the likelihood function score;

[0032] Select from the first sort and ( , For two adjacent examples, it should be noted that if one is the first / last ranked example, then the two examples following or preceding it are taken; otherwise, the two examples preceding and following it are taken, denoted as ( , ),and( , ), and evaluate it with a score:

[0033]

[0034] The scores obtained from all candidate example sets, as per the above formula, generally mean that a larger model receives more examples and therefore performs better. However, when evaluating an example alone on a large model, its performance should be roughly the same as, or only slightly different from, having more examples. Therefore, we propose a comparison ( , The effect of using it alone as a unique example versus using it alongside other examples as model examples, compared to This is to better reflect the importance of the example.

[0035] In step 2, user question-related examples are obtained through the trained user question representation model, specifically as follows:

[0036] User issues Input the trained user question representation model In the process, obtain the relevant example set, and then address the problems in the example set. And user questions are represented as vectors, cosine similarity is calculated, and the top users with the highest similarity are selected. Problems with a sample set ,get An example related to user issues.

[0037] In step 3, a first language model and a second language model are built, and user questions and related examples are input into the first language model, specifically as follows:

[0038] A first language model and a second language model are built. The user's question and related examples are input into the first language model to generate a response, and the second language model is used to calculate the likelihood function score of the candidate example set.

[0039] It should be noted here that the language model can be either pre-trained by us or an open-source model, such as ChatGLM-6B. This model typically has more than 5 billion parameters.

[0040] The present invention provides a method for selecting large model examples based on ablation. The method includes building a user question representation model and training it based on a database. The trained user question representation model is used to obtain user question-related examples. A first language model and a second language model are built. The user question and related examples are input into the first language model. The method can find user question-related examples from the existing database and input them into the language model as auxiliary data to help the language model generate better responses and improve response accuracy.

[0041] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. Furthermore, those skilled in the art will recognize that, based on the ideas of the present invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. An ablation-based large model example selection method, characterized in that, Includes the following steps: Step 1: Build a user problem representation model and train it based on the database; Step 2: Obtain examples related to user questions through the trained user question representation model; Step 3: Build a first language model and a second language model, and input the user's question and related examples into the first language model to generate a response. The second language model is used to calculate the likelihood function score of the candidate example set. In step 1, a user problem representation model is built and trained based on the database, specifically as follows: Build a user problem representation model M and obtain training samples from the database. , ),in, For the user questions of the training samples, For the question answers of the training samples, a set of candidate examples is obtained by searching the database based on the question answers doc_o of the training samples using an inverted index. , ), for candidate example set ( , ) to score, and obtain the example set of the top k scores ( , ),Will( , As a positive example, the score obtained is arrive Example set ( , ),Will( , As negative examples, operations are performed on each training sample, and the positive and negative examples obtained from each training sample are used to represent the user problem in the model. Conduct training; For candidate example set ( , The scoring is conducted as follows: pass For each set of candidate examples ( , The scores are assigned to obtain the first ranking, where P(*) is the likelihood function score; Select from the first sort and ( , Two adjacent examples are denoted as ( , ), and( , ), and evaluate them with scores: . Get the scores for all candidate example sets.

2. The method for selecting large model examples based on ablation according to claim 1, characterized in that, In step 2, user question-related examples are obtained through the trained user question representation model, specifically as follows: User issues Input the trained user question representation model In the process, obtain the relevant example set, and then address the problems in the example set. And user questions are represented as vectors, cosine similarity is calculated, and the top users with the highest similarity are selected. Problems with a sample set ,get An example related to user issues.

Citation Information

Patent Citations

  • Double-tower model training method and device, a retrieval method and device and electronic equipment

    CN113051368A

  • Word normalization method, word normalization device, machine translation method, and machine translation device

    JP2018077850A