Generative adversarial network data expansion method based on entropy item influence and large language model
By adopting a generative adversarial network data expansion method based on the influence of entropy terms and a large language model of collaborative interaction among multiple agents in the intelligent dialogue system, the shortcomings of the existing system in natural language understanding, task processing and data support capabilities are solved, and efficient and high-quality user interaction and data expansion are achieved.
Patent Information
- Application Number
- CN202510070668.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-16
- Publication Date
- 2025-04-25
AI Technical Summary
The existing intelligent dialogue systems have bottlenecks in natural language understanding and generation, task processing efficiency, data support capabilities, etc., which are difficult to meet the needs of complex users. The system coordination capabilities are weak, the data expansion method is single, and the cost is high and the efficiency is low.
The generative adversarial network data expansion method based on the influence of entropy terms is adopted, and the learning rate of generators and discriminators is adjusted through dynamic game strategies, the data generation ability of scarce categories is improved, and a large language model for real-time dialogue of multi-agents collaborative interaction is proposed to realize modular and parallel efficient task processing.
It improves the quality of generated results, improves user experience and real-time interaction capabilities, realizes efficient task processing and data expansion, and reduces data processing and expansion costs.
Smart Images

Figure CN119884753A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a generative adversarial network data expansion method and a large language model based on entropy influence. Background Art
[0002] At present, there are still many problems in intelligent dialogue systems and related technical fields, which make it difficult to meet the increasingly complex user needs and application scenarios. With the rapid development of artificial intelligence technology, intelligent dialogue systems are widely used in customer service, education, medical care, finance and other fields. However, existing dialogue systems still have obvious bottlenecks in natural language understanding and generation, task processing efficiency, data support capabilities, etc. Traditional intelligent dialogue systems usually rely on a single model to complete the entire process from user intent parsing to response generation, which is difficult to adapt to diverse and complex user needs. This design architecture lacks flexibility, especially when dealing with high-complexity or high-concurrency tasks, it is often difficult to guarantee response speed and accuracy. In addition, the existing system is insufficient in task collaborative processing, and it is difficult to efficiently integrate different modules or models to complete distributed tasks.
[0003] Therefore, the prior art has at least the following deficiencies:
[0004] (1) The system has weak coordination capabilities, insufficient task decomposition and real-time performance, limited semantic understanding and context modeling capabilities, and low quality of generated results, resulting in poor user experience and real-time interaction capabilities;
[0005] (2) It is difficult to generate scarce data categories, the data expansion method is single, and the cost of data processing and expansion is high and the efficiency is low.
[0006] In view of this, it is necessary to provide a generative adversarial network data expansion method and a large language model based on the influence of entropy terms to overcome the above defects. Summary of the invention
[0007] The purpose of the present invention is to provide a generative adversarial network data expansion method and a large language model based on the influence of entropy terms, aiming to solve the problems of insufficient task decomposition and real-time performance, and difficulty in generating scarce data categories.
[0008] In order to achieve the above object, the present invention provides a method for data expansion of a generative adversarial network based on the influence of entropy terms, comprising:
[0009] Step S11: Initialize the parameters of the generator and discriminator in the data augmentation model built based on the generative adversarial network algorithm. Let the generator be G c , the discriminator is D c , set the weight of the generator to W Gc , the weight of the discriminator is W Dc , where the initialization method is expressed as:
[0010]
[0011] In the formula, is a normal distribution with a mean of 0 and a standard deviation of the unit matrix I; ~ is subject to a specific distribution;
[0012] Step S12: In the generation phase, the generator generates a batch of new data samples based on real samples and current network parameters. These samples preliminarily try to imitate the distribution characteristics of real data, which can be expressed as:
[0013]
[0014] In the formula, z c is the latent vector sampled from the prior distribution; G c ( ) is the generator function, is the generator weight at the tth iteration; is the sample generated by the generator in the tth iteration; W Tc Represents the weight of feature transformation; ⊙ represents element-level multiplication;
[0015] Step S13: The discriminator evaluates the generated data samples and the real data samples, and outputs the probability that each sample is a real sample, which is expressed as:
[0016]
[0017] In the formula, Indicates that the generated samples and real samples are merged into one batch input; D c ( ) is the discriminator function, is the discriminator weight at the tth iteration; is the discrimination result of the discriminator in the tth iteration;
[0018] Step S14: Use the dynamic game strategy to adjust the learning rate and update strategy of the generator and discriminator, dynamically adjust the loss function according to the results of each round of confrontation, and give priority to improving the ability to generate scarce category data, which is expressed as:
[0019]
[0020] In the formula, is the generator weight at the t+1th iteration; is the discriminator weight at the t+1th iteration; Gc is the learning rate of the generator; Dc is the learning rate of the discriminator; is the loss function of the generator; is the loss function of the discriminator; Xrc Samples generated for the generator; represents the gradient with respect to the generator weights; represents the gradient with respect to the discriminator weights;
[0021] Step S15: During the adversarial training of the generator and the discriminator, the adjustment coefficient and the regularization coefficient that control the influence of the entropy term are dynamically adjusted so that the data generated each time can better simulate the real data distribution, which is expressed as:
[0022]
[0023] In the formula, α c is the learning rate adjustment factor, which is used to control the dynamic adjustment of the learning rate; is the symbol of partial derivative; is the adjustment coefficient of the control entropy term at the tth iteration, is the regularization coefficient of the tth iteration; is the adjustment coefficient of the control entropy term at the tth iteration, is the regularization coefficient of the tth iteration;
[0024] Step S16: Repeat the above steps S12-S15 until the preset stop iteration condition is met, which means that the data expansion model training is completed, and then expand the initial training samples through the trained data expansion model.
[0025] In a preferred embodiment, in step S12, the quality of generated samples is improved and the learning ability of the generative adversarial network model for different data is enhanced through an adaptive feature transformation strategy, and feature weight learning is achieved based on dynamic weighting and adjustment of the input features of the generator; wherein the calculation method of the feature transformation weight is expressed as:
[0026] W Tc =Sig(V c ·z c +b c ),
[0027] Where Sig( ) is the Sigmoid activation function; V c is the weight parameter matrix of the generator.
[0028] In a preferred embodiment, in step S14, the loss function of the generator is combined with the entropy of the generated data for comprehensive calculation to more comprehensively evaluate the quality of the generated data and increase the diversity of the generated samples, which is expressed as:
[0029]
[0030] In the formula, H c( ) represents the entropy function, λ Gc is the adjustment coefficient that controls the influence of the entropy term.
[0031] In a preferred embodiment, in step S14, the loss function of the discriminator uses a regularization term to prevent overfitting, which is expressed as:
[0032]
[0033] In the formula, y c represents the real sample label, where 1 is the real sample and 0 is the generated sample; Dc is the regularization coefficient, which is used for weight decay to reduce model complexity and overfitting risk; ||W Dc || 2 Represents the square of the L2 norm of the discriminator weights.
[0034] The present invention also provides a large language model for multi-agent collaborative interaction and real-time dialogue, including:
[0035] A large language module, which uses a pre-trained language model as a main control to process natural language understanding and generation of user input;
[0036] A multi-agent module, wherein the multi-agent module is deployed with multiple functional agents, each of which is used to independently complete a specific task;
[0037] A knowledge base and reasoning engine storing domain-specific knowledge to support logical reasoning, dynamic updating and expansion;
[0038] A real-time interactive interface, which is used to provide an entry point for users to interact with the system and ensure efficient input and output processing;
[0039] Among them, after collecting and annotating the initial training samples, the generative adversarial network data expansion method based on the influence of entropy terms as described in any of the above implementation methods is used to generate samples to achieve data expansion, and then the expanded training samples are input into the pre-trained language model for training.
[0040] In a preferred embodiment, the pre-trained language model is a model based on a Transformer network, including an encoder and a decoder; wherein the encoder is used to map input features into a series of context-aware vector representations, and the decoder is used to gradually decode the vector representations into target features;
[0041] The encoder includes N identical encoding layers, each encoding layer includes two sublayers, a multi-head attention mechanism sublayer and a feedforward network sublayer, and the encoder adds a residual connection and a normalization operation after each sublayer;
[0042] The decoder includes N identical decoding layers, each decoding layer includes two multi-head attention mechanism sublayers and one feedforward network sublayer, and the decoder adds residual connections and normalization operations after each sublayer;
[0043] The second multi-head attention mechanism sublayer of the decoding layer is implemented by a multi-head cross-attention mechanism; wherein the multi-head cross-attention mechanism is a mechanism for information exchange between the encoder and the decoder, which takes the output features of the encoder and the input features of the decoder as input, and uses the attention mechanism to perform cross-attention calculations on the input, thereby obtaining a set of weighted decoder output features.
[0044] In a preferred embodiment, the multi-head attention mechanism sublayer of the encoder and the first multi-head attention mechanism sublayer of the decoder are both implemented by a multi-head self-attention mechanism; wherein the multi-head self-attention mechanism comprises the following steps:
[0045] Step S21: Use the Softmax function to process the attention score to obtain the attention weight of each position in the input data sequence, and make it processable as a probability distribution, expressed as:
[0046]
[0047] Where headi is the attention weight of the i-th head, Qi is the query vector of the i-th head, Ki is the key vector of the i-th head, is the transpose of the key vector of the i-th head, dks is the dimension of the input feature, hks is the number of attention heads, Vi is the value vector of the i-th head; Sof( ) is the Softmax function;
[0048] Step S22: Use the obtained attention weights to perform weighted summation on the value vector to obtain an output vector;
[0049] Step S23: Concatenate the output vectors of all heads together, and then generate the output of the final multi-head self-attention mechanism sub-layer through a linear transformation layer.
[0050] In a preferred embodiment, in the encoder and the decoder, the output of each sub-layer is the result of layer normalization and residual connection, which is expressed as:
[0051] y cgy =LN c (x trans +Sublayer(x trans )),
[0052] In the formula, LNc ( ) is the layer normalization function, Sublayer( ) represents the output of the residual connected sublayer, x trans Represents the input of the sublayer; y cgy is the feature output after layer normalization.
[0053] The entropy-based generative adversarial network data expansion method and large language model provided by the present invention have the following beneficial effects:
[0054] (1) The entropy term influence strategy is adopted in the generative adversarial network based on the entropy term influence, which solves the limitations of the traditional generative adversarial network in generating scarce category data. Through the dynamic game strategy, the learning rate of the generator and the discriminator is adjusted to improve the performance of the model in generating scarce category data and the data distribution simulation ability;
[0055] (2) By proposing a real-time dialogue expert system architecture with a large language module as the main control and multiple agent modules as the collaborative ones, the large model module is used to generate task plans, which are distributed to multiple agents to complete the tasks independently. Finally, the results are summarized and returned to the user, thus achieving modular and parallel efficient task processing.
[0056] (3) In some preferred embodiments, the pre-trained language model captures the global context information of the sequence data by enhancing the multi-head attention mechanism of the encoder, and introduces a multi-head cross-attention mechanism in the decoder to further optimize the information interaction between the encoder and the decoder. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0058] Figure 1 The architecture diagram of a large language model for multi-agent collaborative interaction and real-time dialogue;
[0059] Figure 2 This is a flowchart of the data expansion method for generating adversarial networks based on the influence of entropy terms;
[0060] Figure 3 This is the architecture diagram of the pre-trained language model in the large language model. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and beneficial technical effect of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. It should be understood that the specific implementation methods described in this specification are only for explaining the present invention, not for limiting the present invention.
[0062] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0063] It should be further understood that the term "and / or" used in the present description and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0064] In an embodiment of the present invention, a large language model 100 for multi-agent collaborative interactive real-time dialogue is provided to enhance the system collaboration capability, improve semantic understanding and context modeling capabilities, so as to improve the quality of generated results as well as user experience and real-time interaction capabilities, and realize modular and parallel efficient task processing.
[0065] like Figure 1 As shown, the large language model 100 for multi-agent collaborative interaction and real-time dialogue includes: a large language module 10, a multi-agent module 20, a knowledge base and reasoning engine 30, and a real-time interaction interface 40.
[0066] Specifically, the large language module 10 uses a pre-trained language model as a main control to process the natural language understanding and generation of user input.
[0067] The multi-agent module 20 is deployed by multiple functional agents (such as intent recognition, entity extraction, sentiment analysis, etc.) to complete specific tasks independently.
[0068] The knowledge base and reasoning engine 30 stores domain-specific knowledge to support logical reasoning, dynamic updating and expansion.
[0069] The real-time interactive interface 40 is used to provide an entry for users to interact with the system, ensuring efficient input and output processing.
[0070] Among them, when using the large language model of multi-agent collaborative interaction and real-time dialogue, the workflow is as follows: the user inputs the request through the real-time interaction interface 40; the large language module 10 parses the user's intention and generates a preliminary task plan, and then the task is distributed to the multi-agent module 20, which is collaboratively executed by relevant agents; after completing the task, the agent returns the result, and the large language module 10 summarizes and generates the final output; the output is returned to the user through the real-time interaction interface 40.
[0071] In an embodiment of the present invention, after collecting and labeling the initial training samples, a generative adversarial network data expansion method based on the influence of entropy terms is used to generate samples to achieve data expansion, and then the expanded training samples are input into a pre-trained language model for training.
[0072] The sources of initial training sample data collection include but are not limited to: various professional forums, real-time communication records of academic conferences and online question-and-answer platforms. The collection method uses automated crawler technology combined with API crawling. All collected data is stored in a unified JSON format, including fields such as timestamp, user ID, conversation content and conversation context.
[0073] Furthermore, the collected data is annotated, and the present invention exemplarily defines the annotation categories as follows:
[0074] (1) Intent recognition: determining the user’s main intent in a conversation;
[0075] (2) Entity extraction: extract key information from the conversation, such as date, location, name, etc.
[0076] (3) Sentiment analysis: evaluate the emotional tendencies expressed by users in conversations;
[0077] (4) Dialogue behavior type: mark the behavior type in the dialogue, such as question and answer, suggestion, request, etc.
[0078] For example, the training data is shown in Table 1 below:
[0079] Table 1: Exemplary initial training data
[0080]
[0081]
[0082] Furthermore, the training data is vectorized so that it can adapt to the input requirements of the machine learning model. The present invention uses the Word2Vec algorithm to vectorize the text. The Word2Vec algorithm is a commonly used vectorization algorithm in this field. It scans the texts to be vectorized based on a preset large-scale corpus, and represents each word as a one-hot encoded vector. The dimension of the one-hot encoded vector is equal to the size of the vocabulary in the corpus.
[0083] It is understandable that the collection, labeling and preprocessing of conventional training data is time-consuming and labor-intensive, and insufficient training samples can easily lead to poor model generalization ability and affect the accuracy of the model.
[0084] Therefore, the present invention adopts a generative adversarial network algorithm based on entropy term influence to generate samples, thereby realizing data expansion. Traditional generative adversarial networks often have difficulty in generating accurate samples of relatively scarce categories when faced with skewed data distribution. The present invention uses an entropy term influence strategy to achieve a trade-off between the generator and the discriminator in the adversarial process, so that each generated data better simulates the real data distribution.
[0085] For example, a generative adversarial network based on a topological self-organizing structure can be used to construct a data expansion model to expand training data. The generative adversarial network based on a topological self-organizing structure includes: a generator (G) and a discriminator (D). The input of the generator is a random noise vector extracted from a prior distribution, and the discriminator makes a judgment based on the vectorized original training sample and the output of the generator.
[0086] Specifically, Figure 2 As shown, the method for generating adversarial network data expansion based on the influence of entropy terms includes steps S11-S16.
[0087] Step S11: Initialize the parameters of the generator and discriminator in the data augmentation model built based on the generative adversarial network algorithm. Let the generator be G c , the discriminator is D c , set the weight of the generator to W Gc , the weight of the discriminator is W Dc , where the initialization method is expressed as:
[0088]
[0089] In the formula, is a normal distribution with mean 0 and standard deviation of the unit matrix I; ~ obeys a specific distribution.
[0090] Step S12: In the generation phase, the generator generates a batch of new data samples based on the initial training samples and the current network parameters. These samples preliminarily try to imitate the distribution characteristics of real data, which can be expressed as:
[0091]
[0092] In the formula, z c is the latent vector sampled from the prior distribution; G c ( ) is the generator function, is the generator weight at the tth iteration; is the sample generated by the generator in the tth iteration; W Tc Represents the weight of feature transformation; ⊙ represents element-wise multiplication.
[0093] Furthermore, in step S12, the quality of generated samples is improved through an adaptive feature transformation strategy and the learning ability of the generative adversarial network model for different data is enhanced. Based on the dynamic weighting and adjustment of the input features of the generator, feature weight learning is achieved; wherein the calculation method of the feature transformation weight is expressed as:
[0094] W Tc =Sig(V c ·z c +b c ),
[0095] Where Sig( ) is the Sigmoid activation function; V c is the weight parameter matrix of the generator.
[0096] Step S13: The discriminator evaluates the generated data samples and the real data samples, and outputs the probability that each sample is a real sample, which is expressed as:
[0097]
[0098] In the formula, Indicates that the generated samples and real samples are merged into one batch input; D c ( ) is the discriminator function, is the discriminator weight at the tth iteration; is the discrimination result of the discriminator in the tth iteration.
[0099] Step S14: Use the dynamic game strategy to adjust the learning rate and update strategy of the generator and discriminator, dynamically adjust the loss function according to the results of each round of confrontation, and give priority to improving the ability to generate scarce category data, which is expressed as:
[0100]
[0101] In the formula, is the generator weight at the t+1th iteration; is the discriminator weight at the t+1th iteration;Gc is the learning rate of the generator; Dc is the learning rate of the discriminator; is the loss function of the generator; is the loss function of the discriminator; X rc Samples generated for the generator; represents the gradient with respect to the generator weights; represents the gradient with respect to the discriminator weights.
[0102] Furthermore, in step S14, the loss function of the generator is comprehensively calculated in combination with the entropy of the generated data to more comprehensively evaluate the quality of the generated data and increase the diversity of the generated samples, which is expressed as:
[0103]
[0104] In the formula, H c ( ) represents the entropy function, λ Gc is the adjustment coefficient that controls the influence of the entropy term.
[0105] Furthermore, in step S14, the loss function of the discriminator uses a regularization term to prevent overfitting, which is expressed as:
[0106]
[0107] In the formula, y c represents the real sample label, where 1 is the real sample and 0 is the generated sample; Dc is the regularization coefficient, which is used for weight decay to reduce model complexity and overfitting risk; ||W Dc || 2 Represents the square of the L2 norm of the discriminator weights.
[0108] Step S15: During the adversarial training of the generator and the discriminator, the adjustment coefficient and the regularization coefficient that control the influence of the entropy term are dynamically adjusted so that the data generated each time can better simulate the real data distribution, which is expressed as:
[0109]
[0110] In the formula, α c is the learning rate adjustment factor, which is used to control the dynamic adjustment of the learning rate; is the symbol of partial derivative; is the adjustment coefficient of the control entropy term at the tth iteration, is the regularization coefficient of the tth iteration; is the adjustment coefficient of the control entropy term at the tth iteration, is the regularization coefficient for the tth iteration. Preferably, α c αc Set to 0.01.
[0111] Step S16: Repeat the above steps S12-S15 until the preset stop iteration condition is met, which means that the data expansion model training is completed, and then the initial training sample is expanded by the trained data expansion model. In one embodiment, the preset stop iteration condition is reaching the preset maximum number of iterations, and preferably, the preset maximum number of iterations is set to 1000 times.
[0112] After the data expansion model training is completed, the trained data expansion model is used to increase the number of samples. In one embodiment, assuming that the original collected samples are 800, and the data expansion model expands and generates 200 samples, the expanded data set contains 1000 samples.
[0113] In an embodiment of the present invention, Figure 3 As shown in the figure, the pre-trained language model is a model based on the Transformer network, which includes an encoder and a decoder. The encoder is used to map the input features into a series of context-aware vector representations, and the decoder is used to gradually decode the vector representation into target features.
[0114] The encoder consists of N identical encoding layers, each of which includes two sublayers: a multi-head attention mechanism sublayer and a feedforward network sublayer, and the encoder adds residual connections and normalization operations after each sublayer.
[0115] The decoder includes N identical decoding layers, each of which includes two multi-head attention mechanism sublayers and a feedforward network sublayer, and the decoder adds residual connections and normalization operations after each sublayer. That is, unlike the encoding layer, each decoding layer has an additional multi-head attention mechanism sublayer. Among them, the second multi-head attention mechanism sublayer of the decoding layer is implemented by a multi-head cross attention mechanism. It should be noted that the multi-head cross attention mechanism is a mechanism for information exchange between the encoder and the decoder. It takes the output features of the encoder and the input features of the decoder as input, and uses the attention mechanism to perform cross attention calculations on the input, thereby obtaining a set of weighted decoder output features.
[0116] In this embodiment, the multi-head attention mechanism sublayer of the encoder and the first multi-head attention mechanism sublayer of the decoder are both implemented through a multi-head self-attention mechanism; wherein the multi-head self-attention mechanism includes the following steps S21-S23.
[0117] Step S21: Use the Softmax function to process the attention score to obtain the attention weight of each position in the input data sequence. The Softmax function ensures that all weights add up to 1 and can be processed as a probability distribution, which is specifically expressed as:
[0118]
[0119] In the formula, head i is the attention weight of the i-th head, Q i is the query vector of the i-th head, K i is the key vector of the i-th head, is the transpose of the key vector of the i-th head, d ks is the dimension of the input feature, h ks is the number of attention heads, V i is the value vector of the i-th head; Sof( ) is the Softmax function.
[0120] Step S22: Use the obtained attention weights to perform weighted summation on the value vector to obtain an output vector.
[0121] Step S23: Concatenate the output vectors of all heads together, and then generate the output of the final multi-head self-attention mechanism sub-layer through a linear transformation layer.
[0122] It should be noted that the multi-head attention mechanism sublayer is implemented by a multi-head self-attention mechanism, which is the core module of the encoder and is responsible for learning the importance of each position from the input features and combining the information of all positions to obtain a global context representation, thereby improving the performance and generalization ability of the model. Specifically, the multi-head self-attention mechanism is implemented in that the input features pass through three different linear transformation layers to generate "query", "key" and "value" vectors respectively, and the linear transformation is implemented by multiplying the weight matrix. Further, the generated query, key and value vectors are divided into multiple smaller parts, namely "heads", so that the model processes multiple different representation subspaces in parallel, thereby capturing the diversity information in the input data. Further, for each head, the dot product of the query and key vectors is calculated respectively to obtain an attention score, which reflects the relative importance of different positions in the sequence of input data. In order to make the numerical stability of the attention score, the attention score is divided by a scaling factor, which can be the square root of the dimension of the key vector.
[0123] Furthermore, in both the encoder and decoder, the output of each sub-layer is the result of layer normalization and residual connection, which is expressed as:
[0124] y cgy =LNc (x trans +Sublayer(x trans )),
[0125] In the formula, LN c ( ) is the layer normalization function, Sublayer( ) represents the output of the residual connected sublayer, x trans Represents the input of the sublayer; y cgy is the feature output after layer normalization.
[0126] The feedforward network sublayer consists of two fully connected layers and an activation function, which is used to perform nonlinear transformation on the vector at each position. In this sublayer, the input vector first passes through the first fully connected layer for linear transformation, then passes through a ReLU activation function for nonlinear transformation, and finally passes through the second fully connected layer for linear transformation to improve the expressiveness and generalization ability of the model, so that the model can better handle complex input data.
[0127] In summary, the data expansion method of the generative adversarial network based on the influence of entropy terms and the large language model of multi-agent collaborative interaction and real-time dialogue provided by the present invention have the following beneficial effects:
[0128] (1) By proposing a real-time dialogue expert system architecture with a large language module as the master control and multiple agent modules as the collaborative ones, the large language module is used to generate task plans, which are distributed to multiple agents to complete the tasks independently. Finally, the results are summarized and returned to the user, thus achieving modular and parallel efficient task processing.
[0129] (2) By adopting the entropy term influence strategy based on the generative adversarial network, the limitations of the traditional generative adversarial network in generating scarce category data are solved. Through the dynamic game strategy, the learning rate of the generator and the discriminator is adjusted to improve the performance of the model in generating scarce category data and the data distribution simulation ability;
[0130] (3) The pre-trained language model captures the global context information of the sequence data by enhancing the multi-head attention mechanism of the encoder and introducing the multi-head cross-attention mechanism in the decoder to further optimize the information interaction between the encoder and decoder.
[0131] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0132] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0133] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0134] In the embodiments provided by the present invention, it should be understood that the disclosed systems or devices / terminal equipment and methods can be implemented in other ways. For example, the system or device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the system or unit can be electrical, mechanical or other forms.
[0135] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0136] The present invention is not limited to what is described in the specification and implementation modes, and therefore additional advantages and modifications can be easily realized by those skilled in the art. Therefore, without departing from the spirit and scope of the general concept defined by the claims and their equivalents, the present invention is not limited to the specific details, representative devices, and illustrative examples shown and described herein.
Claims
1. A data augmentation method for a generative adversarial network based on the influence of entropy terms, characterized in that: include: Step S11: Initialize the parameters of the generator and discriminator in the data augmentation model built based on the generative adversarial network algorithm. Let the generator be G c , the discriminator is D c , set the weight of the generator to W Gc , the weight of the discriminator is W Dc , where the initialization method is expressed as: In the formula, is a normal distribution with a mean of 0 and a standard deviation of the unit matrix I; ~ is subject to a specific distribution; Step S12: In the generation phase, the generator generates a batch of new data samples based on real samples and current network parameters. These samples preliminarily try to imitate the distribution characteristics of real data, which can be expressed as: In the formula, z c is the latent vector sampled from the prior distribution; G c ( ) is the generator function, is the generator weight at the tth iteration; is the sample generated by the generator in the tth iteration; W Tc Represents the weight of feature transformation; ⊙ represents element-level multiplication; Step S13: The discriminator evaluates the generated data samples and the real data samples, and outputs the probability that each sample is a real sample, which is expressed as: In the formula, Indicates that the generated samples and real samples are merged into one batch input; D c ( ) is the discriminator function, is the discriminator weight at the tth iteration; is the discrimination result of the discriminator in the tth iteration; Step S14: Use the dynamic game strategy to adjust the learning rate and update strategy of the generator and discriminator, dynamically adjust the loss function according to the results of each round of confrontation, and give priority to improving the ability to generate scarce category data, which is expressed as: In the formula, is the generator weight at the t+1th iteration; is the discriminator weight at the t+1th iteration; Gc is the learning rate of the generator; Dc is the learning rate of the discriminator; is the loss function of the generator; is the loss function of the discriminator; X rc Samples generated for the generator; represents the gradient with respect to the generator weights; represents the gradient with respect to the discriminator weights; Step S15: During the adversarial training of the generator and the discriminator, the adjustment coefficient and the regularization coefficient that control the influence of the entropy term are dynamically adjusted so that the data generated each time can better simulate the real data distribution, which is expressed as: In the formula, α c is the learning rate adjustment factor, which is used to control the dynamic adjustment of the learning rate; is the symbol of partial derivative; is the adjustment coefficient of the control entropy term at the tth iteration, is the regularization coefficient of the tth iteration; is the adjustment coefficient of the control entropy term at the tth iteration, is the regularization coefficient of the tth iteration; Step S16: Repeat the above steps S12-S15 until the preset stop iteration condition is met, which means that the data expansion model training is completed, and then expand the initial training samples through the trained data expansion model.
2. The method for generating adversarial network data expansion based on entropy term influence as claimed in claim 1, characterized in that: In step S12, the quality of generated samples is improved through an adaptive feature transformation strategy and the learning ability of the generative adversarial network model for different data is enhanced. Based on the dynamic weighting and adjustment of the input features of the generator, feature weight learning is achieved; wherein the calculation method of the feature transformation weight is expressed as: W Tc =Sig(V c ·z c +b c ), Where Sig( ) is the Sigmoid activation function; V c is the weight parameter matrix of the generator.
3. The method for generating adversarial network data expansion based on entropy term influence as claimed in claim 2, characterized in that: In step S14, the loss function of the generator is combined with the entropy of the generated data for comprehensive calculation to more comprehensively evaluate the quality of the generated data and increase the diversity of the generated samples, which is expressed as: In the formula, H c ( ) represents the entropy function, λ Gc is the adjustment coefficient that controls the influence of the entropy term.
4. The method for generating adversarial network data expansion based on entropy term influence as claimed in claim 2, characterized in that: In step S14, the loss function of the discriminator uses a regularization term to prevent overfitting, which is expressed as: In the formula, y c represents the real sample label, where 1 is the real sample and 0 is the generated sample; Dc is the regularization coefficient, which is used for weight decay to reduce model complexity and overfitting risk; ||W Dc || 2 Represents the square of the L2 norm of the discriminator weights.
5. A large language model for multi-agent collaborative interaction and real-time dialogue, characterized in that: include: A large language module, which uses a pre-trained language model as a main control to process natural language understanding and generation of user input; A multi-agent module, wherein the multi-agent module is deployed with multiple functional agents, each of which is used to independently complete a specific task; A knowledge base and reasoning engine storing domain-specific knowledge to support logical reasoning, dynamic updating and expansion; A real-time interactive interface, which is used to provide an entry point for users to interact with the system and ensure efficient input and output processing; After collecting and labeling the initial training samples, the generative adversarial network data expansion method based on the influence of entropy terms as described in any one of claims 1 to 4 is used to generate samples to achieve data expansion, and then the expanded training samples are input into the pre-trained language model for training.
6. The large language model for multi-agent collaborative interactive real-time dialogue as claimed in claim 5, characterized in that: The pre-trained language model is a model based on a Transformer network, including an encoder and a decoder; wherein the encoder is used to map input features into a series of context-aware vector representations, and the decoder is used to gradually decode the vector representations into target features; The encoder includes N identical encoding layers, each encoding layer includes two sublayers, a multi-head attention mechanism sublayer and a feedforward network sublayer, and the encoder adds a residual connection and a normalization operation after each sublayer; The decoder includes N identical decoding layers, each decoding layer includes two multi-head attention mechanism sublayers and one feedforward network sublayer, and the decoder adds residual connections and normalization operations after each sublayer; The second multi-head attention mechanism sublayer of the decoding layer is implemented by a multi-head cross-attention mechanism; wherein the multi-head cross-attention mechanism is a mechanism for information exchange between the encoder and the decoder, which takes the output features of the encoder and the input features of the decoder as input, and uses the attention mechanism to perform cross-attention calculations on the input, thereby obtaining a set of weighted decoder output features.
7. The large language model for multi-agent collaborative interactive real-time dialogue as claimed in claim 6, characterized in that: The multi-head attention mechanism sublayer of the encoder and the first multi-head attention mechanism sublayer of the decoder are both implemented by a multi-head self-attention mechanism; wherein the multi-head self-attention mechanism comprises the following steps: Step S21: Use the Softmax function to process the attention score to obtain the attention weight of each position in the input data sequence, and make it processable as a probability distribution, expressed as: Where headi is the attention weight of the i-th head, Qi is the query vector of the i-th head, Ki is the key vector of the i-th head, is the transpose of the key vector of the i-th head, dks is the dimension of the input feature, hks is the number of attention heads, Vi is the value vector of the i-th head; Sof() is the Softmax function; Step S22: Use the obtained attention weights to perform weighted summation on the value vector to obtain an output vector; Step S23: Concatenate the output vectors of all heads together, and then generate the output of the final multi-head self-attention mechanism sub-layer through a linear transformation layer.
8. The large language model for multi-agent collaborative interactive real-time dialogue as claimed in claim 6, characterized in that: In the encoder and the decoder, the output of each sub-layer is the result of layer normalization and residual connection, which is expressed as: y cgy =LN c (x trans +Sublayer(x trans )), In the formula, LN c () is the layer normalization function, Sublayer( ) represents the output of the residual connected sublayer, X trans Represents the input of the sublayer; y cgy is the feature output after layer normalization.