Processing method and device for updating additional parameters of knowledge items
By using feedback statistics list in the knowledge base for additional parameters pre-tuning and using genetic algorithms to update until the performance of the new version is better than the old version, the update problem caused by manual intervention in the existing technology is solved, and more efficient and flexible is achieved Additional parameters updated.
Patent Information
- Application Number
- CN202411502364.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-10-25
AI Technical Summary
In the prior art, additional parameter updates for knowledge entries rely on manual intervention, resulting in unstable quality, long periods and low efficiency of parameter updates.
The additional parameter pre-tuning and genetic algorithm update method based on feedback statistics list are used to completely remove artificial interference factors through multiple rounds of updates and performance discrimination until the performance of the new version is better than the old version.
Improve the quality of additional parameter updates, shorten the update cycle, and improve the update efficiency and flexibility.
Smart Images

Figure CN119441384A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a processing method and device for updating additional parameters of knowledge items. Background Art
[0002] Large Language Models (LLMs) are widely used in a variety of natural language processing (NLP) tasks, such as translation tasks, question-answering tasks, etc. In order to improve the generalization, prediction accuracy, and prediction timeliness of large language models, it is often necessary to configure a knowledge base for reference information query.
[0003] This type of knowledge base usually consists of multiple knowledge items. The data elements of each knowledge item can be roughly divided into two categories: basic parameters and additional parameters. Basic parameters include elements such as knowledge item identification, knowledge item title, knowledge item content, creation / update time, etc., and additional parameters include elements such as knowledge weight, knowledge category, knowledge difficulty level, user preference, update frequency, etc. The purpose of basic parameters is mainly to provide a series of basic key values for knowledge retrieval, and the purpose of additional parameters is to provide a series of additional retrieval key values for knowledge retrieval. In principle, some data elements of basic parameters (such as knowledge content, creation / update time, etc.) will not be updated under normal circumstances except in some specific circumstances (such as changes in knowledge content); while all or part of the data elements of additional parameters may be required to be adaptively updated when some objective conditions (such as user / model knowledge usage preferences, knowledge quality assessment, etc.) change. In other words, the knowledge retrieval accuracy of the knowledge base is positively correlated with the update efficiency of additional parameters to a certain extent.
[0004] At present, the data update mechanism for additional parameters is mostly based on a regular batch update method with manual intervention. Specifically, it continuously collects data on the common knowledge set, knowledge usage preference, knowledge quality assessment and other information of users or models, and regularly analyzes the collected data in the recent specified period to obtain a feedback statistical information, and determines whether to update the additional parameters of some knowledge items in the knowledge base based on the feedback statistical information, and when it is confirmed that the update is to be carried out, a manual intervention method is used to reset the additional parameters of a series of knowledge items based on the above feedback statistical information. Through research, we found that this conventional update method is affected by human factors and is bound to have problems such as unstable parameter update quality, long parameter update cycle, and low parameter update efficiency. Summary of the invention
[0005] The purpose of the present invention is to provide a processing method, device, electronic device and computer-readable storage medium for updating additional parameters of knowledge items in view of the defects of the prior art. After receiving the feedback statistical list each time, the present invention will first pre-adjust the additional parameters of the knowledge base based on the feedback statistical list and update the additional parameters of the pre-adjusted current knowledge base based on the genetic algorithm. After each round of additional parameter update, the performance of the new and old versions of the knowledge base will be judged based on a label data set. When it is judged that the performance of the new version is inferior to that of the old version, the current knowledge base will be pre-adjusted again based on the feedback statistical list and the pre-adjusted current knowledge base will be updated based on the genetic algorithm until the performance of the new version is better than that of the old version. When it is judged that the performance of the new version is better than that of the old version, the latest current knowledge base will be used as the latest first knowledge base and saved. Through the present invention, artificial interference factors can be completely removed from the additional parameter update process, so as to achieve the purpose of improving the quality of parameter update, shortening the update cycle, improving update efficiency and improving update flexibility.
[0006] To achieve the above object, a first aspect of an embodiment of the present invention provides a processing method for updating additional parameters of a knowledge item, the method comprising:
[0007] Step 1, receiving a first feedback statistical list and a first label data set; and recording a knowledge base corresponding to the first feedback statistical list as a corresponding first knowledge base; and recording a large language model that uses the first knowledge base to process a natural language task as a corresponding first large language model;
[0008] Wherein, the natural language task includes at least a translation task and a question-answering task;
[0009] Step 2, duplicating the first knowledge base twice and using the obtained two duplicate knowledge bases as the corresponding old version knowledge base and the current knowledge base respectively;
[0010] Step 3, first pre-adjusting the current knowledge base for a round of additional parameters according to the first feedback statistical list; then updating the pre-adjusted current knowledge base for a round of additional parameters based on a genetic algorithm;
[0011] Step 4: at the end of this additional parameter update, determining whether the current knowledge base is better than the old version knowledge base according to the first label data set and the first large language model to obtain a corresponding first determination result;
[0012] The first determination result includes better than the old version and worse than the old version;
[0013] Step 5, identifying whether the first determination result is better than the old version; if not, go to step 6; if yes, go to step 7;
[0014] Step 6, identifying the preset re-update mode; if the re-optimization mode is a re-update, firstly copy the entire knowledge base of the old version knowledge base and use the obtained copy knowledge base as the new current knowledge base, and then return to step 3; if the re-update mode is a continued update, directly return to step 3;
[0015] The re-update mode includes restarting the update and continuing the update;
[0016] Step 7: Save the latest current knowledge base as the latest first knowledge base.
[0017] Preferably, the first large language model includes at least a BERT series model, a BART series model, a GPT series model, a T5 series model, and a Wenxin series model; the first large language model is used to perform corresponding natural language task processing according to the task instruction text input by the model and output the corresponding generated text;
[0018] The first label data set includes a plurality of first data records; the first data record includes a first task instruction text and a first label text; each of the first task input texts is a task instruction text of the first large language model; the first label text is a label text used to perform correctness / error verification on the generated text of the first large language model;
[0019] The first knowledge base includes a plurality of first knowledge items; the first knowledge items include a first basic parameter set and a first additional parameter set; the first basic parameter set includes at least a first knowledge item identifier, a first knowledge item title, a first knowledge item content and a first creation / update time; the first additional parameter set includes at least a first knowledge weight, a first knowledge category, a first knowledge difficulty level, a first user preference and a first update frequency; the first user preference includes at least two preference states: like and dislike;
[0020] The first feedback statistical list includes a first preference category set, a first preference item set, a first preference level set and a first evaluation item set; when the first preference category set is not empty, it is composed of one or more first preference categories, and each first preference category corresponds to a knowledge category; when the first preference item set is not empty, it is composed of one or more first preference item identifiers, and each first preference item identifier corresponds to a knowledge item identifier; when the first preference level set is not empty, it is composed of one or more first preference levels, and each first preference level corresponds to a knowledge difficulty level; when the first evaluation item set is not empty, it is composed of one or more first evaluation items, and the first evaluation item includes a first evaluation item identifier and a first item evaluation type, and the first item evaluation type includes two evaluation types: good review and bad review.
[0021] Preferably, performing a round of additional parameter pre-adjustment on the current knowledge base according to the first feedback statistical list specifically includes:
[0022] Step 31, extracting the corresponding first preference category set, the first preference item set, the first preference level set and the first evaluation item set from the first feedback statistical list;
[0023] Step 32: if the first preference category set is not empty, all the first knowledge items in the current knowledge base that match any of the first preference categories in the first preference category set are recorded as corresponding preference type items; and based on a preset first single-step increment ratio a, the first knowledge weight of each preference type item is fine-tuned in a single-step increment, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1 + a);
[0024] Step 33, if the first preference item set is not empty, then each of the first knowledge item identifiers in the current knowledge base that matches any of the first preference item identifiers in the first preference item set is recorded as a corresponding preference item; and the first user preference of each of the preference items is set as a preference;
[0025] Step 34, if the first preference level set is not empty, then all the obtained preference type items and all the preference items form a corresponding current item set; and the first knowledge items in the current item set whose first knowledge difficulty level matches any of the first preference levels in the first preference level set are recorded as corresponding preference level items; and the first knowledge weight of each preference level item is fine-tuned in a single-step increment based on a preset second single-step increment ratio b, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1 + b);
[0026] Step 35, if the first evaluation item set is not empty, then each of the first evaluation items in the first evaluation item set is taken as the corresponding current evaluation item; and the first evaluation item identifier and the first item evaluation type of the current evaluation item are taken as the corresponding current item identifier and the current evaluation type; and the first knowledge item whose first knowledge item identifier in the current knowledge base matches the current item identifier is taken as the corresponding current knowledge item; and the current evaluation type is identified; if the current evaluation type is a positive review, then based on the preset third single-step incremental ratio c, a single-step incremental fine-tuning is performed on the first knowledge weight of the current knowledge item, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1+c); if the current evaluation type is a negative review, then based on the preset first single-step decrement ratio d, a single-step decrement fine-tuning is performed on the first knowledge weight of the current knowledge item, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1-d).
[0027] Preferably, the performing a round of additional parameter updating on the pre-adjusted current knowledge base based on the genetic algorithm specifically includes:
[0028] Step 41, counting the total number of the first knowledge items that have been adjusted in the most recent additional parameter pre-adjustment of the current knowledge base to obtain a corresponding most recent adjustment total number; and identifying whether the most recent adjustment total number is greater than a preset first adjustment total number threshold, if so, all the first knowledge items that have been adjusted in the most recent additional parameter pre-adjustment in the current knowledge base are recorded as the corresponding items to be updated, if not, all the first knowledge items in the current knowledge base are recorded as the corresponding items to be updated;
[0029] Step 42, counting the total number of entries to be updated to obtain the corresponding total number of entries N;
[0030] Step 43: Based on the preset additional parameter-value conversion rule, the first knowledge weight, the first knowledge category, the first knowledge difficulty level, the first user preference and the first update frequency of each of the items to be updated are converted into corresponding first weight values va i 、First category value vb i , first level value vc i 、First preference value vd i and the first frequency value ve i Form a corresponding first-entry numerical vector V i , 1≤entry index i≤N; and the obtained N first entry numerical vectors V iForm a corresponding first vector set;
[0031] The additional parameter-value conversion rule at least includes knowledge weight-value conversion rule, knowledge category-value conversion rule, knowledge difficulty level-value conversion rule, user preference-value conversion rule and update frequency-value conversion rule;
[0032] Step 44, initializing the first iteration counter t to 0; and performing an iteration on each of the first entry value vectors V of the first vector set. i Perform vector numerical normalization calculation to obtain the corresponding second entry numerical vector V i * ; and each of the second entry numerical vectors V * i Bring in the preset fitness evaluation function F fit Calculate the corresponding first fitness m i =F fit (V * i ); and obtain the N first fitness m i Perform the sum calculation and use the result as the corresponding first version sum S t and save; and save the current knowledge base once to obtain the corresponding first version of the knowledge base K t ;
[0033] Wherein, the second entry numerical vector V i * Including the second weight value va i * 、Second category value vb * i , Second level value vc * i , second preference value vd * i and the second frequency value ve * i ,
[0034]
[0035] Step 45, in descending order of fitness, the latest N first fitness m i Sort to obtain a corresponding first sequence; identify the parity of the total number of entries N; if the total number of entries N is an odd number, the first first fitness m in the first sequence i The first reserved fitness is recorded as the corresponding first reserved fitness, and the first reserved fitness is deleted from the first sequence, and the remaining N-1 first fitness m in the first sequence are randomly grouped.i Randomly divide into (N-1) / 2 groups of first fitness groups; if the total number of entries N is an even number, the first and second first fitness m in the first sequence are i The first and second reserved fitness values are recorded as the corresponding first and second reserved fitness values, and the first and second reserved fitness values are deleted from the first sequence, and the remaining N-2 first fitness values m in the first sequence are randomly grouped. i Randomly divide into (N-2) / 2 groups the first fitness grouping;
[0036] Each group of the first fitness level has two first fitness levels m. i composition;
[0037] Step 46, perform a round of traversal on all the first fitness groups obtained this time; and in this round of traversal, record the first fitness group currently traversed as the corresponding current group; and add the two first entry value vectors V corresponding to the current group in the first vector set i Recorded as the corresponding first and second selection vectors; and randomly selecting a numerical type from the preset exchangeable type set as the corresponding exchange type at that time, and randomly selecting one from other numerical types in the exchangeable type set that do not match the exchange type at that time as the corresponding mutation type at that time; and exchanging two similar numerical values corresponding to the exchange type at that time in the first and second selection vectors; and based on the preset single-step mutation rule, in the direction of improving the fitness of the first and second selection vectors, performing a single-step mutation process on the type numerical values corresponding to the mutation type at that time in the first and second selection vectors that have completed the numerical exchange;
[0038] Wherein, the exchangeable type set includes a weight value type, a preference value type and a frequency value type;
[0039] Step 47: add 1 to the first iteration counter t; and perform an operation on each of the first entry value vectors V of the first vector set. i Perform vector numerical normalization calculation to obtain the new second entry numerical vector V * i ; and each of the second entry numerical vectors V i * Substitute the fitness evaluation function F fit Calculate and obtain the new first fitness m i ; and for the latest N first fitness m i Perform the sum calculation to obtain the new first version sum S t and save; and based on each of the first entry numerical vectors V of the first vector seti The first additional parameter set corresponding to the to-be-updated entry in the current knowledge base is updated, and after all the to-be-updated entries are updated, the current knowledge base is saved to obtain a new first version of the knowledge base K t ;
[0040] Step 48, identifying whether the first iteration counter t is greater than a preset first iteration number threshold; if so, go to step 49; if not, return to step 45;
[0041] Step 49, from the saved plurality of first version sums S t The maximum value is selected as the corresponding maximum sum; and the first version of the knowledge base K corresponding to the maximum sum is t as the corresponding optimal knowledge base; and use the optimal knowledge base as the latest current knowledge base.
[0042] Preferably, determining whether the current knowledge base is better than the old version knowledge base according to the first label data set and the first large language model to obtain a corresponding first determination result specifically includes:
[0043] Step 51, counting the total number of the first data records of the first tag data set to obtain the corresponding total number of first records;
[0044] Step 52, use the first large language model connected to the old version knowledge base as the corresponding old version model; and perform a round of traversal on all the first data records; and in this round of traversal, use the first data record currently traversed as the corresponding current evaluation record; and input the first task instruction text of the current evaluation record into the old version model for corresponding natural language task processing and use the generated text output by the model as the corresponding first predicted text; and time the processing time of the old version model for processing this natural language task to obtain the corresponding first processing time; and perform word segmentation processing on the first predicted text and the first label text of the current evaluation record to obtain the corresponding first and second word segmentation sequences; and perform word embedding encoding on the first and second word segmentation sequences respectively The code is processed to obtain the corresponding first and second coding vectors; and based on the cosine vector similarity algorithm, the vector similarity of the first and second coding vectors is calculated to obtain the corresponding first similarity; and whether the first similarity is greater than a preset first similarity threshold is identified, and if so, the corresponding first verification state is set to be correct, and if not, the corresponding first verification state is set to be wrong; and at the end of this round of traversal, the mean of all the first processing durations obtained is calculated and the calculation result is used as the corresponding first average response time; and the total number of the first verification states that are specifically wrong is counted to obtain the corresponding first total number of errors, and the corresponding first error rate is calculated based on the first total number of errors and the first total number of records = (total number of first errors / total number of first records) × 100%;
[0045] Step 52, use the first language model connected to the current knowledge base as the corresponding new version model; and perform a round of traversal on all the first data records; and in this round of traversal, use the first data record currently traversed as the corresponding current evaluation record; and input the first task instruction text of the current evaluation record into the new version model for corresponding natural language task processing and use the generated text output by the model as the corresponding second predicted text; and time the processing time of the new version model processing this natural language task to obtain the corresponding second processing time; and perform word segmentation processing on the second predicted text and the first label text of the current evaluation record to obtain the corresponding third and fourth word segmentation sequences; and perform word embedding on the third and fourth word segmentation sequences respectively The encoding process obtains the corresponding third and fourth encoding vectors; and based on the cosine vector similarity algorithm, the vector similarity of the third and fourth encoding vectors is calculated to obtain the corresponding second similarity; and whether the second similarity is greater than the first similarity threshold is identified, and if so, the corresponding second verification state is set to be correct, otherwise the corresponding second verification state is set to be wrong; and at the end of this round of traversal, the mean of all the second processing time obtained is calculated and the calculation result is used as the corresponding second average response time; and the total number of the second verification states that are specifically wrong is counted to obtain the corresponding second total number of errors, and the corresponding second error rate is calculated based on the second total number of errors and the first total number of records = (total number of second errors / total number of first records) × 100%;
[0046] Step 53, identifying the first and second average response times and the first and second error rates; if the second average response time is less than or equal to the first average response time and the second error rate is less than or equal to the first error rate, setting the corresponding first judgment result to be better than the old version; if the second average response time is greater than the first average response time or the second error rate is greater than the first error rate, setting the corresponding first judgment result to be worse than the old version.
[0047] A second aspect of an embodiment of the present invention provides a device for implementing the processing method for updating additional parameters of a knowledge item as described in the first aspect, the device comprising: a data receiving module, a first preprocessing module, an additional parameter updating module, a performance identification module, a performance comparison module, a second preprocessing module and a data output module;
[0048] The data receiving module is used to receive a first feedback statistical list and a first label data set; and record the knowledge base corresponding to the first feedback statistical list as the corresponding first knowledge base; and record the large language model that uses the first knowledge base to process the natural language task as the corresponding first large language model; wherein the natural language task includes at least a translation task and a question-answering task;
[0049] The first preprocessing module is used to perform two full knowledge base copies on the first knowledge base and use the obtained two copied knowledge bases as the corresponding old version knowledge base and the current knowledge base respectively;
[0050] The additional parameter updating module is used to first perform a round of additional parameter pre-adjustment on the current knowledge base according to the first feedback statistical list; and then perform a round of additional parameter update on the pre-adjusted current knowledge base based on a genetic algorithm;
[0051] The performance identification module is used to determine whether the current knowledge base is better than the old version knowledge base according to the first label data set and the first large language model at the end of the additional parameter update to obtain a corresponding first determination result; wherein the first determination result includes better than the old version and worse than the old version;
[0052] The performance comparison module is used to identify whether the first determination result is better than the old version; if not, it is transferred to the second preprocessing module; if so, it is transferred to the data output module;
[0053] The second preprocessing module is used to identify the preset re-update mode; if the re-optimization mode is a restart, the old version of the knowledge base is first fully copied and the copied knowledge base is used as the new current knowledge base, and then transferred to the additional parameter update module; if the re-update mode is a continued update, it is directly transferred to the additional parameter update module; wherein the re-update mode includes restart and continued update;
[0054] The data output module is used to save the latest current knowledge base as the latest first knowledge base.
[0055] A third aspect of an embodiment of the present invention provides an electronic device, including: a memory, a processor, and a transceiver;
[0056] The processor is used to be coupled to the memory, read and execute instructions in the memory, so as to implement the method steps described in the first aspect above;
[0057] The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
[0058] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions. When the computer instructions are executed by a computer, the computer executes the instructions of the method described in the first aspect above.
[0059] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for updating additional parameters of knowledge items. It can be seen from the above content that after receiving the feedback statistical list each time, the embodiment of the present invention will first perform a round of additional parameter pre-adjustment on the knowledge base based on the feedback statistical list and perform a round of additional parameter update on the pre-adjusted current knowledge base based on the genetic algorithm, and after each round of additional parameter update, the performance of the new and old versions of the knowledge base will be judged based on a label data set, and when it is judged that the performance of the new version is inferior to the old version, the current knowledge base will be pre-adjusted again based on the feedback statistical list and the pre-adjusted current knowledge base will be updated based on the genetic algorithm until the performance of the new version is better than the old version, and when it is judged that the performance of the new version is better than the old version, the latest current knowledge base will be used as the latest first knowledge base and saved. Through the embodiment of the present invention, artificial interference factors can be completely removed from the additional parameter update process, which not only improves the parameter update quality, but also shortens the update cycle, improves the update efficiency, and improves the update flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A schematic diagram of a processing method for updating additional parameters of a knowledge item provided in the first embodiment of the present invention;
[0061] Figure 2 A module structure diagram of a processing device for updating additional parameters of a knowledge item provided in the second embodiment of the present invention;
[0062] Figure 3 A schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION
[0063] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0064] Embodiment 1 of the present invention provides a processing method for updating additional parameters of a knowledge item, such as Figure 1A schematic diagram of a processing method for updating additional parameters of a knowledge item provided in the first embodiment of the present invention is shown. The method mainly includes the following steps:
[0065] Step 1, receiving a first feedback statistical list and a first label data set; and recording the knowledge base corresponding to the first feedback statistical list as the corresponding first knowledge base; and recording the large language model that uses the first knowledge base to process natural language tasks as the corresponding first large language model.
[0066] Here, the first feedback statistical list of the embodiment of the present invention includes a first preference category set, a first preference item set, a first preference level set and a first evaluation item set; when the first preference category set is not empty, it is composed of one or more first preference categories, and each first preference category corresponds to a knowledge category; when the first preference item set is not empty, it is composed of one or more first preference item identifiers, and each first preference item identifier corresponds to a knowledge item identifier; when the first preference level set is not empty, it is composed of one or more first preference levels, and each first preference level corresponds to a knowledge difficulty level; when the first evaluation item set is not empty, it is composed of one or more first evaluation items, and the first evaluation item includes a first evaluation item identifier and a first item evaluation type, and the first item evaluation type includes two evaluation types: good review and bad review.
[0067] The first label data set of the embodiment of the present invention includes multiple first data records; the first data record includes a first task instruction text and a first label text; each first task input text is a task instruction text of the first large language model; the first label text is a label text used to perform correct / error verification on the generated text of the first large language model. It should be noted that if the first preference category set of the first feedback statistical list is not empty, the knowledge category distribution involved in all the first task instruction texts of the first label data set of the embodiment of the present invention should be positively correlated with the first preference category set.
[0068] The first knowledge base of the embodiment of the present invention includes multiple first knowledge items; the first knowledge items include a first basic parameter set and a first additional parameter set; the first basic parameter set includes at least a first knowledge item identifier, a first knowledge item title, a first knowledge item content and a first creation / update time; the first additional parameter set includes at least a first knowledge weight, a first knowledge category, a first knowledge difficulty level, a first user preference and a first update frequency; the first user preference includes at least two preference states: like and dislike.
[0069] The first large language model of the embodiment of the present invention includes at least a BERT series model, a BART series model, a GPT series model, a T5 series model, and a Wenxin series model; the first large language model is used to perform corresponding natural language task processing according to the task instruction text input by the model and output the corresponding generated text.
[0070] The natural language tasks that can be processed by the first language model in the embodiment of the present invention include at least translation tasks and question-answering tasks.
[0071] Step 2: perform two full knowledge base copies on the first knowledge base and use the two copied knowledge bases as the corresponding old version knowledge base and the current knowledge base respectively.
[0072] Step 3, first pre-adjust the current knowledge base with a round of additional parameters according to the first feedback statistical list; then update the pre-adjusted current knowledge base with a round of additional parameters based on the genetic algorithm;
[0073] Specifically, it includes: step 31, firstly pre-adjusting a round of additional parameters of the current knowledge base according to the first feedback statistical list;
[0074] Specifically, it includes: step 311, extracting the corresponding first preference category set, first preference item set, first preference level set and first evaluation item set from the first feedback statistical list;
[0075] Step 312: if the first preference category set is not empty, the first knowledge items of each first knowledge category in the current knowledge base that match any first preference category in the first preference category set are recorded as corresponding preference type items; and the first knowledge weight of each preference type item is fine-tuned in a single-step increment based on a preset first single-step increment ratio a, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1 + a);
[0076] The first single-step increment ratio a is a preset small ratio parameter, 0 <a<1;
[0077] Step 313, if the first preference item set is not empty, each first knowledge item whose first knowledge item identifier in the current knowledge base matches any first preference item identifier in the first preference item set is recorded as a corresponding preference item; and the first user preference of each preference item is set as a preference;
[0078] Step 314, if the first preference level set is not empty, then all the obtained preference type items and all the preference items form a corresponding current item set; and the first knowledge items whose first knowledge difficulty level in the current item set matches any first preference level in the first preference level set are recorded as corresponding preference level items; and the first knowledge weight of each preference level item is fine-tuned in a single-step increment based on a preset second single-step increment ratio b, and the fine-tuned first knowledge weight = the first knowledge weight before fine-tuning × (1 + b);
[0079] The second single-step increment ratio b is a preset small ratio parameter, 0 <b<1;
[0080] Step 315, if the first evaluation item set is not empty, then each first evaluation item in the first evaluation item set is used as the corresponding current evaluation item; and the first evaluation item identifier and the first item evaluation type of the current evaluation item are used as the corresponding current item identifier and the current evaluation type; and the first knowledge item whose first knowledge item identifier in the current knowledge base matches the current item identifier is used as the corresponding current knowledge item; and the current evaluation type is identified; if the current evaluation type is a positive review, then the first knowledge weight of the current knowledge item is fine-tuned in a single-step increment based on the preset third single-step increment ratio c, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1+c); if the current evaluation type is a negative review, then the first knowledge weight of the current knowledge item is fine-tuned in a single-step decrement based on the preset first single-step decrement ratio d, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1-d);
[0081] The third single-step increment ratio c and the first single-step decrement ratio d are each a preset small-proportional parameter, 0 <c<1,0<d<1;
[0082] Step 32, performing another round of additional parameter update on the pre-adjusted current knowledge base based on the genetic algorithm;
[0083] Specifically, the method comprises: step 321, counting the total number of first knowledge items that have been adjusted in the latest additional parameter pre-adjustment in the current knowledge base to obtain the corresponding latest adjusted total number; and identifying whether the latest adjusted total number is greater than a preset first adjusted total number threshold, if so, recording all first knowledge items that have been adjusted in the latest additional parameter pre-adjustment in the current knowledge base as corresponding items to be updated, if not, recording all first knowledge items in the current knowledge base as corresponding items to be updated;
[0084] Here, the first adjustment total threshold is a preset threshold parameter;
[0085] Step 322, counting the total number of entries to be updated to obtain the corresponding total number of entries N;
[0086] Step 323: Based on the preset additional parameter-value conversion rule, the first knowledge weight, the first knowledge category, the first knowledge difficulty level, the first user preference and the first update frequency of each item to be updated are converted into corresponding values to obtain the corresponding first weight value va i 、First category value vb i , first level value vc i 、First preference value vd i and the first frequency value ve i Form a corresponding first-entry numerical vector V i , 1≤entry index i≤N; and the obtained N first entry numerical vector V i Form a corresponding first vector set;
[0087] Among them, the additional parameter-value conversion rule at least includes knowledge weight-value conversion rule, knowledge category-value conversion rule, knowledge difficulty level-value conversion rule, user preference-value conversion rule and update frequency-value conversion rule;
[0088] Here, the specific scheme of the additional parameter-value conversion rule can be customized based on application requirements; one customized scheme is: the knowledge weight-value conversion rule stipulates that the first knowledge weight is directly used as the corresponding first weight value va i , the knowledge category-value conversion rule stipulates that the type value code corresponding to the first knowledge category is used as the corresponding first category value vb i , the knowledge difficulty level-value conversion rule stipulates that the level value code corresponding to the first knowledge difficulty level is used as the corresponding first level value vc i , the user preference-value conversion rule stipulates that when the first user preference is like, the corresponding first preference value vd i Set to 1, when the first user preference is not liked, the corresponding first preference value vd i Set to 0 (or -1), the update frequency-value conversion rule stipulates that the first update frequency is directly used as the corresponding first frequency value ve i ;
[0089] Step 324, initialize the first iteration counter t to 0; and perform a first iteration on each first entry value vector V of the first vector set. i Perform vector numerical normalization calculation to obtain the corresponding second entry numerical vector V * i ; and each second entry numerical vector V * i Bring in the preset fitness evaluation function Ffit Calculate the corresponding first fitness m i =F fit (V * i ); and obtain the N first fitness m i Perform the sum calculation and use the result as the corresponding first version sum S t and save; and save the current knowledge base once to obtain the corresponding first version of the knowledge base K t ;
[0090] Here, the second entry of the numerical vector V * i Includes: the second weight value va i * 、Second category value vb * i , Second level value vc i * , second preference value vd * i and the second frequency value ve * i ;in,
[0091]
[0092] Step 325: rank the latest N first fitness values m in descending order. i Sort to obtain the corresponding first sequence; identify the parity of the total number of entries N; if the total number of entries N is an odd number, the first first fitness m in the first sequence i The first reserved fitness is recorded as the corresponding first reserved fitness, and the first reserved fitness is deleted from the first sequence, and the remaining N-1 first fitness m in the first sequence are randomly grouped. i Randomly divide into (N-1) / 2 groups of first fitness groups; if the total number of entries N is an even number, the first and second first fitness m in the first sequence are i The first and second reserved fitness values are recorded as the corresponding first and second reserved fitness values, and the first and second reserved fitness values are deleted from the first sequence, and the remaining N-2 first fitness values m in the first sequence are randomly grouped. i Randomly divide into (N-2) / 2 groups of the first fitness group;
[0093] Among them, each group of first fitness groups has two first fitness m i composition;
[0094] Step 326, perform a round of traversal on all the first fitness groups obtained this time; and in this round of traversal, record the first fitness group currently traversed as the corresponding current group; and add the two first entry numerical vectors V corresponding to the current group in the first vector set i Recorded as the corresponding first and second selection vectors; and randomly selecting a numerical type from the preset exchangeable type set as the corresponding exchange type at that time, and randomly selecting one from other numerical types in the exchangeable type set that do not match the exchange type at that time as the corresponding mutation type at that time; and exchanging two similar numerical values corresponding to the exchange type at that time in the first and second selection vectors; and based on the preset single-step mutation rule, in the direction of improving the fitness of the first and second selection vectors, performing a single-step mutation process on the type numerical values corresponding to the mutation type at that time in the first and second selection vectors that have completed the numerical exchange;
[0095] Here, the exchangeable type set of the embodiment of the present invention includes a weight value type, a preference value type and a frequency value type;
[0096] The single-step mutation rule of the embodiment of the present invention can be customized based on application requirements, and the embodiment of the present invention does not limit it; for example, the positive / negative correlation between the numerical change direction (increase / decrease) corresponding to the current mutation type and the numerical change direction (increase / decrease) of the fitness is identified in advance. If the numerical change direction corresponding to the current mutation type is positively correlated with the numerical change direction of the fitness, the single-step mutation rule used this time can be set to a mutation calculation process implemented by a single-step increment method; if the numerical change direction corresponding to the current mutation type is negatively correlated with the numerical change direction of the fitness, the single-step mutation rule used this time can be set to a mutation calculation process implemented by a single-step decrement method;
[0097] Step 327, add 1 to the first iteration counter t; and perform a first iteration on each first entry value vector V of the first vector set. i Perform vector numerical normalization calculation to obtain a new second entry numerical vector V * i ; and each second entry numerical vector V i * Substitute the fitness evaluation function F fit Calculate the new first fitness m i ; and for the latest N first fitness m i Perform the sum calculation to get the new first version sum S t and save; and based on each first entry numerical vector V of the first vector set iUpdate the first additional parameter set of the corresponding entry to be updated in the current knowledge base, and save the current knowledge base after all entries to be updated have been updated to obtain a new first version of the knowledge base K t ;
[0098] Step 328, identifying whether the first iteration counter t is greater than a preset first iteration number threshold; if so, go to step 329; if not, return to step 325;
[0099] Here, the first iteration number threshold is a preset threshold parameter;
[0100] Step 329, from the saved first version sum S t Select the maximum value as the corresponding maximum sum; and set the first version of the knowledge base K corresponding to the maximum sum t as the corresponding optimal knowledge base; and use the optimal knowledge base as the latest current knowledge base.
[0101] Step 4: at the end of this additional parameter update, whether the current knowledge base is better than the old version of the knowledge base is determined based on the first label data set and the first language model to obtain a corresponding first determination result;
[0102] The first judgment result includes better than the old version and worse than the old version;
[0103] Specifically, it includes: step 41, counting the total number of first data records of the first tag data set to obtain the corresponding total number of first records;
[0104] Step 42, the first language model connected to the old version knowledge base is used as the corresponding old version model; and a round of traversal is performed on all the first data records; and in this round of traversal, the first data record currently traversed is used as the corresponding current evaluation record; and the first task instruction text of the current evaluation record is input into the old version model for the corresponding natural language task processing and the generated text output by the model is used as the corresponding first predicted text; and the processing time of the old version model processing this natural language task is timed to obtain the corresponding first processing time; and the first predicted text and the first label text of the current evaluation record are respectively segmented to obtain the corresponding first and second segmented word sequences; and the first and second segmented word sequences are respectively word embedded coding processed to obtain The corresponding first and second coding vectors; and based on the cosine vector similarity algorithm, the vector similarity of the first and second coding vectors is calculated to obtain the corresponding first similarity; and whether the first similarity is greater than the preset first similarity threshold is identified, and if so, the corresponding first verification state is set to be correct, otherwise the corresponding first verification state is set to be wrong; and at the end of this round of traversal, the mean of all the first processing durations obtained is calculated and the calculation result is used as the corresponding first average response time; and the total number of first verification states that are specifically wrong is counted to obtain the corresponding first total number of errors, and the corresponding first error rate is calculated based on the first total number of errors and the first total number of records = (first total number of errors / first total number of records) × 100%;
[0105] Here, the first similarity threshold is a preset threshold parameter;
[0106] Step 42, the first language model connected to the current knowledge base is used as the corresponding new version model; and a round of traversal is performed on all the first data records; and in this round of traversal, the first data record currently traversed is used as the corresponding current evaluation record; and the first task instruction text of the current evaluation record is input into the new version model for the corresponding natural language task processing and the generated text output by the model is used as the corresponding second predicted text; and the processing time of the new version model processing this natural language task is timed to obtain the corresponding second processing time; and the second predicted text and the first label text of the current evaluation record are respectively segmented to obtain the corresponding third and fourth segmented word sequences; and the third and fourth segmented word sequences are respectively word embedded coding processed The corresponding third and fourth coding vectors are obtained; and based on the cosine vector similarity algorithm, the vector similarity of the third and fourth coding vectors is calculated to obtain the corresponding second similarity; and whether the second similarity is greater than the first similarity threshold is identified, and if so, the corresponding second verification state is set to be correct, otherwise the corresponding second verification state is set to be wrong; and at the end of this round of traversal, the mean of all the obtained second processing durations is calculated and the calculation result is used as the corresponding second average response time; and the total number of specifically wrong second verification states is counted to obtain the corresponding second total number of errors, and the corresponding second error rate is calculated based on the second total number of errors and the first total number of records = (second total number of errors / first total number of records) × 100%;
[0107] Step 43, identifying the first and second average response times and the first and second error rates; if the second average response time is less than or equal to the first average response time and the second error rate is less than or equal to the first error rate, setting the corresponding first judgment result to be better than the old version; if the second average response time is greater than the first average response time or the second error rate is greater than the first error rate, setting the corresponding first judgment result to be worse than the old version.
[0108] Step 5, identifying whether the first determination result is better than the old version; if not, go to step 6; if so, go to step 7.
[0109] Step 6, identifying the preset re-update mode; if the re-optimization mode is a re-update, first copy the entire knowledge base of the old version of the knowledge base and use the copied knowledge base as the new current knowledge base, then return to step 3; if the re-update mode is a continue update, directly return to step 3;
[0110] Here, the re-update mode of the embodiment of the present invention includes restarting the update and continuing the update.
[0111] Step 7: Save the latest current knowledge base as the latest first knowledge base.
[0112] Figure 2A module structure diagram of a processing device for updating additional parameters of a knowledge item provided in the second embodiment of the present invention, the device is a terminal device or server that implements the aforementioned method embodiment, and can also be a device that enables the aforementioned terminal device or server to implement the aforementioned method embodiment, for example, the device can be a device or chip system of the aforementioned terminal device or server. Figure 2 As shown, the device includes: a data receiving module 201, a first preprocessing module 202, an additional parameter updating module 203, a performance identification module 204, a performance comparison module 205, a second preprocessing module 206 and a data output module 207.
[0113] The data receiving module 201 is used to receive a first feedback statistical list and a first label data set; and record the knowledge base corresponding to the first feedback statistical list as the corresponding first knowledge base; and record the large language model that uses the first knowledge base to process natural language tasks as the corresponding first large language model; wherein the natural language tasks include at least translation tasks and question-answering tasks.
[0114] The first preprocessing module 202 is used to perform two full knowledge base copies on the first knowledge base and use the obtained two copied knowledge bases as the corresponding old version knowledge base and the current knowledge base respectively.
[0115] The additional parameter updating module 203 is used to first perform a round of additional parameter pre-adjustment on the current knowledge base according to the first feedback statistical list; and then perform a round of additional parameter update on the pre-adjusted current knowledge base based on a genetic algorithm.
[0116] The performance identification module 204 is used to determine whether the current knowledge base is better than the old version of the knowledge base based on the first label data set and the first language model at the end of this additional parameter update to obtain a corresponding first determination result; wherein the first determination result includes better than the old version and worse than the old version.
[0117] The performance comparison module 205 is used to identify whether the first determination result is better than the old version; if not, it goes to the second pre-processing module 206; if so, it goes to the data output module 207.
[0118] The second preprocessing module 206 is used to identify the preset re-update mode; if the re-optimization mode is a restart, the old version of the knowledge base is first copied in its entirety and the copied knowledge base is used as the new current knowledge base, and then the additional parameter update module 203 is transferred; if the re-update mode is a continue update, the additional parameter update module 203 is directly transferred; wherein, the re-update mode includes a restart and a continue update.
[0119] The data output module 207 is used to save the latest current knowledge base as the latest first knowledge base.
[0120] An embodiment of the present invention provides a processing device for updating additional parameters of a knowledge item, which can execute the method steps in the above method embodiment. Its implementation principle and technical effects are similar and will not be repeated here.
[0121] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the data receiving module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and called and executed by a processing element of the above device. The function of the above-mentioned module is determined. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.
[0122] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module above is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0123] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the above method embodiments are generated. The above computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the above-mentioned computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center through wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, Bluetooth, microwave, etc.) methods. The above-mentioned computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0124] Figure 3 This is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device may be a terminal device or a server for implementing the method of the aforementioned embodiment, or may be a terminal device or a server for implementing the method of the aforementioned embodiment connected to the aforementioned terminal device or server. Figure 3 As shown, the electronic device may include: a processor 301 (such as a CPU), a memory 302, and a transceiver 303; the transceiver 303 is coupled to the processor 301, and the processor 301 controls the transceiver 303. Various instructions may be stored in the memory 302 to complete various processing functions and implement the processing steps described in the aforementioned embodiment method. Preferably, the electronic device involved in the embodiment of the present invention also includes: a power supply 304, a system bus 305 and a communication port 306. The system bus 305 is used to realize the communication connection between components. The above-mentioned communication port 306 is used for connecting and communicating between the electronic device and other peripherals.
[0125] exist Figure 3The system bus 305 mentioned in the figure can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize the communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory (Non-Volatile Memory), such as at least one disk storage.
[0126] The above-mentioned processor can be a general-purpose processor, including a central processing unit CPU, a network processor (Network Processor, NP), a graphics processing unit (Graphics Processing Unit, GPU), etc.; it can also be a digital signal processor DSP, an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0127] It should be noted that an embodiment of the present invention further provides a computer-readable storage medium, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes the method and processing process provided in the above embodiments.
[0128] The embodiment of the present invention provides a processing method, device, electronic device and computer-readable storage medium for updating additional parameters of knowledge items. It can be seen from the above content that after receiving the feedback statistical list each time, the embodiment of the present invention will first perform a round of additional parameter pre-adjustment on the knowledge base based on the feedback statistical list and perform a round of additional parameter update on the pre-adjusted current knowledge base based on the genetic algorithm, and after each round of additional parameter update, the performance of the new and old versions of the knowledge base will be judged based on a label data set, and when it is judged that the performance of the new version is inferior to the old version, the current knowledge base will be pre-adjusted again based on the feedback statistical list and the pre-adjusted current knowledge base will be updated based on the genetic algorithm until the performance of the new version is better than the old version, and when it is judged that the performance of the new version is better than the old version, the latest current knowledge base will be used as the latest first knowledge base and saved. Through the embodiment of the present invention, artificial interference factors can be completely removed from the additional parameter update process, which not only improves the parameter update quality, but also shortens the update cycle, improves the update efficiency, and improves the update flexibility.
[0129] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0130] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A processing method for updating additional parameters of a knowledge item, characterized in that: The method comprises: Step 1, receiving a first feedback statistical list and a first label data set; and recording a knowledge base corresponding to the first feedback statistical list as a corresponding first knowledge base; and recording a large language model that uses the first knowledge base to process a natural language task as a corresponding first large language model; Wherein, the natural language task includes at least a translation task and a question-answering task; Step 2, duplicating the first knowledge base twice and using the obtained two duplicate knowledge bases as the corresponding old version knowledge base and the current knowledge base respectively; Step 3, first pre-adjusting the current knowledge base for a round of additional parameters according to the first feedback statistical list; then updating the pre-adjusted current knowledge base for a round of additional parameters based on a genetic algorithm; Step 4: at the end of this additional parameter update, determining whether the current knowledge base is better than the old version knowledge base according to the first label data set and the first large language model to obtain a corresponding first determination result; The first determination result includes better than the old version and worse than the old version; Step 5, identifying whether the first determination result is better than the old version; if not, go to step 6; if yes, go to step 7; Step 6, identifying the preset re-update mode; if the re-optimization mode is a re-update, firstly copy the entire knowledge base of the old version knowledge base and use the obtained copy knowledge base as the new current knowledge base, and then return to step 3; if the re-update mode is a continued update, directly return to step 3; The re-update mode includes restarting the update and continuing the update; Step 7: Save the latest current knowledge base as the latest first knowledge base.
2. The processing method for updating the additional parameters of a knowledge item according to claim 1, characterized in that: The first language model includes at least a BERT series model, a BART series model, a GPT series model, a T5 series model, and a Wenxin series model; the first language model is used to perform corresponding natural language task processing according to the task instruction text input by the model and output the corresponding generated text; The first label data set includes a plurality of first data records; the first data record includes a first task instruction text and a first label text; each of the first task input texts is a task instruction text of the first large language model; the first label text is a label text used to perform correctness / error verification on the generated text of the first large language model; The first knowledge base includes a plurality of first knowledge items; the first knowledge items include a first basic parameter set and a first additional parameter set; the first basic parameter set includes at least a first knowledge item identifier, a first knowledge item title, a first knowledge item content and a first creation / update time; The first additional parameter set includes at least a first knowledge weight, a first knowledge category, a first knowledge difficulty level, a first user preference, and a first update frequency; The first user preference includes at least two preference states: like and dislike; The first feedback statistical list includes a first preference category set, a first preference item set, a first preference level set and a first evaluation item set; when the first preference category set is not empty, it is composed of one or more first preference categories, each of which corresponds to a knowledge category; when the first preference item set is not empty, it is composed of one or more first preference item identifiers, each of which corresponds to a knowledge item identifier; when the first preference level set is not empty, it is composed of one or more first preference levels, each of which corresponds to a knowledge difficulty level; When the first evaluation item set is not empty, it is composed of one or more first evaluation items. The first evaluation item includes a first evaluation item identifier and a first item evaluation type. The first item evaluation type includes two evaluation types: positive evaluation and negative evaluation.
3. The processing method for updating the additional parameters of a knowledge item according to claim 2, characterized in that: The performing a round of additional parameter pre-adjustment on the current knowledge base according to the first feedback statistical list specifically includes: Step 31, extracting the corresponding first preference category set, the first preference item set, the first preference level set and the first evaluation item set from the first feedback statistical list; Step 32: if the first preference category set is not empty, all the first knowledge items in the current knowledge base that match any of the first preference categories in the first preference category set are recorded as corresponding preference type items; and based on a preset first single-step increment ratio a, the first knowledge weight of each preference type item is fine-tuned in a single-step increment, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1 + a); Step 33, if the first preference item set is not empty, then each first knowledge item whose first knowledge item identifier in the current knowledge base matches any first preference item identifier in the first preference item set is recorded as a corresponding preference item; and the first user preference of each preference item is set as a preference; Step 34, if the first preference level set is not empty, then all the obtained preference type items and all the preference items form a corresponding current item set; and the first knowledge items in the current item set whose first knowledge difficulty level matches any of the first preference levels in the first preference level set are recorded as corresponding preference level items; and the first knowledge weight of each preference level item is fine-tuned in a single-step increment based on a preset second single-step increment ratio b, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1 + b); Step 35, if the first evaluation item set is not empty, then each of the first evaluation items in the first evaluation item set is taken as the corresponding current evaluation item; and the first evaluation item identifier and the first item evaluation type of the current evaluation item are taken as the corresponding current item identifier and the current evaluation type; and the first knowledge item whose first knowledge item identifier in the current knowledge base matches the current item identifier is taken as the corresponding current knowledge item; and the current evaluation type is identified; if the current evaluation type is a positive review, then based on the preset third single-step incremental ratio c, a single-step incremental fine-tuning is performed on the first knowledge weight of the current knowledge item, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1+c); if the current evaluation type is a negative review, then based on the preset first single-step decrement ratio d, a single-step decrement fine-tuning is performed on the first knowledge weight of the current knowledge item, and the first knowledge weight after fine-tuning = the first knowledge weight before fine-tuning × (1-d).
4. The processing method for updating the additional parameters of a knowledge item according to claim 2, characterized in that: The performing a round of additional parameter updating on the pre-adjusted current knowledge base based on the genetic algorithm specifically includes: Step 41, counting the total number of the first knowledge items that have been adjusted in the most recent additional parameter pre-adjustment of the current knowledge base to obtain a corresponding most recent adjustment total number; and identifying whether the most recent adjustment total number is greater than a preset first adjustment total number threshold, if so, all the first knowledge items that have been adjusted in the most recent additional parameter pre-adjustment in the current knowledge base are recorded as the corresponding items to be updated, if not, all the first knowledge items in the current knowledge base are recorded as the corresponding items to be updated; Step 42, counting the total number of entries to be updated to obtain the corresponding total number of entries N; Step 43: Based on the preset additional parameter-value conversion rule, the first knowledge weight, the first knowledge category, the first knowledge difficulty level, the first user preference and the first update frequency of each of the items to be updated are converted into corresponding first weight values va i 、First category value vb i , first level value vc i 、First preference value vd i and the first frequency value ve i Form a corresponding first-entry numerical vector V i , 1≤entry index i≤N; and the obtained N first entry numerical vectors V i Form a corresponding first vector set; The additional parameter-value conversion rule at least includes knowledge weight-value conversion rule, knowledge category-value conversion rule, knowledge difficulty level-value conversion rule, user preference-value conversion rule and update frequency-value conversion rule; Step 44, initializing the first iteration counter t to 0; and performing an iteration on each of the first entry value vectors V of the first vector set. i Perform vector numerical normalization calculation to obtain the corresponding second entry numerical vector and convert each of the second entries into a numeric vector Bring in the preset fitness evaluation function F fit Calculate the corresponding first fitness And the obtained N first fitness m i Perform the sum calculation and use the result as the corresponding first version sum S t and save; and save the current knowledge base once to obtain the corresponding first version of the knowledge base K t ; where the second entry is a numerical vector Includes second weight value Second category value Second level value Second preference value and the second frequency value Step 45, in descending order of fitness, the latest N first fitness m i Sort to obtain a corresponding first sequence; identify the parity of the total number of entries N; if the total number of entries N is an odd number, the first first fitness m in the first sequence i The first reserved fitness is recorded as the corresponding first reserved fitness, and the first reserved fitness is deleted from the first sequence, and the remaining N-1 first fitness m in the first sequence are randomly grouped. i Randomly divide into (N-1) / 2 groups of first fitness groups; if the total number of entries N is an even number, the first and second first fitness m in the first sequence are i The first and second reserved fitness values are recorded as the corresponding first and second reserved fitness values, and the first and second reserved fitness values are deleted from the first sequence, and the remaining N-2 first fitness values m in the first sequence are randomly grouped. i Randomly divide into (N-2) / 2 groups the first fitness grouping; Each group of the first fitness level has two first fitness levels m. i composition; Step 46, perform a round of traversal on all the first fitness groups obtained this time; and in this round of traversal, record the first fitness group currently traversed as the corresponding current group; and add the two first entry value vectors V corresponding to the current group in the first vector set i Recorded as the corresponding first and second selection vectors; and randomly selecting a numerical type from the preset exchangeable type set as the corresponding exchange type at that time, and randomly selecting one from other numerical types in the exchangeable type set that do not match the exchange type at that time as the corresponding mutation type at that time; and exchanging two similar numerical values corresponding to the exchange type at that time in the first and second selection vectors; and based on the preset single-step mutation rule, in the direction of improving the fitness of the first and second selection vectors, performing a single-step mutation process on the type numerical values corresponding to the mutation type at that time in the first and second selection vectors that have completed the numerical exchange; Wherein, the exchangeable type set includes a weight value type, a preference value type and a frequency value type; Step 47: add 1 to the first iteration counter t; and perform an operation on each of the first entry value vectors V of the first vector set. i Perform vector numerical normalization calculation to obtain the new second entry numerical vector and convert each of the second entries into a numeric vector Substitute the fitness evaluation function F fit Calculate and obtain the new first fitness m i ; and for the latest N first fitness m i Perform the sum calculation to obtain the new first version sum S t and save; and based on each of the first entry numerical vectors V of the first vector set i The first additional parameter set corresponding to the to-be-updated entry in the current knowledge base is updated, and after all the to-be-updated entries are updated, the current knowledge base is saved to obtain a new first version of the knowledge base K t ; Step 48, identifying whether the first iteration counter t is greater than a preset first iteration number threshold; if so, go to step 49; if not, return to step 45; Step 49, from the saved plurality of first version sums S t The maximum value is selected as the corresponding maximum sum; and the first version of the knowledge base K corresponding to the maximum sum is t as the corresponding optimal knowledge base; and use the optimal knowledge base as the latest current knowledge base.
5. The processing method for updating the additional parameters of a knowledge item according to claim 2, characterized in that: The determining whether the current knowledge base is better than the old version knowledge base according to the first label data set and the first large language model to obtain a corresponding first determination result specifically includes: Step 51, counting the total number of the first data records of the first tag data set to obtain the corresponding total number of first records; Step 52, use the first large language model connected to the old version knowledge base as the corresponding old version model; and perform a round of traversal on all the first data records; and in this round of traversal, use the first data record currently traversed as the corresponding current evaluation record; and input the first task instruction text of the current evaluation record into the old version model for corresponding natural language task processing and use the generated text output by the model as the corresponding first predicted text; and time the processing time of the old version model for processing this natural language task to obtain the corresponding first processing time; and perform word segmentation processing on the first predicted text and the first label text of the current evaluation record to obtain the corresponding first and second word segmentation sequences; and perform word embedding encoding on the first and second word segmentation sequences respectively The code is processed to obtain the corresponding first and second coding vectors; and based on the cosine vector similarity algorithm, the vector similarity of the first and second coding vectors is calculated to obtain the corresponding first similarity; and whether the first similarity is greater than a preset first similarity threshold is identified, and if so, the corresponding first verification state is set to be correct, and if not, the corresponding first verification state is set to be wrong; and at the end of this round of traversal, the mean of all the first processing durations obtained is calculated and the calculation result is used as the corresponding first average response time; and the total number of the first verification states that are specifically wrong is counted to obtain the corresponding first total number of errors, and the corresponding first error rate is calculated based on the first total number of errors and the first total number of records = (total number of first errors / total number of first records) × 100%; Step 52, use the first language model connected to the current knowledge base as the corresponding new version model; and perform a round of traversal on all the first data records; and in this round of traversal, use the first data record currently traversed as the corresponding current evaluation record; and input the first task instruction text of the current evaluation record into the new version model for corresponding natural language task processing and use the generated text output by the model as the corresponding second predicted text; and time the processing time of the new version model processing this natural language task to obtain the corresponding second processing time; and perform word segmentation processing on the second predicted text and the first label text of the current evaluation record to obtain the corresponding third and fourth word segmentation sequences; and perform word embedding on the third and fourth word segmentation sequences respectively The encoding process obtains the corresponding third and fourth encoding vectors; and based on the cosine vector similarity algorithm, the vector similarity of the third and fourth encoding vectors is calculated to obtain the corresponding second similarity; and whether the second similarity is greater than the first similarity threshold is identified, and if so, the corresponding second verification state is set to be correct, otherwise the corresponding second verification state is set to be wrong; and at the end of this round of traversal, the mean of all the second processing time obtained is calculated and the calculation result is used as the corresponding second average response time; and the total number of the second verification states that are specifically wrong is counted to obtain the corresponding second total number of errors, and the corresponding second error rate is calculated based on the second total number of errors and the first total number of records = (total number of second errors / total number of first records) × 100%; Step 53, identifying the first and second average response times and the first and second error rates; if the second average response time is less than or equal to the first average response time and the second error rate is less than or equal to the first error rate, setting the corresponding first judgment result to be better than the old version; if the second average response time is greater than the first average response time or the second error rate is greater than the first error rate, setting the corresponding first judgment result to be worse than the old version.
6. A device for executing the processing method for updating additional parameters of a knowledge item according to any one of claims 1 to 5, characterized in that: The device comprises: a data receiving module, a first preprocessing module, an additional parameter updating module, a performance identification module, a performance comparison module, a second preprocessing module and a data output module; The data receiving module is used to receive a first feedback statistical list and a first label data set; and record the knowledge base corresponding to the first feedback statistical list as the corresponding first knowledge base; and record the large language model that uses the first knowledge base to process the natural language task as the corresponding first large language model; wherein the natural language task includes at least a translation task and a question-answering task; The first preprocessing module is used to perform two full knowledge base copies on the first knowledge base and use the obtained two copied knowledge bases as the corresponding old version knowledge base and the current knowledge base respectively; The additional parameter updating module is used to first perform a round of additional parameter pre-adjustment on the current knowledge base according to the first feedback statistical list; and then perform a round of additional parameter update on the pre-adjusted current knowledge base based on a genetic algorithm; The performance identification module is used to determine whether the current knowledge base is better than the old version knowledge base according to the first label data set and the first large language model at the end of the additional parameter update to obtain a corresponding first determination result; wherein the first determination result includes better than the old version and worse than the old version; The performance comparison module is used to identify whether the first determination result is better than the old version; if not, it is transferred to the second preprocessing module; if so, it is transferred to the data output module; The second preprocessing module is used to identify the preset re-update mode; if the re-optimization mode is a restart, the old version of the knowledge base is first fully copied and the copied knowledge base is used as the new current knowledge base, and then transferred to the additional parameter update module; if the re-update mode is a continued update, it is directly transferred to the additional parameter update module; wherein the re-update mode includes restart and continued update; The data output module is used to save the latest current knowledge base as the latest first knowledge base.
7. An electronic device, characterized in that: include: memory, processors, and transceivers; The processor is used to couple with the memory, read and execute instructions in the memory, so as to implement the method according to any one of claims 1 to 5; The transceiver is coupled to the processor, and the processor controls the transceiver to send and receive messages.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a computer, the computer is enabled to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Local knowledge base updating method and system based on large language model and BERT model
CN117194602A
Time sequence database multi-objective optimization method based on genetic algorithm parameter adjustment
CN117743294A
Large language model intelligent question and answer work order processing method and device based on optimized knowledge base
CN118535702A
RAG block parameter optimization method based on genetic algorithm
CN118689977A
Process for semi-automatic maintenance of a knowledge base using tagged examples
US20040117335A1