Session processing method and electronic equipment
By employing a dual-dimensional decision-making mechanism that combines task difficulty assessment and lexical consumption prediction, the problem of large language models lacking dynamic perception capabilities during reasoning is solved, enabling intelligent selection of reasoning modes and improving service quality and resource utilization efficiency.
Patent Information
- Application Number
- CN202511754399.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-03-03
AI Technical Summary
In existing technologies, large language models lack the ability to dynamically perceive the actual difficulty of the task and the ability to quantitatively control resource budget during the reasoning process. This makes it easy for users to make decision-making errors when manually specifying the reasoning mode, resulting in overthinking of simple problems or failure to use reasoning for complex problems.
It adopts a two-dimensional decision-making mechanism of task difficulty assessment and word consumption prediction. It processes user questions through a pre-trained multi-task assessment model, outputs task difficulty assessment value and word consumption prediction value, and automatically selects the appropriate reasoning mode, including no thinking mode, thinking mode, concise thinking mode, standard thinking mode and deep thinking mode.
It enables intelligent selection of reasoning modes for large language models, improves service quality and resource utilization efficiency, avoids resource waste in simple tasks and incorrect answers in complex tasks, and significantly optimizes overall reasoning efficiency and user experience.
Smart Images

Figure CN121597798A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large language model technology, and more specifically, to a conversation processing method and an electronic device. Background Technology
[0002] With the widespread application of Large Language Models (LLMs) in fields such as intelligent question answering, content generation, and decision support, models with hybrid reasoning modes are gradually becoming an important technical path to improve reasoning quality. These models support two reasoning modes: "thinking" and "not thinking." In thinking mode, the model first generates the internal reasoning process text and then outputs the final answer, which helps improve the accuracy of complex tasks. In non-thinking mode, the model skips the explicit reasoning process and directly generates the answer, thereby reducing token consumption and response latency.
[0003] However, choosing the appropriate inference mode during actual reasoning remains a significant technical challenge. Existing methods primarily rely on manual switching by the user or simple discrimination mechanisms based on fixed rules, lacking the ability to dynamically perceive the actual difficulty of the task and quantitatively control resource budgets. When users manually specify the inference mode, decision-making errors often occur due to the inability to accurately assess the complexity of the problem: simple problems are over-analyzed, resulting in unnecessary computational overhead; complex problems, on the other hand, fail to utilize reasoning, leading to incorrect answers or logical gaps. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a session processing method and electronic device to at least partially improve the problems of lacking dynamic perception of the actual difficulty of a task and quantitative control over resource budget.
[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, embodiments of the present invention provide a session processing method, including: In response to a session request from the target object, retrieve the user question from the session request; The acquired user questions are processed using a pre-trained multi-task evaluation model, which outputs the task difficulty evaluation value of the user questions and the lexical consumption prediction value required to answer the user questions using a thinking mode. Based on the task difficulty assessment value and the word consumption prediction value, determine the reasoning mode for handling the user's question; The user's question is processed according to the determined reasoning pattern to obtain the corresponding response content.
[0006] Optionally, the step of processing the acquired user question using a pre-trained multi-task evaluation model and outputting a task difficulty evaluation value for the user question and a lexical consumption prediction value required to answer the user question using a thinking pattern includes: Extract the semantic information of the user's question; The semantic information is encoded to generate a semantic feature vector; The semantic feature vectors are input into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model, respectively, to obtain the task difficulty evaluation value and lexical consumption prediction value.
[0007] Optionally, after the step of encoding the semantic information to generate a semantic feature vector, the method further includes: Based on the semantic feature vector, a predetermined number of historical questions similar to the user's question are retrieved from the user's historical question database; Extract the metadata of each of the historical questions; the metadata includes the reasoning mode used by the historical question, the number of lexical units consumed, and the quality feedback results; Encode each of the aforementioned metadata to obtain each historical feature vector; The semantic feature vector and each of the historical feature vectors are fused to obtain a fused feature vector; The step of inputting the semantic feature vector into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model respectively to obtain the task difficulty evaluation value and lexical consumption prediction value includes: The fused feature vectors are input into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model, respectively, to obtain the task difficulty evaluation value and lexical consumption prediction value.
[0008] Optionally, the reasoning mode includes a no-thinking mode and a thinking mode, and determining the reasoning mode for handling the user question based on the task difficulty assessment value and the lexical consumption prediction value includes: If the task difficulty assessment value is greater than or equal to the preset difficulty threshold, and the word consumption prediction value is less than or equal to the word budget limit, then the reasoning mode for handling the user problem is determined to be the thinking mode. Otherwise, the reasoning mode for handling the user's problem is determined to be the no-thinking mode.
[0009] Optionally, the reasoning modes include a no-thinking mode, a concise thinking mode, a standard thinking mode, and a deep thinking mode, wherein the depth of reasoning increases sequentially; determining the reasoning mode for handling the user's question based on the task difficulty assessment value and the lexical consumption prediction value includes: Calculate the budget adequacy difference between the upper limit of the lexical budget and the predicted value of lexical consumption; Based on the task difficulty and the preset first difficulty threshold and second difficulty threshold, the user problem is divided into simple task, medium task and complex task. Based on the budget adequacy difference and the preset first leniency threshold and second leniency threshold, the resources required for the user problem are divided into low budget, medium budget and high budget. When the user's problem is a simple task or the resources are limited, select the no-thinking mode; When the user's problem is a medium-sized task and the resources are within a medium budget, select the concise thinking mode; When the user problem is a medium-sized task and the resources are a high budget, select the standard thinking mode; When the user problem is a complex task and the resources are within a medium budget, select the standard thinking mode; When the user's problem is a complex task and resources are in high demand, select the Deep Thinking mode.
[0010] Optionally, the upper limit of the lexical budget is determined by multiplying the maximum response latency set by the user by the lexical output speed of the large language model; wherein, the maximum response latency is the longest waiting time for a question response configured by the user, and the lexical output speed is the number of lexical units generated by the large language model per unit time in the target deployment environment.
[0011] Optionally, after the step of processing the user question according to the determined reasoning pattern to obtain the corresponding response content, the method further includes: Obtain quality assessment data for the response content; The user question, the difficulty assessment value, the reasoning pattern, the actual word consumption for processing the user question, and the quality assessment data are stored in the user's historical question database.
[0012] Optionally, obtaining quality assessment data for the response content includes: Determine whether feedback from the user regarding the response content has been received; If so, the feedback result shall be used as quality assessment data for the response content; If not, the response content is evaluated using a quality assessment model to obtain quality assessment data for the response content.
[0013] Optionally, the step of performing a quality assessment on the response content using a quality assessment model to obtain quality assessment data for the response content includes: Based on the user's question, an online search is performed to obtain reference information related to the user's question; The response content is compared and analyzed with the reference information to generate quality assessment data for the response content.
[0014] In a second aspect, embodiments of the present invention provide an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the method described in any of the above-mentioned embodiments.
[0015] The present invention provides a session processing method and electronic device that, by constructing a dual-dimensional evaluation mechanism of "task difficulty + resource consumption prediction", realizes intelligent dynamic selection of large model inference mode, which significantly optimizes resource utilization efficiency while improving service quality.
[0016] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 A schematic structural block diagram of an electronic device provided in an embodiment of the present invention; Figure 2 This is one of the flowcharts illustrating a session processing method provided in an embodiment of the present invention; Figure 3 A second schematic flowchart of a session processing method provided in an embodiment of the present invention; Figure 4 A third schematic flowchart of a session processing method provided in an embodiment of the present invention; Figure 5 The fourth flowchart illustrates a session processing method provided in an embodiment of the present invention. Figure 6 The fifth flowchart illustrates a session processing method provided in an embodiment of the present invention. Figure 7 A flowchart illustrating a session processing method provided in an embodiment of the present invention is shown in Figure 6. Figure 8 This is a general flowchart of a session processing method provided in an embodiment of the present invention.
[0019] Icons: 100 - Electronic device; 101 - Memory; 102 - Communication interface; 103 - Processor; 104 - Communication bus. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0022] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0023] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0024] As described in the background section, significant technical challenges remain in how to rationally select these two modes during actual reasoning. Existing methods primarily rely on manual switching by the user or simple discrimination mechanisms based on fixed rules, lacking the ability to dynamically perceive the actual difficulty of the task and quantitatively control resource budgets. When users manually specify the reasoning mode, decision-making errors often occur due to the inability to accurately assess the complexity of the problem: simple problems are over-analyzed, resulting in unnecessary computational overhead; complex problems, on the other hand, result in incorrect answers or logical gaps because the reasoning process is not utilized.
[0025] Based on the above, embodiments of the present invention provide a conversation processing method and electronic device. By introducing a two-dimensional decision-making mechanism of task difficulty assessment and lexical consumption prediction, it achieves automated and intelligent selection of reasoning modes. Compared with existing technologies that rely on manual intervention or fixed rules, it can accurately identify the complexity of the problem, ensuring the quality of answers to high-difficulty tasks while avoiding resource waste caused by overthinking in simple tasks.
[0026] To implement the process steps and functions of the various examples of this invention, please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic structural block diagram of an electronic device provided in an embodiment of the present invention. The electronic device 100 includes a memory 101 and a processor 103, which are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses 104 or signal lines. The memory 101 can be used to store software programs and modules, and the processor 103 executes the software programs and modules stored in the memory 101, thereby performing various functional applications and data processing.
[0027] Electronic device 100 may be, but is not limited to, a personal computer (PC), a server, a distributed computer, etc. It is understood that electronic device 100 is not limited to a physical server, but may also be a virtual machine on a physical server, a virtual machine built on a cloud platform, or any other computer that can provide the same functionality as the server or virtual machine.
[0028] The memory 101 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.
[0029] The communication connection between the electronic device 100 and external devices is achieved through at least one communication interface 102 (which can be wired or wireless).
[0030] Processor 103 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of this embodiment can be completed by integrated logic circuits in the hardware of processor 103 or by instructions in software form. Processor 103 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0031] Understandable. Figure 1 The structure shown is for illustrative purposes only; the electronic device 100 may also include components that are more advanced than those shown. Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.
[0032] The session processing method provided by this invention will be described below by way of example. See [link to documentation]. Figure 2 The subject executing this method can be one of the above. Figure 1 The electronic device 100 shown, the method includes as follows Figure 2 The following steps are described: S209: In response to a session request from the target object, retrieve the user question from the session request.
[0033] S210: Use a pre-trained multi-task evaluation model to process user questions, and output the task difficulty evaluation value of the user questions and the lexical consumption prediction value required to answer the user questions using thinking patterns.
[0034] S220: Determine the reasoning pattern for handling user questions based on the task difficulty assessment value and the word consumption prediction value.
[0035] S230: Process the user's question according to the determined reasoning pattern and obtain the corresponding response content.
[0036] When a target object (such as an end user or calling program) initiates a session request to interact with the large language model, the session request is received and the original natural language input text, i.e., the user question, is extracted from it.
[0037] After obtaining user questions, a pre-trained multi-task evaluation model is used to process them. This multi-task evaluation model can jointly optimize multiple relevant prediction objectives on a large-scale labeled dataset through supervised learning, and has the ability to simultaneously evaluate the complexity of user questions at the task level and the resources required in the answering process.
[0038] The "Task Difficulty Assessment Value" characterizes the cognitive or computational complexity of the task involved in the user's problem. This value reflects the overall difficulty in problem understanding, logical reasoning, knowledge retrieval, or multi-step solution. It can be represented as a continuous numerical value (e.g., a score between 0 and 1, where a value closer to 0 indicates a simpler problem, and a value closer to 1 indicates a more difficult problem) or a graded rating (e.g., low, medium, high). For example, the model will output a higher task difficulty assessment value for problems requiring cross-domain knowledge integration or deep causal reasoning; while for fact-finding or grammatical transformation problems, it will output a lower assessment value.
[0039] Meanwhile, the "predicted lexical consumption value required to answer user questions using a thinking mode" refers to the expected number of tokens in the language model output sequence when using generative thinking mechanisms such as Chain-of-Thought (CoT), self-reflection, and step-by-step reasoning to respond to the question. This number can be represented in the form of segmented predictions (e.g., 500, 1000, 1500, 2000...). This predicted value reflects the potential computational overhead and latency risk, and is an important basis for the selection of inference modes in resource-sensitive scenarios.
[0040] The two metrics mentioned above can share the underlying semantic representation by the multi-task evaluation model and be output separately through independent head networks, ensuring collaborative learning and feature reuse among the objectives and improving prediction accuracy and generalization ability. The model input is the original user question text, which, after semantic features are extracted by the encoder, is fed into the difficulty prediction head and the lexical consumption prediction head respectively, and finally outputs the corresponding values.
[0041] Based on the obtained task difficulty assessment and lexical consumption prediction values, the reasoning mode used to handle the user's question is automatically determined. The reasoning mode may include no-thinking mode, thinking mode, or may include: no-thinking mode, concise thinking mode, standard thinking mode, and deep thinking mode.
[0042] After determining the target reasoning mode, the large language model configures its generation behavior according to that mode. For example, if the reasoning mode is a no-thinking mode, the large language model directly starts the answer generation process and suppresses the intermediate reasoning text output; if it is a thinking mode, it activates the corresponding prompt template, guiding the model to first output the chain of thought process or self-reflection statements, and then generate the final response content.
[0043] This method introduces a two-dimensional decision-making mechanism—task difficulty assessment and lexical consumption prediction—to automate and intelligently select reasoning modes for large models. Compared to existing technologies that rely on manual intervention or fixed rules, this method can accurately perceive the actual complexity of the problem. While ensuring the quality of answers to high-difficulty tasks, it effectively avoids resource waste caused by overthinking in simple tasks, significantly improving overall reasoning efficiency and user experience.
[0044] For predicting task difficulty assessment values and lexical consumption prediction values, predictions can be made directly using the semantic information of the user's question, or by combining the semantic information of the user's question with the user's historical questions. In one optional implementation, see [link to implementation details]. Figure 3 Step S210 may include the following sub-steps: S211, S212 and S217, which are used to directly predict the task difficulty and lexical consumption based on the content of the current user question itself.
[0045] S211: Extract semantic information from user questions.
[0046] S212: Encode semantic information to generate semantic feature vectors.
[0047] S217: Input the semantic feature vector into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model respectively to obtain the task difficulty evaluation value and lexical consumption prediction value.
[0048] In step S211, semantic information is first extracted from the received user question. This process can be implemented using natural language understanding technology, aiming to capture key semantic elements such as the question's topic domain, syntactic structure, intent category, and potential knowledge requirements. For example, using rules and small-scale neural networks, the semantic information extracted from the current user question may include question length, domain entity keywords, etc.
[0049] Next, in step S212, the extracted semantic information is encoded to generate a high-dimensional semantic feature vector. This encoding process can use a pre-trained language model as the encoder to map the user question into a dense semantic space, so that semantically similar questions have similar vector representations in this space. This semantic feature vector can effectively represent the essential content of the user question and serve as a shared input for the multi-task evaluation model.
[0050] Subsequently, in step S217, the aforementioned semantic feature vectors are input into two independent output heads in the multi-task evaluation model: the "difficulty prediction head" and the "lexical consumption prediction head." The difficulty prediction head can be trained through regression or classification to output a task difficulty assessment value reflecting the cognitive complexity of the task. The lexical consumption prediction head, based on supervised learning of the actual number of tokens consumed in historical question-and-answer data, outputs a predicted lexical consumption value for the length of tokens required to generate the user's question when the thinking mode is activated. These two prediction results together constitute the core basis for subsequent inference mode decisions.
[0051] In another alternative implementation, to further improve evaluation accuracy, user historical behavior information can be introduced after step S212 to enhance the model's understanding of personalized or context-sensitive questions. See also Figure 4 After step S212, the method may further include the following steps: S213: Based on semantic feature vectors, retrieve a preset number of historical questions similar to the user's questions from the user's historical question database.
[0052] S214: Extract metadata for each historical problem; metadata includes the reasoning pattern used in the historical problem, the number of lexical units consumed, and the quality feedback results.
[0053] S215: Encode each metadata element to obtain each historical feature vector.
[0054] S216: Perform feature fusion on the semantic feature vector and each historical feature vector to obtain the fused feature vector.
[0055] Step S217 includes: S217: Input the fused feature vector into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model respectively to obtain the task difficulty evaluation value and lexical consumption prediction value.
[0056] Based on the generated semantic feature vectors, a predetermined number of historical questions with semantic similarity to the current user's question are retrieved from a pre-built database of user historical questions. This retrieval process can be implemented through vector similarity calculation (such as cosine similarity or approximate nearest neighbor search) to ensure that the most valuable historical cases are matched.
[0057] For each retrieved historical question, its associated metadata is extracted. The metadata includes at least three key pieces of information: the reasoning mode used for the historical question at the time (no thinking mode, thinking mode, etc.); the number of lexical units consumed during the actual answering process; and the quality feedback results of the response content to the historical question, which reflect the effectiveness of the answer.
[0058] The metadata of each historical issue is encoded to obtain the corresponding historical feature vector. This encoding can be converted into a continuous vector by an embedding layer, and then combined with numerical variables (such as word consumption count) after normalization to form a structured representation that can participate in neural network operations.
[0059] Next, the semantic feature vector of the current user's question is fused with the historical feature vectors corresponding to all retrieved historical questions to obtain a comprehensive fused feature vector. Fusion strategies can employ attention mechanisms, weighted summation, or nonlinear transformation after concatenation, enabling the model to adaptively focus on historical experiences that performed well in similar past situations.
[0060] Accordingly, step S217' in this implementation is adjusted to: inputting the fused feature vector into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model, respectively, thereby outputting more accurate task difficulty evaluation values and lexical consumption prediction values. Since this fused feature not only includes the semantic content of the current problem but also incorporates the processing trajectory and effect feedback of similar historical problems, the predictions made are more context-aware and experience-guided, making it particularly suitable for personalized service scenarios or the optimized scheduling of high-frequency repetitive tasks.
[0061] In one alternative implementation, the reasoning mode of the large language model has only two basic types: no-thinking mode and thinking mode. Among them: The no-thinking mode refers to the large language model skipping explicit internal reasoning processes (such as chain thinking, self-reflection, etc.) and directly generating the final answer. It is suitable for simple, explicit or factual query tasks and has lower lexical consumption and response latency.
[0062] The thinking mode refers to the large language model outputting intermediate reasoning steps (such as "Let's analyze step by step...") before generating the answer, and then drawing a conclusion based on the reasoning path. It is suitable for complex tasks that require multi-step logical deduction, cross-domain knowledge integration, or abstract understanding. Although it improves accuracy, it increases lexical overhead.
[0063] Accordingly, see Figure 5 Step S220 may include the following steps: S221: If the task difficulty assessment value is greater than or equal to the preset difficulty threshold, and the word consumption prediction value is less than or equal to the word budget limit, then the reasoning mode for handling user problems is determined to be the thinking mode.
[0064] S222: Otherwise, determine that the reasoning mode for handling user problems is the no-thinking mode.
[0065] A preset difficulty threshold is used to distinguish whether the internal reasoning mechanism needs to be enabled for a task. Its value can be obtained based on historical data statistical analysis or through offline experimentation and optimization. For example, it can be set to 0.5 (the normalized difficulty score range is [0,1]). The thinking mode is only considered to be enabled when the problem is determined to be "sufficiently complex".
[0066] Meanwhile, a lexical budget cap is introduced as a resource constraint to ensure that even if the problem is difficult, it should not exceed the system's acceptable response latency or computational cost. The thinking mode is only allowed to be activated if the expected lexical consumption does not exceed this budget, thereby avoiding a decline in user experience due to excessively long reasoning processes.
[0067] When a user's question is highly difficult (task difficulty assessment value ≥ preset difficulty threshold), but the expected resource consumption is still within a controllable range (predicted word consumption value ≤ word budget limit), the system determines to activate "thinking mode," allowing the model to perform enhanced reasoning behaviors such as thought chain expansion, intermediate hypothesis generation and verification; otherwise, it enters "no-thinking mode," directly returning a fast response result to avoid unnecessary resource consumption.
[0068] In real-world business scenarios, users typically have clear expectations regarding the response latency of large language models. This method allows users to configure their desired response latency, thereby calculating the lexical budget ceiling. The lexical budget ceiling is determined by multiplying the user-defined maximum response latency by the lexical output rate of the large language model; where the maximum response latency is the longest waiting time for a question response configured by the user, and the lexical output rate is the number of lexical units generated by the large language model per unit time in the target deployment environment. This can be expressed by the following formula:
[0069] Where token_budget is the upper limit of the token budget, max_latency is the maximum latency for answering questions set by the user, and model_speed is the speed at which the large language model outputs tokens.
[0070] For example, if the user sets the maximum response time to 5 seconds, and the average output speed of the deployed large model on the target device is 100 / second, then the corresponding word budget limit is 500.
[0071] In another optional implementation, to achieve more refined reasoning control, the reasoning mode is expanded to four levels: No-Thinking Mode, Concise Thinking Mode, Standard Thinking Mode, and Deep Thinking Mode. The reasoning depth of each mode increases sequentially, adapting to different levels of task complexity and resource availability. Specifically, No-Thinking Mode refers to the large language model skipping any form of explicit internal reasoning process (such as chain thinking, self-reflection, etc.) and directly generating the final answer based on the input question. Concise Thinking Mode refers to the large language model performing only lightweight, limited-step (e.g., no more than 5 steps) logical reasoning before generating the final answer. The reasoning chain is short, focusing on core derivation steps and avoiding redundant expansion. Standard Thinking Mode refers to the model using complete chain thinking for comprehensive but not overly in-depth analysis. The reasoning chain (e.g., no more than 10 steps) is moderate, covering the main logical branches and knowledge calls. Deep Thinking Mode refers to the large language model initiating advanced cognitive operations, including multi-round iterative reasoning, counterfactual deduction, cross-document information integration, hypothesis generation and verification, self-correction, and other complex behaviors, forming a deep and systematic solution path.
[0072] In this case, see Figure 6 Step S220 may include the following steps: S221`: Calculate the difference in budget adequacy between the upper limit of the lexical budget and the predicted value of lexical consumption.
[0073] S222: Based on the task difficulty and the preset first difficulty threshold and second difficulty threshold, user problems are divided into simple tasks, medium tasks and complex tasks.
[0074] S223: Based on the difference in budget adequacy and the preset first and second leniency thresholds, the resources required for user issues are divided into low budget, medium budget, and high budget.
[0075] S224: Select No Thinking Mode when the user's problem is a simple task or resources are limited.
[0076] S225: When the user's problem is a medium-sized task and the resources are within a medium budget, select the concise thinking mode.
[0077] S226: When the user problem is a medium-sized task and the resources are a high budget, choose the standard thinking mode.
[0078] S227: When the user problem is a complex task and the resources are within a medium budget, select the standard thinking mode.
[0079] S228: When the user's problem is a complex task and the resources are in a high budget, select the deep thinking mode.
[0080] First, subtract the predicted word consumption value from the upper limit of the word budget to obtain the budget sufficiency difference. This difference reflects the "margin" available for the reasoning process under the current resource conditions and is a key indicator for determining whether deeper thinking can be enabled.
[0081] Subsequently, based on the difference between the task difficulty assessment value and the budget adequacy value, user problems were categorized into simple tasks, medium tasks, and complex tasks, and the resources required for user problems were categorized into low budget, medium budget, and high budget: a task difficulty assessment value less than the first difficulty threshold is a simple task; a task difficulty assessment value greater than or equal to the first difficulty threshold and less than the second difficulty threshold is a medium task; a task difficulty assessment value greater than or equal to the second difficulty threshold is a complex task; a budget adequacy difference less than the first leniency threshold is a low budget; a budget adequacy difference greater than or equal to the first leniency threshold but less than the second leniency threshold is a medium budget; and a budget adequacy difference greater than or equal to the second leniency threshold is a high budget.
[0082] Based on the above division, the following hierarchical decision-making logic is executed: If a user's problem is determined to be a simple task, or if system resources are in a low-budget state, then the reasoning mode for handling that user's problem is determined to be the no-thinking mode.
[0083] If a user's problem is classified as a medium-level task and the system resources are in a medium-budget state, then the reasoning mode for handling the user's problem is determined to be the concise thinking mode.
[0084] If a user's problem is classified as a medium-sized task and system resources are in a high-budget state, then the reasoning mode for handling that user's problem is determined to be the standard thinking mode.
[0085] If a user's problem is determined to be a complex task and the system resources are in a medium-budget state, then the reasoning mode for handling the user's problem is determined to be the standard thinking mode.
[0086] If a user's problem is determined to be a complex task and system resources are in a high-budget state, then the reasoning mode for handling the user's problem is determined to be the deep thinking mode.
[0087] Alternatively, this method can also avoid dividing the task and directly perform the following multi-level judgment: If the task difficulty assessment value is less than the first difficulty threshold, or the budget adequacy difference is less than the first leniency threshold, the reasoning mode is determined to be the no-thinking mode. This indicates that the problem itself is relatively simple, or system resources are scarce, and no explicit reasoning needs to be initiated.
[0088] When the task difficulty assessment value is greater than or equal to the first difficulty threshold and less than the second difficulty threshold, and the budget adequacy difference is greater than or equal to the first leniency threshold but less than the second leniency threshold, the reasoning mode is determined to be the concise thinking mode. This is suitable for medium-difficulty problems, allowing for lightweight reasoning (e.g., reasoning steps ≤ 5) when resources are limited.
[0089] When the task difficulty assessment value is greater than or equal to the first difficulty threshold and less than the second difficulty threshold, but the budget adequacy difference is greater than or equal to the second leniency threshold, the reasoning mode is determined to be the standard thinking mode. This is suitable for medium-difficulty problems, allowing for lightweight reasoning (e.g., 5 < reasoning steps ≤ 10) when resources are limited.
[0090] When the task difficulty assessment value is greater than or equal to the second difficulty threshold (high-difficulty task), and the budget adequacy difference is at a moderate level (≥ the first lenient threshold but < the second lenient threshold), the standard thinking mode can still be used. Even with slightly limited resources, sufficient reasoning at the basic level should be ensured for highly complex problems.
[0091] When the task difficulty assessment value is greater than or equal to the second difficulty threshold, and the difference in budget adequacy is greater than or equal to the second leniency threshold, the reasoning mode is determined to be the deep thinking mode. This is the highest level of reasoning, which may include advanced cognitive operations such as multiple rounds of self-verification, counterfactual reasoning, and cross-document integration, and is only activated when the problem is extremely difficult and resources are sufficient.
[0092] This multi-level decision-making mechanism enables dynamic hierarchical control of reasoning behavior, which not only improves the quality of responses to complex tasks but also takes into account resource utilization and service stability. By introducing the indicator of "budget adequacy difference," it can not only determine whether resources are "sufficient" but also identify whether resources are "abundant," thereby achieving a leapfrog decision-making ability from "whether one can think" to "to what extent one can think."
[0093] In an exemplary configuration, the first difficulty threshold is set to 0.2, the second difficulty threshold is set to 0.7, the first lenient threshold is set to 100, and the second lenient threshold is set to 500. Actual values can be flexibly adjusted based on the model architecture, deployment environment, and service objectives.
[0094] For example, if the task difficulty assessment value is 0.1, or the budget adequacy difference is 50, then use the no-thinking mode directly. If the task difficulty assessment value is 0.5 and the budget adequacy difference is 300, then use the concise thinking mode. If the task difficulty assessment value is 0.5 and the budget adequacy difference is 800, then use the standard thinking mode. If the task difficulty assessment value is 0.8 and the budget adequacy difference is 300, then use the standard thinking mode. If the task difficulty assessment value is 0.8 and the budget adequacy difference is 800, then use the deep thinking mode.
[0095] The above judgment rules can be formally represented as a two-dimensional decision matrix. A task difficulty assessment value less than the first difficulty threshold indicates a simple task; a task difficulty assessment value greater than or equal to the first difficulty threshold but less than the second difficulty threshold indicates a medium task; and a task difficulty assessment value greater than or equal to the second difficulty threshold indicates a complex task. A budget adequacy difference less than the first leniency threshold indicates a low budget; a budget adequacy difference greater than or equal to the first leniency threshold but less than the second leniency threshold indicates a medium budget; and a budget adequacy difference greater than or equal to the second leniency threshold indicates a high budget. See Table 1 below: Table 1
[0096] To further enhance the intelligence level of reasoning pattern decision-making and the system's adaptive capability, after generating the response content (step S230), the method may also include subsequent processing steps to evaluate quality and continuously optimize model performance, see [link to relevant documentation]. Figure 7 After step S230, the method may further include the following steps: S240: Obtain quality assessment data for the response content.
[0097] To measure the output performance under different inference modes, this invention provides a hybrid quality evaluation mechanism that integrates explicit feedback and automatic assessment. This mechanism effectively addresses scenarios where user feedback is lacking, ensuring that all question-and-answer interactions receive reliable quality scores.
[0098] Step S240 may include the following steps: S241: Determine whether feedback from the user regarding the response content has been received.
[0099] S242: If so, use the feedback results as quality assessment data for the response content.
[0100] The feedback can be likes / dislikes, ratings, text comments, etc. For example, if a user clicks the "helpful" button, the answer is marked as "high quality"; if the user edits or adds information or explicitly marks "incorrect information," it is marked as "low quality."
[0101] This method directly reflects the user experience, is highly reliable, and is suitable for application scenarios with user interaction interfaces (such as intelligent customer service, dialogue assistants, etc.).
[0102] S243: If not, conduct a quality assessment of the response content using a quality assessment model to obtain quality assessment data for the response content.
[0103] If no user feedback is received, the response content is automatically evaluated using a pre-trained quality assessment model to obtain the corresponding quality assessment data.
[0104] This quality assessment model can be trained using a discriminative neural network model with a large amount of manually labeled data, and it has the ability to judge the completeness of the answer, the consistency of facts, the logical coherence and the relevance.
[0105] In one alternative implementation, step S243 may include the following sub-steps: S2431: Based on the user's question, perform an online search to obtain reference information related to the user's question.
[0106] Search sources can include authoritative knowledge bases (such as academic databases), the top N results returned by search engines, industry white papers, and other credible resources; search strategies can be dynamically adjusted according to the type of question. For example, factual questions can be prioritized for searching structured databases, while opinion questions can be compared using multiple sources.
[0107] S2432: Compare and analyze the response content with the reference information to generate quality assessment data for the response content.
[0108] The analytical dimensions can include: whether key facts are accurate, whether there are illusions, information coverage, and clarity of expression. The output can be a continuous score (such as a quality score between 0 and 1) or a rating label (such as "Excellent", "Satisfactory", "Unsatisfactory").
[0109] S250: Store user questions, difficulty assessment values, reasoning patterns, actual word consumption for handling user questions, and quality assessment data in the user history question database.
[0110] After obtaining the quality assessment data, the system summarizes and persistently stores the key information from this interaction in the user's historical question database, forming an experience memory pool that can be used for future reasoning and decision-making. This information can then be used in steps S213 and S214.
[0111] The stored information may include: the original text of the user's question, the task difficulty assessment value output by the multi-task evaluation model, the actual reasoning mode used, the actual number of lexical units consumed in processing the question, and the quality assessment data of the response content (from user feedback or automatic evaluation).
[0112] This user history problem database can be stored in a vector database, relational database, or distributed file system, supporting efficient semantic retrieval and feature extraction. For example, when processing new problems, semantic similarity can be calculated to retrieve several historical cases from this database, enhancing the contextual understanding and decision-making basis for the current task.
[0113] In one alternative implementation, see [link to implementation details]. Figure 8 After obtaining the user's question, semantic extraction is performed on the user's question, and multiple similar historical questions are retrieved from the user's historical question database to extract meta-information. The semantic information and each meta-information are encoded and fused to obtain a fused feature vector. Based on the fused feature vector, the task difficulty evaluation value and the token consumption prediction value are predicted. Based on these two values, the inference mode is determined. The determined inference mode and the user's question are input into the large language model for processing to obtain the response content of the user's question. Then, the quality of the response content is evaluated. Finally, the user's question, inference mode, token consumption, quality evaluation data, etc. are stored in the user's historical question database.
[0114] In summary, the conversation processing method and electronic device provided by this invention can jointly consider the task difficulty of the user's question and the lexical consumption prediction under the thinking mode, and adaptively select the optimal inference mode in combination with resource budget constraints. While ensuring the quality of answers to complex tasks, it avoids the waste of computing resources caused by overthinking in simple tasks, significantly improving inference efficiency and system response performance. Furthermore, by introducing a user historical question database, a quality feedback loop, and an automatic evaluation mechanism, the model's adaptability to personalized scenarios is enhanced, and continuous learning and optimization are supported, thereby achieving a dual improvement in quality and efficiency in resource-constrained environments.
[0115] In the embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0116] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0117] If the functionality is implemented as a software module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a computer-readable storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0118] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
[0119] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A session processing method, characterized in that, include: In response to a session request from the target object, retrieve the user question from the session request; The user question is processed using a pre-trained multi-task evaluation model, which outputs the task difficulty evaluation value of the user question and the lexical consumption prediction value required to answer the user question using a thinking mode. Based on the task difficulty assessment value and the word consumption prediction value, determine the reasoning mode for handling the user's question; The user's question is processed according to the determined reasoning pattern to obtain the corresponding response content.
2. The method according to claim 1, characterized in that, The process of using a pre-trained multi-task evaluation model to process the user question and outputting a task difficulty evaluation value for the user question and a predicted lexical consumption value required to answer the user question using a thinking pattern includes: Extract the semantic information of the user's question; The semantic information is encoded to generate a semantic feature vector; The semantic feature vectors are input into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model, respectively, to obtain the task difficulty evaluation value and lexical consumption prediction value.
3. The method according to claim 2, characterized in that, After the step of encoding the semantic information to generate a semantic feature vector, the method further includes: Based on the semantic feature vector, a predetermined number of historical questions similar to the user's question are retrieved from the user's historical question database; Extract the metadata of each of the historical questions; the metadata includes the reasoning mode used by the historical question, the number of lexical units consumed, and the quality feedback results; Encode each of the aforementioned metadata to obtain each historical feature vector; The semantic feature vector and each of the historical feature vectors are fused to obtain a fused feature vector; The step of inputting the semantic feature vector into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model respectively to obtain the task difficulty evaluation value and lexical consumption prediction value includes: The fused feature vectors are input into the difficulty prediction head and lexical consumption prediction head of the multi-task evaluation model, respectively, to obtain the task difficulty evaluation value and lexical consumption prediction value.
4. The method according to claim 1, characterized in that, The reasoning mode includes a no-thinking mode and a thinking mode. Determining the reasoning mode for handling the user's question based on the task difficulty assessment value and the lexical consumption prediction value includes: If the task difficulty assessment value is greater than or equal to the preset difficulty threshold, and the word consumption prediction value is less than or equal to the word budget limit, then the reasoning mode for handling the user problem is determined to be the thinking mode. Otherwise, the reasoning mode for handling the user's problem is determined to be the no-thinking mode.
5. The method according to claim 1, characterized in that, The reasoning modes include a no-thinking mode, a concise thinking mode, a standard thinking mode, and a deep thinking mode, with increasing reasoning depth; determining the reasoning mode for handling the user's question based on the task difficulty assessment value and the lexical consumption prediction value includes: Calculate the budget adequacy difference between the upper limit of the lexical budget and the predicted value of lexical consumption; Based on the task difficulty and the preset first difficulty threshold and second difficulty threshold, the user problem is divided into simple task, medium task and complex task. Based on the budget adequacy difference and the preset first leniency threshold and second leniency threshold, the resources required for the user problem are divided into low budget, medium budget and high budget. When the user's problem is a simple task or the resources are limited, select the no-thinking mode; When the user's problem is a medium-sized task and the resources are within a medium budget, select the concise thinking mode; When the user problem is a medium-sized task and the resources are a high budget, select the standard thinking mode; When the user problem is a complex task and the resources are within a medium budget, select the standard thinking mode; When the user's problem is a complex task and resources are in high demand, select the Deep Thinking mode.
6. The method according to claim 4 or 5, characterized in that, The upper limit of the lexical budget is determined by multiplying the maximum response latency set by the user by the lexical output speed of the large language model; wherein, the maximum response latency is the longest waiting time for a question response configured by the user, and the lexical output speed is the number of lexical units generated by the large language model per unit time in the target deployment environment.
7. The method according to any one of claims 1 to 5, characterized in that, After the step of processing the user question according to the determined reasoning pattern to obtain the corresponding response content, the method further includes: Obtain quality assessment data for the response content; The user question, the difficulty assessment value, the reasoning pattern, the actual word consumption for processing the user question, and the quality assessment data are stored in the user's historical question database.
8. The method according to claim 7, characterized in that, The step of obtaining quality assessment data for the response content includes: Determine whether feedback from the user regarding the response content has been received; If so, the feedback result shall be used as quality assessment data for the response content; If not, the response content is evaluated using a quality assessment model to obtain quality assessment data for the response content.
9. The method according to claim 8, characterized in that, The step of evaluating the quality of the response content using a quality assessment model to obtain quality assessment data for the response content includes: Based on the user's question, conduct an online search to obtain reference information related to the user's question; The response content is compared and analyzed with the reference information to generate quality assessment data for the response content.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Task processing method, computing device and computer readable storage medium
CN119806850A
Code generation task adaptive reasoning method, device and equipment
CN120560664A
Automatic deep thinking model selection training method and system for large language model
CN120706561A
Methods and systems for indicating resource usage parameter for prompting a large language model (LLM)
US20240311192A1
Output detection method for large language model, apparatus, electronic device and storage medium
WO2025139382A1