Dialogue analysis small model training method and device, electronic equipment and storage medium
By training a small dialogue analysis model through the generation and filtering of reasoning step chains, the problem of insufficient reasoning ability in existing technologies is solved, and more coherent and logical response results are achieved, especially in multi-turn dialogue information processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-16
- Publication Date
- 2026-04-10
AI Technical Summary
Existing training schemes for small dialogue analysis models lack annotations for intermediate reasoning steps in reasoning tasks, resulting in poor model reasoning ability and a lack of coherence and logic in the generated response results, especially when integrating multi-turn dialogue information.
By generating reasoning step chains corresponding to sample dialogue data, including key evidence, intermediate reasoning processes, and reasoning conclusions, multiple reasoning training data are generated using a pre-set large model and chained prompts. High-quality step chains are then selected using an evaluation algorithm, and progressive training is conducted to enhance the reasoning ability of the small model.
It enhances the reasoning ability of the small dialogue analysis model, improves the coherence and logic of the response results, and optimizes the performance in scenarios that integrate multi-turn dialogue information.
Smart Images

Figure CN121835818A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine learning, in particular to a dialogue analysis small model training method and device, electronic equipment and storage medium. BACKGROUND
[0002] A language model, also known as a dialogue analysis model, is usually divided into a language large model (dialogue analysis large model) and a language small model (dialogue analysis small model). The language large model usually has a parameter quantity of hundreds of billions and needs a high-performance GPU or cloud deployment, and has a large power consumption. The language small model usually has a parameter quantity of millions to billions and can be run locally, and is suitable for mobile phones, edge devices and other resource-constrained scenarios. The language small model has the advantages of low latency and high throughput, but has weak generality and may not perform well in complex tasks.
[0003] The current dialogue analysis small model training scheme is usually based on a knowledge distillation technology, which uses a powerful teacher model (i.e., a dialogue analysis large model) to guide a small student model (i.e., a dialogue analysis small model) to learn, so as to obtain a dialogue analysis small model with a performance close to the dialogue analysis large model but with a parameter quantity much less than that of the dialogue analysis large model.
[0004] However, for tasks involving reasoning, the knowledge distillation technology is difficult to pass advanced reasoning knowledge. The training of the dialogue analysis small model is only completed by using training data including dialogue context data and corresponding correct response data, and lacks annotation of intermediate reasoning steps, resulting in poor reasoning ability of the dialogue analysis small model trained by the current dialogue analysis small model training scheme, and the generated response result may lack coherence and logicality and perform poorly when integrating multi-round dialogue information is needed. SUMMARY
[0005] The main purpose of the present application is to provide a dialogue analysis small model training method, device, electronic equipment and storage medium, which aims to enhance the reasoning ability of the dialogue analysis small model, improve the coherence and logicality of the response result, and optimize the performance of the dialogue analysis small model in the scene of integrating multi-round dialogue information.
[0006] In a first aspect, the present application provides a dialogue analysis small model training method, comprising: According to a sample dialogue data set and a preset large model, at least one reasoning step chain corresponding to each sample dialogue data in the sample dialogue data set is generated, each reasoning step chain comprising: key evidence, intermediate reasoning process and reasoning conclusion, the sample dialogue data set comprising: a plurality of sample dialogue data, each sample dialogue data comprising: dialogue context data and annotated correct response data; According to each sample dialogue data and the corresponding reasoning step chain, a plurality of reasoning training data are obtained; training a preset small model by the inference training data, to obtain a trained dialog analysis small model.
[0007] In an optional implementation, the generating, according to the sample dialog data set and the preset large model, of at least one inference step chain corresponding to each piece of sample dialog data in the sample dialog data set comprises: inputting the sample dialog data set into the preset large model, and guiding the preset large model to generate at least one inference step chain corresponding to each piece of sample dialog data by a preset chain prompt.
[0008] In an optional implementation, the inputting of the sample dialog data set into the preset large model and the guiding of the preset large model to generate at least one inference step chain corresponding to each piece of sample dialog data by a preset chain prompt comprises: inputting each piece of sample dialog data in the sample dialog data set into the preset large model multiple times; guiding the preset large model to generate multiple inference step chains corresponding to each piece of sample dialog data by the preset chain prompt multiple times.
[0009] In an optional implementation, after the guiding of the preset large model to generate multiple inference step chains corresponding to each piece of sample dialog data by the preset chain prompt multiple times, the method further comprises: evaluating a quality score of each inference step chain by a preset evaluation algorithm respectively; eliminating the inference step chain with a quality score lower than a preset quality score threshold, to obtain a filtered inference step chain; the obtaining of multiple inference training data according to each piece of sample dialog data and the corresponding inference step chain comprises: the obtaining of multiple inference training data according to each piece of sample dialog data and the corresponding filtered inference step chain.
[0010] In an optional implementation, the evaluating of a quality score of each inference step chain by a preset evaluation algorithm respectively comprises: evaluating a similarity between the inference conclusion of each inference step chain and the correct response data in the corresponding sample dialog data by the preset evaluation algorithm respectively; evaluating a logical consistency between the intermediate inference process of each inference step chain and the dialog context data in the corresponding sample dialog data by the preset evaluation algorithm respectively; determining a quality score of the corresponding inference step chain according to the similarity and the logical consistency.
[0011] In an optional implementation, the obtaining, according to each piece of the sample dialogue data and the corresponding reasoning step chain, of a plurality of reasoning training data comprises: obtaining, according to the key evidence and the reasoning conclusion in the sample dialogue data and the corresponding reasoning step chain, a plurality of simple reasoning training data; obtaining, according to the key evidence, the intermediate reasoning process and the reasoning conclusion in the sample dialogue data and the corresponding reasoning step chain, a plurality of complete reasoning training data.
[0012] In an optional implementation, the training, by the reasoning training data, of a preset small model to obtain a trained dialogue analysis small model comprises: training, by the simple reasoning training data, of a preset small model to obtain a preliminarily trained dialogue analysis small model; retraining, by the complete reasoning training data, of the preliminarily trained dialogue analysis small model to obtain the trained dialogue analysis small model.
[0013] In a second aspect, the present application provides a dialogue analysis small model training device, comprising: a generation module configured to generate, according to a sample dialogue data set and a preset large model, at least one reasoning step chain corresponding to each piece of sample dialogue data in the sample dialogue data set, each reasoning step chain comprising: key evidence, an intermediate reasoning process and a reasoning conclusion, and the sample dialogue data set comprising: a plurality of sample dialogue data, each piece of sample dialogue data comprising: dialogue context data and annotated correct response data; an obtaining module configured to obtain, according to each piece of the sample dialogue data and the corresponding reasoning step chain, a plurality of reasoning training data; a training module configured to train, by the reasoning training data, a preset small model to obtain a trained dialogue analysis small model.
[0014] In a third aspect, the present application provides an electronic device, comprising: a processor, a storage medium and a bus, the storage medium storing machine readable instructions executable by the processor, when the electronic device is running, the processor and the storage medium communicate through the bus, and the processor executes the machine readable instructions to perform the steps of the method according to any one of the preceding embodiments.
[0015] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing a computer program, when the computer program is executed by a processor, the steps of the method according to any one of the preceding embodiments are performed.
[0016] The present application has the following beneficial effects: The dialog analysis small model training method provided in the embodiments of the present application comprises: generating at least one inference step chain corresponding to each piece of sample dialog data in a sample dialog data set according to the sample dialog data set and a preset large model, each inference step chain comprising: key evidence, intermediate inference process and inference conclusion, the sample dialog data set comprising: a plurality of pieces of sample dialog data, each piece of sample dialog data comprising: dialog context data and labeled correct response data; obtaining a plurality of pieces of inference training data according to each piece of sample dialog data and the corresponding inference step chain; and training a preset small model through the inference training data to obtain a trained dialog analysis small model. In the embodiments, the sample dialog data set is input into the preset large model to obtain at least one inference step chain corresponding to each piece of sample dialog data in the sample dialog data set, and then each piece of sample dialog data and the corresponding inference step chain are combined to form a plurality of pieces of inference training data, so that the preset small model is trained through the inference training data comprising the inference step chain to obtain the trained dialog analysis small model, thereby enhancing the inference ability of the dialog analysis small model, improving the coherence and logicality of the response result, and optimizing the performance of the dialog analysis small model in the scene of integrating multi-round dialog information. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0018] Figure 1 A dialog analysis small model training method flowchart provided by an embodiment of the present application; Figure 2 A dialog analysis small model training method flowchart provided by another embodiment of the present application; Figure 3 A dialog analysis small model training method flowchart provided by still another embodiment of the present application; Figure 4 A dialog analysis small model training method flowchart provided by yet another embodiment of the present application; Figure 5 A dialog analysis small model training method flowchart provided by still another embodiment of the present application; Figure 6 A structural diagram of a dialog analysis small model training device provided by an embodiment of the present application; Figure 7 A structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0019] In order to make the purposes, technical solutions, and advantages of the embodiments of the present application clearer, the following will be combined with the accompanying drawings for the embodiments of the present application to make a clear and complete description of the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The components of the embodiments of the present application described and shown in the accompanying drawings can be arranged and designed in various different configurations.
[0020] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work under the premise that the embodiments in the present application fall within the scope of protection of the present application.
[0021] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0022] It should be noted that: similar reference numerals and letters represent similar items in the following drawings, therefore, once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0023] The following will be combined with the accompanying drawings for the embodiments of the present application. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
[0024] The current dialogue analysis small model training scheme is usually based on a knowledge distillation technology, which uses a powerful teacher model (i.e., a dialogue analysis large model) to guide a small student model (i.e., a dialogue analysis small model) to learn, so as to obtain a dialogue analysis small model with performance close to the dialogue analysis large model but with much fewer parameters than the dialogue analysis large model. However, for tasks involving reasoning, it is difficult for the knowledge distillation technology to pass on advanced reasoning knowledge. In general, when training a dialogue analysis small model based on the knowledge distillation technology, only training data including dialogue context data and corresponding correct response data are used to complete the training of the dialogue analysis small model, and the training data lack annotations of intermediate reasoning steps, resulting in that the dialogue analysis small model trained by the current dialogue analysis small model training scheme has poor reasoning ability, and the generated response result may lack coherence and logicality, and performs poorly when integrating multi-round dialogue information is required.
[0025] To solve the above problems, the main purpose of the present application is to provide a dialogue analysis small model training method, which aims to enhance the reasoning ability of the dialogue analysis small model, improve the coherence and logicality of the response result, and optimize the performance of the dialogue analysis small model in the scene of integrating multi-round dialogue information.
[0026] Figure 1 A flowchart of a dialogue analysis small model training method provided by an embodiment of the present application is shown in the figure. The execution subject of the method can be a computer, a server, or other devices with computing and processing functions, but is not limited thereto. As shown in the figure, the method comprises the following steps. Figure 1 S101, generating at least one reasoning step chain corresponding to each sample dialogue data in a sample dialogue data set according to the sample dialogue data set and a preset large model, each reasoning step chain comprising key evidence, intermediate reasoning process and reasoning conclusion, and the sample dialogue data set comprising a plurality of sample dialogue data, each sample dialogue data comprising dialogue context data and annotated correct response data.
[0027] For example, the sample dialogue data set can be represented as D=[d1 (dialogue context data 1, correct response data 1), d2 (dialogue context data 2, correct response data 2), d3 (dialogue context data 3, correct response data 3)……], where D is the sample dialogue data set, and d1, d2 and d3 are a plurality of sample dialogue data in the sample dialogue data set. However, it should be understood that the actual number of sample dialogue data in the sample dialogue data set is not limited to three, and the representation of the sample dialogue data set is not limited to the above example.
[0028] The aforementioned pre-set large model may refer to a trained language model or a dialogue analysis model that has logical reasoning capabilities. However, the specific type, function, training method, number of parameters, etc. of the pre-set large model can be selected and determined according to the actual situation, and are not restricted here.
[0029] The above-mentioned method generates at least one inference step chain corresponding to each sample dialogue data in the sample dialogue dataset based on the sample dialogue dataset and the preset large model. For example, it can refer to using the sample dialogue dataset as input data, processing it through the preset large model, and generating at least one inference step chain corresponding to each sample dialogue data in the sample dialogue dataset. The inference step chain is used to indicate the inference steps to obtain the corresponding correct response data through the dialogue context data in the sample dialogue dataset. For example, the inference step chain can be represented in the form of natural language text, but is not limited thereto.
[0030] S102. Based on each of the above sample dialogue data and the corresponding inference step chain, obtain multiple inference training data.
[0031] For example, based on each of the above sample dialogue data and the corresponding inference step chain, multiple inference training data are obtained. For instance, the inference step chain can be added to the corresponding sample dialogue data to obtain the corresponding inference training data. An example is given for sample dialogue data d1 (dialogue context data 1, correct response data 1): Assuming that the inference step chain corresponding to sample dialogue data d1 (dialogue context data 1, correct response data 1) includes: inference step chain 1, inference step chain 1', and inference step chain 1'', based on this, multiple inference training data are obtained according to each of the above sample dialogue data and the corresponding inference step chain. That is, according to dialogue data d1 (dialogue context data 1, correct response data 1) and the corresponding inference step chain 1, inference step chain 1', and inference step chain 1'', the corresponding inference training data t1 (dialogue context data 1, correct response data 1, inference step chain 1, inference step chain 1', and inference step chain 1'') is obtained. It can be understood that the above example assumes that the inference step chain corresponding to sample dialogue data d1 (dialogue context data 1, correct response data 1) includes: inference step chain 1, inference step chain 1', and inference step chain 1''. However, the inference step chain corresponding to the actual sample dialogue data may be one or more, and is not limited to three inference step chains for each sample dialogue data. Furthermore, the specific form of the inference training data is not limited to the above example and can be represented in other forms.
[0032] S103. Train the preset small model using the above reasoning training data to obtain the trained dialogue analysis small model.
[0033] Exemplarily, the preset small model is trained by the inference training data to obtain the trained dialogue analysis small model, for example, based on the knowledge distillation technology, the preset small model is trained by the inference training data, and after the preset small model is trained, the trained dialogue analysis small model is obtained. The trained dialogue analysis small model can form an analysis logic such as "based on certain dialogue context data, a chain of inference steps can be performed to obtain a correct response data type conclusion", but the specific preset small model type, parameter quantity, evaluation method, optimization method and the like are not limited herein, and can be selected and determined according to actual needs.
[0034] In the dialogue analysis small model training method provided by the embodiments of the present application, at least one inference step chain corresponding to each sample dialogue data in a sample dialogue data set is generated according to the sample dialogue data set and a preset large model, each inference step chain includes key evidence, intermediate inference process and inference conclusion, the sample dialogue data set includes a plurality of sample dialogue data, and each sample dialogue data includes dialogue context data and labeled correct response data. A plurality of inference training data are obtained according to each sample dialogue data and the corresponding inference step chain. A preset small model is trained by the inference training data to obtain a trained dialogue analysis small model. In this embodiment, the sample dialogue data set is input into the preset large model to obtain at least one inference step chain corresponding to each sample dialogue data in the sample dialogue data set, and then each sample dialogue data and the corresponding inference step chain are combined to form a plurality of inference training data, so that the preset small model is trained by the inference training data including the inference step chain to obtain the trained dialogue analysis small model, thereby enhancing the inference ability of the dialogue analysis small model, improving the coherence and logicality of the response result, and optimizing the performance of the dialogue analysis small model in the scene of integrating multi-round dialogue information.
[0035] Further, in the above Figure 1 Based on the embodiments, the at least one inference step chain corresponding to each sample dialogue data in the sample dialogue data set can be generated according to the sample dialogue data set and the preset large model, which can include: The sample dialogue data set is input into the preset large model, and the preset large model is guided to generate at least one inference step chain corresponding to each sample dialogue data by a preset chain prompt.
[0036] Exemplarily, the preset chain prompt can be a guided natural language text input into the preset large model, such as a dialogue analysis large model, for example, "please think step by step", "let's analyze and reason step by step", and the like. Of course, the specific chain prompt can be adjusted and determined according to the situation and characteristics of the preset large model, and is not limited to the above examples.
[0037] Figure 2 A flowchart of a method for training a dialogue analysis small model according to another embodiment of the present application is shown in FIG. 6. As shown in FIG. 6, the method can include the following steps. Figure 2 Optionally, on the basis of the above-mentioned embodiments, the method can further include the following steps. S201, inputting each piece of sample dialogue data in the sample dialogue data set into the preset large model multiple times.
[0038] S202, guiding the preset large model through the preset chain prompt multiple times to generate multiple pieces of inference step chains corresponding to each piece of sample dialogue data.
[0039] For example, when each piece of sample dialogue data in the sample dialogue data set is inputted into the preset large model once, one piece of inference step chain corresponding to each piece of sample dialogue data can be generated. When each piece of sample dialogue data in the sample dialogue data set is inputted into the preset large model multiple times, multiple pieces of inference step chain corresponding to each piece of sample dialogue data can be generated.
[0040] It can be understood that if each piece of sample dialogue data in the sample dialogue data set is inputted into the preset large model multiple times, the content of the preset chain prompt used to guide the preset large model to generate multiple pieces of inference step chain corresponding to each piece of sample dialogue data can be the same or different, which is not limited here.
[0041] Further, on the basis of the above-mentioned embodiments, after the multiple pieces of inference step chain corresponding to each piece of sample dialogue data are generated by guiding the preset large model through the preset chain prompt, the method can further include the following steps. Figure 2 evaluating the quality score of each piece of inference step chain through a preset evaluation algorithm. Removing the inference step chain with a quality score lower than a preset quality score threshold to obtain filtered inference step chains.
[0042] For example, the preset evaluation algorithm can be a preset scoring rule, a preset heuristic rule, etc. The preset evaluation algorithm can also be a trained scoring model. The preset evaluation algorithm can also be a combination of multiple algorithms, models, and rules, but the specific implementation is not limited here.
[0043] The pre-set evaluation algorithm is a trained scoring model. The trained scoring model may be a machine learning model. The machine learning model may be trained using a labeled scoring training dataset. The labeled scoring training dataset may include a plurality of scoring training data. Each scoring training data may include sample dialogue data input to the pre-set large model, at least one inference step chain corresponding to the sample dialogue data output by the pre-set large model, and a labeled score of each inference step chain.
[0044] For example, the scoring training data x1 may be represented as x1 (dialogue context data 11, correct response data 11, inference step chain 11, labeled score of inference step chain 11, inference step chain 11', labeled score of inference step chain 11, inference step chain 11'', and labeled score of inference step chain 11). The machine learning model may form a scoring logic such as "based on dialogue context data 11 and correct response data 11, if the inference step chain formed by the pre-set large model is 11, the score is the labeled score of inference step chain 11, if the inference step chain formed by the pre-set large model is 11', the score is the labeled score of inference step chain 11', and if the inference step chain formed by the pre-set large model is 11'', the score is the labeled score of inference step chain 11''.
[0045] Of course, the above content is only one possible example. The pre-set evaluation algorithm is not limited to the trained scoring model. Even if the pre-set evaluation algorithm is a trained scoring model, the type and training method of the trained scoring model are not limited to the above example.
[0046] The above-mentioned filtering of the inference step chain with a quality score lower than the pre-set quality score threshold ensures that the inference steps and inference logic in the inference step chain are correct, avoiding the formation of inference training data from inference step chains with incorrect inference steps and inference logic.
[0047] The above-mentioned obtaining of a plurality of inference training data according to each sample dialogue data and corresponding inference step chain includes: The above-mentioned obtaining of a plurality of inference training data according to each sample dialogue data and corresponding filtered inference step chain.
[0048] For example, the above-mentioned obtaining of a plurality of inference training data according to each sample dialogue data and corresponding filtered inference step chain ensures that the inference steps and inference logic in the inference step chain in the inference training data are correct, so as to accurately complete the training of the pre-set small model.
[0049] In the embodiment, the reasoning training data can include the sample dialogue data and the corresponding reasoning step chain, i.e., the Figure 1 The reasoning training data in the embodiment is in the form of reasoning training data t1 (dialogue context data 1, correct response data 1, reasoning step chain 1, reasoning step chain 1', reasoning step chain 1''), where the dialogue context data 1 and the correct response data 1 are the sample dialogue data, and the reasoning step chain 1, the reasoning step chain 1', and the reasoning step chain 1'' are the corresponding reasoning step chain. However, the reasoning training data is not limited to including a complete reasoning step chain.
[0050] Figure 3 A flowchart of an alarm notification processing method provided by another embodiment of the application is shown in FIG. 6. Figure 3 As shown in FIG. 6, optionally, on the basis of the above-mentioned embodiments, the quality score of each reasoning step chain evaluated by the preset evaluation algorithm can include: S301, the similarity between the reasoning conclusion of each reasoning step chain and the correct response data in the corresponding sample dialogue data is evaluated by the preset evaluation algorithm.
[0051] For example, the preset evaluation algorithm can include a text similarity evaluation algorithm. Correspondingly, the similarity between the reasoning conclusion of each reasoning step chain and the correct response data in the corresponding sample dialogue data evaluated by the preset evaluation algorithm can mean that the text similarity between the reasoning conclusion of each reasoning step chain and the correct response data in the corresponding sample dialogue data is evaluated by the text similarity evaluation algorithm. The text similarity can be expressed as a percentage of 0-100%, such as 56%, 67%, 89%, etc., but is not limited thereto. The specific text similarity evaluation algorithm is not limited herein.
[0052] S302, the logical consistency between the intermediate reasoning process of each reasoning step chain and the dialogue context data in the corresponding sample dialogue data is evaluated by the preset evaluation algorithm.
[0053] Exemplarily, the preset evaluation algorithm can include a trained logical consistency evaluation model, which can be a machine learning model, and the trained logical consistency evaluation model can be trained using a labeled logical consistency training dataset, which can include a plurality of pieces of logical consistency training data, each piece of logical consistency training data including sample dialogue data input to the preset large model, at least one inference step chain corresponding to the sample dialogue data output by the preset large model, and the labeled logical consistency of each inference step chain.
[0054] For example, the logical consistency training data y1 can be represented as y1 (dialogue context data 22, correct response data 22, inference step chain 22, labeled logical consistency of inference step chain 22, inference step chain 22', labeled logical consistency of inference step chain 22, inference step chain 22'', and labeled logical consistency of inference step chain 22), so that the machine learning model forms a logical consistency evaluation logic such as “based on the dialogue context data 22 and the correct response data 22, if the inference step chain formed by the preset large model is 22, the score is the labeled logical consistency of the inference step chain 22, if the inference step chain formed by the preset large model is 22', the score is the labeled logical consistency of the inference step chain 22', and if the inference step chain formed by the preset large model is 22'', the score is the labeled logical consistency of the inference step chain 22''. The logical consistency can also be represented as a percentage, for example, 0-100%, such as 33%, 45%, 98%, and the like.
[0055] Of course, the above is only one possible example, and the actual preset evaluation algorithm can not be limited to a trained logical consistency evaluation model, but can be adjusted and determined according to actual conditions.
[0056] S303, determining the quality score of the corresponding inference step chain according to the similarity and the logical consistency.
[0057] Exemplarily, the preset evaluation algorithm can include a preset quality score algorithm, and the determination of the quality score of the corresponding inference step chain according to the similarity and the logical consistency can refer to the calculation of the quality score of the corresponding inference step chain according to the similarity, the logical consistency, and the preset quality score algorithm.
[0058] The preset quality score algorithm may be, for example, a quality score obtained based on a weighted average algorithm "(similarity x similarity weight + logical consistency x logical consistency weight) x 100". For example, assuming that the similarity is 87%, the logical consistency is 91%, and the weight of the similarity: logical consistency is 30:70, the quality score of the corresponding reasoning step chain may be determined according to the similarity and the logical consistency, for example, by (87% x 30% + 91% x 70%) x 100 = 89.8, that is, the quality score of the corresponding reasoning step chain is 89.8 according to the similarity and the logical consistency. It can be understood that, under the premise that the similarity and the logical consistency are each a percentage of 0-100%, the quality score of the reasoning step chain will be a number of 0-100, and the preset quality score algorithm is not limited to the weighted average algorithm in the example.
[0059] Figure 4 A flowchart of an alarm notification processing method according to another embodiment of the present application is shown in FIG. 6. Figure 4 In the foregoing Figure 1 Based on the foregoing embodiments, the obtaining of the plurality of reasoning training data according to each of the sample dialogue data and the corresponding reasoning step chain includes: S401, obtaining a plurality of simple reasoning training data according to the key evidence and the reasoning conclusion in the sample dialogue data and the corresponding reasoning step chain.
[0060] In this embodiment, the simple reasoning training data includes the content in part of the reasoning step chain (i.e., the key evidence and the reasoning conclusion in the reasoning step chain), but does not include the intermediate reasoning process in the reasoning step chain. Training the preset small model by using the simple reasoning training data can reduce the training difficulty and enable the preset small model to form a simple reasoning logic first.
[0061] For example, assuming that each of n pieces of sample dialogue data dn (dialogue context data n, correct response data n) has only one corresponding reasoning step chain n, the simple reasoning training data tn' may be expressed as tn' (dialogue context data n, correct response data n, key evidence n, reasoning conclusion n), for example.
[0062] S402, obtaining a plurality of complete reasoning training data according to the key evidence, the intermediate reasoning process, and the reasoning conclusion in the sample dialogue data and the corresponding reasoning step chain.
[0063] This complete reasoning training data includes all the content of the aforementioned reasoning chain (i.e., key evidence, intermediate reasoning processes, and reasoning conclusions). Directly using this complete training data to train a pre-defined small model might lead to excessive training difficulty and affect training efficiency. Therefore, this complete reasoning training data can be used, for example, to train a pre-defined small model that has mastered simple reasoning logic, thereby achieving phased training of the pre-defined small model and ultimately enabling it to form complete reasoning logic, thus improving training efficiency. Of course, this complete reasoning training data is not limited to training pre-defined small models that have mastered simple reasoning logic.
[0064] Continuing with the example above, the complete inference training data t1'' can be represented as tn'' (dialogue context data n, correct response data n, key evidence n, intermediate inference process n, inference conclusion n).
[0065] Figure 5 A schematic flowchart of an alarm notification processing method provided in another embodiment of this application is shown below. Figure 5 As shown, further, in the above Figure 4 Based on the embodiments, the above-mentioned training of a preset small model using the aforementioned inference training data yields a trained dialogue analysis small model, including: S501. Train the preset small model using the above-mentioned simplified reasoning training data to obtain a preliminary trained dialogue analysis small model.
[0066] S502. The dialogue analysis mini-model that was initially trained is trained again using the complete reasoning training data to obtain the trained dialogue analysis mini-model.
[0067] For example, the training method described above, which first trains a preset small model using simple inference training data and then trains the preliminarily trained dialogue analysis small model using complete inference training data, is different from directly training the preset small model using the inference training data in the aforementioned embodiments. For example, a progressive inference distillation strategy can be used. This progressive inference distillation strategy can execute the training process of the preset small model in stages, allowing the preset small model to first master simple inference patterns and then gradually digest complex multi-hop inference processes, resulting in more stable training convergence and efficient acquisition of inference capabilities.
[0068] Furthermore, during the training process, the training process of the above-mentioned progressive reasoning distillation strategy can also weight the key evidence and reasoning conclusions in the above-mentioned simplified reasoning training data, as well as the key evidence, intermediate reasoning process, and reasoning conclusions in the above-mentioned complete reasoning training data, so as to emphasize the key reasoning steps in the training process. However, the specific weighting method and weight value are not limited here and can be adjusted and determined according to the actual situation.
[0069] Figure 6 A structural diagram of a dialogue analysis small model training device is provided for an embodiment of the present application. The dialogue analysis small model training device can execute the dialogue analysis small model training method described above. The device can be integrated into a computer, a server, or other device with computing processing capability, as shown in the figure. The device can include: Figure 6 The generation module 610 is configured to generate at least one inference step chain corresponding to each piece of sample dialogue data in the sample dialogue data set according to the sample dialogue data set and the preset large model. Each inference step chain includes key evidence, intermediate inference process, and inference conclusion. The sample dialogue data set includes multiple pieces of sample dialogue data. Each piece of sample dialogue data includes dialogue context data and annotated correct response data.
[0070] The acquisition module 620 is configured to acquire multiple pieces of inference training data according to each piece of sample dialogue data and the corresponding inference step chain.
[0071] The training module 630 is configured to train the preset small model through the inference training data to obtain a trained dialogue analysis small model.
[0072] In the dialogue analysis small model training method provided by the embodiment of the present application, at least one inference step chain corresponding to each piece of sample dialogue data in the sample dialogue data set is generated according to the sample dialogue data set and the preset large model. Each inference step chain includes key evidence, intermediate inference process, and inference conclusion. The sample dialogue data set includes multiple pieces of sample dialogue data. Each piece of sample dialogue data includes dialogue context data and annotated correct response data. Multiple pieces of inference training data are acquired according to each piece of sample dialogue data and the corresponding inference step chain. The preset small model is trained through the inference training data to obtain a trained dialogue analysis small model. In this embodiment, the sample dialogue data set is input into the preset large model to obtain at least one inference step chain corresponding to each piece of sample dialogue data in the sample dialogue data set. Then, each piece of sample dialogue data and the corresponding inference step chain are combined to form multiple pieces of inference training data. The inference training data including the inference step chain is used to train the preset small model to obtain the trained dialogue analysis small model. Thus, the inference ability of the dialogue analysis small model is enhanced, the coherence and logicality of the response result are improved, and the performance of the dialogue analysis small model in the scene of integrating multiple rounds of dialogue information is optimized.
[0073] Optionally, the generation module 610 is specifically configured to input the sample dialogue data set into the preset large model and guide the preset large model to generate at least one inference step chain corresponding to each piece of sample dialogue data through a preset chain prompt.
[0074] Optionally, the generation module 610 is specifically configured to input each piece of the sample dialogue data in the sample dialogue data set into the preset large model multiple times respectively.
[0075] Optionally, the dialogue analysis small model training apparatus can further include an evaluation module configured to evaluate a quality score of each piece of the reasoning step chain by using a preset evaluation algorithm, and remove the reasoning step chain with a quality score lower than a preset quality score threshold to obtain filtered reasoning step chains.
[0076] The training module 630 is specifically configured to obtain multiple pieces of reasoning training data according to each piece of the sample dialogue data and the corresponding filtered reasoning step chain.
[0077] Optionally, the evaluation module is specifically configured to evaluate a similarity between the reasoning conclusion of each piece of the reasoning step chain and the correct response data in the corresponding sample dialogue data by using the preset evaluation algorithm, and evaluate a logical consistency between the intermediate reasoning process of each piece of the reasoning step chain and the dialogue context data in the corresponding sample dialogue data by using the preset evaluation algorithm. The quality score of the corresponding reasoning step chain is determined according to the similarity and the logical consistency.
[0078] Optionally, the obtaining module 620 is specifically configured to obtain multiple pieces of simple reasoning training data according to the sample dialogue data and the key evidence and the reasoning conclusion in the corresponding reasoning step chain, and obtain multiple pieces of complete reasoning training data according to the sample dialogue data and the key evidence, the intermediate reasoning process and the reasoning conclusion in the corresponding reasoning step chain.
[0079] Optionally, the training module 630 is specifically configured to train a preset small model by using the simple reasoning training data to obtain a preliminarily trained dialogue analysis small model, and retrain the preliminarily trained dialogue analysis small model by using the complete reasoning training data to obtain the trained dialogue analysis small model.
[0080] The apparatus is used for executing the method provided by the foregoing embodiments, and has similar implementation principles and technical effects, which will not be described here.
[0081] Figure 7 A structural schematic diagram of an electronic device is provided for the embodiments of the present application. The electronic device can be a device with computing processing capability such as the vehicle machine mentioned above, as shown in the figure, the device 700 includes: Figure 7 As shown in the figure, the device 700 includes: The processor 710, the storage medium 720 and the bus 730 are communicatively connected between the processor 710 and the storage medium 720.
[0082] The storage medium 720 stores machine readable instructions executable by the processor 710, and the processor 710 executes the machine readable instructions to perform the above dialogue analysis small model training method when the electronic device is running.
[0083] It should be understood that, Figure 7 The structure shown is only a structural schematic diagram of the electronic device, and the electronic device can further include more or less components than those shown in the figures, or have a different configuration from that shown in the figures. Figure 7 The components shown in the figures can be implemented in hardware, software or a combination thereof. Figure 7 The components shown in the figures can be implemented in hardware, software or a combination thereof. Figure 7 The components shown in the figures can be implemented in hardware, software or a combination thereof.
[0084] The embodiments of the present application also provide a computer readable storage medium, the computer readable medium stores a computer program, and the computer program can be executed by the processor to implement the dialogue analysis small model training method described in the above method embodiments.
[0085] The computer readable storage medium can be an electronic storage such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM. Alternatively, the computer readable storage medium includes a non-transitory computer readable medium. The computer readable storage medium has a storage space for program codes for executing any of the above methods. The program codes can be read from or written into one or more computer program products. The program codes can be compressed in a suitable form, for example.
[0086] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented by other manners. The apparatus embodiments described above are merely illustrative, for example, the flowcharts and block diagrams in the drawings show the possible implementation architecture, function and operation of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowchart or block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementation manners, the functions noted in the blocks can also occur in different order from that noted in the drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can also be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for executing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0087] In addition, the function modules in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0088] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products and stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the embodiments of the method of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various program code storage media.
[0089] The above description is merely the preferred embodiments of the present application, and does not limit the patent scope of the present application, and any equivalent structural transformation made according to the contents of the present application specification and drawings, or direct / indirect application in other related technical fields is included in the patent protection scope of the present application.
Claims
1. A method for training a small dialogue analysis model, characterized in that, include: Based on the sample dialogue dataset and the preset large model, at least one inference step chain is generated for each sample dialogue data in the sample dialogue dataset. Each inference step chain includes: key evidence, intermediate inference process, and inference conclusion. The sample dialogue dataset includes: multiple sample dialogue data. Each sample dialogue data includes: dialogue context data and labeled correct response data. Based on each sample dialogue data and the corresponding inference step chain, multiple inference training data are obtained; The preset small model is trained using the inference training data to obtain the trained dialogue analysis small model.
2. The dialogue analysis small model training method according to claim 1, characterized in that, The step of generating at least one inference step chain corresponding to each sample dialogue data in the sample dialogue dataset based on the sample dialogue dataset and the preset large model includes: The sample dialogue dataset is input into the preset large model, and the preset large model is guided by preset chain prompts to generate at least one inference step chain corresponding to each sample dialogue data.
3. The dialogue analysis small model training method according to claim 2, characterized in that, The step of inputting the sample dialogue dataset into the preset large model and guiding the preset large model to generate at least one inference step chain corresponding to each sample dialogue data through preset chain prompts includes: Each of the sample dialogue data in the sample dialogue dataset is input into the preset large model multiple times; The preset large model is guided multiple times by the preset chain of prompts to generate multiple inference step chains corresponding to each sample dialogue data.
4. The dialogue analysis small model training method according to claim 3, characterized in that, After repeatedly guiding the preset large model through the preset chain of prompts to generate multiple inference step chains corresponding to each sample dialogue data, the method further includes: The quality score of each inference step chain is evaluated using a preset evaluation algorithm. The inference step chains with quality scores lower than a preset quality score threshold are removed to obtain the filtered inference step chains. The step of obtaining multiple inference training data based on each sample dialogue data and the corresponding inference step chain includes: Based on each sample dialogue data and the corresponding filtered inference step chain, multiple inference training data are obtained.
5. The dialogue analysis small model training method according to claim 4, characterized in that, The process of evaluating the quality score of each inference step chain using a preset evaluation algorithm includes: The similarity between the reasoning conclusion of each reasoning step chain and the correct response data in the corresponding sample dialogue data is evaluated using the preset evaluation algorithm. The logical consistency between the intermediate reasoning process of each of the reasoning step chains and the dialogue context data in the corresponding sample dialogue data is evaluated using the preset evaluation algorithm. Based on the similarity and the logical consistency, a quality score is determined for the corresponding reasoning step chain.
6. The dialogue analysis small model training method according to claim 1, characterized in that, The step of obtaining multiple inference training data based on each sample dialogue data and the corresponding inference step chain includes: Based on the sample dialogue data and the key evidence and reasoning conclusion in the corresponding reasoning step chain, multiple simplified reasoning training data are obtained. Based on the sample dialogue data and the key evidence, intermediate reasoning process, and reasoning conclusion in the corresponding reasoning step chain, multiple complete reasoning training data are obtained.
7. The dialogue analysis small model training method according to claim 6, characterized in that, The step of training a preset small model using the inference training data to obtain a trained dialogue analysis small model includes: The preset small model is trained using the simplified reasoning training data to obtain a preliminary trained dialogue analysis small model; The initial dialogue analysis mini-model is retrained using the complete inference training data to obtain the trained dialogue analysis mini-model.
8. A training device for a small dialogue analysis model, characterized in that, include: The generation module is used to generate at least one inference step chain corresponding to each sample dialogue data in the sample dialogue dataset based on the sample dialogue dataset and the preset large model. Each inference step chain includes: key evidence, intermediate inference process, and inference conclusion. The sample dialogue dataset includes: multiple sample dialogue data. Each sample dialogue data includes: dialogue context data and labeled correct response data. The acquisition module is used to acquire multiple inference training data based on each sample dialogue data and the corresponding inference step chain; The training module is used to train a preset small model using the inference training data to obtain a trained dialogue analysis small model.
9. An electronic device, characterized in that, include: The device includes a processor, a storage medium, and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the method as described in any one of claims 1-7.