Question processing method and device, electronic equipment and storage medium
Through the dual-threaded processing architecture that executes classification models and large models in parallel, the problem of latency overhead in large-model online inference systems is solved, achieving faster response speed and more efficient resource utilization, which is suitable for scenarios such as intelligent question-answering and service consulting.
Patent Information
- Application Number
- CN202510854855.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-10-14
AI Technical Summary
In large-model online reasoning systems, the latency overhead introduced by multi-level processing flows leads to insufficient response speed, and existing technologies are unable to effectively improve the efficiency of problem solving.
A dual-threaded processing architecture is used to execute the classification model and the large model in parallel. The classification model is used to generate a set of trigger probability values for the target dimension processing, and determine whether to trigger the business processing flow. After parallel processing, the answer is directly used as the final answer, reducing invalid calculations and waiting time.
It improves the response speed of question answering, reduces the waste of computing resources, improves the overall efficiency of the system and the accuracy of answers, especially when searching is required, it can respond quickly and optimize resource utilization.
Smart Images

Figure CN120780801A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to the technical field of deep learning, large model, etc., which can be applied to intelligent question answering, service consultation and the like, and specifically relates to a question processing method and device, an electronic device and a storage medium. BACKGROUND
[0002] In a large model online inference system, a hierarchical processing architecture is usually adopted: a small-scale auxiliary model or module processes the input data first, and the output result thereof serves as a precondition for inference of the large model. Such a design relying on a chain calling mechanism introduces additional time delay overhead due to the multi-stage processing flow. SUMMARY
[0003] The present disclosure provides a question processing method and device, an electronic device and a storage medium.
[0004] According to a first aspect of the present disclosure, a question processing method is provided, comprising: acquiring a question to be answered; and executing a first processing thread and a second processing thread in parallel; wherein the first processing thread comprises: inputting the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values; and the second processing thread comprises: inputting the question to be answered into a pre-trained large model to generate a first answer; wherein each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow; and if each target dimension processing trigger probability value is less than the preset probability value corresponding thereto, the first answer is taken as the final answer of the question to be answered.
[0005] According to a second aspect of the present disclosure, a question processing device is provided, comprising: a question acquisition module configured to acquire a question to be answered; a thread control module configured to execute a first processing thread and a second processing thread in parallel; wherein the first processing thread comprises: inputting the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values; and the second processing thread comprises: inputting the question to be answered into a pre-trained large model to generate a first answer; wherein each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow; and a first answer determination module configured to, if each target dimension processing trigger probability value is less than the preset probability value corresponding thereto, take the first answer as the final answer of the question to be answered.
[0006] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0007] at least one processor; and
[0008] a memory communicatively connected to the at least one processor; wherein
[0009] 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 to enable the at least one processor to perform any method in the embodiments of the present disclosure.
[0010] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any method according to the embodiments of the present disclosure.
[0011] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, which implements any method according to the embodiments of the present disclosure when executed by a processor.
[0012] The solution disclosed herein can improve the response speed of problem solving.
[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0015] Figure 1 is a flowchart of a problem-solving method according to an embodiment of the present disclosure;
[0016] Figure 2 is a flowchart of online reasoning of an intelligent question-answering system according to an embodiment of the present disclosure;
[0017] Figure 3 is a structural diagram of a problem handling device according to an embodiment of the present disclosure;
[0018] Figure 4 is a scenario diagram of a problem handling method according to an embodiment of the present disclosure;
[0019] Figure 5 1 is a structural diagram of an electronic device used to implement the problem-solving method of an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0021] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The term "at least one" in this article means any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C. The terms "first" and "second" in this article refer to multiple similar technical terms and distinguish them, and do not mean to limit the order or to limit to only two. For example, the first feature and the second feature refer to two categories / two features. The first feature can be one or more, and the second feature can also be one or more.
[0022] In addition, numerous specific details are provided in the following detailed description to better illustrate the present disclosure. Those skilled in the art will appreciate that the present disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art are not described in detail in order to highlight the main points of the present disclosure.
[0023] Before introducing the technical solutions of the embodiments of the present disclosure, the following technical terms that may be used in the present disclosure are further explained:
[0024] Large models are deep learning models with a very large number of parameters and high computational complexity. These models are typically based on deep learning architectures and are trained using massive amounts of data and extensive computing resources. They possess strong generalization and multi-tasking capabilities.
[0025] Token: In natural language processing, a token is the basic unit in a text, usually a word, punctuation mark, subword, or character.
[0026] In related technologies, in large-model online inference systems, a single large model often cannot achieve the best results. It is generally assisted by multiple small models or modules. These small models or modules can be roughly divided into two dimensions according to their functions: classification and generation.
[0027] a) For the classification model / module, the large model calls the subsequent links only after the classification model / module outputs the classification results. The processing of the classification model / module will cause a certain amount of delay overhead.
[0028] b) For generative models / modules, since the generative models / modules are in the link before the large model inference, the large model inference depends on the processing results of these generative models / modules, which will cause certain delay overhead.
[0029] In order to at least partially solve one or more of the above-mentioned problems and other potential problems, the present disclosure proposes a problem-solving method that can realize parallel calling of the originally serial modules on part of the traffic, reduce waiting time, and improve the response speed of the overall system.
[0030] The present disclosure provides a method for solving the problem. Figure 1 This is a flow chart of a problem handling method according to an embodiment of the present disclosure, which can be applied to a problem handling device. The problem handling device is located in an electronic device. The electronic device includes but is not limited to fixed devices and / or mobile devices. For example, fixed devices include but are not limited to servers, and servers can be cloud servers or ordinary servers. For example, mobile devices include but are not limited to: mobile phones, tablet computers. In some possible implementations, the problem handling method can also be implemented by a processor calling computer-readable instructions stored in a memory. Figure 1 As shown, the method for solving this problem includes:
[0031] S101. Obtain questions to be answered;
[0032] S102. Execute a first processing thread and a second processing thread in parallel. The first processing thread inputs the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values. The second processing thread inputs the question to be answered into the pre-trained large model to generate a first answer. Each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow.
[0033] S103. If the trigger probability value of each target dimension processing is less than the corresponding preset probability value, the first answer is used as the final answer to the question to be answered.
[0034] In an embodiment of the present disclosure, the question processing method is applied to an intelligent question answering system, which includes a classification model and a large model.
[0035] In the disclosed embodiments, the question to be answered can be the original question input by the user, or it can be an independent sub-question obtained by segmenting the original question. For example, the question to be answered could be "What's the weather like today?", "The most livable city?", "Spleen-strengthening diet?", "Housing price forecast for each region over the next ten years," etc. The above is merely an example and does not limit all possible scenarios of the question to be answered, but this is not an exhaustive list.
[0036] In the embodiments of the present disclosure, the target dimension refers to a pre-set processing type dimension that is directly associated with a specific business requirement. Each target dimension has independent decision logic and a preset probability value threshold setting, for example:
[0037] Dimension 1 (data retrieval): determines whether it is necessary to call the search engine for additional information, with the preset probability value threshold set to 0.75;
[0038] Dimension 2 (Security Review): Determines whether sensitive content filtering needs to be enabled, with the preset probability value threshold set to 0.95.
[0039] Here, the preset probability value threshold of each target dimension can be dynamically optimized through historical operation data.
[0040] In the embodiment of the present disclosure, the target dimension processing trigger probability value is a probability indicator used by the classification model to determine whether the current question to be answered needs to trigger a preset business processing flow.
[0041] In the embodiment of the present disclosure, the target dimension processing trigger probability value set includes at least one target dimension processing trigger probability value.
[0042] For example, if the pre-set business processing type includes external data retrieval, the target dimension processing trigger probability value is the search necessity probability value. The search necessity probability value is a probability indicator used by the classification model to determine whether the current question requires an external search engine. For example, if a user asks "2024 Nobel Prize in Economics winner," the classification model may output a low probability value of 0.15, indicating that an external search engine is not required and the large model can directly answer the question.
[0043] For example, if the pre-set business processing type includes security review, the target dimension processing trigger probability value is the security judgment necessity probability value. The security judgment necessity probability value is a probability indicator used by the classification model to determine whether the current question requires a security judgment. For example, when a user asks "2024 university rankings," the classification model may output a low probability value of 0.10, indicating that there is no need to call the external security review engine for the answer, and the large model can directly answer the question.
[0044] In the disclosed embodiment, the intelligent question-answering system utilizes a dual-threaded processing architecture, comprising a classification thread and a generation thread. The classification thread utilizes a classification model whose parameter scale is smaller than a first parameter value, while the generation thread utilizes a large model whose parameter scale is larger than a second parameter value, wherein the first parameter value is smaller than the second parameter value. This dual-threaded processing architecture supports parallel processing, reduces response delays for most questions, and improves the overall system response speed.
[0045] In the embodiment of the present disclosure, the classification model is a lightweight decision module deployed on the service front end, which is used to output the target dimension processing trigger probability value. This disclosure does not impose mandatory restrictions on the model structure and training method of the classification model.
[0046] In the embodiments of the present disclosure, the large model can be a natural language processing model trained on a large corpus. Illustratively, the large model is a generative artificial intelligence (AI) model, which has the ability of context understanding and text generation. The present disclosure does not impose mandatory limitations on the model structure and training method of the large model.
[0047] In the embodiments of the present disclosure, the first answer is a preliminary answer directly generated by the large model. For example, when the user asks "basic principles of quantum entanglement", the large model generates an explanation text containing the points of wave function superposition and particle correlation.
[0048] In the embodiments of the present disclosure, the final answer is an answer displayed to the user through a visual operation interface. The visual operation interface is a front-end interface including an answer display area, an interactive button, and a voice playback control, and supports text highlighting, picture-text mixed layout and other display forms. The final answer can be output in multiple modalities, for example, in a composite display mode integrating text, voice, and visual elements. For example, when displaying "quantum entanglement experiment steps", the combination of text explanation, three-dimensional animation demonstration, and voice explanation is generated synchronously.
[0049] In some embodiments, the original question input by the user is received through an application programming interface (API) interface, and the question to be answered is determined based on the original question. Here, the original question can be input in the form of text or voice or image or video, etc. In this way, by establishing a unified question receiving channel, multi-modal input is supported, and the complexity of the user input question is reduced.
[0050] In some embodiments, a differentiated preset probability value is set according to the field to which the question belongs. Illustratively, the preset probability value of a general question is 0.8, and the preset probability value of a medical or legal field is 0.6. The above is only an illustrative example and is not a limitation on the preset probability value and the field. In this way, when the target dimension processing trigger probability value is less than the preset probability threshold, the search engine is triggered to supplement the key information, which can reduce unnecessary network requests and save computing resources.
[0051] The scheme of the embodiments of the present disclosure performs the classification model and the large model in parallel, and when the classification model completes the judgment, the large model has generated part of the effective output. When it is determined that there is no need to search (high-frequency scenario), the result calculated by the large model is directly reused, which reduces the end-to-end response time, saves the calling cost of the search engine, and improves the response speed of answering questions.
[0052] In the embodiments of the present disclosure, the business processing type includes at least one of the following:
[0053] External data retrieval processing;
[0054] content security review processing;
[0055] de-identification processing, which can specifically include data generalization and data suppression;
[0056] compliance review processing.
[0057] When the processing trigger probability value of any target dimension exceeds the preset probability value threshold corresponding to the target dimension, the corresponding business processing flow is executed.
[0058] In the intelligent question and answer scenario, the "external data retrieval processing" target dimension is set, and when the probability value is greater than a certain threshold, the search flow is executed.
[0059] In the social media platform post generation content scenario, the "content security review processing" target dimension is set, and when the probability value is greater than a certain threshold, the content security review processing is automatically performed.
[0060] In the medical question and answer scenario, the "de-identification processing" target dimension is set, and when the probability value is greater than a certain threshold, the patient's identity information is automatically shielded.
[0061] In the financial field, the "compliance review processing" target dimension is set, and the regulatory rule database is connected in real time.
[0062] In this way, compared with single dimension threshold judgment, the disclosure can improve the judgment speed of each preset business type by multiple target dimension independent judgment. At the same time, the probability value of each target dimension is independently judged, which can reduce the false trigger rate. The threshold is dynamically adjusted according to the dimension, which can improve the resource utilization rate.
[0063] In some embodiments, the question processing method further includes: if the processing trigger probability value of any target dimension is not less than the preset probability value corresponding to the target dimension, sending a termination signal to the large model, and starting the business processing flow corresponding to the target dimension to obtain the key information required to answer the question to be answered; generating an enhanced prompt based on the key information and the question to be answered; inputting the enhanced prompt into the large model to obtain a second answer generated by the large model; and taking the second answer as the final answer to the question to be answered.
[0064] In the embodiment of the disclosure, the termination signal is a control instruction for interrupting the generation process of the large model. For example, a preset method is called through API to terminate the text generation, thereby avoiding invalid calculation.
[0065] In the embodiment of the disclosure, the processing flow corresponding to the target dimension is a processing link for obtaining supplementary information through an external data source.
[0066] In the embodiments of the present disclosure, the key information is structured data that is strongly related to the question after screening. For example, for the question "New sports competition events in 2024", the extracted fields include the name of the competition and the rule change clause.
[0067] In the embodiments of the present disclosure, the enhanced prompt is an optimized input that combines the original question and external knowledge. For example, the original question "Working principle of quantum computer" is restructured as "Explain the working principle of quantum computer in combination with the paper 'Superconducting qubit array'".
[0068] In the embodiments of the present disclosure, the second answer is an optimized answer generated based on the enhanced prompt. For the same question to be answered, when the question to be answered needs to be searched, the accuracy and comprehensiveness of the second answer are higher than those of the first answer.
[0069] In some embodiments, the processing flow corresponding to the target dimension is started, including: determining a target search engine that matches the question type and the field of the question to be answered from a pre-constructed hybrid search engine based on the question type and the field of the question to be answered, and calling the target search engine to search the question to be answered. In this way, the search accuracy can be improved and the search time can be reduced. The above is only an exemplary description, and is not intended to limit all possible cases of starting the processing flow corresponding to the target dimension, but here we do not make an exhaustive enumeration.
[0070] In some embodiments, the enhanced prompt is generated, including: adding the question to be answered and the key information to the corresponding positions according to a preset prompt template to obtain the enhanced prompt. In this way, the robustness of the enhanced prompt can be improved, and the accuracy of the answer facts can be improved. The above is only an exemplary description, and is not intended to limit all possible cases of generating the enhanced prompt, but here we do not make an exhaustive enumeration.
[0071] In this way, compared with the traditional scheme in which the large model reasoning needs to be completely performed regardless of whether the search is needed, the present scheme can reduce the resource waste rate by immediately terminating the large model reasoning when the classification model determines that the search is needed. When it is determined that the search is needed (low-frequency scenario), the large model generates the second answer in combination with the key information obtained by the search engine, which can improve the accuracy of answering the question.
[0072] In some embodiments, the question processing method further includes: extracting a time-related entity in the question to be answered; accessing a dynamically updated mandatory trigger rule library; if it is detected that the time-related entity matches the mandatory trigger rule library, generating a mandatory trigger instruction, the mandatory trigger instruction has the highest priority and can override the classification result of the classification model; and sending a termination signal to the large model after the mandatory trigger instruction is triggered.
[0073] In the embodiments of the present disclosure, the time-related entity is a time element in the question that represents timeliness. For example, the explicit time is "2024" in "2024 election results of the highest administrative position of a company". The implicit time is "latest version" in "the latest version of medical insurance policy" (which needs to be analyzed as the current year). The time range is "five years" in "the growth rate of per capita consumption level in the past five years".
[0074] In the embodiments of the present disclosure, the mandatory triggering rule library is a knowledge base that stores timeliness rules that must be triggered. For example, in the medical field, the related question and answer within 30 days are forced to be retrieved; in the financial field, the latest 3 working days are automatically matched when "the latest interest rate" is involved; in the legal field, the latest bulletin is associated when the question contains "revised version".
[0075] In the embodiments of the present disclosure, the mandatory triggering instruction is a search control signal with the highest priority, and the execution logic is to interrupt all ongoing processing threads and immediately start the search engine.
[0076] In some embodiments, the time-related entity in the question to be answered is extracted, including: extracting the time-related entity in the question to be answered based on a pre-constructed hybrid recognition model. The hybrid recognition model includes a basic layer, an enhanced layer, and a post-processing layer. The basic layer is used to detect explicit timestamps. The enhanced layer is used to analyze professional expressions. The post-processing layer is used to standardize the time format. In this way, the accuracy of time-related entity recognition can be improved.
[0077] In this way, the present scheme can improve the processing accuracy of time-sensitive questions by constructing a timeliness-driven intelligent decision-making system.
[0078] In some embodiments, the termination signal is sent to the large model, including: if the real-time inference progress value of the large model is monitored and does not exceed the preset progress value, a first mandatory termination signal is sent to the large model, the first mandatory termination signal being used to indicate that the inference process for the question to be answered is directly terminated; if the real-time inference progress value of the large model is monitored and exceeds the preset progress value, a second mandatory termination signal is sent to the large model, the second mandatory termination signal being used to indicate that the inference process is terminated after the generated intermediate activation value is saved.
[0079] In the embodiments of the present disclosure, the real-time inference progress value is a completion quantitative index of the answer generated by the large model. The real-time inference progress value can be calculated based on the Token generation ratio. For example, if 120 Tokens / estimated total length 200 Tokens have been output, the progress value = 60%. The real-time inference progress value can be evaluated based on semantic integrity. For example, a pre-trained model is used to determine whether the main structure of the answer is complete, such as whether the conclusion section appears.
[0080] In the embodiments of the present disclosure, the preset progress value is a critical threshold value for triggering different termination strategies. For example, in a general scenario, the preset progress value can be set to 35% (empirical value, balancing resource consumption and information retention), and in a medical field scenario, the preset progress value can be adjusted to 50% (to ensure the integrity of key diagnostic basis). The above are only exemplary descriptions and do not limit all possible cases of the preset progress value. Here, an exhaustive enumeration is not made.
[0081] In the embodiments of the present disclosure, the first forced termination signal is an instruction to terminate immediately and not to retain the intermediate activation value.
[0082] In the embodiments of the present disclosure, the second forced termination signal is an instruction to terminate after retaining the intermediate result.
[0083] In the embodiments of the present disclosure, the intermediate activation value can be an output feature vector of each layer of the large model.
[0084] In some embodiments, the Token generation rate of the inference process is collected by the lightweight monitoring module, the remaining generation time is estimated by using a neural network, and the real-time inference progress value is predicted. In this way, by predicting the real-time inference progress value, the termination signal is issued early, which not only improves the resource release speed, but also avoids invalid calculation and saves computing energy consumption.
[0085] In some embodiments, the intermediate activation value is saved according to a preset incremental saving mechanism. The preset incremental saving mechanism includes: transmitting the activation value asynchronously and saving the intermediate activation value by using a hierarchical storage strategy. For example, for a key layer, complete parameters are saved, and for a non-key layer, only gradient change amounts are stored. In this way, the interruption recovery time can be shortened, and the coherence of answer generation can be improved.
[0086] In this way, by using the phased dynamic termination strategy (the first / second forced termination signal), the system intelligently distinguishes the resource recycling value of different inference progress stages, and significantly optimizes the computing resource utilization rate. If the progress is lower than the threshold value, the resources are directly released, so that the invalid computing resource consumption is reduced. If the progress is greater than the threshold value, the intermediate activation value is saved, and when the same type of problem is triggered again, the progress can reduce the amount of repeated calculation. By fine-grained calculation process control, compared with the traditional full termination scheme, the resource utilization rate can be improved, and compared with the no termination scheme, the influence of abnormal interruption can be reduced.
[0087] In some embodiments, the problem processing method further includes: calculating a hash value of the to-be-solved problem before inputting the to-be-solved problem into the classification model; if the hash value exists in the cache and is not expired, it is determined that the first processing thread is not executed, and the target dimension processing trigger probability value is determined according to the classification result corresponding to the hash value in the cache.
[0088] In the embodiment of the present disclosure, a hash value is a unique identifier of a fixed length obtained by mapping input data through a hash function.
[0089] In the embodiment of the present disclosure, the cache is a temporary storage area for storing frequently accessed data.
[0090] In the embodiment of the present disclosure, the classification result cache is a key-value pair set that stores historical question classification probability values.
[0091] In some implementations, cache update strategies include: active updates: when a user marks an answer as "satisfied," the cache validity period for that question is extended to 7 days; passive updates: when the classification model version is upgraded, the cache of the relevant fields is cleared (via tag association); and exception handling: when a hash conflict is detected, a double hash check mechanism is activated. The above is merely illustrative and does not constitute a complete list of all possible cache update strategies, but this is not intended to be exhaustive.
[0092] In this way, if the hash value exists in the cache and has not expired, the first processing thread will not be executed, and the target dimension processing trigger probability value will be determined based on the classification result corresponding to the hash value in the cache, which can save computing resources; compared with classification model reasoning, it can further improve the system's response speed in answering questions.
[0093] In some embodiments, the problem handling method further includes: calculating the current total benefit based on the acceleration benefit and resource waste loss monitored in real time; and adjusting the preset probability value when it is monitored that the total benefit drops by more than the permitted value.
[0094] In the disclosed embodiments, acceleration benefits refer to the business value conversion brought about by the improvement of system response speed. For example, in the e-commerce customer service scenario, for every 1 second faster response, the conversion rate increases by 0.3%.
[0095] In the embodiment of the present disclosure, resource waste loss is the hardware cost consumed by ineffective computing.
[0096] In the embodiment of the present disclosure, the permission value may be a specific value or a proportional value.
[0097] In some implementations, the acceleration benefit indicator and the resource loss indicator are collected through a deployed distributed indicator collector.
[0098] In some embodiments, the total revenue or the revenue change rate is calculated by a revenue calculation engine.
[0099] This reduces the overall cost per question through real-time revenue optimization, not only helping to achieve optimal cost control but also improving resource allocation efficiency. For example, during peak traffic hours, the system automatically increases the preset probability value to prioritize service availability and increase peak throughput. When answering questions in specialized areas (such as medical and legal consultations), the system automatically decreases the preset probability value to improve answer accuracy.
[0100] In some embodiments, the total revenue is calculated as:
[0101] Total benefit = α × acceleration benefit - β × resource waste loss; α and β represent preset coefficients, and α + β = 1.
[0102] Among them, acceleration benefit = response speed improvement value × unit speed value coefficient.
[0103] Among them, resource waste loss = number of tasks terminated early × single task computing cost.
[0104] In the embodiment of the present disclosure, the response speed and resource consumption cost can be balanced by adjusting α and β.
[0105] In this way, by converting the business goal of total revenue into a computable mathematical model, precise alignment of system resource allocation and value is achieved. Compared with traditional empirical tuning methods, this can reduce the cost per unit problem and improve the overall benefits in complex scenarios.
[0106] In some embodiments, the large model adopts a staged reasoning architecture, which includes a fast response layer and a precise processing layer; wherein the fast response layer is used to perform first-stage reasoning, and the first-stage reasoning includes: calling the lightweight model in the large model to generate an answer summary; the precise processing layer is used to perform second-stage processing, and the second-stage reasoning includes: when no termination signal is received within a preset time, calling the complete model in the large model for in-depth processing, and the first-stage reasoning and the second-stage reasoning share the intermediate results of the attention mechanism.
[0107] In the disclosed embodiment, the staged reasoning architecture is a collaborative computing framework that splits the model reasoning process into multiple stages.
[0108] In the disclosed embodiment, the fast response layer is an efficient reasoning module responsible for generating preliminary answers.
[0109] In the disclosed embodiment, the precise processing layer is a complete model module for performing deep reasoning.
[0110] In the embodiment of the present disclosure, the computation time of the fast response layer does not exceed a preset percentage of the total computation time. The preset percentage is an upper threshold of the fast layer computation time as a percentage of the total inference time.
[0111] In the embodiments of the present disclosure, the intermediate result of the attention mechanism is the cached data of the Key / Value matrix in the Transformer network.
[0112] In some embodiments, the fast response layer reasoning includes: constructing a lightweight model architecture; deploying a real-time monitoring system; implementing dynamic batch processing: automatically reducing the batch size when the time consumption approaches the threshold. In this way, the first byte arrival time can be shortened, and the user perceived waiting time can be reduced.
[0113] In some embodiments, the accurate processing layer deepening processing includes: designing an intermediate result sharing mechanism, saving the intermediate result when the fast layer is executed, loading the shared result by the accurate processing layer, and implementing a progressive generation strategy: generating an answer framework in the first stage, and filling in technical details (formula / case / reference) in the second stage. In this way, not only the amount of deep reasoning calculation is reduced, but also the information density of the answer is improved.
[0114] Taking the emergency triage scene as an example, the user symptom description is “sudden chest pain with dyspnea”, and the system processing flow is: fast layer (0.28 seconds): output “suspected acute coronary syndrome, recommend immediate electrocardiogram examination”; accurate layer (1.2 seconds): supplement the characteristics of ST-segment elevation myocardial infarction, troponin detection threshold, and percutaneous coronary intervention (PCI) operation indications; shared intermediate result: reuse the attention weight of chest pain symptoms (similar case matching degree 92%). In this way, the triage accuracy can be improved.
[0115] In this way, the fast response layer occupies a small amount of resources to complete the preliminary response, and the accurate processing layer is started on demand to avoid high consumption throughout the process; the attention sharing mechanism ensures the semantic coherence of the two stages, the fast layer guarantees the basic response speed, and the accurate layer improves the reliability through multi-path verification.
[0116] In some embodiments, the classification model and the large model are obtained by joint training. The joint training includes: constructing an adversarial training sample set; the adversarial training sample set includes common sense questions that need to be answered quickly and professional questions that need to be answered accurately, wherein the common sense questions are marked as not needing to search, and the professional questions are marked as needing to trigger a preset business processing flow; designing a joint loss function; and training the classification model and the large model based on the joint loss function.
[0117] In the disclosed embodiments, the adversarial training sample set includes a special training dataset of adversarial samples to improve model robustness. Examples include the common sense question "What is the boiling point of water?" (marked as not requiring search); the specialized question "Optimization method for beamforming algorithm for phase noise compensation in millimeter wave communications" (marked as requiring search); and the adversarial question "Should the batch normalization layer be placed before the activation function in a neural network?" (requiring manual labeling and verification).
[0118] In the disclosed embodiments, a search rule system is pre-established, and the need for searching sample questions is determined based on the search rule system. For example, the need for searching is determined based on the timeliness of the sample questions. For example, sample questions with less timeliness, such as historical facts and theorem knowledge, are not searched; whereas sample questions with more timeliness, such as scientific and technological advances and legal provisions, are searched.
[0119] In the disclosed embodiment, the joint loss function is a composite objective function that simultaneously optimizes the classifier and the generator.
[0120] In the embodiment of the present disclosure, the calculation formula of the joint loss function can be:
[0121] Total loss = γ × classification loss + (1-γ) × large model perplexity difference, where γ can increase with the number of training rounds.
[0122] In this way, by building a knowledge closed loop and joint training, the accuracy of classification model recognition can be improved, and the intelligent collaboration of "accurate classification-reliable generation" can be achieved. For problems with weak timeliness, the speed of answering can be improved; for problems with strong timeliness, the accuracy of answering can be improved.
[0123] In some embodiments, the unanswered questions in step S101 are sub-questions obtained by dividing the original question input by the user. In some embodiments, the question processing method further includes: if the original question includes multiple unanswered questions, then according to the logical relationship between the original questions, the final answers corresponding to each unanswered question are integrated to obtain the final answer to the original question.
[0124] In the disclosed embodiments, the original question can be a complete, complex question input by the user. Sub-questions are independently answerable units broken down through semantic parsing. For example, if the original question is "Compare the effectiveness, side effects, and vaccination interval requirements of pneumonia and influenza vaccines," it can be broken down into three sub-questions: "Pneumonia vaccine effectiveness data," "Common side effects of influenza vaccines," and "Minimum number of days between vaccinations for the two vaccines."
[0125] In the disclosed embodiments, logical relationships represent the associations between problem units. For example, logical relationships may include serial relationships, embedded relationships, comparative relationships, and the like. The above is merely an example and does not limit all possible logical relationships. This is not intended to be exhaustive.
[0126] In some implementations, a semantic parsing model can be deployed to segment the original question input by the user. A multi-level segmentation strategy can be employed to segment the original question. This multi-level segmentation strategy includes: first-level segmentation: period / question mark clauses; second-level segmentation: conjunction analysis ("及", "与", "并"); and third-level segmentation: dependency syntax tree parsing. This multi-level segmentation improves the accuracy of the original question segmentation, thereby helping to improve the accuracy of the answer to the original question.
[0127] In some implementations, a logical relationship recognition model can be deployed to identify the logical relationships between sub-questions within the original question. Logical relationships include, but are not limited to, temporal relationships, comparative relationships, inclusion relationships, serial relationships, and embedding relationships. By establishing a process of problem decomposition, answer generation, and logical reorganization, the speed of answering the original question can be increased.
[0128] In this way, the response speed and accuracy of the intelligent question-answering system in answering questions can be improved.
[0129] Figure 2 The flowchart of online reasoning of intelligent question answering system is shown as Figure 2 As shown, the process includes:
[0130] S201: Split the original question input by the user into one or more questions to be answered;
[0131] S202: Determine whether the question to be answered hits the cache. If yes, execute S203; if not, execute S204;
[0132] S203: Obtain the classification result from the cache, call the large model to process the question to be answered, and then execute S205a or S205b according to the obtained classification result;
[0133] S204: calling the classification model to generate a classification result, and calling the large model to process the question to be answered. After the classification model generates a classification result, S205a or S205b is executed according to the classification result.
[0134] S205a: If the classification result is that no search is required, the large model continues to process the question to be answered, and then executes S207;
[0135] S205b: If the classification result is that search is needed, terminate the processing of the to-be-answered question by the large model, call a search engine to process the to-be-answered question, and then perform S206;
[0136] S206: input the key information output by the search engine and the to-be-answered question into the large model, and then perform S207;
[0137] S207: determine whether the original question only includes one to-be-answered question, if yes, perform S208; if no, perform S209;
[0138] S208: directly output the answer generated by the large model;
[0139] S209: according to the logical relationship of the original question, integrate the answers of the large model to each to-be-answered question, and output the integrated final answer.
[0140] It should be noted that, Figure 2 is described by taking that the target dimension only includes external data retrieval as an example. In actual application, the target dimension includes at least one of external data retrieval, content security review, de-identification processing, and compliance review, and here is not exhaustive.
[0141] It should be understood that, Figure 2 The schematic diagram shown is only exemplary and not restrictive, and it is extensible, and those skilled in the art can make various obvious changes and / or replacements based on the examples of Figure 2 The resulting technical solutions still belong to the disclosure range of the embodiments of the present disclosure.
[0142] The scheme can realize parallelization of originally serial modules on part of the traffic, improve the response speed of the overall system, and reduce the user waiting time. Through the cache hit and prediction mechanism, the response speed of the overall system can be further improved. For tasks that need to be searched, the downstream module is preferentially executed when the conditions are met, reducing the consumption of computing resources. Through the combination of parallelization calling mechanism and cache technology, effective use of resources and saving of processing time are realized. The scheme optimizes and innovates the serial task scheduling strategy, and improves the system efficiency.
[0143] The technical scheme of the present disclosure can significantly improve the answer quality while ensuring the response speed of the intelligent question and answer system, and is suitable for intelligent question and answer, service consultation and other scenes, and is also suitable for financial analysis, legal consultation, scientific research assistance, medical diagnosis and other scenes with strict requirements on information timeliness and accuracy.
[0144] The embodiments of the present disclosure provide a question processing device applied to an intelligent question and answer system, such as Figure 3As shown, the apparatus can comprise: a question acquisition module 301, configured to acquire a question to be answered; a thread control module 302, configured to execute a first processing thread and a second processing thread in parallel; wherein the first processing thread is: inputting the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values; the second processing thread is: inputting the question to be answered into a pre-trained large model to generate a first answer; wherein each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow; a first answer determination module 303, configured to, if each target dimension processing trigger probability value is less than a preset probability value corresponding to the target dimension, take the first answer as the final answer of the question to be answered.
[0145] In some embodiments, the apparatus further comprises:
[0146] a first signal control module, configured to, if any target dimension processing trigger probability value is not less than a preset probability value corresponding to the target dimension, send a termination signal to the large model, and start the processing flow corresponding to the target dimension to obtain key information required to answer the question to be answered;
[0147] a prompt generation module, configured to generate an enhanced prompt based on the key information and the question to be answered; input the enhanced prompt into the large model to obtain a second answer generated by the large model;
[0148] a second answer determination module, configured to take the second answer as the final answer of the question to be answered.
[0149] In some embodiments, the apparatus further comprises:
[0150] a second signal control module, configured to extract a time-related entity in the question to be answered; access a dynamically updated mandatory trigger rule library; if it is detected that the time-related entity matches the mandatory trigger rule library, generate a mandatory trigger instruction, the mandatory trigger instruction has the highest priority and can cover the classification result of the classification model; after the mandatory trigger instruction is triggered, send a termination signal to the large model.
[0151] In some embodiments, the first signal control module and the second signal control module are further configured to:
[0152] if it is monitored that the real-time inference progress value of the large model does not exceed the preset progress value, send a first mandatory termination signal to the large model, the first mandatory termination signal is used to indicate that the inference process for the question to be answered is directly terminated;
[0153] if it is monitored that the real-time inference progress value exceeds the preset progress value, send a second mandatory termination signal to the large model, the second mandatory termination signal is used to indicate that the inference process is terminated after the generated intermediate activation value is saved.
[0154] In some embodiments, the apparatus further comprises:
[0155] a determining module configured to:
[0156] calculate a hash value of the question to be answered before inputting the question to the classification model;
[0157] if the hash value exists in the cache and is not expired, determine not to execute the first processing thread, and determine the target dimension processing trigger probability value according to the classification result corresponding to the hash value in the cache.
[0158] In some embodiments, the apparatus further comprises:
[0159] an adjusting module configured to:
[0160] calculate the total income according to the real-time monitored acceleration income and resource waste loss;
[0161] adjust the preset probability value when the total income is monitored to decrease by more than a permitted value.
[0162] In some embodiments, the calculation formula of the total income is:
[0163] total income = α × acceleration income - β × resource waste loss; α and β represent preset coefficients, and α + β = 1;
[0164] wherein, acceleration income = response speed improvement value × unit speed value coefficient;
[0165] wherein, resource waste loss = number of tasks terminated in advance × single task calculation cost.
[0166] In some embodiments, the large model adopts a staged inference architecture, and the staged inference architecture comprises a fast response layer and an accurate processing layer; wherein,
[0167] the fast response layer is configured to perform first stage inference, and the first stage inference comprises: calling a lightweight model in the large model to generate an answer summary;
[0168] the accurate processing layer is configured to perform second stage processing, and the second stage inference comprises: calling a complete model in the large model for deepening processing when no termination signal is received, and the second stage inference and the first stage inference share an attention mechanism intermediate result.
[0169] In some embodiments, the classification model and the large model are obtained through joint training. The apparatus further comprises:
[0170] a sample construction module configured to construct an adversarial training sample set; the adversarial training sample set comprises common sense questions requiring fast answers and professional questions requiring accurate answers, wherein the common sense questions are labeled as not requiring triggering a preset business processing flow, and the professional questions are labeled as requiring triggering a preset business processing flow.
[0171] The training module is used to design a joint loss function; classification models and large models are obtained based on the joint loss function training.
[0172] In some embodiments, the question to be answered is a sub-question obtained by dividing the original question input by the user. The device also includes:
[0173] The third answer determination module is used to integrate the final answers corresponding to each question to be answered according to the logical relationship of the original question if the original question includes multiple questions to be answered, so as to obtain the final answer to the original question.
[0174] For the description of specific functions and examples of each module and submodule of the device in the embodiment of the present disclosure, please refer to the relevant description of the corresponding steps in the above method embodiment, which will not be repeated here.
[0175] The question processing device in the embodiment of the present disclosure can improve the response speed and answer accuracy of the intelligent question-answering system in answering questions.
[0176] The embodiment of the present disclosure provides a scenario diagram of a problem handling method, such as Figure 4 shown.
[0177] As mentioned above, the problem solving method provided by the embodiments of the present disclosure is applied to electronic devices. The electronic devices are intended to represent various forms of digital computers, such as laptops, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers.
[0178] Specifically, the electronic device can perform the following operations:
[0179] Get questions to be answered;
[0180] The first processing thread and the second processing thread are executed in parallel. The first processing thread inputs the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values. The second processing thread inputs the question to be answered into the pre-trained large model to generate a first answer. Each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow.
[0181] If the trigger probability value of each target dimension is less than the corresponding preset probability value, the first answer is taken as the final answer to the question to be answered;
[0182] When the processing trigger probability value of any target dimension exceeds the preset probability value of the target dimension, a termination signal is sent to the large model, and the corresponding business processing flow is executed to obtain the key information output by the corresponding business processing flow;
[0183] The second answer generated by the large model based on the enhanced prompt is used as the final answer; wherein the enhanced prompt is generated based on the question to be answered and key information.
[0184] It should be understood that Figure 4 The scene diagram shown is only illustrative and not restrictive. Those skilled in the art can Figure 4 Various obvious changes and / or substitutions can be made to the examples, and the resulting technical solutions still fall within the scope of the disclosure of the embodiments of the present disclosure.
[0185] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0186] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0187] Figure 5 A schematic block diagram of an example electronic device 500 that can be used to implement embodiments of the present disclosure is shown. 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 can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0188] like Figure 5 As shown, the device 500 includes a computing unit 501, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the device 500 can also be stored in the RAM 503. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0189] Various components in device 500 are connected to I / O interface 505, including: an input unit 506, such as a keyboard, mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a magnetic disk, optical disk, etc.; and a communication unit 509, such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows device 500 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0190] The computing unit 501 can be a variety of general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the problem-solving method. For example, in some embodiments, the problem-solving method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the problem-solving method described above can be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to execute the problem handling method in any other appropriate manner (eg, by means of firmware).
[0191] Various embodiments of the systems and techniques described 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), system on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0192] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0193] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0194] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the 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 acoustic input, voice input, or tactile input).
[0195] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0196] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0197] It should be understood that the various forms of flow shown above can be re-ordered, added to, or have steps deleted, using the steps described above. For example, the steps described in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions disclosed in the present application can be achieved, which are not limited herein.
[0198] The specific implementation described above does not constitute a limitation on the protection scope of the present 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 replacements, and improvements within the principles of the present disclosure should be included in the protection scope of the present disclosure.
Claims
1. A problem solving method, comprising: Get questions to be answered; A first processing thread and a second processing thread are executed in parallel; wherein the first processing thread inputs the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values; and the second processing thread inputs the question to be answered into the pre-trained large model to generate a first answer; wherein each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow; If the processing trigger probability value of each target dimension is less than the corresponding preset probability value, the first answer will be used as the final answer to the question to be answered.
2. The method according to claim 1, wherein The business processing types include: External data retrieval processing; Content security review and processing; De-identification; Compliance review processing.
3. The method according to claim 1, wherein The method further comprises: If the processing trigger probability value of any of the target dimensions is not less than the preset probability value corresponding to the target dimension, a termination signal is sent to the large model, and the business processing flow corresponding to the target dimension is triggered to obtain key information required to answer the question to be answered; generating enhanced prompts based on the key information and the questions to be answered; Inputting the enhanced prompt into the large model to obtain a second answer generated by the large model; The second answer is taken as the final answer to the question to be answered.
4. The method according to claim 1, wherein The method further comprises: Extracting time-related entities from the question to be answered; Access to a dynamically updated library of mandatory triggering rules; If it is detected that the time-related entity matches the mandatory trigger rule library, a mandatory trigger instruction is generated, wherein the mandatory trigger instruction has the highest priority and can override the classification result of the classification model; After the forced trigger instruction is triggered, a termination signal is sent to the large model.
5. The method according to claim 3 or 4, wherein: The sending of a termination signal to the large model comprises: If it is monitored that the real-time reasoning progress value of the large model does not exceed the preset progress value, a first forced termination signal is sent to the large model, where the first forced termination signal is used to instruct to directly terminate the reasoning process for the problem to be answered; If it is monitored that the real-time reasoning progress value exceeds the preset progress value, a second forced termination signal is sent to the large model, and the second forced termination signal is used to instruct to save the generated intermediate activation value before terminating the reasoning process.
6. The method according to claim 1, wherein The method further comprises: Before inputting the question to be answered into the classification model, calculating a hash value of the question to be answered; If the hash value exists in the cache and has not expired, it is determined that the first processing thread will not be executed, and the target dimension processing trigger probability value is determined based on the classification result corresponding to the hash value in the cache.
7. The method according to claim 1, wherein The method further comprises: Calculate the current total benefit based on the acceleration benefit and resource waste loss monitored in real time; When it is monitored that the total revenue drops by more than the permitted value, the preset probability value is adjusted.
8. The method according to claim 1, wherein The large model adopts a staged reasoning architecture, which includes a fast response layer and an accurate processing layer; wherein, The fast response layer is used to perform the first stage reasoning, which includes: calling the lightweight model in the large model to generate an answer summary; The precise processing layer is used to perform second-stage processing. The second-stage reasoning includes: when no termination signal is received, calling the complete model in the large model for in-depth processing. The second-stage reasoning and the first-stage reasoning share the intermediate results of the attention mechanism.
9. The method according to claim 1, wherein The classification model and the large model are obtained through joint training, wherein the joint training includes: Construct an adversarial training sample set; the adversarial training sample set includes common sense questions that need to be answered quickly and professional questions that need to be answered accurately, wherein the common sense questions are marked as not requiring the triggering of a preset business process, and the professional questions are marked as requiring the triggering of a preset business process; Design a joint loss function; The classification model and the large model are obtained by training based on the joint loss function.
10. The method according to claim 1, wherein The question to be answered is a sub-question obtained by dividing the original question input by the user; the method further includes: If the original question includes multiple questions to be answered, then according to the logical relationship of the original question, the final answer corresponding to each question to be answered is integrated to obtain the final answer to the original question.
11. A problem handling device, comprising: Question acquisition module, used to obtain questions to be answered; A thread control module is configured to execute a first processing thread and a second processing thread in parallel; wherein the first processing thread inputs the question to be answered into a pre-trained classification model to generate a set of target dimension processing trigger probability values; and the second processing thread inputs the question to be answered into a pre-trained large model to generate a first answer; wherein each target dimension corresponds to a preset business processing type, and the probability value is used to determine whether to trigger the corresponding business processing flow; The first answer determination module is used to use the first answer as the final answer to the question to be answered if the trigger probability value of each target dimension processing is less than the corresponding preset probability value.
12. An electronic device comprising: at least one processor; as well as a memory communicatively connected to at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 10.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are for causing a computer to perform a method according to any one of claims 1-10.
14. A computer program product comprising a computer program stored on a storage medium, the computer program implementing the method according to any one of claims 1 to 10 when executed by a processor.
Citation Information
Cited By
Data screening method and device, large language model output acceleration method and device, medium and product
CN121071124A