Interaction method based on large model, method for training large model and intelligent agent

By introducing semantic risk detection and target expert networks into large models, the problems of semantic understanding illusion and illegal output in multimodal large models when processing images and videos are solved, thereby improving compliance and fluency and reducing the waste of computing resources.

CN121958499APending Publication Date: 2026-05-01BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAIDU NETCOM SCI & TECH CO LTD
Filing Date
2026-01-22
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

When processing data such as images and videos, multimodal large models are prone to semantic understanding illusions due to visual defects, resulting in the output of sensitive words and other illegal information. Existing review methods lead to a waste of computing resources or defective output content, making it difficult to meet user needs.

Method used

By introducing semantic risk detection into a large model, using a target expert network that matches the risk detection results to perform the target task, and selecting an appropriate model strategy to generate compliant response text, the risk of semantic violations is reduced and the semantic fluency of the output is improved.

Benefits of technology

It reduces the risk of semantic violations in multimodal large models, reduces computational overhead, improves the semantic compliance and fluency of response text, and meets user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121958499A_ABST
    Figure CN121958499A_ABST
Patent Text Reader

Abstract

The invention provides an interaction method based on a large model, a method for training the large model and an intelligent agent, and relates to the technical field of artificial intelligence, in particular to the technical field of large models, intelligent medical treatment, computer vision, intelligent transportation and the like. The interaction method based on the large model comprises the steps of receiving input information of a target object; the large model is used for executing a target task according to the input information, a reply text is generated, the large model conducts semantic risk detection on semantic features related to the input information, a risk detection result is obtained, and the risk detection result represents semantic violation risks related to the reply text; executing the target task according to the semantic features by using a target expert network matched with the risk detection result in the large model; and pushing the reply text to the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Interaction methods based on large models, methods for training large models, and intelligent agents Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, particularly to the fields of large-scale models, smart healthcare, computer vision, and intelligent transportation. Background Technology

[0002] With the rapid development of artificial intelligence technology, the powerful multimodal data understanding capabilities of multimodal large models can be used to accurately generate descriptive information for multimodal data such as images, videos, and text, in order to meet the diverse needs of users. Summary of the Invention

[0003] This disclosure provides an interaction method based on a large model, a method for training a large model, and an intelligent agent.

[0004] According to one aspect of this disclosure, a large-scale model-based interaction method is provided, comprising: receiving input information from a target object; using the large-scale model to perform a target task based on the input information and generating a response text, wherein the large-scale model performs semantic risk detection on semantic features related to the input information to obtain a risk detection result, the risk detection result representing the semantic violation risk related to the response text; using a target expert network in the large-scale model that matches the risk detection result to perform the target task based on the semantic features; and pushing the response text to the target object.

[0005] According to another aspect of this disclosure, a method for training a large model is provided, comprising: receiving sample input information and labeled response text, wherein the labeled response text matches the demand intent represented by the input information and satisfies semantic compliance conditions; using the large model to perform a target task based on the sample input information to generate sample response text, wherein the large model performs semantic risk detection on the sample semantic features related to the sample input information to obtain a sample risk detection result, the sample risk detection result representing the semantic violation risk related to the sample response text; using a target expert network in the large model that matches the sample risk detection result to perform the target task based on the sample semantic features; and training the large model based on the difference between the labeled response text and the sample response text to obtain a trained large model.

[0006] According to another aspect of this disclosure, a large-model-based interactive device is provided, comprising: a first receiving module for receiving input information from a target object; a response text obtaining module for using the large model to perform a target task based on the input information and generate response text, wherein the large model performs semantic risk detection on semantic features related to the input information to obtain risk detection results, the risk detection results characterizing semantic violation risks related to the response text, and uses a target expert network in the large model that matches the risk detection results to perform the target task based on semantic features; and a push module for pushing the response text to the target object.

[0007] According to another aspect of this disclosure, an apparatus for training a large model is provided, comprising: a second receiving module for receiving sample input information and labeled response text, wherein the labeled response text matches the demand intent represented by the input information and satisfies semantic compliance conditions; a sample response text obtaining module for generating sample response text by performing a target task based on the sample input information using the large model, wherein the large model performs semantic risk detection on the sample semantic features related to the sample input information to obtain a sample risk detection result, the sample risk detection result representing the semantic violation risk related to the sample response text, and performs the target task based on the sample semantic features using a target expert network in the large model that matches the sample risk detection result; and a training module for training the large model based on the difference between the labeled response text and the sample response text to obtain a trained large model.

[0008] According to another aspect of this disclosure, an artificial intelligence agent is provided, comprising: an input module for receiving input information; a processing module for determining a target task based on the input information received by the input module, determining a large model based on the target task, and obtaining output information by calling the large model to execute the method provided in the embodiments of this disclosure; and an output module for outputting the output information obtained by the processing module.

[0009] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method provided according to an embodiment of this disclosure.

[0010] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform a method provided according to an embodiment of this disclosure.

[0011] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to embodiments of this disclosure.

[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0013] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0014] Figure 1 schematically illustrates an exemplary system architecture for applying large-model-based interaction methods and apparatus according to embodiments of the present disclosure.

[0015] Figure 2 schematically illustrates a flowchart of a large-model-based interaction method according to an embodiment of the present disclosure.

[0016] Figure 3 schematically illustrates the principle of a large-model-based interaction method according to an embodiment of the present disclosure.

[0017] Figure 4 schematically illustrates a flowchart of a method for training a large model according to an embodiment of the present disclosure.

[0018] Figure 5 schematically illustrates the initial large model and the principle diagram of the large model according to an embodiment of the present disclosure.

[0019] Figure 6 schematically illustrates a block diagram of a large-model-based interactive device according to an embodiment of the present disclosure.

[0020] Figure 7 schematically illustrates a block diagram of an apparatus for training a large model according to an embodiment of the present disclosure.

[0021] Figure 8 schematically illustrates a structural block diagram of an artificial intelligence agent according to an embodiment of the present disclosure.

[0022] Figure 9 shows a schematic block diagram of an example electronic device that can be used to implement embodiments of the present disclosure, including a large model-based interaction method and a method for training a large model. Detailed Implementation

[0023] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0024] In the technical solution disclosed herein, the acquisition, storage, and application of user personal information comply with the provisions of relevant laws and regulations, necessary confidentiality measures have been taken, and there is no violation of public order and good morals.

[0025] The inventors discovered that when processing image and video data using multimodal large-scale models, visual defects such as image blurring can cause semantic illusions in the large-scale models, potentially leading to the output of sensitive words or other prohibited information. Methods that involve reviewing the output of large-scale models for violations would waste computational resources by having the large model re-execute generative tasks, or directly replacing sensitive words or other prohibited information would result in defects in the fluency and semantic logic of the output, failing to meet the actual needs of users.

[0026] Embodiments of this disclosure provide a large-model-based interaction method, a method for training the large-model, and an intelligent agent. The large-model-based interaction method includes: receiving input information from a target object; using the large-model to perform a target task based on the input information and generating a response text, wherein the large-model performs semantic risk detection on semantic features related to the input information to obtain risk detection results, the risk detection results representing semantic violation risks related to the response text; using a target expert network in the large-model that matches the risk detection results to perform the target task based on semantic features; and pushing the response text to the target object.

[0027] According to embodiments of this disclosure, during the execution of a target task by a large model, semantic risk detection is performed on the semantic features generated in the target task. A target expert network matching the risk detection results is then used to execute the target task based on the semantic features. This allows for the selection of a target expert network appropriate to the risk level to execute subsequent target generation tasks, leveraging semantic violation risk. The target expert network can accurately adjust the semantics of the text in the response text generated by the target task based on the semantic violation risk corresponding to the semantic features. This ensures that the response text output by the large model meets semantic compliance requirements, reduces semantic violation risk, and minimizes computational overhead caused by repeated execution of the target task by the large model. Simultaneously, the semantic understanding capabilities of the large model improve the semantic fluency and clarity of the response text, avoiding the substitution or masking of sensitive information that reduces semantic fluency and meets the user's actual needs.

[0028] Figure 1 schematically illustrates an exemplary system architecture for applying large-model-based interaction methods and apparatus according to embodiments of the present disclosure.

[0029] It should be noted that Figure 1 is merely an example of a system architecture that can be applied to the embodiments of this disclosure, to help those skilled in the art understand the technical content of this disclosure, but does not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments, or scenarios. For example, in another embodiment, an exemplary system architecture that can be applied to the large model-based interaction method and apparatus may include a terminal device, but the terminal device may implement the large model-based interaction method and apparatus provided by the embodiments of this disclosure without interacting with the server.

[0030] As shown in Figure 1, the system architecture 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.

[0031] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as knowledge reading applications, web browser applications, search applications, instant messaging tools, email clients, and / or social platform software, etc. (for example only).

[0032] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0033] Server 105 can be a server that provides various services, such as a backend management server that supports the content browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.

[0034] It should be noted that the large-model-based interaction method provided in this disclosure can generally be executed by the first terminal device 101, the second terminal device 102, or the third terminal device 103. Correspondingly, the large-model-based interaction device provided in this disclosure can also be disposed in the first terminal device 101, the second terminal device 102, or the third terminal device 103.

[0035] Alternatively, the large-model-based interaction method provided in this embodiment can generally be executed by server 105. Correspondingly, the large-model-based interaction device provided in this embodiment can generally be located in server 105. The large-model-based interaction method provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the large-model-based interaction device provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.

[0036] It should be understood that the number of terminal devices, networks, and servers shown in Figure 1 is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0037] Figure 2 schematically illustrates a flowchart of a large-model-based interaction method according to an embodiment of the present disclosure.

[0038] As shown in Figure 2, the interaction method based on the large model includes operations S210~S230.

[0039] In operation S210, input information from the target object is received.

[0040] When operating S220, the large model is used to perform the target task based on the input information and generate the response text.

[0041] In operation S230, a reply text is pushed to the target object.

[0042] According to embodiments of this disclosure, the input information can be data of any modality, such as images, text, audio, and video. Embodiments of this disclosure do not limit the modal type of the input information.

[0043] According to embodiments of this disclosure, the large model can be a Multimodal Large Language Model (MLLM) for processing multimodal information. The large model can perform semantic understanding of the input information based on a large number of model parameters to perform a target task and output response text that matches the intended demand represented by the input information.

[0044] According to embodiments of this disclosure, a large model performs semantic risk detection on semantic features related to the input information to obtain risk detection results. The risk detection results characterize the semantic violation risks related to the response text, and a target expert network in the large model that matches the risk detection results performs the target task based on the semantic features.

[0045] For example, the risk detection module in a large model can determine the degree of similarity between the semantic content represented by the semantic features and the preset violation semantics by performing semantic understanding on the semantic features, thereby determining the risk detection result corresponding to the semantic features.

[0046] It should be noted that semantic features can be determined by feature extraction from input information of any modality, or by semantic fusion of input information from multiple modalities. Semantic features can represent the semantic attributes of data from any modality, such as visual semantics, textual semantics, and semantic style semantics.

[0047] In some embodiments, the large model may include multiple expert networks, each corresponding to a set of preset risk detection results. For example, the multiple expert networks may correspond to high-risk, medium-risk, and low-risk levels in the preset risk detection results, respectively. A first expert network processes the semantic features corresponding to the high-risk level, enabling it to perform the target task based on a more conservative text generation strategy, resulting in semantically conservative and compliant text content. A second expert network processes the semantic features corresponding to the medium-risk level, performing the target task based on the model strategy corresponding to the medium-risk level. A third expert network processes the semantic features corresponding to the low-risk level, performing the target task based on the model strategy corresponding to the low-risk level, making the output response text more vivid and emotionally resonant, thus improving the text quality of the response text.

[0048] According to embodiments of this disclosure, expert large models can be constructed based on any type of deep learning algorithm, and embodiments of this application do not limit the type and number of algorithms used to construct expert networks.

[0049] In some embodiments, the input information includes a target image and a demand text representing the intention to demand the target image. The semantic features include visual semantic features related to the target image and textual semantic features related to the demand text.

[0050] For example, the target image can be an image representing any scene, such as a health check image, a video frame sequence, or a road shot image, while the requirement text can represent the intention to identify or describe objects such as vehicles, buildings, and people in the target image.

[0051] According to embodiments of this disclosure, visual semantic features and textual semantic features can be obtained by extracting features from the target image and the required text, respectively. For example, feature embedding networks can be used to extract features from the target image and the required text to obtain visual semantic features and textual semantic features. Alternatively, multiple neural network layers of a large model can be used to perform cross-modal semantic fusion on the target image and the required text, and a text generation task can be performed to obtain the fused visual semantic features and textual semantic features. Both visual semantic features and textual semantic features incorporate the visual semantics of the target image and the textual semantics of the required text.

[0052] It should be noted that the acquisition of any data involved in the embodiments of this disclosure, including but not limited to target images and requirement text, is conducted with the authorization of relevant personnel or organizations. Furthermore, the purpose of the acquired information is communicated to the relevant personnel or organizations before acquisition, ensuring the accurate provision of compliant response information. Necessary encryption measures are employed during information processing to prevent information leakage.

[0053] In some embodiments, the risk detection result includes a specified high-risk level, and the target expert network corresponding to the specified high-risk level performs a target task based on semantic features to output a response word that satisfies a first requirement condition. The first requirement condition represents that at least one response word is based on fuzzy semantic modification of the specified object described in the response text.

[0054] In some examples, the target expert network corresponding to a specified high-risk level is the first target expert network among multiple expert networks. This first target expert network can be trained on training corpora containing text with conservative linguistic styles and ambiguous semantic modifications. Therefore, the target task can be performed based on the first target expert network learning relatively conservative and ambiguous semantic content. This prevents the output response from being affected by the ambiguous visual and textual semantics of the input information, thus avoiding multimodal hallucinations. Consequently, the response text output by the first target expert network, based on ambiguous semantic modifications, can describe the target image, requirement text, audio data, and other specified objects related to the input information. This reduces the risk of semantic violations in the output response text of the large model due to model hallucinations, improves the semantic compliance accuracy of the response text, and reduces the computational waste caused by repeatedly performing the target task on the large model.

[0055] In one comparative example of this application, the input information includes road surveillance images. Due to factors such as sunlight, the areas of people in the road surveillance images are relatively blurry. When the large model processes the road surveillance images, it may identify a person carrying a guitar on the road as carrying dangerous items due to the blurred visual semantics.

[0056] The large-model-based interaction method provided according to embodiments of this disclosure can extract semantic features from road monitoring images in the input information. Risk detection results obtained by performing risk detection on the semantic features characterize a specified high-risk level. A first target expert network corresponding to the specified high-risk level is used to perform a target task based on the semantic features, and the output response text can be: "The person in the road may be abnormal and requires attention." Therefore, "may" can be used as a vague semantic modifier for the person in the response text to avoid model illusions caused by the large model leading to insufficient judgment based on real visual evidence in the image, resulting in semantically non-compliant text output, thus improving the compliance and semantic fluency of the response text.

[0057] According to embodiments of this disclosure, the risk detection result includes a specified low-risk level, and the target expert network corresponding to the specified low-risk level performs a target task based on semantic features and outputs a response word that meets a second requirement condition. The second requirement condition indicates that at least one response word is expressed in natural language based on sentiment expression words.

[0058] In some embodiments, the target expert network corresponding to the specified low-risk level can be a second target expert network among multiple expert networks. The second target expert network can be trained on training corpora with vivid language styles. For example, the second target expert network can be trained on training corpora with emotional rhetoric such as metaphors, so that the second target expert network can perform target tasks for semantic features with low semantic violation risk, and enable the response words corresponding to the semantic features to express natural language based on emotional expressions, thereby improving the vividness and flexibility of the response text and improving the quality of the response text.

[0059] In some embodiments, the large model includes a first execution network and multiple expert networks. The large model performs the target task based on the following operations: using the first execution network to perform semantic understanding on the input information to obtain semantic features corresponding to the response word to be determined in the response text; determining the risk detection result related to the response word to be determined based on the label probability distribution determined based on the semantic features; and processing the semantic features according to the target expert network among the multiple expert networks that matches the risk detection result to obtain the response word in the response text.

[0060] According to embodiments of this disclosure, the first execution network can be a network layer in a large model used for semantic understanding of multimodal input information and execution of target tasks. For example, the first execution network can perform visual semantic and textual semantic understanding by semantic fusion of multimodal semantics in the input information, and perform text word generation tasks by referring to the knowledge content of the knowledge base based on the first execution network, so that semantic features can represent response text words that can meet the needs and intentions of the target object when the multimodal semantics of the input information are fused.

[0061] In some embodiments, the token probability distribution determined based on semantic features may include processing the semantic features using a regression algorithm, so that the token probability distribution represents the selection probability of each of the multiple candidate tokens. For example, multiple candidate tokens each represent candidate words in a preset vocabulary. By using a regression algorithm to calculate the probability of the semantic features, the selection probabilities corresponding to the multiple candidate tokens can be obtained as the token probability distribution corresponding to the semantic features.

[0062] In some embodiments, determining the risk detection result related to the response word to be determined based on the labeled probability distribution may include determining the initial response word representing semantic features based on the labeled probability distribution. The text composed of the response word in the already generated response text and the initial response word is then used to determine whether it matches a preset violation word. The risk detection result is determined based on the matching degree with the preset violation word. Thus, the degree of semantic violation risk of the output response word can be judged based on the hidden features generated by the large model performing the target task. A target expert network matching the risk detection result can then be invoked to perform subsequent target tasks. This allows for semantic intervention of the response word before it is output to the large model, reducing the semantic violation risk of the response word and mitigating the risk of outputting violation text due to model illusion caused by the large model. By fine-grained control over the semantic violation risk of the response word, the fluency and logical coherence of the response text are improved, thereby enhancing the quality of the response text.

[0063] In some embodiments, the input information includes a target image. For example, the target image may be a physical examination image, and the response text may be supplementary descriptive text describing the examination results based on the physical examination image.

[0064] In some embodiments, determining the risk detection result related to the response word to be determined based on the label probability distribution determined based on semantic features may include: determining the initial response word corresponding to the semantic features based on the label probability distribution determined based on semantic features; performing semantic matching between the initial response word and the regional visual semantic features of at least one image region in the target image to obtain the semantic matching degree; and determining the risk detection result corresponding to the semantic features based on the semantic matching degree.

[0065] According to embodiments of this disclosure, semantic matching degree characterizes the degree of model illusion experienced by a large model during the execution of a target task. Image regions in the target image can represent objects such as buildings, people, and clothing. Semantic matching degree represents the similarity between the visual semantic features of the region and the textual semantics of the initial response word. A low semantic matching degree can be understood as the large model misinterpreting the image region during the execution of the target task, easily leading to model illusion due to misunderstandings of the region's visual semantic features.

[0066] In some embodiments, semantic matching degree can be represented based on semantic matching values. When the semantic matching values ​​corresponding to multiple image regions are all below a preset threshold, it can be understood that the semantic features lack evidence supporting the visual semantics in the target image, and are prone to model illusion. Therefore, it can be determined that...

[0067] In some embodiments, the highest semantic matching degree can be determined as the target matching degree from multiple semantic matching degrees corresponding to multiple image regions. The risk detection result is determined based on the comparison between the target matching degree and a preset matching degree threshold.

[0068] For example, if the target matching degree is greater than a first preset matching degree threshold, the risk detection result can be determined to represent a low-risk level; if the target matching degree is less than the first preset matching degree threshold but greater than a second preset matching degree threshold, the risk detection result can be determined to represent a medium-risk level; and if the target matching degree is less than the second preset matching degree threshold, the risk detection result can be determined to represent a high-risk level.

[0069] In one example, the textual semantic features corresponding to the initial response word can be matched with multiple region visual semantic features, resulting in multiple initial semantic matching scores. An initial semantic matching score can be expressed as the ratio between semantic similarity and average semantic similarity. Semantic similarity is the similarity between the textual semantic features corresponding to the initial response word and the region visual semantic features, while average semantic similarity is the average of the similarities between the textual semantic features corresponding to the initial response word and the individual visual semantic features of multiple regions. Therefore, the highest initial semantic matching score can be determined from these multiple initial semantic matching scores as the semantic matching score corresponding to the initial response word. A higher semantic matching score indicates a higher visual semantic similarity between the initial response word and the target image region representation, thus confirming that the initial response word receives visual semantic support from the target image. Conversely, a lower semantic matching score indicates a lower visual semantic similarity between the initial response word and the target image region representation, thus confirming that the initial response word does not receive visual semantic support from the target image, potentially leading to semantic violations due to model illusion caused by the large model.

[0070] In some embodiments, the routing layer of the large model processes risk detection results to determine a target expert network that matches the risk detection results from multiple expert networks. For example, if the risk detection results indicate a high risk level, a first target expert network is determined to process semantic features to perform the target task and generate the corresponding response text. If the risk detection results indicate a medium risk level, semantic features are input into the first and second target expert networks, and the first and second target label probability distributions output by the first and second target expert networks are weighted and fused to obtain the label probability distribution used to determine the response text, and the response text is generated. If the risk detection results indicate a low risk level, a third target expert network is determined to process semantic features to perform the target task and generate the corresponding response text. Thus, the routing layer of the large model can select different target expert networks corresponding to the risk detection results to perform the target task, so that corresponding model strategies can be adopted for semantic features with semantic violation risks based on the hidden features of the target task, preventing semantic violations caused by a consistent model illusion from the source and improving the fluency of the response text.

[0071] In some embodiments, determining the risk detection result corresponding to the semantic features based on the semantic matching degree may include fusing the semantic matching degree and the semantic fuzzy weight to obtain the risk detection result.

[0072] According to embodiments of this disclosure, the semantic fuzziness weight represents the amount of fuzzy response words in the currently determined response text. Fuzzy response words are used to represent semantically ambiguous natural language expressions. The currently determined response text may include response words already output by the large model. Fuzzy response words can be, for example, vague modifiers such as "seems," "maybe," "looks like," or "suspected."

[0073] For example, the large model has already output the currently determined response text "The person in the image may be holding...". The semantic features corresponding to the response word to be determined can represent semantically compliant text words such as "apple" and "orange", or, in the case of model illusion during the large model's execution of the target task, the semantic features can represent semantically non-compliant text words such as "weapon". In the currently determined response text "The person in the image may be holding...", the response word "may be" is a fuzzy response word. The semantic fuzziness weight represents the ratio p between the number of fuzzy response words and the number of response words in the currently determined response text. uncertain The semantic fuzzy weight uc can be, for example, uc = 1 - p. uncertain .

[0074] In some embodiments, fusing semantic matching degree and semantic fuzzy weight may include updating the semantic fuzzy weight based on the semantic fuzzy weight. For example, the risk score can be obtained by fusing semantic matching degree and semantic fuzzy weight based on formula (1).

[0075] (1)

[0076] Here, risk_score represents the risk score, characterizing the risk detection result. uc represents the semantic fuzziness weight, and sv represents the maximum semantic matching degree between the semantic features and the image region. The risk detection result corresponding to the semantic violation risk level can be determined by comparing the risk score with a preset risk score threshold.

[0077] According to embodiments of this disclosure, the semantic fuzziness weight represents the ratio p between the number of characters in the fuzzy response and the number of characters in the currently determined response text. uncertain The higher the level of semantic ambiguity, the lower the weight of semantic ambiguity. This indicates that the generated response text has a high degree of semantic ambiguity and a low risk of semantic violation. The risk of semantic violation is inversely proportional to the proportion of ambiguous response words in the generated response text. The semantic ambiguity weight represents the semantic confidence level and model illusion of the large model during the execution of the target task of determining the response word to be determined.

[0078] For example, the response text currently determined by the large model does not contain any ambiguous response words, such as not using any uncertainty modifiers to describe the execution object in the target image, and its proportion p uncertain =0, the semantic ambiguity weight uc has the largest weight value. This may lead to model illusion due to low semantic matching between semantic features and regional visual semantic features, resulting in incorrect response words and increasing the risk of semantic violations. Therefore, based on the risk detection results determined by the risk score, a first-target expert network corresponding to the specified high-risk level can be selected to perform the target task according to semantic features. This ensures that the output response word maintains contextual semantic consistency, logical coherence, and fluency with the currently determined response text, avoiding semantic violations and improving the compliance and fluency of the response text.

[0079] In some embodiments, determining the risk detection result corresponding to the semantic features based on the semantic matching degree may further include: fusing the semantic matching degree and the target risk weight to obtain the risk detection result.

[0080] According to embodiments of this disclosure, a target risk weight corresponds to target risk information, which is determined by semantically matching the initial response word with multiple preset risk information items. The preset risk weight characterizes the degree of negative impact that the semantic type expressed by the preset risk information will produce.

[0081] For example, based on the content shown in Table 1, the initial response word determined based on semantic features can be semantically matched with example words corresponding to the meanings of multiple risk example words to obtain example word matching results. The preset risk information corresponding to the target example word that matches the initial response word is determined as the target risk information, and the weight value of the target risk weight is determined through the target risk information. For example, if the initial response word matches the name of a prescription drug, the target risk weight can be determined to be 2.0.

[0082] Table 1

[0083]

[0084] In some embodiments, fusing semantic matching degree and target risk weight to obtain risk detection results may include weighted fusion of semantic matching degree based on target risk weight to obtain risk score, and determining risk detection results based on risk score.

[0085] For example, the risk score can be obtained by using formula (2) to represent the fusion semantic matching degree and target risk weight.

[0086] (2).

[0087] Here, risk_score represents the risk score, characterizing the risk detection result. ω_s represents the target risk weight, and sv represents the maximum semantic matching degree between the semantic features and the image region. The risk detection result corresponding to the semantic violation risk level can be determined by comparing the risk score with a preset risk score threshold.

[0088] According to embodiments of this disclosure, the risk detection result can be determined by fusing the target risk weight and semantic matching degree. The degree of negative impact generated by the initial response word represented by semantic features can be used to quantify the semantic violation risk generated by model illusion during the execution of the current target task. Thus, the target task can be executed according to the semantic features based on the target expert network corresponding to the risk detection result, thereby reducing the negative impact caused by the semantic violation risk generated by the response word to be determined. When the risk impact is small, the target task can be executed according to the semantic features through the corresponding target expert network. This can improve the overall text quality of the response text by outputting flexible and vivid response words with emotional modification and metaphor modification, thereby improving the logical coherence and semantic fluency of the response text and enhancing the user's interactive experience by performing semantic violation intervention on the response word at a fine-grained level.

[0089] In some embodiments, fusing semantic matching degree and target risk weight to obtain risk detection results may include: fusing semantic matching degree, target risk weight and semantic fuzziness weight to obtain risk detection results.

[0090] Among them, the semantic fuzziness weight represents the amount of fuzzy reply words in the currently determined reply text. Fuzzy reply words are used to represent semantically fuzzy natural language expressions.

[0091] In one example, the risk score can be obtained by using formula (3) to represent the fusion of semantic matching degree, target risk weight and semantic ambiguity weight.

[0092] (3).

[0093] `risk_score` represents the risk score, characterizing the risk detection result. `ω_s` represents the target risk weight, `sv` represents the maximum semantic matching degree between the semantic features and the image region of the target image, and `uc` is the semantic ambiguity weight. Two thresholds, `τlow` and `τhigh`, are set, for example, `τlow=0.6` and `τhigh=1.2`, and the specified risk level `r` is determined according to the following rules: When `r=2`, if `risk_score ≥ τhigh`, `r=2` is determined, indicating that the risk detection result represents the specified high risk level. When `τlow ≤ risk_score < τhigh`, `r=1` is determined, indicating that the risk detection result represents the specified medium risk level. When `risk_score < τlow`, `r=0` is determined, indicating that the risk detection result represents the specified low risk level.

[0094] Therefore, based on the similarity between the initial response word represented by semantic features and the visual semantics of the region, the degree of negative impact of the target risk information represented by semantic features on the semantic violation risk, and the fuzzy semantic expression in the currently generated response text, the semantic violation risk of the response word to be determined can be comprehensively judged. The model strategy of the target expert network can be determined according to the degree of semantic violation risk to execute the target task. This enables risk intervention on the hidden features in the target task based on the large model, thereby improving the compliance and semantic coherence of the response word.

[0095] In some embodiments, the large model further includes a second execution network. The second execution network can be a network layer used to perform the target task. For example, the second execution network can be constructed based on an attention network algorithm.

[0096] According to embodiments of this disclosure, processing semantic features based on a target expert network that matches the risk detection result among multiple expert networks to obtain the response word in the response text may include: using the target expert network to perform a semantic fusion task on the semantic features according to a risk suppression strategy that matches the risk level represented by the risk detection result to obtain intermediate semantic features; and using a second execution network to generate the response word based on the intermediate semantic features.

[0097] According to embodiments of this disclosure, the risk mitigation strategy corresponding to the target expert network can be represented based on the model parameters of the target expert network.

[0098] In one example, the target expert network can process semantic features based on trained model parameters, and perform semantic fusion on multimodal semantic features according to a risk suppression strategy matched with the risk level to obtain intermediate semantic features. For example, the visual semantic features and textual semantic features represented by the semantic features can be semantically fused based on the model parameters corresponding to the first target expert network to obtain intermediate semantic features. Thus, the first target expert network can be used to perform semantic fusion on semantic features according to a risk suppression strategy matched with the high-risk level to obtain intermediate semantic features.

[0099] According to embodiments of this disclosure, the response word is matched with the semantic requirements corresponding to the risk level.

[0100] In some examples, the semantic requirement conditions corresponding to a specified high-risk level can indicate that the response contains vague modifiers. By performing semantic fusion on the semantic features based on a risk suppression strategy corresponding to the specified high-risk level, intermediate semantic features are obtained. These intermediate semantic features can be sufficiently subject to semantic risk suppression, enabling the second execution network to perform the target task based on these features, resulting in natural language expression based on vague modifiers such as "possibly" and "suspected." Therefore, uncertain words in the response can be used to modify the specified object, avoiding text content corresponding to risk information.

[0101] In some examples, the semantic requirement condition corresponding to a specified low-risk level can indicate that the reply contains low-risk-related sentiment modifiers or other types of pre-defined semantic style text content. By performing semantic fusion on semantic features based on a risk suppression strategy corresponding to the specified low-risk level, intermediate semantic features are obtained. This prevents the intermediate semantic features from being excessively suppressed by semantic risk, allowing the second execution network to perform the target task based on the intermediate semantic features, resulting in natural language expression based on vivid descriptive words such as metaphors and sentiment expressions. Therefore, the reply can enhance the vividness of the reply text through a more vivid language style, improving the vividness and fluency of the reply text while avoiding text content corresponding to risk information.

[0102] According to embodiments of this disclosure, semantic fusion of semantic features through a risk suppression strategy matched to the risk level enables the large model to suppress model illusions regarding the response word to be determined based on the model strategy of the target expert network. Furthermore, it suppresses model illusions based on the semantic violation risk level corresponding to the risk detection result, avoiding negative consequences such as information loss and reduced accuracy in intermediate semantic features due to excessive suppression of model illusions. This allows intermediate semantic features to reduce the semantic violation risk level and maintain semantic coherence and logic with the text content of the currently determined response text. Therefore, by using a second execution network to execute the target task based on the intermediate semantic features, the second execution network can generate response words that satisfy logical coherence and vividness based on intermediate semantic features with lower semantic violation risk levels. This achieves improved textual expression quality of the response text through dynamic risk suppression of hidden features within the large model.

[0103] Figure 3 schematically illustrates the principle of a large-model-based interaction method according to an embodiment of the present disclosure.

[0104] As shown in Figure 3, the large model 300 includes a first execution network, a risk detection layer, a routing layer, a first expert network, a second expert network, a third expert network, and a second execution network. Input information may include a target image and demand text representing the intent to target the image. The first execution network performs semantic understanding on the multimodal input information and the currently determined response word "the person in the image may be" in the response text, fusing the visual semantics of the target image and the textual semantics of the demand text to obtain semantic features. The risk detection layer performs semantic risk detection on the semantic features, obtaining a risk detection result representing a specified high-risk level. The routing layer processes the risk detection result representing the specified high-risk level and selects the first expert network as the target expert network to perform the target task related to the response word 311 to be determined. The first expert network performs semantic fusion on the semantic features based on the risk suppression strategy corresponding to the specified high-risk level, obtaining intermediate semantic features. The second execution network continues to execute the target task based on the intermediate semantic features, obtaining the response word 311 in the response text 310.

[0105] In response text 310, the currently determined response word can be fed into the first execution network. The first execution network can perform semantic fusion on the target image and the required text based on the already generated response words in the response text, outputting the semantic features corresponding to the next position. Thus, multiple expert networks based on a large model can dynamically suppress semantic risks based on the risk detection results corresponding to the currently determined response word, improving the semantic compliance and fluency of response text 310 and enhancing the text quality of the response text.

[0106] In some embodiments, the risk detection layer is constructed based on a lightweight neural network algorithm. This layer processes semantic features, including visual and textual semantics, to quantify the semantic violation risk of the response word to be determined, and quantifies the degree of model illusion by outputting a risk score and risk level identifier. For example, the risk detection layer can output a risk level r∈{0,1,2}, where risk identifiers 0, 1, and 2 represent a low-risk level, a medium-risk level, and a high-risk level, respectively. Thus, based on the risk identifier, the routing layer can input semantic features into the target expert network corresponding to the specified risk level, enabling differentiated execution strategies for semantic violation risk levels without modifying the backbone model parameters of the larger model, thereby improving the semantic compliance of the response word and the semantic fluency of the response text.

[0107] In some embodiments, the first execution network performs semantic fusion based on the visual semantic features of the target image, the textual semantic features of the request text, and the contextual semantic features generated from the dialogue with the target object to obtain semantic features. A shared encoder can be used to encode the textual content and visual information to achieve feature extraction of both textual and visual semantics.

[0108] In some embodiments, the large model-based interaction method can be applied to medical image-assisted diagnosis scenarios. For example, when the large model processes the input medical image and the request text, if the semantic features represent preset high-risk information such as "tumor" or "malignant," and the semantic matching degree does not match the semantics of the lesion-free area in the image, a risk suppression strategy corresponding to the specified high-risk level can be applied to the semantic features based on a first-target expert network. This ensures that the output response text contains ambiguous text such as "there may be a risk of disease, but no obvious space-occupying lesion is seen," thus avoiding the influence of fictitious diagnostic assistance suggestions on the judgment of relevant personnel.

[0109] In some embodiments, the large model-based interaction method can be applied to social media image and text moderation scenarios. For example, when a user uploads a blurry photo of a crowd, the large model's semantic understanding of the blurry photo may easily lead to model illusion, resulting in the output of semantically sensitive information and fictitious information such as "illegal gathering." Based on the large model-based interaction method provided in this disclosure, the large model can identify that the initial response text corresponding to the semantic features lacks visual semantic support from the image region. Therefore, based on a first target expert network, the semantic features are processed using a risk suppression strategy corresponding to a specified high-risk level, so that the output response text contains a vague descriptive phrase such as "it is difficult to confirm the specific scene," thereby avoiding the misidentification of normal images as illegal images and causing serious negative impacts.

[0110] In some embodiments, the large model-based interaction method can be applied to autonomous driving scenarios. For example, if a person in a target image is illuminated by light, the large model may easily interpret it as the semantic content of "pedestrian illegally crossing the road." However, the large model-based interaction method provided in this disclosure can enable the large model to identify that the initial response word corresponding to the semantic features lacks visual semantic support from the image region, thus avoiding the output of descriptive content with obvious errors.

[0111] It should be noted that the interaction method based on a large model provided in this disclosure is not limited to specific application scenarios.

[0112] Based on the above-described interaction method based on large models, embodiments of this disclosure also provide a method for training large models.

[0113] Figure 4 schematically illustrates a flowchart of a method for training a large model according to an embodiment of the present disclosure.

[0114] As shown in Figure 4, the method for training the large model includes operations S410~S430.

[0115] During operation of S410, sample input information and tag response text are received.

[0116] When operating the S420, the large model is used to perform the target task based on the sample input information and generate sample response text.

[0117] In operation S430, a large model is trained based on the difference between the labeled response text and the sample response text, resulting in a trained large model.

[0118] According to embodiments of this disclosure, the tagged response text matches the intended demand represented by the input information and satisfies semantic compliance conditions.

[0119] According to embodiments of this disclosure, a large model performs semantic risk detection on the semantic features of samples related to the sample input information to obtain sample risk detection results. The sample risk detection results characterize the semantic violation risks related to the sample response text. The target expert network in the large model that matches the sample risk detection results performs the target task based on the sample semantic features.

[0120] In some embodiments, sample input information may include multiple sample input information corresponding to different specified risk levels. For example, multimodal historical input information and initial response text of sample objects from historical periods can be collected, and the historical input information and initial response text corresponding to different specified risk levels can be determined by semantically rewriting, manually screening, or manually rewriting the historical input information and initial response text. The historical input information and initial response text corresponding to the specified high-risk level are used as high-risk training samples, the historical input information and initial response text corresponding to the specified low-risk level are used as low-risk training samples, and the historical input information and initial response text corresponding to the specified medium-risk level are used as medium-risk training samples. Thus, multiple expert networks corresponding to the specified high-risk level, specified medium-risk level, and specified low-risk level can be trained in the large model based on the high-risk training samples, medium-risk training samples, and low-risk training samples, respectively, to obtain the trained large model.

[0121] In some embodiments, the initial response text is a semantically non-compliant response text, and the labeled response text in the training samples can be a semantically compliant text obtained by rewriting the initial response text. The initial response text can be used as negative example prompt words in the training samples to improve the semantic principle of the sample response text output by the large model and the semantically non-compliant content in the initial response text.

[0122] In some embodiments, training a large model using the difference between labeled response text and sample response text may include: determining loss information based on the difference between labeled response text and sample response text, and adjusting the model parameters of the large model according to the loss information, so that each expert network of the large model can learn the ability to suppress risk for semantic features of a specified risk level. This enables the expert network of the large model to dynamically adjust the risk suppression strategy for performing the target task according to the degree of semantic violation risk corresponding to the semantic features, thereby improving the compliance and accuracy of the response text.

[0123] It should be noted that the technical terms involved in the method for training a large model in the embodiments of this disclosure, including but not limited to sample input information, sample response text, and large model, have the same or similar meanings as the technical terms involved in the interaction method based on the large model provided in the above embodiments, including but not limited to input information, response text, and large model. The embodiments of this disclosure will not repeat the above.

[0124] The training model determined by the method for training a large model provided in the embodiments of this disclosure can be used in the large model-based interaction methods described above. For example, input information can be processed based on the trained large model to obtain response text. The embodiments of this disclosure will not be described in detail here.

[0125] In some embodiments, training a large model based on the difference between the labeled response text and the sample response text may include: determining target gradient information related to the target expert network based on the difference between the labeled response text and the sample response text; and adjusting the model parameters of the target expert network based on the target gradient information while freezing other model parameters in the large model.

[0126] According to embodiments of this disclosure, the other model parameters are model parameters other than those of the target expert network in the large model.

[0127] For example, a large model includes a first expert network, a second expert network, and a third expert network. By acquiring training samples corresponding to a specified high-risk level, the first execution network, the first expert network, and the second execution network of the large model perform the target task and generate sample response text. The target gradient information is determined by utilizing the difference between the labeled response text in the training samples and the sample response text. This target gradient information is then used to adjust the model parameters of the first expert network. During the adjustment of the first expert network's model parameters, the model parameters of the second and third expert networks are frozen until the target gradient information meets the convergence condition, resulting in the trained first expert network. Therefore, by freezing the model parameters of expert networks that do not participate in the execution of the target task, a large model can be trained to improve the risk suppression ability of expert networks for semantic features corresponding to a specified risk level. Furthermore, the large model can be based on multiple expert networks to use differentiated risk suppression strategies for semantic features corresponding to different specified risk levels to execute the target task. This achieves risk suppression through the hidden space features within the large model, thereby improving the robustness and semantic violation risk suppression ability of the trained large model. It also reduces the degree of model illusion generated by the large model when performing target tasks on multimodal input information such as images, videos, and audio, and improves the semantic fluency and logical coherence of the output response text.

[0128] According to embodiments of this disclosure, the risk detection result includes a specified high-risk level, the large model includes a first target expert network corresponding to the specified high-risk level, and the label response text includes a first label text that matches the specified high-risk level. The first label text is based on fuzzy semantic modification of the specified object described by the label response text.

[0129] In some embodiments, the first target expert network can be a first expert network corresponding to a specified high-risk level, and the first label text can include the label response text from the high-risk training samples corresponding to the specified high-risk level. The first label text can be based on vague textual words such as "may be" or "not clearly seen" to achieve fuzzy semantic modification of the specified objects such as people and vehicles described in the label response text.

[0130] For example, the sample images in the high-risk training samples are road surveillance images with backlighting conditions, and the first label text is "The red car may be an overloaded vehicle." Based on these sample images and the first label text, a first target expert network corresponding to a specified high-risk level can be trained. This network learns to use ambiguous modifiers to describe the specified objects related to the target image when the target image has quality issues such as blurred areas. This avoids the large model making unfounded guesses based on model illusions due to its inability to accurately understand the visual semantics of the target image's regions. This improves the large model's risk suppression ability for the semantic features corresponding to the specified high-risk level, thereby enhancing the robustness of the trained large model and the fluency of the output text.

[0131] In some embodiments, the large model may include a risk detection layer, a routing layer, a first expert network, a second expert network, and a third expert network. Training the large model based on labeled response text may include training the first, second, and third expert networks using high-risk, medium-risk, and low-risk training samples, respectively.

[0132] For example, in the first stage of training a large model based on high-risk training samples, the model parameters of the second and third expert networks are frozen. The first execution network of the large model processes the sample input information of the high-risk training samples and outputs semantic features. The risk detection layer performs semantic risk detection on the semantic features to obtain risk detection results. The routing layer, based on the risk detection results, calls the first expert network to process the semantic features corresponding to the specified high-risk level, performing semantic fusion to obtain intermediate semantic features. The second execution network of the large model executes the target task based on the intermediate semantic features and outputs the sample response text.

[0133] Based on the difference between the sample response text and the first label text, textual difference loss information is determined. Visual alignment loss information is obtained based on the semantic difference between the sample response text and the label descriptors representing the image content in the sample image. The model parameters of other network layers in the large model, excluding the second and third expert networks, are adjusted based on the textual difference loss information and visual alignment loss information until the loss information converges, resulting in the intermediate large model of the first training stage. This intermediate large model of the first training stage can use fuzzy modifiers to describe image content in the input information that has unclear visual semantic representation. This uses uncertainty to modify the actions, behaviors, object types, and other attribute information of the specified object, avoiding model illusions without visual basis, improving the text quality and fluency of the response text, and reducing semantic violations in the response text. High-risk training samples can include multimodal information with high requirements for factual accuracy. For example, high-risk training samples can include medical examination images and image-assisted examination report texts, which serve as input information and label response texts, respectively. For example, high-risk training samples can include news images and their descriptive text, which serve as input information and labeled response text, respectively. This allows for further improvement in the visual consistency detection requirements of the first-objective expert network for semantic features by adding visual alignment loss information. It also enhances the risk suppression capability for semantic features lacking visual evidence, thereby improving the risk suppression capability for semantic features corresponding to a specified high-risk level and ultimately enhancing the semantic compliance of the output response text.

[0134] For example, in the second stage of training a large model based on medium-risk training samples, the model parameters of the first and third expert networks in the intermediate large model corresponding to the first training stage are frozen. The first execution network of the intermediate large model corresponding to the first training stage processes the sample input information of the medium-risk training samples and outputs semantic features. The risk detection layer performs semantic risk detection on the semantic features to obtain the risk detection result. The routing layer calls the second expert network to process the semantic features corresponding to the specified medium-risk level, performing semantic fusion to obtain intermediate semantic features. The second execution network performs the target task based on the intermediate semantic features and outputs sample response text. Thus, the intermediate large model corresponding to the first training stage is trained based on the difference between the sample response text and the labeled response text in the medium-risk training samples. Alternatively, the intermediate large model corresponding to the second training stage can be trained based on visual alignment loss information and text difference loss information to improve the model performance of the large model, resulting in the intermediate large model corresponding to the second training stage.

[0135] For example, in the third stage of training the large model based on low-risk training samples, the model parameters of the first and second expert networks are frozen. The first execution network of the intermediate large model corresponding to the second training stage processes the sample input information of the low-risk training samples and outputs semantic features. The risk detection layer performs semantic risk detection on the semantic features to obtain risk detection results. The routing layer calls the third expert network based on the risk detection results to process the semantic features corresponding to the specified low-risk level, performing semantic fusion to obtain intermediate semantic features. The second execution network of the intermediate large model corresponding to the second training stage executes the target task based on the intermediate semantic features and outputs sample response text. Thus, the large model is trained based on the difference between the sample response text and the labeled response text in the low-risk training samples. The labeled response text in the low-risk training samples can contain emotional descriptive words or text content expressed in natural language using rhetoric such as metaphors. Therefore, by training the third expert network, the large model can output vivid emotional descriptive text for response words with low semantic violation risk, thereby improving the expressive effect of the response text.

[0136] In one example, a reinforcement learning mechanism can be used to detect the semantic diversity of sample response texts output by a third-party expert network. This determines the diversity reward information for the expression methods, and then the intermediate large model corresponding to the second training stage is trained based on the diversity loss information and text difference loss information determined by the diversity reward information, resulting in a trained large model. This allows the trained large model to improve the natural language expression ability of the response text and enhance its vivid descriptive power based on the diversity reward information.

[0137] In some embodiments, the large model to be trained is constructed as follows: multiple adjacent associated network layers are determined from multiple network layers of the initial large model; the embedding positions between the multiple associated network layers are determined, and multiple expert networks are embedded into the embedding positions to obtain the large model.

[0138] According to embodiments of this disclosure, the multiple expert networks include multiple target expert networks corresponding to specified risk levels for each of the multiple risk detection results. The expert networks can be constructed based on any type of algorithm, such as deep learning algorithms like attention network algorithms and multilayer perceptron algorithms. Embodiments of this disclosure do not limit the specific algorithm type used to construct the expert networks.

[0139] In some embodiments, the initial large model can be a basic multimodal large model with multimodal information understanding capabilities. For example, the initial large model can be a licensed multimodal large model such as Large Language and Vision Assistant (LLaVA). It should be noted that the specific name or type of the large model involved in the embodiments of this disclosure can be model parameters or related model information obtained through authorization, and is not intended to specify a particular large model to perform the methods provided in the embodiments of this disclosure.

[0140] Figure 5 schematically illustrates the initial large model and the principle diagram of the large model according to an embodiment of the present disclosure.

[0141] As shown in Figure 5, the initial large model includes a first execution network 510 and a second execution network 520. The first execution network 510 has network layers 1 through 10, and the second execution network has network layers 11 through 20. Adjacent associated network layers may include the 10th and 11th network layers, with the embedding location between the 10th and 11th network layers.

[0142] By embedding the risk detection layer, routing layer, first expert network, second expert network, and third expert network into the embedding position between the 10th and 11th network layers, a large model to be trained can be obtained. This allows for structural improvements to the initial large model with multimodal information understanding capabilities, resulting in a larger model to be trained. This enables targeted training based on the relatively strong multimodal semantic understanding capabilities of the initial large model, improving the training efficiency of the trained large model. Therefore, without modifying the backbone feature fusion network layer of the initial large model, the model parameters of each network layer can be reused to improve the training efficiency of the large model. This allows the trained large model to perform semantic risk suppression based on the hidden features of the large model, enabling security audit intervention during the execution of the target task. It also allows for dynamic perception and intervention based on the risk level of semantic features, improving the fluency of the generated response text.

[0143] Figure 6 schematically illustrates a block diagram of a large-model-based interactive device according to an embodiment of the present disclosure.

[0144] As shown in Figure 6, the interactive device 600 based on a large model includes: a first receiving module 610, a reply text acquisition module 620, and a push module 630.

[0145] The first receiving module 610 is used to receive input information from the target object.

[0146] The response text acquisition module 620 is used to perform the target task based on the input information using a large model to generate response text. The large model performs semantic risk detection on the semantic features related to the input information to obtain risk detection results. The risk detection results represent the semantic violation risks related to the response text. The target expert network in the large model that matches the risk detection results performs the target task based on the semantic features.

[0147] The push module 630 is used to push reply text to the target object.

[0148] According to embodiments of this disclosure, the large model includes a first execution network and multiple expert networks. The large model performs the target task based on the following operations: using the first execution network to perform semantic understanding on the input information to obtain semantic features corresponding to the response character to be determined in the response text; determining the risk detection result related to the response character to be determined based on the label probability distribution determined based on the semantic features, where the label probability distribution represents the selection probability of each of the multiple candidate character labels; and processing the semantic features according to the target expert network among the multiple expert networks that matches the risk detection result to obtain the response character in the response text.

[0149] According to embodiments of this disclosure, the input information includes a target image; determining a risk detection result related to the response word to be determined based on a label probability distribution determined based on semantic features includes: determining an initial response word corresponding to the semantic features based on the label probability distribution determined based on semantic features; semantically matching the initial response word with the regional visual semantic features of at least one image region in the target image to obtain a semantic matching degree, wherein the semantic matching degree characterizes the degree of model illusion of the large model in the process of performing the target task; and determining a risk detection result corresponding to the semantic features based on the semantic matching degree.

[0150] According to embodiments of this disclosure, determining a risk detection result corresponding to a semantic feature based on the semantic matching degree includes: fusing the semantic matching degree and the target risk weight to obtain a risk detection result, wherein the target risk weight corresponds to target risk information, and the target risk information is determined by semantically matching the initial response word with multiple preset risk information.

[0151] According to embodiments of this disclosure, the risk detection result is obtained by fusing semantic matching degree and target risk weight, including: fusing semantic matching degree, target risk weight and semantic ambiguity weight to obtain risk detection result, wherein the semantic ambiguity weight represents the amount of data of ambiguous reply words in the currently determined reply text, and ambiguous reply words are used to represent semantically ambiguous natural language expressions.

[0152] According to embodiments of this disclosure, determining the risk detection result corresponding to the semantic features based on the semantic matching degree includes: fusing the semantic matching degree and the semantic fuzziness weight to obtain the risk detection result, wherein the semantic fuzziness weight represents the amount of data of fuzzy reply words in the currently determined reply text, and the fuzzy reply words are used to represent semantically fuzzy natural language expressions.

[0153] According to embodiments of this disclosure, the large model further includes a second execution network; processing semantic features based on a target expert network that matches the risk detection result among multiple expert networks to obtain the response word in the response text includes: using the target expert network to perform a semantic fusion task on the semantic features according to a risk suppression strategy that matches the risk level represented by the risk detection result to obtain intermediate semantic features; and using the second execution network to generate the response word based on the intermediate semantic features, wherein the response word matches the semantic requirement condition corresponding to the risk level.

[0154] According to embodiments of this disclosure, the risk detection result includes a specified high-risk level, and the target expert network corresponding to the specified high-risk level performs a target task based on semantic features and outputs a response word that meets a first requirement condition. The first requirement condition represents at least one response word that modifies the specified object of the response text description based on fuzzy semantics.

[0155] According to embodiments of this disclosure, the risk detection result includes a specified low-risk level, and the target expert network corresponding to the specified low-risk level performs a target task based on semantic features and outputs a response word that meets a second requirement condition. The second requirement condition indicates that at least one response word is expressed in natural language based on sentiment expression words.

[0156] According to embodiments of this disclosure, the target image and the demand text representing the demand intention for the target image, the semantic features include visual semantic features related to the target image and textual semantic features related to the demand text.

[0157] Figure 7 schematically illustrates a block diagram of an apparatus for training a large model according to an embodiment of the present disclosure.

[0158] As shown in Figure 7, the apparatus 700 for training a large model includes: a second receiving module 710, a sample response text acquisition module 720, and a training module 730.

[0159] The second receiving module 710 is used to receive sample input information and label response text, wherein the label response text matches the demand intent represented by the input information and meets the semantic compliance conditions.

[0160] The sample response text acquisition module 720 is used to perform the target task based on the sample input information using a large model and generate sample response text. The large model performs semantic risk detection on the sample semantic features related to the sample input information and obtains the sample risk detection result. The sample risk detection result represents the semantic violation risk related to the sample response text. The target expert network in the large model that matches the sample risk detection result performs the target task based on the sample semantic features.

[0161] Training module 730 is used to train a large model based on the difference between the labeled response text and the sample response text, resulting in a trained large model.

[0162] According to embodiments of this disclosure, the risk detection result includes a specified high-risk level, the large model includes a first target expert network corresponding to the specified high-risk level, and the label response text includes a first label text that matches the specified high-risk level. The first label text is based on fuzzy semantic modification of the specified object described by the label response text.

[0163] According to embodiments of this disclosure, the training module includes: a target gradient information determination unit and an adjustment unit.

[0164] The target gradient information determination unit is used to determine the target gradient information related to the target expert network based on the difference between the labeled response text and the sample response text.

[0165] The adjustment unit is used to adjust the model parameters of the target expert network based on the target gradient information, while freezing the other model parameters in the large model. The other model parameters are model parameters other than the model parameters of the target expert network in the large model.

[0166] According to embodiments of this disclosure, a large model is constructed as follows: multiple adjacent associated network layers are determined from multiple network layers of an initial large model; embedding positions between the multiple associated network layers are determined, and multiple expert networks are embedded at the embedding positions to obtain a large model, wherein the multiple expert networks include a target expert network.

[0167] Figure 8 schematically illustrates a structural block diagram of an artificial intelligence agent according to an embodiment of the present disclosure.

[0168] In embodiments of this disclosure, as shown in FIG8, the AI ​​agent 800 may include an input module 810, a processing module 820, and an output module 830.

[0169] Input module 810 is used to receive input information;

[0170] The processing module 820 is used to determine the target task based on the input information received by the input module, determine the large model based on the target task, and obtain output information by calling the large language model to execute the interaction method based on the large model provided in the embodiments of this disclosure, or by calling the large model to execute the training method of the large model provided in the embodiments of this disclosure.

[0171] Output module 830 is used to output the output information obtained by the processing module.

[0172] According to embodiments of this disclosure, the input module 810 is responsible for receiving or sensing information such as queries, requests, instructions, signals, or data from the outside world (e.g., users or the external environment), and converting it into a format that the AI ​​agent 800 can understand and process. The input module 810 is the primary link for the AI ​​agent 800 to interact with the outside world, enabling the AI ​​agent 800 to efficiently and accurately obtain necessary "sensory" information from the outside world and respond to this information.

[0173] In the example, the input module 810 can input the input information described above, sample input information, tag response text, etc.

[0174] In the example, processing module 820 is the core support for the AI ​​agent 800's ability to handle complex tasks. Processing module 820 can execute the interaction methods and training methods based on large models described above.

[0175] In the example, the performance of the processing module 820 is closely related to the large model on which the AI ​​agent 800 is based. To fully leverage the capabilities of the large model, the internal structure of the processing module 820 can be designed to be highly configurable and scalable to handle various types of tasks and requirements in real-world scenarios.

[0176] In the example, after the AI ​​agent 800 obtains the input information, the processing module 820 can use a large model to process the input information to obtain the response text, and then pass the response text to the output module 830.

[0177] Understandably, while large language models possess excellent language understanding and generation capabilities, like humans, their ability to solve tasks is limited without the aid of any tools. However, once the AI ​​agent 800 is given the ability to invoke tools, it can perform tasks such as using a calculator to complete mathematical calculations, using Python to perform data analysis, and using a search engine to create weather forecasts.

[0178] In the example, output module 830 can output the response text described above or a trained large model.

[0179] The AI ​​agent 800 according to embodiments of this disclosure can simply and effectively improve the level of intelligence, as well as enhance flexibility and versatility.

[0180] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0181] According to an embodiment of the present disclosure, an electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the method described above.

[0182] According to embodiments of the present disclosure, a non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to cause a computer to perform the method described above.

[0183] According to an embodiment of this disclosure, a computer program product includes a computer program that, when executed by a processor, implements the method described above.

[0184] Figure 9 illustrates a schematic block diagram of an example electronic device that can be used to implement the large-model-based interaction method and the method for training the large model, as described in the embodiments of this disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the disclosure described and / or claimed herein.

[0185] As shown in Figure 9, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded into random access memory (RAM) 903 from storage unit 908. RAM 903 can also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0186] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0187] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as large model-based interaction methods and methods for training large models. For example, in some embodiments, the large model-based interaction methods and methods for training large models can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the large model-based interaction methods and methods for training large models described above can be performed. Alternatively, in other embodiments, computing unit 901 may be configured by any other suitable means (e.g., by means of firmware) to perform large model-based interactive methods and methods for training large models.

[0188] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0189] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0190] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0191] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0192] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0193] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, distributed system servers, or servers incorporating blockchain technology.

[0194] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0195] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. An interaction method based on a large model, comprising: Receive input information from the target object; A large model is used to perform a target task based on the input information to generate a response text. The large model performs semantic risk detection on the semantic features related to the input information to obtain a risk detection result. The risk detection result represents the semantic violation risk related to the response text. The target expert network in the large model that matches the risk detection result performs the target task based on the semantic features. And push the reply text to the target object.

2. The method according to claim 1, wherein, The large model includes a first execution network and multiple expert networks. The large model performs the target task based on the following operations: using the first execution network to perform semantic understanding on the input information to obtain semantic features corresponding to the reply character to be determined in the reply text; determining a risk detection result related to the reply character to be determined based on the label probability distribution determined based on the semantic features, wherein the label probability distribution represents the selection probability of each of the multiple candidate character labels; and processing the semantic features according to a target expert network among the multiple expert networks that matches the risk detection result to obtain the reply character in the reply text.

3. The method according to claim 2, wherein, The input information includes a target image; determining the risk detection result related to the response word to be determined based on the label probability distribution determined based on the semantic features includes: determining an initial response word corresponding to the semantic features based on the label probability distribution determined based on the semantic features; semantically matching the initial response word with the regional visual semantic features of at least one image region in the target image to obtain a semantic matching degree, wherein the semantic matching degree characterizes the degree of model illusion of the large model in the process of performing the target task; and determining the risk detection result corresponding to the semantic features based on the semantic matching degree.

4. The method according to claim 3, wherein, The step of determining the risk detection result corresponding to the semantic feature based on the semantic matching degree includes: fusing the semantic matching degree and the target risk weight to obtain the risk detection result, wherein the target risk weight corresponds to the target risk information, and the target risk information is determined by semantically matching the initial response word with multiple preset risk information.

5. The method according to claim 4, wherein, The process of fusing the semantic matching degree and the target risk weight to obtain the risk detection result includes: fusing the semantic matching degree, the target risk weight, and the semantic fuzziness weight to obtain the risk detection result, wherein the semantic fuzziness weight represents the amount of data of fuzzy reply words in the currently determined reply text, and the fuzzy reply words are used to represent semantically fuzzy natural language expressions.

6. The method according to claim 3, wherein, The step of determining the risk detection result corresponding to the semantic feature based on the semantic matching degree includes: fusing the semantic matching degree and the semantic fuzziness weight to obtain the risk detection result, wherein the semantic fuzziness weight represents the amount of data of fuzzy reply words in the currently determined reply text, and the fuzzy reply words are used to represent semantically fuzzy natural language expressions.

7. The method according to claim 2, wherein, The large model also includes a second execution network; the step of processing the semantic features according to a target expert network that matches the risk detection result among the multiple expert networks to obtain the reply word in the reply text includes: using the target expert network to perform a semantic fusion task on the semantic features according to a risk suppression strategy that matches the risk level represented by the risk detection result to obtain intermediate semantic features; and using the second execution network to generate the reply word based on the intermediate semantic features, wherein the reply word matches the semantic requirement condition corresponding to the risk level.

8. The method according to claim 1, wherein, The risk detection result includes a specified high-risk level. The target expert network corresponding to the specified high-risk level performs the target task according to the semantic features and outputs a response word that meets a first requirement condition. The first requirement condition indicates that at least one of the response words modifies the specified object described by the response text based on fuzzy semantics.

9. The method according to claim 1 or 8, wherein, The risk detection result includes a specified low-risk level. The target expert network corresponding to the specified low-risk level performs the target task according to the semantic features and outputs a response word that meets the second requirement condition. The second requirement condition indicates that at least one of the response words is expressed in natural language based on sentiment expression words.

10. The method according to claim 1, wherein, The target image and the demand text representing the demand intent for the target image, wherein the semantic features include visual semantic features related to the target image and textual semantic features related to the demand text.

11. A method for training large models, comprising: Receive sample input information and labeled response text, wherein the labeled response text matches the demand intent represented by the input information and meets semantic compliance conditions; A large model is used to perform a target task based on the sample input information to generate sample response text. The large model performs semantic risk detection on the sample semantic features related to the sample input information to obtain a sample risk detection result. The sample risk detection result characterizes the semantic violation risk related to the sample response text. A target expert network in the large model that matches the sample risk detection result performs the target task based on the sample semantic features. The large model is then trained based on the difference between the labeled response text and the sample response text to obtain a trained large model.

12. The method according to claim 11, wherein, The risk detection result includes a specified high-risk level, the large model includes a first target expert network corresponding to the specified high-risk level, and the labeled response text includes a first labeled text that matches the specified high-risk level. The first labeled text modifies the specified object described by the labeled response text based on fuzzy semantics.

13. The method according to claim 11 or 12, wherein, The step of training the large model based on the difference between the labeled response text and the sample response text includes: determining target gradient information related to the target expert network based on the difference between the labeled response text and the sample response text; and adjusting the model parameters of the target expert network based on the target gradient information while freezing other model parameters in the large model, wherein the other model parameters are model parameters in the large model other than the model parameters that process the target expert network.

14. The method according to claim 11, wherein, The large model is constructed as follows: multiple adjacent associated network layers are determined from multiple network layers of the initial large model; the embedding positions between the multiple associated network layers are determined, and multiple expert networks are embedded in the embedding positions to obtain the large model, wherein the multiple expert networks include the target expert network.

15. An interactive device based on a large model, comprising: The first receiving module is used to receive input information from the target object; The response text acquisition module is used to generate response text by performing a target task based on the input information using a large model. The large model performs semantic risk detection on the semantic features related to the input information to obtain risk detection results. The risk detection results represent the semantic violation risk related to the response text. The target task is performed based on the semantic features by using a target expert network in the large model that matches the risk detection results. And a push module, used to push the reply text to the target object.

16. An apparatus for training large models, comprising: The second receiving module is used to receive sample input information and tag response text, wherein the tag response text matches the demand intent represented by the input information and meets semantic compliance conditions. The sample response text acquisition module is used to generate sample response text by performing a target task based on the sample input information using a large model. The large model performs semantic risk detection on the sample semantic features related to the sample input information to obtain a sample risk detection result. The sample risk detection result represents the semantic violation risk related to the sample response text. The target expert network in the large model that matches the sample risk detection result performs the target task based on the sample semantic features. The training module is used to train the large model based on the difference between the labeled response text and the sample response text, so as to obtain the trained large model.

17. An intelligent agent of artificial intelligence, comprising: The input module is used to receive input information; The processing module is configured to determine a target task based on the input information received by the input module, determine a large model based on the target task, and obtain output information by calling the large model to execute the method of any one of claims 1 to 14. An output module is used to output the output information obtained by the processing module.

18. An electronic device comprising: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 14.

19. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 14.

20. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 14.