Model reasoning method, terminal device, storage medium and computer program product

By semantic segmentation and sensitive information processing of user request text, independent inference subtasks are generated, and interfering subtasks and random sorting are used to solve the privacy protection problems in the model inference process in the existing technology, and effective in inference tasks is achieved The effect of protecting user privacy.

CN119227803APending Publication Date: 2024-12-31WEBANK (CHINA)
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively protect user privacy when performing model inference tasks, especially because independent word-level perturbations may lead to inconsistency in generated text and semantic incoherence, making it difficult to successfully perform inference tasks.

Method used

By semantic segmentation of the user's original request text, multiple independent inference subtasks are generated, and sensitive information is eliminated before being sent to the predetermined inference model. The interfering subtask and random sorting mechanism are used to ensure that each inference subtask only contains Some information reduces the amount of information exposure and prevents the reconstructed user's true inquiries.

Benefits of technology

It realizes the effective protection of user privacy while performing inference tasks smoothly, avoids the possible text inconsistency and semantic inconsistency caused by sentence embedding or word embedding methods, and improves the depth and breadth of privacy protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227803A_ABST
    Figure CN119227803A_ABST
Patent Text Reader

Abstract

The invention discloses a model reasoning method, terminal equipment, a storage medium and a computer program product, and relates to the technical field of artificial intelligence, and the model reasoning method comprises the following steps: obtaining an original request text of a user; performing semantic segmentation processing on the original request text to generate each reasoning sub-task; sending each reasoning sub-task to a predetermined reasoning model to obtain a reasoning sub-result of each reasoning sub-task; and based on each reasoning sub-result, generating a reasoning response result of the original request text. According to the method, the user privacy is protected in the model reasoning process while the reasoning task is smoothly executed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model reasoning method, terminal equipment, storage medium and computer program product. Background Art

[0002] With the rapid development of artificial intelligence technology, pre-trained language models (PLMs) have achieved remarkable results in the field of natural language processing. Since pre-trained language models are generally large in size and require high computing resources, many service providers usually deploy pre-trained language models as inference services in the cloud for users to query.

[0003] However, this service model has serious privacy issues. Currently, for sensitive information in user queries (personal identity information, address, phone number, etc.), private embedding at the sentence level or word level can usually be used to achieve local differential privacy by performing noise processing on sentence embeddings or word embeddings. However, independent word-level perturbations may cause inconsistencies in the generated text and semantic incoherence, making it difficult to perform reasoning tasks. Therefore, how to protect user privacy during model reasoning while smoothly performing reasoning tasks is a problem that needs to be solved urgently.

[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of this application is to provide a model reasoning method, terminal device, storage medium and computer program product, aiming to solve the technical problem of protecting user privacy in the model reasoning process while smoothly executing the reasoning task.

[0006] To achieve the above objectives, the present application proposes a model reasoning method, which includes:

[0007] Get the user's original request text;

[0008] Performing semantic segmentation processing on the original request text to generate various reasoning subtasks;

[0009] Send each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask;

[0010] Based on each of the inference sub-results, an inference response result of the original request text is generated.

[0011] In one embodiment, the step of performing semantic segmentation processing on the original request text to generate each reasoning subtask includes:

[0012] Performing semantic analysis on the original request text to identify semantic relationships between keywords in the original request text;

[0013] Determining corresponding segmentation rules according to the semantic relationship;

[0014] According to the segmentation rule, the original request text is segmented to obtain sub-prompt texts, and each reasoning sub-task is generated based on each sub-prompt text.

[0015] In one embodiment, the step of performing semantic analysis on the original request text to identify the semantic relationship between keywords in the original request text includes:

[0016] Extract keywords from the original request text to obtain keywords in the original request text;

[0017] Clustering the keywords to obtain text clusters;

[0018] Performing semantic analysis on the keywords in the text clustering cluster to identify the intra-cluster semantic relationship of each keyword in the text clustering cluster;

[0019] The semantic relationship within each of the text clustering clusters is used as the semantic relationship between the keywords in the original request text.

[0020] In one embodiment, before the step of sending each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask, the following steps are included:

[0021] Performing sensitive information identification on the reasoning subtask to obtain sensitive words in the reasoning subtask;

[0022] The sensitive attributes of the sensitive words are eliminated to obtain a desensitized reasoning subtask.

[0023] In one embodiment, the step of sending each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask includes:

[0024] Acquire an interfering subtask, wherein the interfering subtask is an inference task whose similarity with the original request text is lower than a predetermined similarity threshold;

[0025] Sending the interference subtask and each reasoning subtask to a predetermined reasoning model to obtain a reasoning result of each task;

[0026] The reasoning sub-results of each reasoning sub-task are screened out from the reasoning results of each task.

[0027] In one embodiment, the predetermined reasoning model includes at least two reasoning service models, and the step of sending each reasoning subtask to the predetermined reasoning model to obtain the reasoning subresult of each reasoning subtask further includes:

[0028] Randomly sort each reasoning subtask to obtain a reasoning task sequence;

[0029] According to the reasoning task sequence, each of the reasoning subtasks is sequentially input into at least two reasoning service models to obtain a reasoning subresult of each reasoning subtask.

[0030] In one embodiment, the step of generating the reasoning response result of the original request text based on each of the reasoning sub-results includes:

[0031] Aligning each of the inference sub-results with the original request text to obtain target keywords in the original request text corresponding to each of the inference sub-results;

[0032] Constructing a logical structure framework according to the logical relationship between the target keywords;

[0033] The inference sub-results are integrated according to the logical structure framework to obtain the inference response result of the original request text.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a terminal device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the model reasoning method described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the model reasoning method described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, it implements the steps of the model reasoning method described above.

[0037] One or more technical solutions proposed in this application have at least the following technical effects:

[0038] This application obtains the original request text of the user, and performs semantic segmentation processing on the original request text to generate each reasoning subtask. Therefore, this application segments the original request text at the semantic level, thereby dividing the complete original request text into multiple independent reasoning subtasks, while ensuring the integrity of each independent reasoning subtask and the logical consistency of each reasoning subtask with the original request text, reducing the information exposure of a single task. Then, each reasoning subtask is sent to a predetermined reasoning model to obtain the reasoning subresult generated by the predetermined reasoning model for each reasoning subtask. Since there are differences between the context information of each reasoning subtask, it is difficult for a service provider or an attacker to infer the possibility of the user's true inquiry intention through the correlation between each reasoning subtask. Then, the reasoning results are integrated based on each of the reasoning subresults to obtain the reasoning response result corresponding to the original request text. This application generates various reasoning subtasks by semantically segmenting the original request text. Since each reasoning subtask only contains part of the information of the original request text, the amount of information exposed by a single reasoning subtask is reduced. Moreover, since the context information between each reasoning subtask after segmentation lacks mutual correlation, even if the service provider or attacker obtains the content of all reasoning subtasks, it is difficult to reconstruct the user's complete and true inquiry intention. Since the reasoning subtasks obtained after segmentation in this application are all independent and complete, this application also avoids the problem that the existing method of using sentence embedding or word embedding to achieve local differential privacy may make it difficult to execute reasoning tasks. That is, this application can protect user privacy in the model reasoning process while smoothly executing reasoning tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0041] Figure 1 A flowchart of the first embodiment of the model reasoning method of the present application is provided;

[0042] Figure 2 A flowchart of the second embodiment of the model reasoning method of the present application is provided;

[0043] Figure 3 A flowchart of the third embodiment of the model reasoning method of the present application is provided;

[0044] Figure 4 A schematic diagram of a scenario of a model reasoning method according to an embodiment of the present application;

[0045] Figure 5 A schematic diagram of the device structure of a terminal device involved in the model reasoning method in an embodiment of the present application.

[0046] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0048] In existing model reasoning methods, privacy protection during reasoning is usually achieved in the following three ways:

[0049] First, the privacy of prompts is protected by identifying and eliminating sensitive attributes in user data (such as personal identity information (PII), address, phone number, and other sensitive attributes). This method only focuses on sensitive information at the word level. However, in addition to the sensitive information that may be contained in user data, the user's true inquiry intention is also an important privacy, so this method is not enough to protect privacy;

[0050] Second, sentence-level or word-level private embeddings are used to achieve local differential privacy (LDP) by performing noise processing on sentence embeddings or word embeddings. However, independent word-level perturbations may cause partial inconsistencies and semantic incoherence in the generated text, making it difficult to successfully perform reasoning tasks.

[0051] Third, the privacy of user prompts can be protected through encryption technology, such as designing a secure reasoning framework based on homomorphic encryption (HE) and secret sharing. However, on the one hand, high computing and communication costs greatly limit the practical application of these encryption technologies, and on the other hand, they can only guarantee the privacy of prompts during transmission.

[0052] Therefore, how to protect user privacy during model reasoning while successfully executing reasoning tasks is a problem that needs to be solved urgently.

[0053] Based on this, the embodiment of the present application provides a model reasoning method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the model reasoning method of the present application.

[0054] In this embodiment, the model inference method includes steps S10 to S40:

[0055] Step S10, obtaining the user's original request text;

[0056] It should be noted that the executor of this embodiment can be a terminal device with data processing, network communication and program running functions, such as a tablet computer, personal computer, mobile phone and other electronic devices that can implement the model reasoning method of this application.

[0057] In addition, it should be noted that the original request text is the original text content input by the user to describe his / her reasoning request.

[0058] In this embodiment, the user can input the original request text through an input device such as a mouse, keyboard, or touch screen, thereby obtaining the user's original request text. Of course, this embodiment can further perform sensitive information identification on the original request text to obtain sensitive words in the original request text, and then eliminate the sensitive attributes of the sensitive words in the original request text to obtain the desensitized original request text. Exemplarily, eliminating the sensitive attributes of the sensitive words in the original request text can be replacing or blurring the sensitive words.

[0059] Step S20, performing semantic segmentation processing on the original request text to generate various reasoning subtasks;

[0060] It should be noted that the semantic segmentation process is a process of segmenting text into small segments or fragments with semantic meanings. Exemplarily, the semantic segmentation process can be implemented by means of a neural network model for natural language processing, a machine learning algorithm, etc.

[0061] As an example, this embodiment can segment the original request text according to a predetermined segmentation rule to obtain each sub-prompt text, and generate each reasoning sub-task based on each sub-prompt text. Exemplarily, the predetermined segmentation rule is at least one of the segmentation logics such as time sequence, subject classification or importance. Taking the original request text as "Please help me generate a market analysis report for ABC Company (technology company)" as an example, if the predetermined segmentation rule is the segmentation logic of time sequence, then the original request text can be segmented into three reasoning sub-tasks corresponding to different time periods: "Query the historical development review of the technology industry", "Query the recent performance analysis of ABC Company" and "Predict the development prospects of ABC Company" according to the time sequence. If the preset segmentation rule is the segmentation logic of subject classification, since a market analysis report logically usually includes three subject parts: market trend, competitor analysis and customer demand, the original request text can be segmented into three reasoning sub-tasks composed of different themes under the market analysis report: "Generate a market trend report on the technology industry", "Search for the main competitors of ABC Company" and "Investigate customer needs and preferences for the technology product" according to subject classification.

[0062] As another example, since the semantic relationships between the text keywords in different original request texts may also be different, following a fixed segmentation rule may result in a decrease in the accuracy of semantic segmentation of the original request text. Therefore, this embodiment identifies the semantic relationship between the keywords in the original request text by performing a semantic analysis on the original request text. This embodiment can construct a correspondence between the semantic relationship and the segmentation logic in advance, and then query the correspondence between the semantic relationship and the segmentation logic based on the semantic relationship, and use the segmentation logic corresponding to the semantic relationship as the corresponding segmentation rule. Therefore, this embodiment can adapt the corresponding segmentation logic as the segmentation rule for the original request texts with different semantic relationships to further improve the accuracy of semantic segmentation of the original request text.

[0063] In a feasible implementation, step S20 may include steps S21 to S23:

[0064] Step S21, performing semantic analysis on the original request text to identify the semantic relationship between the keywords in the original request text;

[0065] Step S22, determining a corresponding segmentation rule according to the semantic relationship;

[0066] Step S23, segmenting the original request text according to the segmentation rule to obtain sub-prompt texts, and generating reasoning sub-tasks based on the sub-prompt texts.

[0067] In this embodiment, the preprocessed words can be obtained by preprocessing the original request (such as word segmentation, deleting stop words, part-of-speech tagging, etc.). Then, the preprocessed words are subjected to keyword extraction to obtain the keywords in the original request text. Then, the semantic relationship between the keywords in the original request text can be identified through semantic analysis processing such as entity recognition (i.e., identifying specific entities such as tasks, places, organizations, etc. in the text), semantic role labeling (i.e., identifying the relationship between verbs and nouns in each keyword), and dependency syntax analysis (i.e., analyzing the dependency relationship between each keyword). Then, according to the semantic relationship, the correspondence between the semantic relationship and the segmentation logic can be queried, and the segmentation logic corresponding to the semantic relationship can be used as the corresponding segmentation rule. In this embodiment, there is a corresponding relationship between the semantic relationship and the segmentation logic. For example, if the semantic relationship represents the temporal association between the text keywords, the temporal sequence segmentation logic can be used as the corresponding segmentation rule. If the semantic relationship represents the association between the text keywords in the subject category, the subject classification segmentation logic can be used as the corresponding segmentation rule. Then, the original request text can be segmented according to the segmentation rules to obtain each sub-prompt text, and each reasoning sub-task is generated based on each sub-prompt text. In addition, it can be understood that the segmentation rules can include multiple segmentation logics. In this embodiment, one or more segmentation logics can be selected from the segmentation rules to segment the original request text to obtain each sub-prompt text. For the scenario where multiple segmentation logics are used to segment the original request text, the original request text can be segmented in sequence according to each segmentation logic to obtain each sub-prompt text, and each reasoning sub-task is generated based on each sub-prompt text. For example, the segmentation rules include both the segmentation logic of the time sequence and the segmentation logic of the subject classification. Then, the original request text can be segmented according to the segmentation logic of the time sequence in the segmentation rules to obtain each secondary prompt text. Then, the secondary prompt text can be segmented according to the segmentation logic of the subject classification in the segmentation rules to obtain each sub-prompt text. Thus, this embodiment can generate each reasoning sub-task based on each sub-prompt text obtained after segmentation. Among them, this embodiment can directly use the sub-prompt text as the reasoning subtask. Of course, in order to improve the semantic integrity and logical coherence of the reasoning subtask corresponding to each sub-prompt text, this embodiment can also perform post-processing operations such as word order adjustment, transition sentence supplementation, grammar correction, and language expression optimization on the sub-prompt text to obtain the reasoning subtask, so as to improve the text quality of the obtained reasoning subtask.

[0068] In this embodiment, by performing semantic analysis on the original request text, the semantic relationship between the keywords in the original request text is identified, and then the corresponding segmentation rules are determined according to the semantic relationship. Therefore, this embodiment can select the segmentation rules that match the semantic relationship according to the different semantic relationships between the keywords in the original request text. Then, according to the segmentation rules, the original request text is segmented to obtain each sub-prompt text, and each reasoning sub-task is generated based on each sub-prompt text. Therefore, this embodiment can further improve the accuracy of the semantic segmentation of the original request text.

[0069] In a feasible implementation, step S21 may include steps A10 to A40:

[0070] Step A10, extracting keywords from the original request text to obtain keywords in the original request text;

[0071] Step A20, clustering the keywords to obtain text clusters;

[0072] Step A30, performing semantic analysis on the keywords in the text clustering clusters to identify the intra-cluster semantic relationship of the keywords in the text clustering clusters;

[0073] Step A40: taking the semantic relationship within each of the text clusters as the semantic relationship between the keywords in the original request text.

[0074] Because in the real model reasoning scenario, for more complex reasoning requirements, the user may mix more elements in the original request text, resulting in a decrease in the recognition accuracy of the semantic relationship. Therefore, the present embodiment can pre-process the original request (such as word segmentation, deletion of stop words, part-of-speech tagging, etc.) to obtain pre-processed words. Exemplarily, the original request text can be decomposed into word units by word segmentation, and the stop words in the word units are removed to remove common words that do not contribute much to the meaning of the text, and then the word units after the stop words are removed are marked with parts of speech (i.e., the word units are marked as nouns, verbs, adjectives, etc.) to obtain pre-processed words. Then, the pre-processed words are subjected to keyword extraction to obtain the keywords in the original request text. The keyword extraction method can be a TF-IDF-based method, a TextRank-based method, etc. Then, the keywords are clustered to assign keywords with higher similarity to the same cluster cluster to obtain each text cluster cluster. Exemplarily, the clustering method may be a clustering algorithm such as hierarchical clustering, density-based clustering algorithm, model-based clustering algorithm, graph-based clustering algorithm, etc. Then, the present embodiment further performs semantic analysis processing such as entity recognition, semantic role labeling, and dependency syntax analysis on the keywords in the text clusters to identify the intra-cluster semantic relationship of each keyword in the text clusters. After the intra-cluster semantic relationship of each text cluster is obtained, the intra-cluster semantic relationship of each text cluster is used as the semantic relationship between the keywords in the original request text.

[0075] In this implementation, by clustering the keywords in the original request text, each text cluster is obtained, and then semantic analysis is performed on the keywords in the text cluster respectively to identify the intra-cluster semantic relationship of each keyword in the text cluster, thereby using the intra-cluster semantic relationship of each text cluster as the semantic relationship between the keywords in the original request text. This embodiment adopts the method of clustering first and then performing semantic analysis on the clusters. Compared with directly performing semantic analysis, when there are many elements mixed in the original request text, the accuracy of the semantic relationship obtained by semantic analysis can be effectively improved.

[0076] Step S30, sending each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask;

[0077] It should be noted that the predetermined reasoning model is a pre-selected language model deployed in the cloud to provide reasoning services, such as LLaMa2 13B, LLaMa2 7B, OPT 7B, etc.

[0078] In this embodiment, each of the reasoning subtasks is sent to a predetermined reasoning model in the cloud. After receiving each of the reasoning subtasks, the predetermined reasoning model outputs a reasoning subresult of each reasoning subtask and feeds back a reasoning subresult of each reasoning subtask.

[0079] As an example, in order to further improve the privacy protection of the user's real query intention, this embodiment can obtain interference subtasks with a low degree of association with the original request text, and then send the interference subtasks and each reasoning subtask to a predetermined reasoning model to obtain the reasoning results of each task, and then filter out the reasoning subresults of each reasoning subtask from the reasoning results of each task. Therefore, this embodiment can further interfere with the realization of the service provider or attacker reconstructing the user's query intention by doping the interference subtasks in the reasoning subtasks of the original request text and then sending them to the predetermined reasoning model, thereby further improving the privacy protection of the user's real query intention.

[0080] As another example, in order to further improve the privacy protection of the user's real inquiry intention, the present embodiment may also select at least two inference service models as the predetermined inference models, and then randomly input each of the inference subtasks into at least two inference service models for inference, and obtain the inference subresults of each inference subtask fed back by each of the inference service models. Exemplarily, the present embodiment may randomly arrange each of the inference subtasks, and then sequentially input at least two inference service models for inference, and obtain the inference subresults of each inference subtask fed back by each of the inference service models. The present embodiment may also randomly group each inference subtask to obtain at least two inference task groups, and then respectively input each of the inference task groups into at least two inference service models to obtain the inference subresults of each inference subtask.

[0081] In a feasible implementation manner, steps S31 to S32 are included before step S30:

[0082] Step S31, performing sensitive information identification on the reasoning subtask to obtain sensitive words in the reasoning subtask;

[0083] Step S32, eliminating the sensitive attributes of the sensitive words to obtain a desensitized reasoning subtask.

[0084] Since the inference subtask obtained after semantic segmentation of the original request text may contain sensitive words, this embodiment can identify sensitive information for the inference subtask to obtain the sensitive words in the inference subtask. Among them, the sensitive information identification can be achieved by sensitive word matching, sensitive rule matching, classification model based on machine learning, deep learning model, etc. Taking sensitive word matching as an example, a list containing sensitive words is pre-set, and then a regular expression or text matching algorithm is used to find out whether the inference subtask contains sensitive words in the list. Taking sensitive word matching as an example, the inference subtask is compared according to the judgment rule constructed by the characteristics of sensitive information to identify sensitive information. Furthermore, this embodiment can eliminate the sensitive attributes of the sensitive words, obtain the desensitized inference subtask, and then execute step S30. Wherein eliminating the sensitive attributes of the sensitive words can be replacing or blurring the sensitive words. Exemplarily, taking eliminating the sensitive attributes of the sensitive words as replacing the sensitive words as an example, this embodiment can replace the sensitive words with common synonyms without sensitive attributes. Taking the example of eliminating the sensitive attribute of the sensitive word by blurring the sensitive word, the present embodiment may replace the sensitive word with a meaningless symbol (such as an asterisk, a question mark, a pound sign, etc.).

[0085] This embodiment performs semantic segmentation on the original request text to generate various reasoning subtasks, and then eliminates the sensitive attributes of sensitive words in the reasoning subtasks, thereby constructing a multi-level privacy protection mechanism. It protects everything from the user's overall query intent to more subtle word-level sensitive information, effectively improving the depth and breadth of privacy protection.

[0086] Step S40: generating an inference response result of the original request text based on each of the inference sub-results.

[0087] After obtaining the inference sub-results of each of the inference sub-tasks, this embodiment can generate the inference response result of the original request text by fusing the information of each of the inference sub-results. Exemplarily, this embodiment can fuse the inference sub-results according to a predetermined logical structure framework, and this embodiment can extract information (such as entity recognition, relationship extraction, event extraction, viewpoint extraction, etc.) from each of the inference sub-results, and summarize the extracted information to retain key content. Furthermore, this embodiment can construct a logical structure framework, such as a timeline, topic classification, etc., based on the logical relationship between each of the inference sub-results. Of course, this embodiment can also construct a logical structure framework based on the logical relationship between the target keywords corresponding to each of the inference sub-results in the original request text. According to the logical structure framework, the key content is fused to generate a comprehensive text as the inference response result of the original request text. Exemplarily, this embodiment can use a natural language processing model, such as a model based on sequence to sequence (Seq2Seq), a Transformer model, etc., to generate the comprehensive text.

[0088] In a feasible implementation, step S40 may include steps S41 to S43:

[0089] Step S41, aligning each of the inference sub-results with the original request text to obtain target keywords in the original request text corresponding to each of the inference sub-results;

[0090] Step S42, constructing a logical structure framework according to the logical relationship between the target keywords;

[0091] Step S43: merge the inference sub-results according to the logical structure framework to obtain the inference response result of the original request text.

[0092] It should be noted that the logical structure framework is an orderly and reasonable framework followed when organizing the various reasoning sub-results, which is used to ensure the coherence of the content.

[0093] For the case where the original request text has a fixed logical relationship (such as a time relationship, a subject relationship), the reasoning response result that may be generated by the logical structure framework constructed by the logical relationship between each of the inference sub-results is logically difficult to adapt to the original request text. Therefore, this embodiment can align each of the inference sub-results with the original request text to obtain the target keywords corresponding to each of the inference sub-results in the original request text. Specifically, this embodiment can match the inference result entity in the inference sub-result with the request text entity of the original request text, and use the request text entity in the original request text that matches the inference result entity as the target keyword. Then, according to the logical relationship between each of the target keywords, a logical structure framework can be constructed. For example, if the logical relationship between each of the target keywords is a timeline relationship, a logical structure framework based on the timeline can be constructed. If the logical relationship between each of the target keywords is a subject classification relationship, a logical structure framework based on the subject classification can be constructed. Then, each of the inference sub-results is fused according to the logical structure framework to obtain the reasoning response result of the original request text. This embodiment can extract information from each of the inference sub-results (entity recognition, relationship extraction, event extraction, viewpoint extraction, etc.), and summarize the extracted information to retain key content. The key content is integrated according to the logical structure framework to generate a comprehensive text as the inference response result of the original request text. Therefore, this embodiment constructs a logical structure framework based on the logical relationship of the request text, so that the inference response result generated based on the logical structure framework is logically compatible with the original request text.

[0094] The first embodiment of the present application provides a model reasoning method, which obtains the original request text of the user and performs semantic segmentation processing on the original request text to generate each reasoning subtask. Therefore, this embodiment segments the original request text at the semantic level, thereby dividing the complete original request text into multiple independent reasoning subtasks, while ensuring the integrity of each independent reasoning subtask and the logical consistency of each reasoning subtask with the original request text, reducing the amount of information exposure of a single task. Then, each reasoning subtask is sent to a predetermined reasoning model to obtain the reasoning subresult generated by the predetermined reasoning model for each reasoning subtask. Since there are differences between the context information of each reasoning subtask, it is difficult for a service provider or an attacker to infer the user's true inquiry intention through the correlation between each reasoning subtask. Then, the reasoning results are integrated based on each of the reasoning subresults to obtain the reasoning response result corresponding to the original request text. This embodiment generates each reasoning subtask by performing semantic segmentation on the original request text. Since each reasoning subtask only contains part of the information of the original request text, the amount of information exposed by a single reasoning subtask is reduced. Moreover, since the context information between each reasoning subtask after segmentation lacks mutual correlation, even if the service provider or attacker obtains the content of all reasoning subtasks, it is difficult to reconstruct the complete and true inquiry intention of the user. Since the reasoning subtasks obtained after segmentation in this embodiment are all independent and complete, this embodiment also avoids the problem that the existing method of using sentence embedding or word embedding to achieve local differential privacy may make it difficult to perform reasoning tasks. That is, this embodiment can protect user privacy in the model reasoning process while smoothly executing reasoning tasks.

[0095] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , step S30 includes steps B10 to B30:

[0096] Step B10, obtaining an interfering subtask, wherein the interfering subtask is an inference task whose similarity with the original request text is lower than a predetermined similarity threshold;

[0097] Step B20, sending the interference subtask and each reasoning subtask to a predetermined reasoning model to obtain a reasoning result of each task;

[0098] Step B30, filtering out the reasoning sub-results of each reasoning sub-task from the reasoning results of each task.

[0099] It should be noted that the interference subtask is an inference task whose similarity with the original request text is lower than a predetermined similarity threshold. The similarity can be a characteristic parameter describing the similarity between texts, such as cosine similarity, Jaccard similarity, Dice coefficient, edit distance, etc. The number of the interference subtasks can be selected according to specific needs, such as 5%, 10%, 20%, etc. of the inference subtask.

[0100] In this embodiment, the reasoning tasks whose similarity with the original request text is lower than the predetermined similarity threshold can be extracted from the predetermined task database as interference subtasks, wherein the predetermined task database is a database pre-stored with reasoning tasks. Of course, this embodiment can also extract any entity from the original request text and generate multiple prompt texts based on the entity. From each of the prompt texts, a prompt text whose similarity with the original request text is lower than the predetermined similarity threshold is selected as an interference subtask, so that the interference subtask is associated with the original request text, but the similarity is low, and it has stronger interference than completely unrelated reasoning tasks. Then, this embodiment sends the interference subtask and each reasoning subtask to the predetermined reasoning model, thereby obtaining the reasoning results of each task fed back by the predetermined reasoning model. Then, the reasoning subresults of each reasoning subtask can be screened out from the reasoning results of each task.

[0101] In the second embodiment of the present application, by obtaining an interference subtask, wherein the interference subtask is an inference task whose similarity with the original request text is lower than a predetermined similarity threshold; sending the interference subtask and each inference subtask to a predetermined inference model to obtain the inference results of each task; and filtering the inference subresults of each inference subtask from the inference results of each task. Therefore, this embodiment, by mixing interference subtasks into each inference subtask of the original request text and then sending them to the predetermined inference model, with the help of interference subtasks with a low degree of relevance to the original request text mixed into each inference subtask obtained by segmenting the original request text, can further interfere with the realization of the service provider or attacker reconstructing the user's query intention. At the same time, since each inference task is independent of each other, it will not affect the inference subresults of each inference subtask, thereby further improving the privacy protection of the user's true inquiry intention without affecting the inference response result of the original request text.

[0102] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , the predetermined reasoning model includes at least two reasoning service models, and step S30 further includes steps C10 to C20:

[0103] Step C10, randomly sorting the reasoning subtasks to obtain a reasoning task sequence;

[0104] Step C20: according to the reasoning task sequence, input each of the reasoning subtasks into at least two reasoning service models in sequence to obtain a reasoning subresult of each reasoning subtask.

[0105] It should be noted that the predetermined reasoning model includes at least two reasoning service models. The reasoning service model is a language model deployed in the cloud to provide reasoning services. The reasoning service model can be provided by different service providers.

[0106] In the case where there are multiple reasoning service models, this embodiment can randomly sort each reasoning subtask to obtain a reasoning task sequence. Exemplarily, this embodiment can create a task list for each reasoning subtask, and then randomly select two reasoning subtasks in the task list and exchange their order, repeat this process multiple times, and obtain a randomly sorted task list, that is, a reasoning task sequence. This embodiment can also randomly extract reasoning subtasks from each of the reasoning subtasks, and then sort the extracted reasoning subtasks to obtain a reasoning subtask sequence. It can be understood that this embodiment does not limit the way of random sorting. Furthermore, this embodiment can input each of the reasoning subtasks into at least two reasoning service models in sequence according to the reasoning task sequence to obtain the reasoning subresults of each reasoning subtask. Exemplarily, this embodiment can select at least two reasoning service models from each of the reasoning service models, and then input each of the reasoning subtasks into the selected reasoning service models in sequence according to the reasoning task sequence to obtain the reasoning subresults of each reasoning subtask.

[0107] It is understandable that the second embodiment and the third embodiment of the present application can be executed one by one or together, that is, obtaining an interference subtask, wherein the interference subtask is an inference task whose similarity with the original request text is lower than a predetermined similarity threshold; randomly sorting the interference subtask and each inference subtask to obtain an inference task sequence; according to the inference task sequence, inputting each inference subtask into at least two inference service models in turn to obtain the inference results of each task; and filtering out the inference subresults of each inference subtask from the inference results of each task. This can further improve the privacy protection of the user's true inquiry intention.

[0108] In the third embodiment of the present application, each reasoning subtask is randomly sorted to obtain a reasoning task sequence; according to the reasoning task sequence, each reasoning subtask is sequentially input into at least two reasoning service models to obtain a reasoning subresult of each reasoning subtask. Therefore, this embodiment further reduces the amount of information related to the original request text that can be obtained by a single reasoning service model by splitting each reasoning subtask into at least two reasoning service models for reasoning, which helps to improve the privacy protection of the user's true inquiry intention.

[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the model reasoning method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0110] Please refer to Figure 4 , Figure 4 Schematic diagram of the scenario of the model reasoning method of the embodiment of the present application. In this embodiment, the predetermined reasoning model is deployed in the cloud 20 to provide reasoning services. The terminal device 10 is connected to the cloud 20 for communication, whereby the terminal device 10 obtains the original request text of the user, and performs semantic segmentation processing on the original request text to generate each reasoning subtask. Then, the terminal device 10 sends each reasoning subtask to the predetermined reasoning model of the cloud 20. After receiving each reasoning subtask sent by the terminal device 10, the predetermined reasoning model of the cloud 20 reasons on each reasoning subtask, outputs the reasoning subresult of each reasoning subtask, and feeds it back to the terminal device 10. After obtaining the reasoning subresult of each reasoning subtask, the terminal device 10 generates a reasoning response result of the original request text based on each reasoning subresult.

[0111] The present application provides a terminal device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the model reasoning method in the above-mentioned embodiment one.

[0112] Reference below Figure 5 , which shows a schematic diagram of the structure of a terminal device suitable for implementing the embodiments of the present application. The terminal device in the embodiments of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), vehicle-mounted terminals, and fixed terminals such as servers and desktop computers. Figure 5 The terminal device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0113] like Figure 5 As shown, the terminal device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the terminal device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the terminal device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a terminal device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.

[0114] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0115] The terminal device provided by the present application adopts the model reasoning method in the above embodiment, which can solve the technical problem of protecting user privacy in the model reasoning process while smoothly executing the reasoning task. Compared with the prior art, the beneficial effects of the terminal device provided by the present application are the same as the beneficial effects of the model reasoning method provided by the above embodiment, and the other technical features in the terminal device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0116] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0117] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0118] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the model reasoning method in the above-mentioned embodiment.

[0119] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.

[0120] The computer-readable storage medium may be included in the terminal device; or may exist independently without being installed in the terminal device.

[0121] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the terminal device, the terminal device: obtains the user's original request text; performs semantic segmentation processing on the original request text to generate various reasoning subtasks; sends each reasoning subtask to a predetermined reasoning model to obtain the reasoning subresult of each reasoning subtask; and generates the reasoning response result of the original request text based on each of the reasoning subresults.

[0122] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

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

[0124] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0125] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned model reasoning method, and can solve the technical problem of protecting user privacy in the model reasoning process while smoothly executing the reasoning task. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the model reasoning method provided in the above-mentioned embodiment, and will not be repeated here.

[0126] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned model reasoning method when executed by a processor.

[0127] The computer program product provided by this application can solve the technical problem of protecting user privacy in the model reasoning process while smoothly executing the reasoning task. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the model reasoning method provided by the above embodiment, which will not be repeated here.

[0128] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A model reasoning method, characterized in that: The model reasoning method comprises: Get the user's original request text; Performing semantic segmentation processing on the original request text to generate various reasoning subtasks; Send each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask; Based on each of the inference sub-results, an inference response result of the original request text is generated.

2. The model reasoning method according to claim 1, characterized in that: The step of performing semantic segmentation processing on the original request text to generate each reasoning subtask includes: Performing semantic analysis on the original request text to identify semantic relationships between keywords in the original request text; Determining corresponding segmentation rules according to the semantic relationship; According to the segmentation rule, the original request text is segmented to obtain sub-prompt texts, and each reasoning sub-task is generated based on each sub-prompt text.

3. The model reasoning method according to claim 2, characterized in that: The step of performing semantic analysis on the original request text to identify the semantic relationship between the keywords in the original request text includes: Extract keywords from the original request text to obtain keywords in the original request text; Clustering the keywords to obtain text clusters; Performing semantic analysis on the keywords in the text clustering cluster to identify the intra-cluster semantic relationship of each keyword in the text clustering cluster; The semantic relationship within each of the text clustering clusters is used as the semantic relationship between the keywords in the original request text.

4. The model reasoning method according to claim 1, characterized in that: Before the step of sending each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask, the method includes: Performing sensitive information identification on the reasoning subtask to obtain sensitive words in the reasoning subtask; The sensitive attributes of the sensitive words are eliminated to obtain a desensitized reasoning subtask.

5. The model reasoning method according to claim 1, characterized in that: The step of sending each reasoning subtask to a predetermined reasoning model to obtain a reasoning subresult of each reasoning subtask includes: Acquire an interfering subtask, wherein the interfering subtask is an inference task whose similarity with the original request text is lower than a predetermined similarity threshold; Sending the interference subtask and each reasoning subtask to a predetermined reasoning model to obtain a reasoning result of each task; The reasoning sub-results of each reasoning sub-task are screened out from the reasoning results of each task.

6. The model reasoning method according to claim 1, characterized in that: The predetermined reasoning model includes at least two reasoning service models, and the step of sending each reasoning subtask to the predetermined reasoning model to obtain the reasoning subresult of each reasoning subtask also includes: Randomly sort each reasoning subtask to obtain a reasoning task sequence; According to the reasoning task sequence, each of the reasoning subtasks is sequentially input into at least two reasoning service models to obtain a reasoning subresult of each reasoning subtask.

7. The model inference method according to any one of claims 1 to 6, characterized in that: The step of generating the reasoning response result of the original request text based on each of the reasoning sub-results includes: Aligning each of the inference sub-results with the original request text to obtain target keywords in the original request text corresponding to each of the inference sub-results; Constructing a logical structure framework according to the logical relationship between the target keywords; The inference sub-results are integrated according to the logical structure framework to obtain the inference response result of the original request text.

8. A terminal device, characterized in that: The terminal device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the model reasoning method according to any one of claims 1 to 7.

9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the model reasoning method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the model reasoning method according to any one of claims 1 to 7 are implemented.