Interaction model, interaction method, electronic device and readable storage medium

Through the classification module, professional parameter module and interactive sub-model in the interactive model, multi-vernal domain professional knowledge is independently stored and processed, and the problem of limited network parameters and mutual influence of knowledge in large language models when storing multi-vernal domain knowledge is solved, and the model's answering ability and professionalism are improved.

CN119782451APending Publication Date: 2025-04-08HUAWEI DEVICE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311284744.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-28
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

When a large language model stores professional knowledge in multiple vertical domains, the network parameters are limited, resulting in mutual influence between knowledge. After training, the model cannot maintain high knowledge and professionalism, and the answer error rate is high.

Method used

An interaction model is proposed, through classification module, professional parameter module and interactive sub-model, the professional knowledge of multiple vertical domains is independently classified and parameterized to avoid mutual influence between vertical domains.

Benefits of technology

When training multi-vertical domain expertise, the knowledge of each vertical domain does not affect each other, and improves the answering ability of the large language model to target multi-vertical domain expertise and reduces the error rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119782451A_ABST
    Figure CN119782451A_ABST
Patent Text Reader

Abstract

The present application belongs to the field of artificial intelligence technology, and relates to an interaction model, an interaction method, an electronic device, and a readable storage medium. The interaction model may include a classification module, at least two professional parameter modules, and an interaction sub-model; wherein the classification module can determine the professional classification corresponding to the interaction instruction, and the interaction sub-model can be combined with the professional parameter module corresponding to the professional classification to process the interaction instruction and obtain an interaction result. The present application injects the professional knowledge of different vertical domains into the corresponding professional parameter modules in the form of parameterized plug-ins, thereby avoiding mutual influence between vertical domains. For the user's interaction instructions, the vertical domain involved in the content of the interaction instructions is first determined through the classification module, and the professional parameter modules of different vertical domains are combined through the interaction sub-model to efficiently complete professional questions and answers for the interaction instructions.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to an interaction model, an interaction method, an electronic device, and a readable storage medium. Background Art

[0002] With the development of artificial intelligence technology, chatbot programs based on text generation models (i.e., large language models) of deep learning technology can interact with users through voice input, text input, etc., and truly chat and communicate like humans. Now, more and more manufacturers store professional knowledge of multiple vertical domains (such as finance, law, retail, education, etc.) in text generation models. Chatbot programs based on text generation models covering professional knowledge of multiple vertical fields can realize a series of services such as intelligent customer service and / or intelligent question and answer and / or intelligent audio and video. Among them, the professional knowledge of multiple vertical domains can be stored through the network parameters of the large language model.

[0003] However, the network parameters of the large language model are limited. When the large language model needs to store professional knowledge in multiple vertical domains, there is an upper limit to the network parameters. In addition, since the professional knowledge in multiple vertical domains is stored in the large language model, the professional knowledge in different vertical domains will influence each other during training, resulting in the large language model after training being unable to maintain a high level of knowledge and professionalism. That is, the error rate of the large language model in answering input questions is high. Summary of the invention

[0004] In order to solve the above-mentioned defects, the present application proposes an interactive model interaction method, an electronic device and a readable storage medium, which ensures that the knowledge of each vertical domain does not affect each other when training professional knowledge of multiple vertical domains, thereby improving the large language model's ability to answer professional knowledge of multiple vertical domains.

[0005] In the first aspect, the embodiment of the present application provides an interaction model, which is applied to an electronic device, including a classification module, at least two professional parameter modules, and an interaction sub-model; wherein the classification module can be called a vertical domain multi-label classification module, the professional parameter module can be called a vertical domain plug-in parameter module, and the interaction sub-model can be called a text generation model. The electronic device here can be any terminal device such as a mobile phone or a Pad or a laptop computer or a desktop computer or an intelligent robot. The classification module is used to determine the professional classification to which the content of the user's interaction instruction belongs, and select a first professional parameter module from at least two professional parameter modules. The first professional parameter module corresponds to the professional classification, wherein different professional parameter modules in at least two professional parameter modules include model parameters corresponding to interaction instructions of different professional classifications, that is, network parameters; the interaction sub-model is used to combine with the first professional parameter module to generate an interaction result corresponding to the interaction instruction.

[0006] In the present application, the user's interactive instruction may be a user's question, and the professional classification may be a vertical domain category. The professional classification may be a vertical domain category involved in the content of the interactive instruction, such as medicine or law, etc. Each professional parameter module stores the professional knowledge of a single vertical domain by means of external parameters, that is, stores the network parameters corresponding to the professional knowledge of the vertical domain. The interactive result may be an answer to the interactive instruction.

[0007] It can be seen that through the above-mentioned interaction model, the professional knowledge of multiple vertical domains can be independently classified and efficiently parameterized and stored, that is, the professional knowledge of different vertical domains can be injected into the corresponding professional parameter modules through parameterized plug-ins, avoiding the mutual influence between vertical domains. For the user's interactive instructions, the classification module is first used to determine the vertical domain involved in the content of the interactive instructions. Through the interactive sub-model combined with the professional parameter modules of different vertical domains, professional questions and answers for the interactive instructions can be efficiently completed. The interactive sub-model here can include at least one of a large language model and a text generation model.

[0008] In a possible implementation of the first aspect above, the classification module is further used to send the first professional parameter module to the interaction sub-model.

[0009] In the present application, the classification module may select a first professional parameter module corresponding to the professional classification to which the interaction instruction belongs; and send the first professional parameter module to the interaction sub-model.

[0010] In a possible implementation of the first aspect above, the professional classification corresponding to the interactive instruction is determined in the classification module, and the professional classification is scored. The classification score is used to determine the level of correlation between the interactive instruction and the professional classification, that is, the higher the classification score of the professional classification corresponding to the interactive instruction, the higher the correlation between the interactive instruction and the professional classification, and the professional classification is sorted from small to large according to the classification score. The professional classification with a lower classification score can first be inferred and answered using the interaction sub-model combined with the professional parameter model, and then the answers are sequentially input into the interaction sub-model combined with the professional parameter model corresponding to the professional classification with a higher score, until the final interaction result is obtained.

[0011] In the present application, when the classification module determines that the content of the interaction instruction belongs to both the first professional classification and the second professional classification, the first classification score of the interaction instruction belonging to the first professional classification and the second classification score of the interaction instruction belonging to the second professional classification are obtained respectively, and when the first classification score is less than the second classification score, the first professional parameter model corresponding to the first professional classification is combined with the interaction sub-model, the interaction instruction is inferred to generate a first result corresponding to the interaction instruction, and the second professional parameter model corresponding to the second professional classification is combined with the interaction sub-model, the first result is inferred to generate an interaction result corresponding to the interaction instruction.

[0012] In a possible implementation of the first aspect, the interaction instruction may include at least one of a voice interaction instruction and a text interaction instruction input by a user to the electronic device. The professional classification may include at least one of law, medicine, finance, and history.

[0013] In a second aspect, an embodiment of the present application provides an interaction method, which is applied to an electronic device, including:

[0014] Determine the professional category to which the content of the user's first interaction instruction belongs; select a first professional parameter module from at least two professional parameter modules, the first professional parameter module corresponds to the professional category, and different professional parameter modules in the at least two professional parameter modules include model parameters corresponding to interaction instructions of different professional categories; combine the first professional parameter module with the interaction sub-model, process the first interaction instruction, and generate a first interaction result corresponding to the first interaction instruction.

[0015] It can be seen that through the above interaction method, at least one professional classification involved in the first interaction instruction of the user can be determined, and the professional question and answer for the first interaction instruction can be completed through the interaction sub-model combined with the professional parameter modules of different professional classifications. Among them, the interaction sub-model includes at least one of a large language model and a text generation model, the first interaction instruction includes at least one of a voice interaction instruction and a text interaction instruction, and the professional classification includes at least one of law, medicine, finance and history.

[0016] In a possible implementation of the second aspect above, after determining the professional classification corresponding to the interactive instruction, if the interactive instruction involves multiple professional classifications, a professional classification classification score can also be performed. The classification score is used to determine the level of correlation between the interactive instruction and the professional classification, that is, the higher the classification score of the professional classification corresponding to the interactive instruction, the higher the correlation between the interactive instruction and the professional classification, and the professional classifications are sorted from small to large according to the classification score. The professional classification with a lower classification score can first be inferred and answered using the interaction sub-model combined with the professional parameter model, and then the answers are sequentially input into the interaction sub-model combined with the professional parameter model corresponding to the professional classification with a higher score, until the final interaction result is obtained.

[0017] In the present application, when it is determined that the content of the first interaction instruction belongs to both the first professional classification and the second professional classification, the first classification score of the first interaction instruction belonging to the first professional classification and the second classification score of the first interaction instruction belonging to the second professional classification are obtained respectively, and when the first classification score is less than the second classification score, the first professional parameter model corresponding to the first professional classification is combined with the interaction sub-model, the first interaction instruction is inferred, and the first interaction sub-result corresponding to the first interaction instruction is generated, and the second professional parameter model corresponding to the second professional classification is combined with the interaction sub-model, the first interaction sub-result is inferred, and the first interaction result corresponding to the first interaction instruction is generated, wherein the first classification score is used to determine the level of correlation between the content of the first interaction instruction and the first professional classification, and the second classification score is used to determine the level of correlation between the content of the first interaction instruction and the second professional classification.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors; one or more memories; one or more memories storing one or more programs, and when the one or more programs are executed by one or more processors, the electronic device executes the interaction method of the second aspect.

[0019] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which instructions are stored, and when the instructions are executed on a computer, the computer executes the interactive method of the second aspect.

[0020] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the interaction method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is an application scenario diagram of answering user questions through a text generation model shown in an embodiment of the present application;

[0022] Figure 2A schematic diagram of a training text generation model shown in an embodiment of the present application;

[0023] Figure 3 A schematic diagram of a large language model configured with a vertical domain multi-label classification module and a vertical domain plug-in parameter module shown in an embodiment of the present application;

[0024] Figure 4 This is an application scenario diagram of answering user questions through a text generation model shown in an embodiment of the present application;

[0025] Figure 5 An architecture diagram of a server for training a large language model shown in an embodiment of the present application;

[0026] Figure 6 An architecture diagram of an electronic device for deploying a chatbot program based on a large language model, shown in an embodiment of the present application;

[0027] Figure 7 A schematic diagram of a training vertical domain plug-in parameter module shown in an embodiment of the present application;

[0028] Figure 8(a) to Figure 8(b) A schematic diagram of a fine-tuning technique for a large language model shown in an embodiment of the present application;

[0029] Fig. 9 A schematic diagram of a training vertical domain multi-label classification module shown in an embodiment of the present application;

[0030] Fig.10 A flowchart of an interactive method according to an embodiment of the present application;

[0031] Figure 11(a) to Figure 11(b) A schematic diagram of a knowledge question answering system that uses a vertical domain multi-label classification module, a vertical domain plug-in parameter module, and a text generation model as shown in an embodiment of the present application;

[0032] Fig.12 A schematic diagram of a knowledge question answering system shown in an embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the objectives, embodiments and advantages of the present application more clear, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

[0034] In order to facilitate understanding of the embodiments of the present application, an application scenario applicable to the embodiments of the present application is first introduced below. First, Figure 1An application scenario diagram provided according to some embodiments of the present application is shown. In the figure, user 1 can be an actual user, and electronic device 2 can deploy a chatbot program based on a text generation model; for example, electronic device 2 can support input methods such as voice input and / or text input, and electronic device 2 can be any terminal device such as a mobile phone or Pad or laptop or desktop computer or intelligent robot in the user's hand, and server 3 can include a local hardware server and / or a cloud server and / or a virtual server, etc. Server 3 can set and / or train and / or adjust the text generation model, and the text generation model here can cover the professional knowledge of the vertical fields of medicine and encyclopedia.

[0035] Continue to refer Figure 1 , user 1 submits input data using the chatbot program of electronic device 2, and electronic device 2 recognizes the input data, such as: the input data is the voice of user 1, and electronic device 2 can recognize text from the voice. Electronic device 2 sends the recognized input data to server 3, and server 3 processes the input data through the set text generation model and feeds back the processing result to electronic device 2. For example, user 1 inputs the voice information "Who created XX", and the chatbot program of electronic device 2 can generate the answer "XXXXX" through the text generation model of server 3. The input data here can also be called the user's interactive instructions or the user's questions, etc.

[0036] Figure 2 A schematic diagram of a training text generation model is shown in an embodiment of the present application, wherein the process of training the text generation model can be completed on a server, and a chatbot program based on the text generation model can be deployed on an electronic device.

[0037] like Figure 2As shown, the text generation model 201 set on the server can be a deep learning model (transformer model) based on the self-attention mechanism, and the text generation model 201 can include N feature processing layers (transformer blocks). The training method of the text generation model includes pre-training and fine-tuning stages, and the professional knowledge of multiple vertical domains (such as: encyclopedia or education or medicine, etc.) is input into the knowledge corpus through pre-training or fine-tuning. In the pre-training stage, the input corpus form is mainly a declarative sentence, for example: "XX is a long science fiction series created by XXXXX." Or "Allergic rhinitis requires the reasonable use of XXXX and XXXXX for treatment." And so on. The corpus form of the fine-tuning stage is mainly question-answer pairs, for example: "Q: Who created XX? A: XXXXX." Or "Q: How to treat allergic rhinitis? A: Through the reasonable use of XXXX and XXXXX." And so on. Through pre-training or fine-tuning, professional knowledge in multiple vertical domains is stored in the network parameters of the trained text generation model 201; when using the text generation model 201 for prediction or reasoning, that is, using a chatbot program based on the text generation model 201, the text generation model 201 can answer the input questions (input data) and generate answers corresponding to the input data.

[0038] It can be seen that Figure 2 The number of network parameters of the text generation model 201 shown is limited (for example: 100 million network parameters). If the professional knowledge of multiple vertical domains is injected into the text generation model 201, the storage of the text generation model 201 will reach its upper limit. At the same time, in the process of using the professional knowledge of multiple vertical domains to train the text generation model 201, the corpus corresponding to the professional knowledge of different vertical domains will influence each other, causing the trained text generation model 201 to lose the knowledge and professionalism of one or more vertical domains, so that the text generation model 201 needs to be retrained as a whole, resulting in serious consumption of computing resources.

[0039] Reference below Figure 3 In order to solve the above problems, the embodiment of the present application proposes a large language model configured with a vertical domain multi-label classification module and a vertical domain plug-in parameter module, such as Figure 3 As shown, the text generation model 303 can be a large language model. The vertical domain multi-label classification module 301 is used to professionally classify the content of the user's input data and determine the vertical domain category involved in the input data, such as medicine or law. The vertical domain plug-in parameter module 302 includes at least two vertical domain plug-in parameter sub-modules. Figure 2The text generation model 201 shown needs to store the professional knowledge of the vertical domain through network parameters. Each vertical domain plug-in parameter submodule in the vertical domain plug-in parameter module 302 stores the professional knowledge of a single vertical domain through plug-in parameters (equivalent to the network parameters in the large language model), that is, the vertical domain plug-in parameter submodule stores the network parameters corresponding to the professional knowledge of the vertical domain, such as: the medical vertical domain plug-in parameter submodule stores medical plug-in parameters, the legal vertical domain plug-in parameter submodule stores legal plug-in parameters, etc. Compared with the vertical domain plug-in parameter module 302, the text generation model 303 can store more basic knowledge compared to professional knowledge, such as: encyclopedia or language, etc.

[0040] In some embodiments, based on the above large language model, the present application embodiment also proposes an interaction method, such as Figure 4 As shown, when user 1 uses the chat robot program based on the above-mentioned text generation model in the embodiment of the present application (deployed on electronic device 2, such as electronic device 2 can be a mobile phone or intelligent robot shown in the figure), the user's input data is output through the vertical domain multi-label classification module 301 set by the server 3 to output the vertical domain category of the input data; then the vertical domain plug-in parameter sub-module corresponding to the vertical domain category is selected based on the vertical domain plug-in parameter module 302; the vertical domain plug-in parameter sub-module is combined with the text generation model 303; the input data is inferred and answered through the text generation model combined with the plug-in parameters, and an answer corresponding to the input data is generated.

[0041] It can be seen that by setting the vertical domain plug-in parameter module for the large language model of the embodiment of the present application, the professional knowledge of multiple vertical domains can be independently classified and efficiently parameterized and stored, and in the process of training the professional knowledge of multiple vertical domains, vertical domain training isolation is achieved, that is, different from injecting the professional knowledge of multiple vertical domains into the large language model for storage, the parameterized plug-in method injects the professional knowledge of different vertical domains into the corresponding vertical domain plug-in parameter sub-module, avoiding the mutual influence between the vertical domains. If a new vertical domain needs to be built, it is only necessary to add a new vertical domain plug-in parameter sub-module. Through the vertical domain multi-label classification module, the vertical domain involved in the user's input data can be determined, and the professional questions and answers for the input data can be efficiently completed through the large language model combined with the vertical domain plug-in parameter sub-modules of different vertical domains.

[0042] In some embodiments, if the user's input data (the user's question) involves multiple vertical domains, it is also possible to arrange and combine different vertical domains, select the optimal arrangement method, and conduct integrated question and answering of professional knowledge of multiple vertical domains for the input data. For example, determine the vertical domain category corresponding to the question, and classify and score the vertical domain category. The classification score is used to determine the degree of correlation between the question and the vertical domain category, that is, the higher the classification score of the vertical domain category corresponding to the question, the higher the correlation between the question and the vertical domain category, and the vertical domain categories are sorted from small to large according to the classification score. The vertical domain types with lower classification scores can first be inferred and answered using the text generation model combined with the vertical domain plug-in parameter submodule, and then the answers are sequentially passed through the text generation model combined with the vertical domain plug-in parameter submodule corresponding to the vertical domain types with higher scores until the final answer is obtained.

[0043] Next, pass Figure 5 and Figure 6 A large language model applicable to an embodiment of the present application and a server and electronic device for a chat robot based on the large language model are introduced.

[0044] Figure 5 The architecture diagram of a server for training a large language model is shown in an embodiment of the present application. The server may include a processor 500, a storage module 510, a power management module 520, and a communication module 530. The server here may include any server device such as a traditional hardware server or a cloud server.

[0045] The processor 500 may include one or more processing units, for example, the processor 500 may include a central processing unit (CPU), etc. The processor 500 is used to perform training on the large language model stored in the storage module 510; the processor 500 may also generate a chatbot program based on the trained large language model, and send the chatbot program to the electronic device through the communication module 530 for deployment.

[0046] The storage module 510 can be used to store computer executable program codes, which include instructions. The storage module 510 can be any storage device such as a hard disk and / or a disk and / or a flash memory, and the storage module 510 can include a program storage area and a data storage area. The program storage area can store a large language model, and the data storage area can store training data.

[0047] The power management module 520 is used to supply power to the processor 500 and the storage module 510 .

[0048] The communication module 530 is used to communicate with at least one electronic device and send the chat robot program based on the trained large language model to the electronic device.

[0049] Figure 6 The following is an architecture diagram of an electronic device for deploying a chatbot program based on a large language model, as shown in an embodiment of the present application. The electronic device here may include a mobile phone or a tablet computer or a wearable device or a vehicle-mounted device or an augmented reality (AR) / virtual reality (VR) device or a laptop or an ultra-mobile personal computer (UMPC) or a netbook or a personal digital assistant (PDA) and other electronic devices with a display screen. The embodiment of the present application does not impose any restrictions on the specific type of the electronic device.

[0050] In some embodiments, the electronic device may include a processor 600, an external memory interface 620, an internal memory 621, a universal serial bus (USB) connector 630, a charging management module 640, a power management module 641, a battery 642, an antenna 1, an antenna 2, a mobile communication module 650, a wireless communication module 660, an audio module 670, a speaker 670A, a receiver 670B, a microphone 670C, an earphone interface 670D, a sensor module 680, a button 690, a motor 691, an indicator 692, a camera 693, a display screen 694, and a subscriber identification module (SIM) card interface 695, etc. Among them, the external memory interface 620, the universal serial bus (USB) connector 630, the audio module 670, the speaker 670A, the receiver 670B, the headphone interface 670D, the sensor module 680, the button 690, the motor 691, the indicator 692, and the camera 693 are optional.

[0051] The processor 600 may include one or more processing units, for example, the processor 600 may include a central processing unit (CPU), a microprocessor (MCU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. In an embodiment of the present application, the processor may be used to execute the interactive method of the embodiment of the present application to obtain the user's question, send the question to the server, and prompt the user with the answer corresponding to the question, etc.

[0052] The internal memory 621 can be used to store computer executable program codes, which include instructions. The internal memory 621 can include a program storage area and a data storage area. The processor 600 executes various functional applications and data processing of the electronic device by running the instructions stored in the internal memory 621 and / or the instructions stored in the memory provided in the processor. In some embodiments, the internal memory 621 can store a chatbot program corresponding to the neural network model.

[0053] The charging management module 640 , the power management module 641 , and the battery 642 may be used to supply power to various components of the electronic device.

[0054] Antenna 1 and antenna 2, as well as mobile communication module 650 and wireless communication module 660 can provide electronic devices with solutions for wireless communication including 2G / 3G / 4G / 5G, etc. In some embodiments, at least some functional modules of mobile communication module 650 can be arranged in the same device as at least some modules of processor 600.

[0055] The microphone 670C and the display screen 694 may be used to receive questions from the user, which may be asked in a voice input or gesture input, etc. The microphone 670C and the display screen 694 may also be used to provide the user with feedback on answers to the questions.

[0056] The external memory interface 620 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 600 through the external memory interface 620 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0057] The sensor module 680 may include a pressure sensor 680A, a gyroscope sensor 680B, an air pressure sensor 680C, a magnetic sensor 680D, an acceleration sensor 680E, a distance sensor 680F, a proximity light sensor 680G, a fingerprint sensor 680H, a temperature sensor 680J, a touch sensor 680K, an ambient light sensor 680L, a bone conduction sensor 680M, and the like.

[0058] The SIM card interface 695 is used to connect a SIM card.

[0059] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0060] After introducing the large language model applicable to the embodiments of the present application and the server and electronic device of the chat robot based on the large language model, the vertical domain plug-in parameter module set for the large language model in the embodiments of the present application is introduced below. Figure 7 This is a schematic diagram of a training vertical domain plug-in parameter module shown in an embodiment of the present application, wherein the process of training the vertical domain plug-in parameter module can be completed on server 3.

[0061] like Figure 7As shown, the process of training the vertical domain plug-in parameter module may include: (1) for multiple target vertical domains, first collect professional knowledge texts of each vertical domain; for example: for the legal vertical domain, various legal articles and / or judicial interpretations and / or court news and / or various popular legal articles, etc. can be collected; for the medical vertical domain, medical examinations and / or medical research and / or consumer medical problems, etc. can be collected. (2) Then, for the professional knowledge text of each vertical domain, select an existing large language model, such as open source Moss and / or Beichuan, etc., or it can be a text generation model of the embodiment of the present application or a text generation model designed and trained from scratch, and use fine-tuning technology to train the plug-in parameters of each vertical domain, and the fine-tuning technology method includes LoRA and / or Prefix and / or Adapter, etc. (3) Finally, the plug-in parameters corresponding to each vertical domain are obtained, and the plug-in parameters are stored in each vertical domain plug-in parameter submodule in the form of network parameters, such as: legal vertical domain plug-in parameter submodule and / or medical vertical domain plug-in parameter submodule, and multiple vertical domain plug-in parameter submodules constitute a vertical domain plug-in parameter module. That is to say, the vertical domain plug-in parameter module can save the vertical domain plug-in parameter sub-modules, and the corresponding relationship between each vertical domain plug-in parameter sub-module and the vertical domain category.

[0062] A fine-tuning technique for a large language model is introduced below through Figure 8(a) and Figure 8(b), such as Low-Rank Adaptation of Large Language Models (LoRA). During the fine-tuning of a large language model, the pre-trained network parameters are frozen through the LoRA method, and the trainable network parameters are injected into the structure of the large language model.

[0063] For example, for the matrix W0 corresponding to the pre-trained network parameters, the matrix W0 can be configured so that it can be applicable to the further trained network parameters: W0+△W=W0+BA.

[0064] Among them, W0∈R(d×k), B∈R(d×r), A∈R(r×k), and the rank of proof r<<min(d, k). At this time, the corrected network parameters become: h=W0x+△Wx=W0x+Bax, where x is the input data.

[0065] When fine-tuning the large language model, W0 is frozen and does not accept updates, and only fine-tunes parameters A and B. Compared with the process of adjusting all network parameters of the large language model, at this time, the number of parameters fine-tuned by the large language model changes from d×k to d×r+r×k, and r<<min(d,k), so the number of fine-tuning parameters is greatly reduced.

[0066] Referring to Figure 8(a), when fine-tuning the text generation model by LoRA, A is initialized with a random Gaussian (A = N(0, σ 2 )), use zero initialization (B=0) for B, so ΔW=BA is zero at the beginning of training, which can ultimately greatly reduce the amount of fine-tuning parameters of the text generation model. When the large language model is deployed to the actual environment, it is only necessary to calculate and store W=W0+BA, and perform reasoning as usual. Compared with other methods, there is no need to add more feature processing layers, that is, there is no need to change the basic structure of the large language model. In some embodiments, for large language models, the use of LoRA can reduce up to 2 / 3 of video memory usage, such as: for GPT-3 175B, the use of LoRA can reduce video memory consumption during training from 1.2TB to 350GB.

[0067] For example, as shown in FIG8( b ), the feature processing layer of the large language model, i.e., the text generation model, may include: multiple layer normalization layers, such as layer normalization layer 801 and layer normalization layer 803, a feedforward network layer 802, and a multi-head attention layer 804. The layer normalization layer 801 and the layer normalization layer 803 are used to perform a normalization operation on the data, i.e., to perform a normalized translation and scaling on the data so that the data belongs to the same latitude or the same feature distribution.

[0068] The feedforward network layer 802 (FeedForward) is used to map the data to a high-dimensional space and then to a low-dimensional space through linear transformation, thereby extracting deeper features of the input data, that is, the features here are the network parameters of the input data.

[0069] The multi-head attention layer 804 is used to use the multi-head attention mechanism to give the output of the attention layer including the coded representation information in different subspaces, thereby enhancing the expressiveness of the model. The stronger the expressiveness, the more the model can reasonably allocate the attention weights.

[0070] For example, when fine-tuning the feature processing layer in the text generation model by LoRA, the network parameters of the feedforward network layer can be frozen, and the professional knowledge text of the vertical domain can be trained by fine-tuning technology. In the process of applying the text generation model, the external parameters obtained after fine-tuning can be combined with the network parameters of the feedforward network layer to obtain the target text generation model.

[0071] The following introduces the vertical domain multi-label classification module set for the large language model in the embodiment of the present application. Fig. 9 This is a schematic diagram of a training vertical domain multi-label classification module 301 shown in an embodiment of the present application, wherein the process of training the vertical domain multi-label classification module 301 can be completed on the server 3.

[0072] like Fig. 9 As shown, the vertical domain multi-label classification module here is used to analyze the user's questions (input data) and determine the vertical domain involved in the question. For example: for the user's question "Please introduce the principle of Ohm's law in high school physics?", it is determined that the vertical domain involved in the question is education; for the user's question "A young male has been using XXX for a long time and suddenly has symptoms such as chest pain and / or vomiting and / or sweating. What disease may he have?", it is determined that the vertical domain involved in the question is medicine; for the user's question "Is XX responsible for the XXXX treatment plan?", it is determined that the question involves two vertical domains, medicine and law. In order to train the vertical domain multi-label classification module, it is necessary to obtain knowledge questions in different vertical domains or cross-vertical domains.

[0073] The specific method of training the vertical domain multi-label classification module may include: collecting questions from different vertical domains, such as: obtaining from the professional knowledge text of each vertical domain through natural language processing (NLP); generating questions and label categories through a large language model + prompt. In some embodiments, a neural network-based multi-label classifier (same as above) can be designed for generating questions and label categories, and a loss function (such as binary cross entropy loss) is used for the output vertical domain category to complete the final training, and obtain a vertical domain multi-label classification module 301.

[0074] The following is based on Fig.10 The flow chart shown is used to describe in detail the interaction method provided in the embodiment of the present application. Fig.10 The method shown can be implemented by the processors of the server 3 and the electronic device 2 executing related instructions.

[0075] refer to Fig.10 , the adjustment method may include the following steps:

[0076] S1001: Electronic device 2 obtains a user's question.

[0077] Exemplarily, the electronic device 2 here can be a mobile phone, and the mobile phone can be configured with a chat robot program corresponding to a large language model (i.e., a text generation model). The chat robot program can be an application installed in the storage area of ​​the mobile phone. The user can open the chat robot program of the mobile phone and ask questions by text input or voice input. For example: the user's question can be "XXXX treatment plan XXX?" The mobile phone can obtain the user's question input to the mobile phone through the screen or microphone.

[0078] S1002: The electronic device 2 sends the question to the server 3.

[0079] Exemplarily, after the mobile phone obtains the user's question, it can send the question to the server 3 through the network connection. That is, the chat robot program of the mobile phone can send the user's question to the text generation model corresponding to the chat robot program on the server 3. Here, the text generation model 303, the vertical domain multi-label classification module 301 and the vertical domain plug-in parameter module 302 are set on the server 3.

[0080] S1003: Server 3 determines the vertical domain category corresponding to the question.

[0081] Exemplarily, the server 3 may first input the question sent from the mobile phone into the vertical domain multi-label classification module 301 to obtain the vertical domain category corresponding to the question.

[0082] In some embodiments, if the vertical domain multi-label classification module 301 outputs a vertical domain category, that is, the question involves a single vertical domain; if the vertical domain multi-label classification module 301 outputs multiple vertical domain categories, that is, the question involves multiple vertical domains. In other embodiments, the vertical domain multi-label classification module 301 may not output a vertical domain category, indicating that the question does not involve professional knowledge, and there is no need to match the vertical domain plug-in parameter submodule 302, and the original text generation model 303 is directly used to infer and answer the question.

[0083] For example, for a user's question "Is the risk of the XXXX treatment plan high?", the vertical domain category output by the server 3 through the vertical domain multi-label classification module 301 may be the medical vertical domain. For a user's question "Is XX responsible for the XXXX treatment plan?", the vertical domain categories output by the server 3 through the vertical domain multi-label classification module 301 may be the medical vertical domain and the legal vertical domain. For a user's question "Please correct the punctuation in the following text", the server 3 may not output the vertical domain category through the vertical domain multi-label classification module 301.

[0084] S1004: Server 3 determines whether the question involves a vertical domain category.

[0085] Exemplarily, if the question involves a single vertical domain or multiple vertical domains, step S1005 is executed, and the server 3 selects the corresponding vertical domain plug-in parameter submodule and combines it with the original text generation model 303, and then performs reasoning and answering on the question. Otherwise, step S1007 is executed, and there is no need to match the vertical domain plug-in parameter submodule, and the original text generation model is directly used to reason and answer the question.

[0086] S1005: Server 3 determines the vertical domain plug-in parameter submodule based on the vertical domain category.

[0087] Exemplarily, referring to FIG. 11( a ), the user's question may be “Is the risk of the XXXX treatment plan high?” The vertical domain category output by the server 3 through the vertical domain multi-label classification module 301 may be the medical vertical domain. Based on the medical vertical domain, the vertical domain plug-in parameter submodule is determined through the vertical domain plug-in parameter module 302.

[0088] S1006: Server 3 combines the vertical domain plug-in parameter sub-module with the text generation model 303.

[0089] For example, referring to FIG. 11(a), the user's question may be "Is the risk of the XXXX treatment plan high?" The server 3 combines the medical vertical domain plug-in parameter submodule with the original text generation model 303 to obtain the network parameter combined text generation model 303. At this time, the text generation model 303 can not only infer and answer general questions, but also infer and answer questions involving professional knowledge texts in the medical vertical domain.

[0090] S1007: The server 3 uses the text generation model 303 to infer the answer to the question and generates an answer corresponding to the question.

[0091] Exemplarily, referring to FIG. 11( a ), for example, in response to a user's question “Is the risk of the XXXX treatment plan high?”, the text generation model 303 generates an answer corresponding to the question such as “The risk of the XXXX treatment plan is high and may cause XXXXXXXXXXXXX.”

[0092] S1008: The server 3 returns the answer corresponding to the question to the electronic device 2.

[0093] Exemplarily, the server 3 may return the generated answer to the mobile phone via a network connection.

[0094] S1009: Electronic device 2 prompts the user to answer.

[0095] Exemplarily, the mobile phone may display the answer corresponding to the user's question on the screen.

[0096] It can be seen that after configuring the vertical domain plug-in parameter module 302 for the original text generation model 303, the professional knowledge of different vertical domains can be stored in each vertical domain plug-in parameter sub-module, so that when training the text generation model 303, the professional knowledge of multiple vertical domains is independent of each other, avoiding affecting the professionalism of the text generation model. When using the text generation model 303 to reason and answer questions, by determining the vertical domain category corresponding to the user's question, selecting the vertical domain plug-in parameter sub-module corresponding to the vertical domain category and combining it with the original text generation model 303, the text generation model 303 can efficiently complete professional questions and answers for questions.

[0097] In some embodiments, when the user's question involves multiple vertical domains, after the server 3 determines the multiple vertical domain categories corresponding to the question through the vertical domain multi-label classification module 301, it can also arrange the vertical domain categories, and predict and answer the questions in turn based on the arranged vertical domain categories. For example: the server 3 sets a classification score for the vertical domain category through the vertical domain multi-label classification module 301, and arranges it according to the classification score. The classification score is used to determine the degree of correlation between the user's question and the vertical domain category, that is, the higher the classification score of the vertical domain category corresponding to the question, the higher the correlation between the question and the vertical domain category. First, the vertical domain multi-label classification module 301 will classify and score the output vertical domain categories, and sort the vertical domain categories from small to large according to the classification score; let the question first pass through the text generation model combined with the vertical domain plug-in parameter sub-module corresponding to the vertical domain category with a lower classification score to obtain the intermediate result of the answer. The intermediate result of the answer here is then passed through the text generation model 303 combined with the vertical domain plug-in parameter sub-module corresponding to the vertical domain category of the next classification score until the final answer is obtained. The intermediate result of each answer can also be combined with the prompt word of the previous vertical domain plug-in parameter sub-module.

[0098] For example, referring to FIG. 11(b), for the user's question "Is XX responsible for the XXXX treatment plan?", the vertical domain categories output by the server 3 through the vertical domain multi-label classification module 301 can be the medical vertical domain and the legal vertical domain, wherein the classification score of the medical vertical domain can be 0.6, and the classification score of the legal vertical domain can be 0.9. Then, the user's question can be first passed through the text generation model 303 combined with the medical vertical domain plug-in parameter submodule, and the intermediate result of the answer combined with the prompt word is obtained to obtain "Combining the treatment plan XXXXXXXX may cause XXXXXXXXX. Answer: Is XX responsible for the XXXX treatment plan?". The intermediate result of the answer is combined with the prompt word and input into the text generation model 303 combined with the legal vertical domain plug-in parameter submodule, and finally the answer is "The XXXX treatment plan itself has a high risk of XXXXXXXXXXXX. XXXXXXXXX can perform XXXXXXXX.".

[0099] In other embodiments, the text generation model may be combined to first arrange and combine different vertical domain categories, determine the results of multiple arrangements, and then input the multiple results into the text generation model to determine the optimal result.

[0100] It can be understood that the execution order of the above steps S1001 to S1009 is only an example. In other embodiments, other execution orders may be adopted, and some steps may be split or combined, which is not limited here.

[0101] It is understood that in some embodiments, Fig.12The knowledge base 304 shown is combined with the knowledge question and answer system of the text generation model 303 to vectorize the professional knowledge of multiple vertical domains and build a knowledge base independent of the text generation model. The knowledge base can be used to store the correspondence between professional knowledge of multiple vertical domains and questions and answers. For user questions, before inputting the questions into the text generation model, the questions are first searched in the knowledge base to find the text information corresponding to the answers to the questions, and then the questions and the retrieved answers are retrieved and spliced ​​and input into the text generation model together, and the final answer is generated by prediction using the text generation model.

[0102] It can be seen that compared with Figure 3 The large language model shown in the configuration includes a vertical domain multi-label classification module 301 and a vertical domain plug-in parameter module 302. Fig.12 In the knowledge question answering system shown, when the answer to the question cannot be retrieved or the retrieval is wrong, it is necessary to use other large models to predict the answer again.

[0103] Although the description of this application will be introduced in conjunction with a preferred embodiment, this does not mean that the features of this application are limited to this embodiment. On the contrary, the purpose of introducing the invention in conjunction with the embodiment is to cover other options or modifications that may be extended based on the claims of this application. In order to provide a deep understanding of the present application, the following description will include many exemplary details. The present application may also be implemented without using these details. In addition, in order to avoid confusion or blurring the focus of the present application, some specific details will be omitted in the description. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other without conflict.

[0104] Furthermore, various operations will be described as multiple discrete operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be construed as implying that these operations are necessarily order dependent. In particular, these operations do not need to be performed in the order presented.

[0105] As used herein, the term "module" or "unit" may refer to: an application specific integrated circuit (ASIC) or an electronic circuit or a (shared or dedicated or group) processor and / or memory or combinational logic circuitry that executes one or more software or firmware programs and / or other suitable components that provide the described functionality.

[0106] In the accompanying drawings, some structural or method features are shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. In some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a specific figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0107] The various embodiments of the mechanism disclosed in the present application can be implemented in hardware or software or firmware or a combination of these implementation methods. The embodiments of the present application can be implemented as a computer program or program code executed on a programmable system, which includes multiple processors, a storage system (including volatile and non-volatile memory and / or storage elements), multiple input devices, and multiple output devices.

[0108] Such computer-readable storage media may include, but are not limited to, a non-transitory tangible arrangement of an article manufactured or formed by a machine or apparatus, including a storage medium such as: a hard disk, any other type of disk, including a floppy disk or an optical disk or a compact disk read-only memory (CD-ROM) or a compact disk rewritable (CD-RW) and a magneto-optical disk or a semiconductor device, such as a read-only memory (ROM) or a random access memory (RAM) such as a dynamic random access memory (DRAM) and a static random access memory (SRAM) or an erasable programmable read-only memory (EPROM) or a flash memory or an electrically erasable programmable read-only memory (EEPROM); a phase change memory (PCM); a magnetic card or an optical card; or any other type of medium suitable for storing electronic instructions.

[0109] Therefore, various embodiments of the present application also include non-transitory computer-readable storage media containing instructions or containing design data, such as hardware description language (HDL), which defines the structures and / or circuits and / or devices and / or processors and / or system features described in the present application.

Claims

1. An interaction model, applied to an electronic device, characterized in that: It includes a classification module, at least two professional parameter modules, and an interaction sub-model; wherein, The classification module is used to determine the professional classification to which the content of the user's interactive instruction belongs, and select a first professional parameter module from the at least two professional parameter modules, wherein the first professional parameter module corresponds to the professional classification, wherein: Different professional parameter modules of the at least two professional parameter modules include model parameters corresponding to interactive instructions of different professional classifications; The interaction sub-model is used to combine with the first professional parameter module to generate an interaction result corresponding to the interaction instruction.

2. The interaction model according to claim 1, characterized in that: The interaction sub-model includes at least one of a large language model and a text generation model.

3. The interactive model according to claim 1 or 2, characterized in that: The classification module is also used to send the first professional parameter module to the interaction sub-model.

4. The interaction model according to any one of claims 1 to 3, characterized in that: The classification module is also used to: When it is determined that the content of the interactive instruction belongs to both the first professional classification and the second professional classification, a first classification score of the interactive instruction belonging to the first professional classification and a second classification score of the interactive instruction belonging to the second professional classification are obtained respectively, and In the case where the first classification score is less than the second classification score, combining the first professional parameter model corresponding to the first professional classification with the interaction sub-model, reasoning the interaction instruction, generating a first result corresponding to the interaction instruction, and The second professional parameter model corresponding to the second professional classification is combined with the interaction sub-model, and the first result is inferred to generate an interaction result corresponding to the interaction instruction, wherein the first classification score is used to determine the degree of correlation between the content of the interaction instruction and the first professional classification, and the second classification score is used to determine the degree of correlation between the content of the interaction instruction and the second professional classification.

5. The interactive model according to any one of claims 1 to 4, characterized in that: The interaction instruction includes at least one of a voice interaction instruction and a text interaction instruction.

6. The interactive model according to any one of claims 1 to 5, characterized in that: The professional classification includes at least one of law, medicine, finance and history.

7. An interactive method, applied to an electronic device, characterized in that: include: Determining the professional category to which the content of the first interactive instruction of the user belongs; Selecting a first professional parameter module from at least two professional parameter modules, wherein the first professional parameter module corresponds to the professional classification, and different professional parameter modules in the at least two professional parameter modules include model parameters corresponding to interaction instructions of different professional classifications; The first interaction instruction is processed in combination with the first professional parameter module and the interaction sub-model to generate a first interaction result corresponding to the first interaction instruction.

8. The interactive method according to claim 7, characterized in that: The interaction sub-model includes at least one of a large language model and a text generation model.

9. The interactive method according to claim 7 or 8, characterized in that: Also includes: When it is determined that the content of the first interactive instruction belongs to both the first professional classification and the second professional classification, a first classification score of the first interactive instruction belonging to the first professional classification and a second classification score of the first interactive instruction belonging to the second professional classification are obtained respectively, and When the first classification score is less than the second classification score, combining the first professional parameter model corresponding to the first professional classification with the interaction sub-model, inferring the first interaction instruction, generating a first interaction sub-result corresponding to the first interaction instruction, and The second professional parameter model corresponding to the second professional classification is combined with the interaction sub-model, and the first interaction sub-result is inferred to generate a first interaction result corresponding to the first interaction instruction, wherein the first classification score is used to determine the degree of correlation between the content of the first interaction instruction and the first professional classification, and the second classification score is used to determine the degree of correlation between the content of the first interaction instruction and the second professional classification.

10. The interactive method according to any one of claims 7 to 9, characterized in that: The first interaction instruction includes at least one of a voice interaction instruction and a text interaction instruction.

11. The interactive method according to any one of claims 7 to 9, characterized in that: The professional classification includes at least one of law, medicine, finance and history.

12. An electronic device, characterized in that: include: one or more processors; One or more memories; the one or more memories store one or more programs, and when the one or more programs are executed by the one or more processors, the electronic device executes the interaction method described in any one of claims 7 to 11.

13. A readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the interactive method according to any one of claims 7 to 11.

14. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the interactive method according to any one of claims 7 to 11.

Citation Information

Cited By

  • Domain-knowledge guided agent framework for automated system analysis

    US20250335707A1