Conversation method

The requested text is domain-classified through the text classification model, and noise dialogue is inserted when fine-tuning the large language model, which solves the hallucination problem caused by data imbalance in fine-tuning the large language model, and improves the accuracy and generalization ability of the model.

CN119128104APending Publication Date: 2024-12-13HUBEI QIGUANG TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411273261.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

When fine-tuning the domain applicability of large language models, since some domain data are not involved in the model pre-training, it requires more fine-tuning samples. Too many fine-tuning samples can easily lead to data imbalance and hallucination problems.

Method used

The text classification model is used to classify the request text in a domain, and the request text and its domain are entered as prompts to enter the large language model. When fine-tuning is performed, the noise dialogue outside the domain is inserted to change the distribution of the training data and reduce hallucination problems.

Benefits of technology

It effectively solves the hallucination problem caused by data imbalance in the field applicability fine-tuning of large language models, and improves the accuracy of answers and the generalization ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119128104A_ABST
    Figure CN119128104A_ABST
Patent Text Reader

Abstract

The invention relates to a dialogue method. The dialogue method comprises the following steps: receiving a request text; classifying the request text by using a text classification model to obtain a question and answer field to which the request text belongs; constructing a prompt, wherein the prompt comprises the request text and the question and answer field to which the request text belongs; and inputting the prompt into a large language model to obtain an answer corresponding to the request text. By utilizing the method disclosed by the invention, the large model illusion problem can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to methods, computing devices, storage media, program products, etc. for conducting conversations. Background Art

[0002] When solving the problem of domain applicability, large language models often need to be fine-tuned to achieve enhanced effects in the domain. However, since some domain data is not involved in model pre-training, more fine-tuning samples are usually required, and too many fine-tuning samples can easily lead to data imbalance and produce additional hallucination problems. Summary of the invention

[0003] Embodiments of the present disclosure provide methods for conducting a conversation and corresponding computing devices, non-transitory machine-readable storage media, and computer program products for executing these methods.

[0004] According to a first aspect of an embodiment of the present disclosure, a method for conducting a conversation is provided, comprising: receiving a request text; classifying the request text using a text classification model to obtain a question-and-answer field to which the request text belongs; constructing a prompt, wherein the prompt includes the request text and the question-and-answer field to which the request text belongs; and inputting the prompt into a large language model to obtain an answer corresponding to the request text.

[0005] Optionally, the large language model is a fine-tuned large language model, and the process of fine-tuning the large language model includes: obtaining one or more multi-round conversations belonging to a first question-and-answer field; inserting at least one round of noise conversation between two adjacent rounds of conversations in the one or more multi-round conversations, wherein the at least one round of noise conversation is a conversation in a question-and-answer field different from the first question-and-answer field; and using one or more multi-round conversations into which the at least one round of noise conversation is inserted as fine-tuning samples, fine-tuning the large language model until a fine-tuning stop condition is met, wherein the fine-tuning stop condition includes that the loss function no longer decreases or the test set indicator meets the standard or the iteration reaches a preset number of fine-tuning times.

[0006] Optionally, the two adjacent rounds of dialogue are two adjacent rounds of dialogue randomly selected from the one or more multi-rounds of dialogue; and the at least one round of noise dialogue is randomly selected from a dialogue in a question-and-answer field different from the first question-and-answer field.

[0007] Optionally, the noise conversation is correlated with the two adjacent conversations, wherein the correlation includes: the noise conversation contains an entity that is the same as or similar to an entity in at least one of the two adjacent conversations; or a slot in the noise conversation is similar to an entity in at least one of the two adjacent conversations; or an entity in the noise conversation is similar to a slot in at least one of the two adjacent conversations; or the similarity between the noise conversation and at least one of the two adjacent conversations exceeds a threshold; or the similarity between the noise conversation and at least one of the two adjacent conversations is the highest in a predetermined set of noise conversations.

[0008] Optionally, the training process of the text classification model includes: predefining multiple question and answer fields; labeling multiple dialogues as training samples according to the predefined multiple question and answer fields; using the training samples to train the text classification model until a training stop condition is met, wherein the training stop condition includes that the loss function no longer decreases or the test set indicator meets the standard or the iteration reaches a preset number of training times.

[0009] Optionally, the prompt is input into a large language model to obtain an answer corresponding to the request text, including: using the large language model to generate one or more reasoning paths for the prompt; the large language model generates one or more candidate answers for the prompt based at least on the one or more reasoning paths; and determining the answer from the one or more candidate answers.

[0010] According to a second aspect of an embodiment of the present disclosure, a dialogue device is provided, comprising: a receiving unit for receiving a request text; a classification unit for classifying the request text using a text classification model to obtain the question and answer field to which the request text belongs; a construction unit for constructing a prompt, wherein the prompt includes the request text and the question and answer field to which the request text belongs; and a reply unit for inputting the prompt into a large language model to obtain an answer corresponding to the request text.

[0011] According to a third aspect of an embodiment of the present disclosure, a computing device is provided, including: a processor; and a memory on which executable code is stored, and when the executable code is executed by the processor, the processor executes the method described in any scheme in the above first aspect.

[0012] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary machine-readable storage medium is provided, on which an executable code is stored. When the executable code is executed by a processor of an electronic device, the processor executes a method as described in any of the schemes in the first aspect above.

[0013] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising an executable code. When the executable code is executed by a processor of an electronic device, the processor is caused to execute a method as described in any one of the schemes in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The above and other objects, features and advantages of the present disclosure will become more apparent through a more detailed description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like components in the exemplary embodiments of the present disclosure.

[0015] Figure 1 The structure diagram of a mobile phone according to at least one embodiment of the present disclosure is exemplarily shown.

[0016] Figure 2 A schematic flow chart of a method for conducting a conversation according to at least one embodiment of the present disclosure is exemplarily shown.

[0017] Figure 3 A block diagram of a computing system for performing reasoning according to at least one embodiment of the present disclosure is exemplarily shown.

[0018] Figure 4 A schematic flowchart of a method for training a text classification model according to at least one embodiment of the present disclosure is exemplarily shown.

[0019] Figure 5 A schematic flowchart of a method for fine-tuning a large language model according to at least one embodiment of the present disclosure is exemplarily shown.

[0020] Figure 6 The figure exemplarily shows a schematic diagram of the composition of a dialogue device according to at least one embodiment of the present disclosure.

[0021] Figure 7 A structural diagram of a computing device according to at least one embodiment of the present disclosure is exemplarily shown. DETAILED DESCRIPTION

[0022] The preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present disclosure more thorough and complete, and to fully convey the scope of the present disclosure to those skilled in the art.

[0023] The development of pre-trained models has provided technical support for the application of natural language processing to more and more scenarios. The application of pre-trained models usually includes two stages. In the first stage, the untrained machine learning model uses the self-supervised loss derived from unlabeled training data to learn general potential representations. After learning a large amount of unlabeled training data, the pre-trained model is obtained; in the second stage, the pre-trained model uses the supervised loss derived from the labeled training data to fine-tune the parameters to obtain a machine learning model with more biased results when solving specific tasks or realizing some specific functions. In the second stage of training, only some labeled training data is needed, which can reduce the difficulty of applying the pre-trained model to different scenarios or solving different tasks.

[0024] When solving domain dialogue problems, pre-trained models such as pre-trained large language models (LLM) show the ability to learn to solve new tasks from only a few examples without any fine-tuning, although large language models with huge parameters such as GPT-4, GPT-4o, and Llama3 have shown their ability to learn to solve new tasks from only a few examples without any fine-tuning. However, their performance is still far behind that of the above-mentioned large language models after fine-tuning. Manually annotating a large amount of training data will significantly improve the performance of large language models. For example, when solving problems in the field of question and answer in car computers, mobile phones, etc., it is necessary to use more dialogue data in these question and answer fields for fine-tuning. However, the present disclosure found that after fine-tuning the pre-trained large language model using 50,000 or more or less repair questions and answers of car computers, mobile phones, etc., the large language model will have more hallucination problems, as shown below:

[0025] Q1: What should I do if my phone has no network? A1: First check whether the mobile network is turned on. If the mobile network is turned on, check...

[0026] Q2: Find me an online novel. A2: If you still cannot connect to the Internet after checking, try restarting your phone.

[0027] Q1 and Q2 represent the questions (queries, also called "request text") asked by the user in sequence, and A1 and A2 represent the answers given by the large language model to each question. Obviously, the answer of A2 does not meet expectations. This is because the large language model has too many fine-tuning samples, which causes the model to hallucinate and misidentify general questions and answers as questions and answers in a specific field, resulting in incorrect replies. If the number of training samples is reduced, the expected training effect may not be achieved.

[0028] Therefore, in order to solve the conflict between too many fine-tuning samples and model hallucinations, the present disclosure proposes a new solution for using a large language model for dialogue, which uses a text classification model to classify the request text (query) in the question-answering domain and then inputs the request text and the classification result into the large language model, thereby providing effective context information for the large language model and effectively solving the large model hallucination problem. In addition, in some embodiments, the present disclosure also proposes to improve the fine-tuning samples in the process of fine-tuning the large language model, by inserting out-of-domain noise data and changing the distribution of domain data during the training process, so as to further effectively solve the large model hallucination problem.

[0029] The method for conducting a conversation provided in the embodiments of the present disclosure can be applied to various types of handheld devices (such as mobile phones, personal digital assistants (PDAs), etc.), various types of computers (such as tablet computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, laptop computers, etc.), wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices and other terminal devices, and can also be applied to databases, servers, and service response systems based on terminal artificial intelligence, etc. The embodiments of the present disclosure do not impose any restrictions on the specific types of application devices such as terminal devices, as long as the application device has the need to conduct a conversation.

[0030] As an example but not limitation, when the terminal device is a wearable device, the wearable device can also be a general term for wearable devices that are developed by applying wearable technology to intelligently design daily wearables, such as gloves, watches, AR head-mounted display devices, VR head-mounted display devices or MR (Mixed Reality) head-mounted display devices equipped with far-field communication modules and / or near-field communication modules.

[0031] In some embodiments, the terminal device may be a device having Figure 1 The exemplary hardware structure of the exemplary mobile phone 100 shown in FIG. Figure 1 As shown, the mobile phone 100 may specifically include: a radio frequency (RF) circuit 110, a memory 120, an input unit 130, a display unit 140, a sensor 150, an audio circuit 160, a short-range wireless communication module 170, a processor 180, and a power supply 190. Those skilled in the art will appreciate that Figure 1The structure of the mobile phone 100 shown in the figure does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0032] Combine the following Figure 1 The components of the mobile phone 100 are described in detail:

[0033] The RF circuit 110 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 180 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 110 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, and the wireless communication can include Global System For Mobile Communications (Global System For Mobile Communications, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Time Division Code Division Multiple Access (Time-Division Code Division Multiple Access, TD-SCDMA), Long Term Evolution (Long Term Evolution, LTE), New Radio (New Radio, NR), GNSS, FM, low-orbit satellite connection and / or IR technology, etc. The GNSS may include a Global Positioning System (GPS), a Global Navigation Satellite System (GLONASS), a BeiDou Navigation Satellite System (BDS), a Quasi-Zenith Satellite System (QZSS) and / or a Satellite Based Augmentation System (SBAS), etc.

[0034] The memory 120 can be used to store software programs and modules. The processor 180 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 120. The memory 120 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, a question and answer application, a voice assistant, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as pictures, audio data, a phone book, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Specifically, the memory 120 may store a program for implementing the method for conducting a conversation according to the present disclosure as will be described in detail later, which may be an independent application, or a functional module embedded in one or more applications or operating systems. In some cases, the memory 120 may store a text classification model and / or a large language model used by the method according to an embodiment of the present disclosure, or may store a program capable of calling a remotely stored text classification model and / or a large language model.

[0035] The input unit 130 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone 100. Specifically, the input unit 130 may include a touch panel 131 and other input devices 132. The touch panel 131, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 131 or near the touch panel 131 using any suitable object or accessory such as a finger (such as a single finger or multiple fingers), a stylus, etc.), and drive the corresponding connection device according to a pre-set program. For example, the user can enter the corresponding request text (query) in the interface for conducting a dialogue on the touch panel 131 through an input method, etc. Optionally, the touch panel 131 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact point coordinates, and then sends it to the processor 180, and can receive and execute commands sent by the processor 180. In addition, the touch panel 131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 131, the input unit 130 can also include other input devices 132. Specifically, the other input devices 132 can include but are not limited to one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, etc.

[0036] The display unit 140 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. For example, the display unit 140 is configured to display an independent application for implementing the method for conducting a conversation according to the present disclosure or a functional module in other applications or operating systems for implementing the method of the present disclosure (for example, the query text input by the user and the corresponding answer finally fed back to the user can be displayed therein). The display unit 140 may include a display panel 141. Optionally, the display panel 141 may be configured in the form of a liquid crystal display (LCD), a light emitting diode (LED), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), etc. Further, the touch panel 131 may cover the display panel 141. When the touch panel 131 detects a touch operation on or near it, it is transmitted to the processor 180 to determine the type of touch event. Then the processor 180 provides a corresponding visual output on the display panel 141 according to the type of touch event. Although in Figure 1 In the embodiment, the touch panel 131 and the display panel 141 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 131 and the display panel 141 can be integrated to realize the input and output functions of the mobile phone.

[0037] The mobile phone 100 may also include at least one sensor 150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 141 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 141 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping, etc.); as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0038] The audio circuit 160, the speaker 161, and the microphone 162 can provide an audio interface between the user and the mobile phone. The audio circuit 160 can transmit the received audio data to the speaker 161 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 160 and converted into audio data, and then the audio data is output to the processor 180 for processing, and then sent to another electronic device through the RF circuit 110, or the audio data is output to the memory 120 for further processing.

[0039] Communication technologies such as Wi-Fi, Bluetooth, Near Field Communication (NFC) and Ultra Wide Band (UWB) belong to short-range wireless transmission technologies. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the short-range wireless module 170, which provides users with wireless broadband Internet access. The above-mentioned short-range wireless module 170 may include a Wi-Fi chip, a Bluetooth chip, an NFC chip and a UWB chip. Through the Wi-Fi chip, the mobile phone 100 can achieve the function of Wi-Fi Direct connection with other electronic devices, and can also make the mobile phone 100 work in an AP mode (Access Point mode) that can provide wireless access services and allow other wireless devices to access, or work in a STA mode (Station mode) that can connect to an AP but does not accept wireless devices to access, thereby establishing point-to-point communication between the mobile phone 100 and other Wi-Fi devices.

[0040] The processor 180 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 120, and calling data stored in the memory 120, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 180 may include one or more processing units; optionally, the processor 180 may include, for example, an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), a controller, a video codec, a digital signal processor (Digital Signal Processor, DSP), a baseband processor, and / or a neural network processor (Neural-Network Processing Unit, NPU) (for example, for running the text classification model and / or large language model described in any embodiment of this document), etc. Among them, different processing units can be independent devices or integrated in one or more processors.

[0041] The mobile phone 100 also includes a power source 190 (such as a battery) for supplying power to various components. Preferably, the power source can be logically connected to the processor 180 through a power management system, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0042] The mobile phone 100 may also include a camera. Optionally, the position of the camera on the mobile phone may be front-mounted or rear-mounted, which is not limited in the embodiments of the present application. The mobile phone may collect a scene image of the current scene through the camera, and determine the scene information and the scene type by analyzing the scene image.

[0043] In some embodiments, the mobile phone 100 can run an operating system and various applications installed thereon, such as an independent application for implementing the method for conducting a conversation according to the present disclosure, which will be described in detail later, or other independent applications. A functional module for implementing the method for conducting a conversation according to the present disclosure may be embedded in one or more other independent applications or operating systems that have a need to answer user questions.

[0044] Figure 2 The schematic flow chart of the method for conducting a dialogue according to at least one embodiment of the present disclosure is exemplarily shown. In the present disclosure, "plurality" or similar expressions refer to two or more.

[0045] like Figure 2 As shown, in step S210, a request text is received.

[0046] In some implementations, the operating system of the terminal device, or one or more applications, can communicate with the user, for example, answering questions related to the terminal device, the operating system, and / or the application, questions in general fields, and / or questions in other fields, etc. Therefore, in the corresponding dialogue interface in the operating system or application, the user can enter a request text (query), and after receiving the request text, the operating system or application can obtain a corresponding answer using the operations described later and feedback to the user in the dialogue interface.

[0047] In step S220, the request text is classified using a text classification model to obtain the question-answering field to which the request text belongs.

[0048] In some embodiments, the text classification model may be a machine learning model that has been trained to implement classification tasks, such as a TextCNN model, a BERT model, etc.

[0049] TextCNN is a text classification model based on convolutional neural network (CNN). It has a strong ability to extract shallow features of text. It works well and quickly when focusing on intent classification in areas such as conversation. In addition, the network structure of TextCNN is relatively simple and easy to implement and train.

[0050] Therefore, through the text classification model, the request text can be better classified into the corresponding question and answer field, so as to understand the intention of the request text, at least avoid the subsequent LLM from having hallucinations in the question and answer field, and improve the accuracy of subsequent answers.

[0051] The trained text classification model can be deployed on the client, client device (i.e., device with the client installed), server, server device (i.e., device with the server installed), operating system using the method of the present disclosure, various servers or various clouds, etc. of any application using the method of the present disclosure, and then perform reasoning to classify the request text input by the user. The training and / or reasoning operation of the text classification model can be performed by, for example, the following Figure 3 computing system to execute.

[0052] Figure 3 A block diagram of a computing system 300 is depicted that performs inference according to examples of the present disclosure.

[0053] In some cases, you can use Figure 3 The computing system 300 implements various reasoning and / or training operations of the text classification model and / or the large language model described in the various embodiments of the present disclosure.

[0054] System 300 includes a user computing device 310 , a server computing device 330 , and a training computing device 350 communicatively coupled via a network 370 .

[0055] The user computing device 310 may be any type of computing device, such as the mobile phone or other types of computing devices mentioned above in the present disclosure.

[0056] The user computing device 310 includes one or more processors 312 and memory 314. The one or more processors 312 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be one processor or multiple processors operably connected. The memory 314 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 314 can store data 316 and instructions 318 executed by the one or more processors 312 to cause the user computing device 310 to perform operations.

[0057] In some implementations, the user computing device 310 may store or include one or more machine learning models 320. For example, the machine learning model 320 may be or may otherwise include various machine learning models, such as a neural network (e.g., a deep neural network) or other types of machine learning models, including nonlinear models and / or linear models. Neural networks may include feedforward neural networks, recursive neural networks (e.g., long short-term memory recursive neural networks), convolutional neural networks, or other forms of neural networks. Some example machine learning models may be aided by attention mechanisms such as self-attention. For example, some example machine learning models may include a multi-head self-attention model (e.g., a transformer model). For example, the machine learning model 320 may include a text classification model and / or a large language model as described in the various embodiments of the present disclosure.

[0058] In some implementations, one or more machine learning models 320 may be received from a server computing device 330 via a network 370 and stored in a user computing device memory 314 before being used or otherwise implemented by one or more processors 312. In some implementations, a user computing device 310 may implement multiple parallel instances of a single machine learning model 320 (e.g., multiple instances of the machine learning model 320 perform parallel inference).

[0059] More specifically, the machine learning model 320 may be used to generate predicted characters or classification results to respond to user input. For example, the user may input content into an operating environment executed by the processor 312 of the user device 310 via a user input component 322 (e.g., keyboard / mic, etc.). It should be noted that the machine learning model 320 may generate predicted characters or classification results during a one-time reasoning time process, so that they may be provided to the user of the user computing device 310 in real time.

[0060] For example, the user input component 322 can be a touch-sensitive component (e.g., a touch-sensitive display screen or a touchpad) that is sensitive to the touch of a user input object (e.g., a finger or a stylus). The touch-sensitive component can be used to implement a virtual keyboard. Other example user input components include a microphone, a traditional keyboard, or other devices that a user can use to provide user input. For another example, the user input component 322 can also include a display component (e.g., an OLED, AMOLED, or Mirco LED display screen), which is configured to provide a display function, such as providing an interface for conducting a conversation, so that the machine learning model 320 can perform reasoning based on the request text input by the interface, such as obtaining the question and answer field to which it belongs.

[0061] In addition, one or more machine learning models 340 may be included in a server computing device 330 that communicates with the user computing device 310 according to a client-server relationship, and the capabilities provided by the machine learning models 340 are stored and implemented by the server computing device 330. For example, the machine learning model 340 may be implemented by the server computing device 330 as part of a network service (e.g., a content generation service or an inference service or a conversational robot service). Thus, one or more machine learning models 320 may be stored and implemented at the user computing device 310, and / or one or more models 340 may be stored and implemented at the server computing device 330.

[0062] For example, the machine learning model 320 stored and implemented on the user computing device 310 may be configured to provide content mapping capabilities to map the input request text and / or the prompts constructed in the steps of the method described later in the present disclosure into appropriate features, and transmit the appropriate features to the machine learning model 340 stored and implemented by the server computing device 330 via the network 370. The machine learning model 340 can perform reasoning based on the appropriate features, such as obtaining classification results, generating coherent text or other appropriate content (such as images, videos, or audio) and transmitting it to the user computing device 310 for display via the network 370. In other examples, the feature mapping and reasoning generation capabilities are fully implemented by the machine learning model 340, and the user computing device 310 may not include any machine learning model 320.

[0063] The server computing device 330 includes one or more processors 332 and memory 334. The one or more processors 332 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be one processor or multiple processors operably connected. The memory 334 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, magnetic disks, etc., and combinations thereof. The memory 334 can store data 336 and instructions 338 executed by the processor 332 to cause the server computing system 330 to perform operations.

[0064] In some implementations, server computing device 330 includes or is implemented by one or more server computing devices. Where server computing device 330 includes multiple server computing devices, such server computing devices may operate according to a sequential computing architecture, a parallel computing architecture, or some combination thereof.

[0065] As described above, the server computing device 330 may store or otherwise include one or more machine learning models 340. For example, the machine learning model 340 may include various machine learning models. Example machine learning models include neural networks or other multi-layer nonlinear models. Example neural networks include feedforward neural networks, deep neural networks, recursive neural networks, and convolutional neural networks. Some example machine learning models may be aided by attention mechanisms such as self-attention. For example, some example machine learning models may include a multi-head self-attention model (e.g., a transformer model). For example, the machine learning model 340 may include a text classification model and / or a large language model as described in the various embodiments of the present disclosure.

[0066] The user computing device 310 and / or the server computing device 330 may train the machine learning model 320 and / or the machine learning model 340, for example, the text classification model and / or the large language model described in various embodiments of the present disclosure, by interacting with the training computing device 350 that is communicatively coupled via the network 370. The training computing device 350 may be separate from the server computing device 330, or may be part of the server computing device 330.

[0067] The training computing device 350 includes one or more processors 352 and memory 354. The one or more processors 352 can be any suitable processing device (e.g., a processor core, a microprocessor, an ASIC, an FPGA, a controller, a microcontroller, etc.) and can be one processor or multiple processors that are operably connected. The memory 354 can include one or more non-transitory computer-readable storage media, such as RAM, ROM, EEPROM, EPROM, flash memory devices, disks, etc., and combinations thereof. The memory 354 can store data 356 and instructions 358 executed by the processor 352 to cause the training computing device 350 to perform operations. In some implementations, the training computing device 350 includes one or more server computing devices or is otherwise implemented by one or more server computing devices.

[0068] The training computing system device may include a model trainer 360 that uses various training or learning techniques, such as error back propagation, to train the machine learning model 320 and / or the machine learning model 340 stored at the user computing device 310 and / or the server computing device 330. For example, a loss function may be back propagated through the (multiple) machine learning models to update one or more parameters of the (multiple) machine learning models (e.g., based on the gradient of the loss function). Various loss functions may be used, such as mean squared error, likelihood loss, cross entropy loss, hinge loss, and / or various other loss functions. Gradient descent techniques may be used to iteratively update parameters over multiple training iterations.

[0069] In some implementations, performing back propagation of errors may include performing truncated back propagation over time. The model trainer 360 may perform a variety of generalization techniques (eg, weight decay, dropout, etc.) to improve the generalization ability of the trained model.

[0070] Specifically, the model trainer 360 can train the machine learning model 320 and / or the machine learning model 340 based on a set of training data 362 to obtain a trained machine learning model. The training data 362 may include, for example, label data indicating input data that needs to be classified and indicating the classification result of the input data. In other examples, the training data 362 may be input data that does not include labels, and the machine learning model 320 and / or the machine learning model 340 can use these input data that do not include labels to learn, for example, the structure, pattern, and usage habits of the input data.

[0071] In some implementations, if the user has provided consent to use private data for training, the training examples may be provided by the user computing device 310. Thus, in such implementations, the machine learning model 320 provided to the user computing device 310 may be trained by the training computing system 350 based on user-specific data received from the user computing device 310. In some cases, this process may be referred to as personalized training of the model.

[0072] The model trainer 360 includes computer logic for providing the desired functionality. The model trainer 360 can be implemented in hardware, firmware, and / or software that controls a general purpose processor. For example, in some implementations, the model trainer 360 includes a program file stored on a storage device, loaded into a memory, and executed by one or more processors. In other implementations, the model trainer 360 includes one or more sets of computer executable instructions stored in a tangible computer readable storage medium, such as RAM, a hard disk, or an optical or magnetic medium.

[0073] Network 370 can be any type of communication network, such as a local area network (e.g., an intranet), a wide area network (e.g., the Internet), or some combination thereof, and can include any number of wired or wireless links. In general, communications on network 370 can be carried via any type of wired and / or wireless connection using a variety of communication protocols (e.g., TCP / IP, HTTP, SMTP, FTP), encodings or formats (e.g., HTML, XML), and / or protection schemes (e.g., VPN, secure HTTP, SSL).

[0074] In some embodiments, Figure 2 The training process of the text classification model in step S220 may include the following steps: Figure 4 The process shown.

[0075] Figure 4 A schematic flowchart of a method for training a text classification model according to at least one embodiment of the present disclosure is exemplarily shown.

[0076] Specifically, if Figure 4 As shown, in step S410, a plurality of question-answering domains are predefined.

[0077] Some question-and-answer fields may be predefined based on experience or actual needs as the categories obtained by the final classification, such as "mobile phone manual", "music", "navigation", "calling", "novel", "general", "others" and other question-and-answer fields.

[0078] Then, in step S420, multiple dialogues are labeled as training samples according to the predefined multiple question-answering fields.

[0079] For example, multiple conversations can be selected from previously generated real conversation data, and then each of the multiple conversations can be automatically classified into one of the predefined multiple question-and-answer fields using manual and / or other machine learning models to complete the labeling as training samples.

[0080] Then, in step S430, the text classification model is trained using the training samples until a training stop condition is met, wherein the training stop condition includes that the loss function no longer decreases or the test set index reaches the standard or the iteration reaches a preset number of training times.

[0081] As mentioned above, the text classification model may be, for example, a TextCNN model or a BERT model, which may be trained in various ways.

[0082] Back to Figure 2 After the question-and-answer domain is obtained through classification in the aforementioned step S220, in step S230, a prompt is constructed, wherein the prompt includes the request text and the question-and-answer domain to which the request text belongs.

[0083] For example, the user inputs the request text: "What should I do if my X phone has no network?" After classification, it is determined that it belongs to the mobile phone manual question and answer field. Therefore, the following prompt can be constructed: "'What should I do if my X phone has no network' belongs to the mobile phone manual question and answer field, so for this question you can:", which describes the request text input by the user and the question and answer field it belongs to, and "So for this question you can:" is a guiding sentence that guides the LLM to give the corresponding answer.

[0084] In addition, for example, the user inputs the request text: "Find me an online novel", which is classified as belonging to the field of novel question and answer, so the prompt can be constructed as follows: "'Find me an online novel' belongs to the field of novel question and answer, so for this question you can: ".

[0085] In some implementations, the prompts can be reconstructed with the help of Chain of Thought (CoT), so that the LLM can think about the problem step by step and logically when generating answers later, thereby helping the LLM to better understand the task and improve the accuracy of the final generated answer.

[0086] For example, you can first define the problem and clarify the problem or task that needs to be solved, then break down the complex problem into a series of simple subtasks to form a thinking chain, and then write a well-structured and carefully designed prompt based on the thinking chain. The prompt can contain instructions, context, input data, and output indicators, etc., to guide the model to perform specific tasks according to the thinking chain. After receiving the prompt, the LLM will step by step execute each subtask in the thinking chain according to the instructions and context information in the prompt, that is, form a corresponding reasoning path and generate corresponding output. After completing all subtasks, the LLM will integrate the outputs of all subtasks to form the final answer or result.

[0087] It should be understood that multiple thought chains can be constructed in one prompt according to the above method. The prompt constructed in this way can guide the LLM to generate one or more reasoning paths accordingly after being input into the LLM, and at least generate one or more candidate answers accordingly based on the one or more reasoning paths, and determine the final answer from the candidate answers.

[0088] After the prompt is constructed in the aforementioned step S230, in step S240, the prompt is input into a large language model (LLM) to obtain an answer corresponding to the request text.

[0089] The present disclosure does not limit the type, deployment location, etc. of the LLM, as long as it can generate corresponding answers according to the prompts. For example, the LLM can be deployed on the client, client device, server, server device, operating system, various servers or various clouds of any application using the method of the present disclosure. For example, the aforementioned Figure 3 The computing system implements the inference and / or training operations of the LLM.

[0090] In some implementations, when the prompt is constructed with the help of thought chains in the aforementioned step S230, the thought chains can be used to obtain an answer corresponding to the request text. For example, the large language model is used to generate one or more reasoning paths for the prompt, the large language model generates one or more candidate answers for the prompt based at least on the one or more reasoning paths, and then the answer is determined from the one or more candidate answers.

[0091] In some embodiments, the large language model is a fine-tuned large language model. It should be understood that the large language model has been pre-trained before fine-tuning.

[0092] In some embodiments, the fine-tuning sample can be improved by inserting out-of-domain noise data into the fine-tuning sample, thereby further effectively solving the large model hallucination problem. For example, the process of fine-tuning the large language model may include the following: Figure 5The process shown.

[0093] Figure 5 A schematic flow chart of a method for fine-tuning a large language model according to at least one embodiment of the present disclosure is exemplarily shown. For the convenience of description, the following describes the process of improving fine-tuning samples and fine-tuning the LLM using the improved fine-tuning samples, taking multiple rounds of dialogue belonging to the first question-answering field as an example, but it should be understood that the present disclosure is not limited to this. In the actual fine-tuning process, a similar method can be used to generate multiple fine-tuning samples belonging to multiple question-answering fields, or even all the question-answering fields involved in the aforementioned text classification model, and use them to fine-tune the LLM.

[0094] Specifically, if Figure 5 As shown, in step S510, one or more multi-round dialogues belonging to the first question-answering field are obtained.

[0095] For example, one or more multi-round dialogues may be selected from previously generated real dialogue data in various ways.

[0096] For example, we can obtain a multi-round dialogue belonging to the field of mobile phone manual question and answer as follows:

[0097] Q1: What if X's mobile phone has no network? A1: Please check whether the mobile network is turned on.

[0098] Q2: The network is turned on, but there is still no network. A2: Check whether the WIFI is turned on.

[0099] Q3:…A3:…

[0100] Q1 and A1 are the first round of dialogue, Q2 and A2 are the second round of dialogue, and Q3 and A3 are the third round of dialogue.

[0101] There is no limit to the number of rounds of the selected multi-round dialogue.

[0102] Then, in step S520, at least one round of noise dialogue is inserted between two adjacent rounds of dialogue in the one or more multi-round dialogues, wherein the at least one round of noise dialogue is a dialogue in a question-and-answer field different from the first question-and-answer field.

[0103] For example, in the multi-round dialogue example in the mobile phone manual question-answering field in the previous step, a dialogue in the novel question-answering field can be inserted between two adjacent dialogue rounds as a noise dialogue. The final fine-tuning sample example is as follows:

[0104] Q1: What if X's mobile phone has no network? A1: Please check whether the mobile network is turned on.

[0105] Q2: Recommend me an online novel. A2: "XX World"

[0106] Q3: The network is turned on, but there is still no network. A3: Check whether the WIFI is turned on.

[0107] Q4:…A4:…

[0108] A round of noise dialogue is inserted between the original first round of dialogue and the second round of dialogue, namely the currently numbered Q2 and A2.

[0109] There is no limit to the number of rounds of the inserted noise dialogue, and for example, it can be determined randomly, or can be fixed to 1 round or 2 rounds, or can be determined by a specific ratio or a specific ratio range of the number of rounds of the original multi-round dialogue.

[0110] There is no restriction on the position where the noise dialogue is inserted, for example, it can be determined randomly, and there is no restriction on the number of rounds of noise dialogue that can be inserted at the same position, for example, it can also be determined randomly.

[0111] In the case of inserting multiple rounds of noise dialogues, the multiple rounds of noise dialogues may belong to the same or different question-answering domains. For example, the multiple rounds of noise dialogues may be randomly determined, and thus the question-answering domains to which they belong are also random.

[0112] In some implementations, the two adjacent rounds of dialogue between which the noise dialogue is inserted are two adjacent rounds of dialogue randomly selected from the one or more multiple rounds of dialogue.

[0113] In some embodiments, the aforementioned inserted at least one round of noise conversation is randomly selected from conversations in a question-and-answer field different from the first question-and-answer field. For example, the number of rounds may be randomly selected, the question-and-answer field may be randomly selected, and / or may be randomly selected from multiple noise conversations.

[0114] In other implementations, the inserted noisy conversation may be correlated with the two adjacent rounds of conversation between which the noisy conversation is inserted, thereby further effectively eliminating the LLM illusion problem.

[0115] For example, the correlations may include:

[0116] The noise conversation contains an entity that is the same as or similar to an entity in at least one of the two adjacent conversation rounds; or

[0117] A slot in the noise conversation is similar to an entity in at least one of the two adjacent conversations; or

[0118] An entity in the noise conversation is similar to a slot in at least one of the two adjacent conversations; or

[0119] The similarity between the noise dialogue and at least one of the two adjacent dialogues exceeds a threshold; or

[0120] In a predetermined group of noise conversations, the noise conversation has the highest similarity to at least one of the two adjacent conversations.

[0121] The aforementioned “similarity” between entities or between an entity and a slot may refer to the similarity between the two in terms of semantics, for example, the similarity between the two in terms of semantics exceeds a certain threshold. For example, various methods may be used to convert two entities or an entity and a slot into vector representations, and then the cosine similarity between the two vectors may be calculated, and whether the two are similar may be determined by comparing the cosine similarity with a threshold.

[0122] Similar entities or slots of each entity or slot can be obtained in advance, and after determining the aforementioned two adjacent rounds of dialogue, a dialogue containing an entity / slot that is identical or similar to an entity / slot in at least one of the two adjacent rounds of dialogue can be searched in other question-and-answer fields as the aforementioned noise dialogue.

[0123] For example, in the aforementioned fine-tuning sample example, the inserted noise dialogue includes the entity "network", which is the same as the entity "network" contained in A1 in the previous round of dialogue and Q3 in the next round of dialogue, and is therefore relevant to the two adjacent rounds of dialogue between which it is inserted.

[0124] The similarity between the two aforementioned conversations may include lexical similarity and / or semantic similarity, etc., and the similarity may be calculated using various methods (such as word frequency statistics, various deep learning models, etc.).

[0125] The aforementioned predetermined set of noise dialogues may belong to the same or different question-answering fields.

[0126] In some cases where multiple rounds of noise conversations are inserted at the same position, it is sufficient as long as at least one round of noise conversation among the multiple rounds of noise conversations is correlated with the two adjacent rounds of conversations between which the noise conversations are inserted.

[0127] Then, in step S530, one or more multi-round conversations into which the at least one round of noise conversation is inserted are used as fine-tuning samples to fine-tune the large language model until a fine-tuning stop condition is met, wherein the fine-tuning stop condition includes that the loss function no longer decreases or the test set indicator meets the standard or the iteration reaches a preset number of fine-tuning times.

[0128] Various fine-tuning techniques can be used to fine-tune the large language model. For example, the large language model can be fine-tuned using LoRA (Low-Rank Adaptation) or QLoRA (Quantized Low-Rank Adaptation) technology. When using LoRA or QLoRA for fine-tuning, all parameters of the base model (i.e., the LLM before fine-tuning) can be frozen, and a small matrix can be trained in parallel with the native transformer parameter matrix to adapt the fine-tuning data. The KQV (Key, Query, Value) matrices can all be fine-tuned using LoRA or QLoRA. LoRA or QLoRA technology greatly reduces the number of trainable parameters in the fine-tuning process through low-rank decomposition, significantly reduces the computational and storage costs of model fine-tuning, and improves the generalization of the model. By limiting the complexity of the model, it helps to prevent overfitting in scenarios with limited training data.

[0129] You can use all the fine-tuning samples to train for one epoch and then observe the model effect (for example, use the test set to calculate the corresponding indicators). If the fit is not good (for example, the test set indicators do not meet the standards), you can increase the number of iterations appropriately until, for example, the test set indicators meet the standards or the iterations reach the preset number of fine-tuning times (that is, the preset number of iterations).

[0130] As mentioned above, the fine-tuned LLM can be deployed on the client, client device, server, server device, operating system, various servers or various clouds of any application using the method of the present disclosure, and then used to generate a response corresponding to the request text in step S240 of the method of the present disclosure.

[0131] Therefore, by using a text classification model in the reasoning process of LLM and inserting out-of-domain noise samples into the fine-tuning samples during the fine-tuning process, the hallucination problem of LLM, especially the domain hallucination problem, is effectively solved.

[0132] In some embodiments, the aforementioned Figure 2Each step in the method and other optional steps are executed by the client of any application using the method of the present disclosure, wherein the question and answer domain to which the request text in step S220 belongs can be obtained by classification by a text classification model deployed on the client or by the client calling a text classification model deployed locally (i.e., deployed on the client device) or remotely deployed (e.g., deployed in the cloud), or can be received from a server that provides background services for the application, for example, the client sends the request text to the server, and then the text classification model deployed on the server or the server calls a text classification model deployed locally (i.e., deployed on the server device) or remotely deployed (e.g., deployed in the cloud) to classify and obtain the question and answer domain, and return the question and answer domain to the client. In addition, the answer corresponding to the request text in step S240 can be generated by the big language model deployed on the client or by the client calling a big language model that is locally deployed (i.e., deployed on the client device) or remotely deployed (e.g., deployed in the cloud), or it can be received from a server that provides background services for the application, for example, the client sends the constructed prompt to the server, and then the big language model deployed on the server or the server calls a big language model that is locally deployed (i.e., deployed on the server device) or remotely deployed (e.g., deployed in the cloud) to generate a corresponding answer based on the input of the prompt, and return the generated answer to the client.

[0133] In other embodiments, the aforementioned Figure 2 Each step in the method and other optional steps are executed by an operating system using the method of the present disclosure, wherein the question and answer field to which the request text in step S220 belongs can be obtained by classification by a text classification model deployed on the operating system or by the operating system calling a text classification model that is remotely deployed (for example, deployed on a server or cloud). In addition, the answer corresponding to the request text in step S240 can be generated by a large language model deployed on the operating system or by the operating system calling a large language model that is remotely deployed (for example, deployed on a server or cloud).

[0134] The present disclosure may also be implemented as a conversation device. Figure 6 The figure exemplarily shows a schematic diagram of the composition of a dialogue device according to at least one embodiment of the present disclosure.

[0135] like Figure 6 As shown, the dialogue device 600 includes a receiving unit 610 , a classification unit 620 , a construction unit 630 and a reply unit 640 .

[0136] Specifically, the receiving unit 610 is used to receive a request text.

[0137] The classification unit 620 is used to classify the request text using a text classification model to obtain the question-answering field to which the request text belongs.

[0138] The constructing unit 630 is used to construct a prompt, wherein the prompt includes the request text and the question-answering field to which the request text belongs.

[0139] The reply unit 640 is used to input the prompt into a large language model to obtain a reply corresponding to the request text.

[0140] The various details or variations of the operations of the above-mentioned units can be referred to in conjunction with Figure 2-5 The contents described will not be repeated here.

[0141] Figure 7 A schematic diagram of the structure of a computing device that can be used to implement the above-mentioned method for conducting a conversation according to at least one embodiment of the present disclosure is shown.

[0142] See also Figure 7 , the computing device 700 includes a memory 710 and a processor 720 .

[0143] The processor 720 may be a multi-core processor or may include multiple processors. In some embodiments, the processor 720 may include a general-purpose main processor and one or more special coprocessors, such as a graphics processing unit (GPU), a digital signal processor (DSP), etc. In some embodiments, the processor 720 may be implemented using a customized circuit, such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA).

[0144] The memory 710 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 720 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 710 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 710 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0145] The memory 710 stores executable codes, and when the executable codes are processed by the processor 720 , the processor 720 can execute the method for conducting a conversation mentioned above.

[0146] In addition, the method according to the present disclosure may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing the above steps defined in the above method of the present disclosure.

[0147] Alternatively, the present disclosure may also be implemented as a non-temporary machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) on which executable code (or computer program, or computer instruction code) is stored. When the executable code (or computer program, or computer instruction code) is executed by a processor of an electronic device (or computing device, server, etc.), the processor executes the various steps of the above-mentioned method according to the present disclosure.

[0148] Those skilled in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or a combination of both.

[0149] The flow charts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the system and method according to multiple embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0150] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for conducting a conversation, comprising: Receive request text; Classify the request text using a text classification model to obtain the question-answering field to which the request text belongs; Constructing a prompt, wherein the prompt includes the request text and the question-answering domain to which the request text belongs; as well as The prompt is input into a large language model to obtain an answer corresponding to the request text.

2. The method according to claim 1, wherein: The large language model is a fine-tuned large language model. The process of fine-tuning a large language model involves: Obtain one or more multi-round dialogues belonging to the first question-answering domain; inserting at least one round of noise dialogue between two adjacent rounds of dialogue in the one or more multi-round dialogues, wherein the at least one round of noise dialogue is a dialogue in a question-and-answer field different from the first question-and-answer field; and Using one or more multi-round conversations into which the at least one round of noise conversation is inserted as fine-tuning samples, the large language model is fine-tuned until a fine-tuning stop condition is met, wherein the fine-tuning stop condition includes that the loss function no longer decreases, or the test set indicator meets the standard, or the iteration reaches a preset number of fine-tuning times.

3. The method according to claim 2, wherein: The two adjacent rounds of dialogue are two adjacent rounds of dialogue randomly selected from the one or more multiple rounds of dialogue; The at least one round of noise dialogue is randomly selected from dialogues in a question-and-answer field different from the first question-and-answer field.

4. The method according to claim 2, wherein: The noise dialogue is correlated with the two adjacent dialogues. The correlations include: The noise conversation contains an entity that is the same as or similar to an entity in at least one of the two adjacent conversation rounds; or A slot in the noise conversation is similar to an entity in at least one of the two adjacent conversations; or An entity in the noise conversation is similar to a slot in at least one of the two adjacent conversations; or The similarity between the noise dialogue and at least one of the two adjacent dialogues exceeds a threshold; or In a predetermined group of noise conversations, the noise conversation has the highest similarity to at least one of the two adjacent conversations.

5. The method according to claim 1, wherein: The training process of the text classification model includes: Predefine multiple question and answer areas; Annotate multiple dialogues as training samples according to the predefined multiple question-answering fields; The text classification model is trained using the training samples until a training stop condition is met, wherein the training stop condition includes that the loss function no longer decreases or the test set index reaches a standard or the iteration reaches a preset number of training times.

6. The method according to claim 1, wherein: Inputting the prompt into a large language model to obtain an answer corresponding to the request text includes: generating one or more reasoning paths for the prompt using the large language model; generating one or more candidate answers for the prompt based at least on the one or more reasoning paths by the large language model; The answer is determined from the one or more candidate answers.

7. A conversation device, comprising: A receiving unit, used for receiving a request text; A classification unit, used to classify the request text using a text classification model to obtain the question-answering field to which the request text belongs; A construction unit, configured to construct a prompt, wherein the prompt includes the request text and the question-answering field to which the request text belongs; as well as The reply unit is used to input the prompt into a large language model to obtain a reply corresponding to the request text.

8. A computing device comprising: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 6.

9. A non-transitory machine-readable storage medium having executable codes stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 6.

10. A computer program product, comprising executable codes, which, when executed by a processor of an electronic device, causes the processor to perform the method according to any one of claims 1 to 6.