A large model-based consulting method and device
By embedding computation and sample conditional routing, combined with security and process verification, the problems of poor consultation response quality and insufficient security in existing technologies are solved. Optimization and adaptation under unlabeled data are achieved, thereby improving the quality and security of consultation responses.
Patent Information
- Application Number
- CN202511343046.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-19
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-09-19
AI Technical Summary
Existing technologies generate poor consultation answers without relying on high-quality labeled data in vertical fields, making it difficult to achieve optimal path selection in different scenarios. They also lack security and controllability, and cannot guarantee the quality of consultation answers or adaptability to different vertical fields.
Multiple paths are generated through embedded computation, and label-free quality assessment is performed. Sample conditional routing is then carried out, and security and process verification and correction are performed. Finally, vertical strategy mapping is used to generate optimized responses to ensure the quality and security of consultation answers.
It enables the optimization of consultation response quality without the need for labeled data, improves the security and controllability of large model output in vertical fields, ensures the quality of consultation responses in different vertical fields, and breaks through the limitations of the adaptability of large model output.
Smart Images

Figure CN120832405B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing technology, and in particular to a consultation method and apparatus based on a large model. Background Technology
[0002] With the rapid development of artificial intelligence (AI) technology, Large Language Models (LLMs) have been widely applied in various vertical fields, particularly in professional areas such as emotional counseling, predictive analytics services, and mental health assessment. AI-based emotional counseling refers to using technologies such as natural language processing, machine learning, and deep learning to simulate or assist the emotional counseling process. This service aims to generate corresponding counseling responses based on user input through an intelligent system, enabling communication with the user and providing emotional support, psychological guidance, or advice. When interacting with users, AI systems need to produce high-quality, reliable responses that conform to the context and flow of the scenario to deliver the desired counseling answers and achieve a better interactive effect.
[0003] However, existing technologies for generating consultation responses face numerous challenges and technical bottlenecks in vertical applications. First, current technologies cannot generate effective consultation responses without relying on high-quality labeled data specific to the vertical domain; even with high-quality labeled data, the effectiveness of optimizing and selecting consultation responses cannot be guaranteed. Second, the effectiveness of consultation responses generated by existing technologies varies significantly depending on the type of consultation information, making it difficult to select the optimal path (i.e., model, hints, or strategies) for different scenarios, thus affecting the quality of the generated responses. Furthermore, consultation responses generated by existing technologies are likely to suffer from insufficient security and controllability, making them less practical for vertical domains such as emotional counseling where security and controllability are extremely important. In addition, existing technologies cannot guarantee the quality of consultation responses generated for different vertical domains, impacting user experience.
[0004] Therefore, overcoming the shortcomings of the existing technology is an urgent problem to be solved in this technical field. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide a consultation method and apparatus based on a large model.
[0006] The present invention adopts the following technical solution:
[0007] Firstly, this invention provides a consultation method based on a large model.
[0008] Obtain user-inputted consultation information; generate multiple paths using the consultation information based on embedded computing; perform label-free quality assessment on the multiple paths;
[0009] Based on the results of the label-free quality assessment, sample conditional routing is performed on the multiple paths to determine the optimal candidate.
[0010] The optimal candidate is then subjected to security and process verification and correction to obtain the final output;
[0011] The final output is mapped using a vertical strategy to generate an optimized response, which in turn generates a consultation answer.
[0012] Furthermore, the step of generating multiple paths using the consultation information based on embedded computing, and performing a label-free quality assessment on the multiple paths, includes:
[0013] The consultation information is used to construct a candidate path pool, and multiple candidate outputs are obtained to generate multiple paths corresponding to the consultation information.
[0014] Generate a combined embedding for each of the candidate outputs; using the combined embedding, estimate the local covariance matrix in the neighborhood of the consultation information to obtain the whitening transformation matrix;
[0015] The consensus embedding of the consultation information is solved using the combined embedding and the whitening transformation matrix. Based on the consensus embedding, the final quality index of the candidate output is determined to complete the label-free quality assessment.
[0016] Furthermore, the step of using the combined embedding and the whitening transformation matrix to solve the consensus embedding of the consultation information, and determining the final quality index of the candidate output based on the consensus embedding, includes:
[0017] Using the combined embedding, the whitening transformation matrix, and the consensus embedding, the nearest neighbor proximity of the consultation information is determined based on Mahalanobis metric.
[0018] Calculate density-weighted pairwise Mahalanobis distances within the neighborhood of the consultation information to construct a consistency graph; determine the webpage ranking results or feature vector centrality of the consistency graph as the consistency graph centrality;
[0019] The candidate outputs are subjected to high-priority security and medium-priority process checks to determine the rule consistency factor;
[0020] The final quality index of the candidate output is obtained by combining the nearest neighbor proximity, the consistent graph centrality, and the rule consistency factor based on the weighted geometric mean and normalized fusion.
[0021] Furthermore, based on the results of the label-free quality assessment, sample-conditional routing is performed on the multiple paths to determine the optimal candidate, including:
[0022] Retrieve the K-nearest neighbor set of the consultation information from the historical database;
[0023] The local covariance matrix, whitening transformation matrix, and consensus embedding are determined according to the K-nearest neighbor set, and the density-weighted pairwise Mahalanobis distance is calculated within the K-nearest neighbor set.
[0024] For all candidate outputs of the consultation information, the candidate output with the highest final quality index is determined as the optimal candidate to complete the sample conditional routing.
[0025] Furthermore, determining the candidate output with the highest final quality index as the optimal candidate from all candidate outputs of the consultation information also includes:
[0026] When the maximum final quality metric is less than the routing threshold, the alternative path is determined as the optimal candidate according to the backoff priority.
[0027] Furthermore, the step of performing security and process verification and correction on the optimal candidate to obtain the final output includes:
[0028] Taboo topic detection is performed on the optimal candidate by keyword matching, and capability boundary detection is performed on the optimal candidate based on professional advice identification, so as to conduct security rule checks.
[0029] When taboo topic detection and / or capability boundary detection are hit, the optimal candidate fails the security rule check, and the capability boundary declaration is determined as the final output;
[0030] When the optimal candidate passes the security rule check, a process rule check is performed on the optimal candidate to determine the final output.
[0031] Furthermore, when the optimal candidate passes the security rule check, performing a process rule check on the optimal candidate to determine the final output includes:
[0032] When the number of dialogue rounds of the optimal candidate is less than the number of rounds threshold, and the optimal candidate belongs to the suggestion type output, the optimal candidate fails the process rule check, and non-suggestion content is determined as the final output; wherein, the non-suggestion content includes in-depth exploration output or empathy support output;
[0033] When the optimal candidate is the same as the historical output, the optimal candidate fails the process rule check, and the candidate output with the second largest final quality index is determined as the final output.
[0034] If the optimal candidate fails the process rule check, the optimal candidate will be determined as the final output.
[0035] Furthermore, the final output is mapped using a vertical strategy to generate an optimized response, which in turn generates a consultation answer, including:
[0036] Develop a strategy tagging system for specific vertical industries;
[0037] Determine the strategy tag corresponding to the final output in the strategy tagging system; determine the structured description guide according to the strategy tag;
[0038] The structured description guidance is fine-tuned based on user history, emotional state, and / or question type to obtain an optimized response.
[0039] Secondly, the present invention also provides a large-model-based consultation device for implementing the large-model-based consultation method described in the first aspect, the device comprising:
[0040] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor for performing the large-model-based consultation method described in the first aspect.
[0041] Thirdly, the present invention also provides a non-volatile computer storage medium storing computer-executable instructions that are executed by one or more processors to perform the large-model-based consultation method described in the first aspect.
[0042] This invention constructs an annotation-free output quality assessment mechanism. Through embedded computation, it generates multiple candidate paths and automatically evaluates the quality of candidate outputs, ensuring the effectiveness of quality optimization and selection for consultation responses without relying on high-quality labeled data. By using sample-conditional dynamic routing, the optimal candidate is selected based on quality assessment, thus achieving optimal path selection in different scenarios. Furthermore, the optimal candidate undergoes security and process verification and correction to obtain the final output, improving the security and controllability of large model outputs in vertical domains. By mapping the final output to vertical categories and generating optimized responses, the quality of consultation responses in different vertical domains is ensured, overcoming the limitations of large model outputs' adaptability in vertical domains. Attached Figure Description
[0043] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments of the present invention will be briefly described below. Obviously, the drawings described below are merely some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without any creative effort.
[0044] Figure 1 This is a flowchart illustrating a consultation method based on a large model provided in an embodiment of the present invention;
[0045] Figure 2 This is a schematic diagram of the overall process of a consultation method based on a large model provided in an embodiment of the present invention;
[0046] Figure 3 This is a flowchart illustrating step 10 provided in an embodiment of the present invention;
[0047] Figure 4 This is a schematic diagram of a label-free quality assessment process provided by an embodiment of the present invention;
[0048] Figure 5 This is a flowchart illustrating step 103 provided in an embodiment of the present invention;
[0049] Figure 6 This is a flowchart illustrating step 20 provided in an embodiment of the present invention;
[0050] Figure 7 This is a sample conditional routing flowchart provided in an embodiment of the present invention;
[0051] Figure 8 This is a flowchart illustrating step 30 provided in an embodiment of the present invention;
[0052] Figure 9 This is a schematic diagram of a hierarchical rule engine provided in an embodiment of the present invention;
[0053] Figure 10 This is a flowchart illustrating step 303 provided in an embodiment of the present invention;
[0054] Figure 11 This is a flowchart illustrating step 40 provided in an embodiment of the present invention;
[0055] Figure 12 This is a schematic diagram of the architecture of a consulting device based on a large model provided in an embodiment of the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0057] In the description of this invention, the terms "inner", "outer", "longitudinal", "lateral", "upper", "lower", "top", "bottom", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and do not require that this invention must be constructed and operated in a specific orientation. Therefore, they should not be construed as limiting this invention.
[0058] In this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0059] In this application, unless otherwise expressly specified and limited, the term "connection" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral part; it can be a direct connection or an indirect connection through an intermediate medium. Furthermore, the term "coupled" can refer to an electrical connection that enables signal transmission.
[0060] Furthermore, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0061] Example 1:
[0062] Existing technologies for large model output have several drawbacks in vertical applications, including scarce labeled data, difficulty in selecting generation paths (i.e., models, hints, or strategies), insufficient security and controllability, and limited domain adaptability. These issues are detailed below.
[0063] (1) Scarcity of labeled data: Many output quality optimization and selection methods used to generate answers rely on a large amount of high-quality labeled data (e.g., preference pairs, reward model labels, and correct response examples). However, in vertical fields, especially professional fields such as sentiment counseling and predictive analytics services, obtaining such labeled data is quite difficult. On the one hand, it requires labeled personnel with professional knowledge, resulting in high labor costs. Even disregarding costs, user expressions are highly personalized and contextualized, making it difficult to guarantee label consistency, and using such labeled data can easily affect the training process and results. On the other hand, there are ethical and legal risks related to sensitive user privacy content; the data distribution is long-tailed, with some scenarios having extremely scarce data; that is, most scenarios in the labeled data have relatively small amounts of data, but are diverse, while only a few scenarios have a large amount of data, and the overall data distribution presents a long tail, with a large number of scarce data points at the tail; some scenarios have extremely scarce data, resulting in these scenarios accounting for a very low proportion in the dataset. The above factors lead to the current technology often facing the dilemma of "data hunger" when using large models to generate consultation answers, making it difficult to fully realize the potential of the model.
[0064] (2) Difficulty in selecting generation paths (i.e., models, prompts, or strategies): In practical applications of generating consultation responses, engineers typically have access to multiple models and prompt schemes, which vary significantly in effectiveness for different types of consultation information. For example, a certain model performs well in emotional consultations but is weak in relationship analysis; a certain prompt is good at short questions and answers but is not effective in handling long narratives; different decoding strategies (e.g., temperature, top-k, or top-p) also affect the output style and stability. Existing technologies mostly adopt static single-path selection methods based on global average performance, or supervised routers trained based on labeled data, and simple ensemble methods (e.g., voting or averaging) to solve the problem of difficult generation path selection. However, the above methods are difficult to achieve optimal path selection at the sample level due to ignoring sample differences, relying on labels, and / or high computational costs, which seriously affects the interaction effect.
[0065] (3) Insufficient security and controllability: Scenarios such as emotional counseling have extremely high requirements for security and controllability. Inappropriate counseling responses may cause psychological harm or compliance risks. Existing technologies often adopt a purely generative approach, which has the following drawbacks: risks of taboo topics and out-of-bounds suggestions; lack of understanding of the dialogue process, inappropriate timing and strategy selection; monotonous and repetitive response style; lack of interpretability and auditability, making quality control difficult.
[0066] (4) Limited domain adaptability: The professional terminology and expressions in vertical domains are unique, and the corresponding tagging and strategy systems vary greatly. The general models used in existing technologies generate consultation answers of inconsistent quality in vertical domains, and their adaptability to specific vertical domains is poor, failing to generate consultation answers with good interactive effects. Moreover, existing adaptation methods (such as fine-tuning or migration) still rely on annotation, which cannot fundamentally solve the problem of data scarcity.
[0067] In recent years, based on artificial intelligence technology, unsupervised and weakly supervised methods have made progress in model output selection and quality assessment. However, most of them focus on pattern discovery or specific tasks and are difficult to directly solve sample-level multi-path output selection in professional fields such as emotional counseling, predictive analysis services and mental health assessment, resulting in the inability to generate effective counseling responses.
[0068] Traditional model ensemble methods (such as Bagging, Boosting, or Stacking) are mostly suitable for supervised scenarios. Recently, unsupervised routing techniques have seen some development, but they are often limited to specific tasks or rely on additional prior knowledge. Weakly supervised methods utilize incomplete, inaccurate, or noisy supervisory information to train models, alleviating the scarcity of labeled data; however, existing methods mostly focus on ontology learning rather than multi-path output selection and optimization in a completely unlabeled environment. Therefore, current techniques still cannot generate interactive consultation responses effectively without relying on high-quality labeled data from vertical domains.
[0069] To address the problems in existing technologies and meet the output optimization needs of vertical fields, especially professional fields such as emotional counseling, there is an urgent need for a consultation method based on a large model. This method should be able to automatically evaluate and select the optimal output path without labeling data; dynamically adjust the routing strategy based on the characteristics of the input samples (i.e., consultation information) to achieve personalized output optimization; possess a robust security mechanism and process rules to ensure the security and consistency of consultation answers; flexibly adapt to different vertical fields and strategy systems; and be interpretable and controllable, facilitating human supervision and quality management.
[0070] To solve the above problems, such as Figure 1 As shown, this embodiment of the invention provides a consultation method based on a large model, including:
[0071] Step 10: Obtain the consultation information input by the user; generate multiple paths using the consultation information based on embedded computing; perform a label-free quality assessment on the multiple paths.
[0072] This invention will be illustrated using a real-world application scenario of emotional counseling as an example: the consultation information input by the user is the text or other consultation information entered into the dialog box during an emotional counseling dialogue based on artificial intelligence technology.
[0073] This invention converts consultation information into an embedded vector representation, generates multiple paths from this embedded vector representation in parallel based on embedding computation, and evaluates the generated paths using weak supervision and annotation-free methods based on embedding technology to obtain the final quality index of each path. The specific method for generating multiple paths based on the consultation information can be selected by those skilled in the art according to the specific application scenario, and is not limited here. In this invention, the path refers to the model, hints, or strategies involved in the large model generating the output of the consultation information; for ease of description, "output" will be used to refer to the path below.
[0074] Step 20: Based on the results of the label-free quality assessment, perform sample conditional routing on the multiple paths to determine the optimal candidate.
[0075] Sample conditional routing predicts or selects one or more paths that are most suitable for processing the consultation information based on the characteristics of the consultation information (such as content, semantics, etc.).
[0076] Step 30: Perform security and process verification and correction on the optimal candidate to obtain the final output.
[0077] For the optimal candidate, security and process verification and correction are used to ensure its security and controllability. If the optimal candidate fails the security and process verification, it is corrected or other pre-set outputs that have passed the security and process verification are used as the final output. A specific example will be given below.
[0078] Step 40: The final output is mapped using a vertical strategy to generate an optimized response, which is then used to generate a consultation answer.
[0079] The abstract strategy (i.e., the final output) is mapped to a specific optimized response for a vertical domain. Then, following the guidance, strategy, or prompts of the optimized response, a specific output (i.e., a consultation answer) is generated to respond to the user's input consultation information. The specific implementation method for generating the consultation answer based on the optimized response is selected by those skilled in the art according to the specific use case and is not limited here.
[0080] This invention constructs an annotation-free output quality assessment mechanism. Through embedded computation, it generates multiple candidate paths and automatically evaluates the quality of candidate outputs, ensuring the effectiveness of quality optimization and selection for consultation responses without relying on high-quality labeled data. By using sample-conditional dynamic routing, the optimal candidate is selected based on quality assessment, thus achieving optimal path selection in different scenarios. Furthermore, the optimal candidate undergoes security and process verification and correction to obtain the final output, improving the security and controllability of large model outputs in vertical domains. By mapping the final output to vertical categories and generating optimized responses, the quality of consultation responses in different vertical domains is ensured, overcoming the limitations of large model outputs' adaptability in vertical domains.
[0081] This invention aims to provide a consultation method based on large models, which is based on sample-level multi-model routing and hierarchical rule collaboration without labeling weak supervision. This method enables dynamic selection of the optimal generation path at the sample level without labeling data, and ensures security and process consistency through rule collaboration.
[0082] In one embodiment, the large model-based consultation method of this invention can be implemented through four core modules: an annotation-free quality assessment module, a sample conditional routing module, an output validation and session rule management module, and a vertical domain strategy mapping and response generation module.
[0083] like Figure 2 The diagram shown is an overall flowchart of a consultation method based on a large model according to an embodiment of the present invention. The following is a detailed description:
[0084] In one embodiment, to illustrate the processing flow of the label-free quality assessment module, such as... Figure 3 As shown, step 10 includes:
[0085] Step 101: Use the consultation information to construct a candidate path pool and obtain multiple candidate outputs to generate multiple paths corresponding to the consultation information.
[0086] like Figure 4 As shown, in one embodiment, for consultation information By constructing a candidate path pool Each Receive inquiries Output response or policy label. The candidate path pool includes several pre-trained and / or adapted models, cue templates, and decoding policy combinations.
[0087] Step 102: Generate a combined embedding for each of the candidate outputs; using the combined embedding, estimate the local covariance matrix in the neighborhood of the consultation information to obtain the whitening transformation matrix.
[0088] For each Forming a combined embedding, and in consulting information The local covariance matrix is estimated from the neighborhood, and the whitening transformation matrix is obtained using the local covariance matrix. A pre-trained embedding model is used. Map the input and output combination to 3D embedding space, to obtain combinatorial embedding ;in, Indicates that the pre-trained model The corresponding embedding mapping function (i.e., the encoder) will convert the input sequence (such as...) Or splicing pairs ) mapped to 3D vector representation.
[0089] To avoid the scale and noise sensitivity of Euclidean distance, a local covariance is first constructed in the local neighborhood retrieved from the input embedding space:
[0090] ;
[0091] in, for identity matrix This is the regularization coefficient (used to ensure numerical stability). To embed spatial dimensions, This indicates the calculation of covariance. Indicates inquiry information The set of K nearest neighbors, This indicates the number of candidate outputs generated in step 101.
[0092] Unlike existing technologies that directly load the global sample covariance, this invention's embodiments utilize consultation information. Construct covariance in a subset and add it to the add-in. This prevents the degradation or ill-conditioned nature of the local covariance matrix, thereby enabling greater sensitivity to the local structural features of the input and accurately reflecting the consultation information. The intrinsic distribution of surrounding samples exhibits stronger numerical robustness to noise and outliers; and because the metric after whitening transformation focuses on the consultation information... The local Mahalanobis distance, rather than the global sample space, can improve the differentiation of subsequent quality scores.
[0093] Using the local covariance matrix Define the whitening transformation matrix .
[0094] Step 103: Solve the consensus embedding of the consultation information using the combined embedding and the whitening transformation matrix, and determine the final quality index of the candidate output based on the consensus embedding to complete the label-free quality assessment.
[0095] Within the whitewashed space, the consultation information is solved according to the following formula. Consensus Embedding :
[0096] ;
[0097] in, It is the Huber loss function, which has robust properties and can suppress the influence of outliers; express 3D real space.
[0098] In one embodiment, to illustrate the process of determining the final quality metric for candidate outputs based on consensus embedding, such as... Figure 5 As shown, step 103 includes:
[0099] Step 1031: Using the combined embedding, the whitening transformation matrix, and the consensus embedding, determine the nearest neighbor proximity of the consultation information based on Mahalanobis metric.
[0100] The embodiments of the present invention define three types of complementary quality factors based on consensus embedding: nearest neighbor proximity, consensus graph centrality, and rule consistency factor.
[0101] The expression for nearest neighbor proximity is as follows:
[0102] ;
[0103] in, The square of the Euclidean norm of the corresponding variable.
[0104] Step 1032: Calculate density-weighted pairwise Mahalanobis distances within the neighborhood of the consultation information to construct a consistency graph; determine the webpage ranking results or feature vector centrality of the consistency graph as the consistency graph centrality.
[0105] Inquiry information Calculate density-weighted pairwise Mahalanobis distances within the neighborhood of the graph and construct a consistency graph. PageRank (i.e., webpage ranking result) or eigenvector centrality is used as the consultation information. Corresponding consistency graph centrality The specific method for determining the webpage ranking result or eigenvector centrality of the consistency graph shall be selected by those skilled in the art based on the specific application scenario, and is not limited here.
[0106] Step 1033: Perform high-priority security and medium-priority process checks on the candidate outputs to determine the rule consistency factor.
[0107] For output Perform high-priority security and medium-priority process checks; the corresponding expressions are as follows:
[0108] ;
[0109] in, This is the rule penalty weighting coefficient, which controls the intensity of the penalty for rule violations; This is a hierarchical set of rules, including security rules and process rules, which are determined by those skilled in the art based on specific use cases. A specific example of a hierarchical set of rules will be given below. The rule violation penalty function calculates the penalty value based on the degree of matching between the output content and the corresponding hierarchical rule.
[0110] Step 1034: Based on the weighted geometric mean and normalized fusion of the nearest neighbor proximity, the consistent graph centrality, and the rule consistency factor, the final quality index of the candidate output is obtained.
[0111] The expression for the final quality metric (i.e., the quality score for each path) is as follows:
[0112] ;
[0113] in, Indicates proximity. This represents the index weight corresponding to the proximity of neighbors; Indicates the centrality of a consistent graph. This represents the exponential weight corresponding to the centrality of the consistent graph; Indicates the rule consistency factor. This represents the index weight corresponding to the rule consistency factor.
[0114] The above formula employs a weighted geometric mean and normalized fusion architecture, unlike traditional linear weighted normalization. This invention, when fusing nearest neighbor proximity, consistency centrality, and regularity factors, freely adjusts the relative contributions of these three factors through exponential weights, taking into account the characteristics of each quality factor; and ensures [the desired outcome] through denominator normalization. It conforms to the properties of probability distribution, which facilitates subsequent routing decisions; the rule consistency factor is internalized into the quality scoring system for the first time, realizing seamless coupling between model scoring and rule verification.
[0115] The above design differs from schemes that rely solely on global Euclidean distance and triplet identities. The specific differences are as follows: a local Mahalanobis metric is used instead of global Euclidean distance; a consensus embedding is constructed; cross-path structural consistency information is captured through consensus graph centrality; and rule consistency is directly internalized to the quality score.
[0116] This invention automatically evaluates the quality of candidate outputs through latent variable graphical models and embedding computation. By constructing a latent variable graphical model, the output quality scores of different candidate outputs are evaluated without the need for labeled data, and the output quality is evaluated by combining three types of complementary quality factors.
[0117] In one embodiment, to illustrate the processing flow of the sample conditional routing module, such as... Figure 6 As shown, step 20 includes:
[0118] Step 201: Retrieve the K-nearest neighbor set of the consultation information in the historical database.
[0119] like Figure 7 As shown, this embodiment of the invention designs a sample-conditional dynamic routing algorithm to select the optimal candidate output for each consultation information. The historical database is used for historically received consultation information; the specific implementation of the historical database can be selected by those skilled in the art based on the specific application scenario, and is not limited here. In an optional embodiment, the consultation information... Input pre-trained model Obtain vector representation ,use In the historical database retrieval, the K-nearest neighbor set is searched through the nearest neighbor search, and the neighborhood is weighted by the kernel weight.
[0120] Step 202: Determine the local covariance matrix, whitening transformation matrix, and consensus embedding according to the K nearest neighbor set, and calculate the density-weighted pairwise Mahalanobis distance within the K nearest neighbor set.
[0121] The specific implementation method for calculating the density-weighted pairwise Mahalanobis distance within the K-nearest neighbor set is selected by those skilled in the art based on the specific application scenario.
[0122] Step 203: For all candidate outputs of the consultation information, the candidate output with the highest final quality index is determined as the optimal candidate to complete the sample conditional routing.
[0123] This invention generates optimal candidates based on dynamic routing and abstention. Dynamic routing is implemented using the final quality metric as the sample-level quality score, according to the following formula:
[0124] ;
[0125] in, This represents the optimal candidate. This indicates the final quality indicator.
[0126] In one embodiment, to illustrate the case of abstention, step 203 further includes: when the largest final quality metric is less than the routing threshold, determining the alternative path as the optimal candidate according to the backoff priority.
[0127] The highest final quality index refers to the highest final quality index among multiple candidate outputs generated for the same consultation information; the routing threshold is determined by those skilled in the art based on the specific use case, and is not limited here.
[0128] when In such cases, a rollback (historical consistency / majority consistency) and a safety fallback are implemented, meaning that the alternative path is selected as the optimal candidate. The specific implementation method of the alternative path is determined by those skilled in the art based on the specific use case.
[0129] The fallback priority is as follows: safety fallback > Category A boundary management > highest historical consistency strategy. In one embodiment, corresponding descriptions can be pre-set as outputs for "safety fallback," "Category A boundary management," and "highest historical consistency strategy," i.e., the corresponding alternative paths. When the maximum final quality indicator is less than the routing threshold, the system's security is ensured first, and the "safety fallback" alternative path is adopted as the optimal candidate. Secondly, if there is no "safety fallback" alternative path, boundary management is performed. For example, by using the "Category A boundary management" alternative path as the optimal candidate, the capability boundary of output content is declared to be limited. Finally, if there is no "Category A boundary management" alternative path, the historical optimal candidate is used as the optimal candidate generated this time according to the highest historical consistency strategy.
[0130] In one embodiment, to illustrate the hierarchical logic rules, such as Figure 8 As shown, step 30 includes:
[0131] Step 301: Perform taboo topic detection on the optimal candidate through keyword matching, and perform capability boundary detection on the optimal candidate based on professional advice identification to conduct security rule checks.
[0132] like Figure 9 As shown, this embodiment of the invention establishes a hierarchical logic rule engine, using high-priority security rules and medium-priority process rules to verify and correct candidate outputs. The corresponding rule execution flow is as follows: first, security rules are checked, then process rules are checked; if neither is triggered, the candidate is retained.
[0133] High-priority security rule checks include: (1) taboo topic detection; (2) capability boundary detection. The specific implementation methods for taboo topic detection through keyword matching and capability boundary detection based on professional advice identification shall be selected by those skilled in the art according to the specific use case, and are not limited here.
[0134] Step 302: When taboo topic detection and / or capability boundary detection are hit, the optimal candidate fails the security rule check, and the capability boundary declaration is determined as the final output.
[0135] Among them, taboo topic detection uses a dual-channel detection method based on keywords and semantic similarity; once a match is found, a "capability boundary statement" is forcibly output. Capability boundary detection forces the output of a "capability boundary statement" when the intent exceeds the service scope (e.g., medical, legal, or investment). In one embodiment, such as... Figure 9 As shown, a strategy labeling system can be pre-defined for each vertical domain, with the capability boundary declaration numbered A5.2. This ensures that when the final output is displayed to the user, the user is aware that their input has exceeded the model's capability boundaries and the model cannot provide the expected answer.
[0136] Step 303: When the optimal candidate passes the security rule check, perform a process rule check on the optimal candidate to determine the final output.
[0137] Medium-priority process rules: Avoid making suggestions too early in the early rounds; prioritize empathy or exploration; avoid repeating strategies.
[0138] In one embodiment, such as Figure 10 As shown, step 303 includes:
[0139] Step 3031: When the number of dialogue rounds of the optimal candidate is lower than the number of rounds threshold, and the optimal candidate belongs to the suggestion type output, the optimal candidate fails the process rule check, and the non-suggestion content is determined as the final output; wherein, the non-suggestion content includes in-depth exploration output or empathy support output.
[0140] The specific content of the turn threshold, the in-depth exploration of non-suggested content, and the output of empathic support are all determined by those skilled in the art based on the specific use case. The following rules apply: avoid providing suggestions too early when the number of dialogue turns is small; prioritize empathic support and / or in-depth exploration. Figure 9 As shown, in one embodiment, the round threshold can be 3. Suggestion-type output refers to outputting descriptions that provide suggestions based on the consultation information. In-depth exploration output refers to outputting descriptions that further analyze and discuss the consultation information, allowing the user to feel that the model is exploring the consultation information in depth. Empathy and support output refers to outputting descriptions based on the consultation information.
[0141] Step 3032: When the optimal candidate is the same as the historical output, the optimal candidate fails the process rule check, and the candidate output with the second largest final quality index is determined as the final output.
[0142] Here, historical output refers to the output from previous rounds of conversations with the same user. The following rules apply: detect policy duplication and temporarily lower its priority, select a suboptimal policy, and enhance the richness of the interaction. For example... Figure 9 As shown, for example, the optimal candidate overlaps with historical outputs, meaning the outputs in the last two rounds are duplicated. In this case, the priority of the optimal candidate obtained in step 302 is reduced, and according to the ranking of the final quality index corresponding to the consultation information in step 203, the candidate output with the second largest final quality index is determined as the final output, so as to modify the output strategy for this time.
[0143] Step 3033: When the optimal candidate fails the process rule check, the optimal candidate is determined as the final output.
[0144] This invention introduces a management mechanism that combines output verification with session rules. Through a hierarchical rule engine, it performs security and process consistency checks and corrections on candidate outputs to ensure the security, professionalism and consistency of the final response.
[0145] In one embodiment, to illustrate the process of vertical strategy mapping and response generation, such as... Figure 11 As shown, step 40 includes:
[0146] Step 401: Build a strategy tag system for specific vertical fields.
[0147] By constructing a strategy tagging system, the strategy system and its implementation are optimized for vertical scenarios.
[0148] The following is a specific example of a strategy labeling system: A1 to A6 category strategy labels and their definitions, applicable scenarios, implementation guidelines and examples.
[0149] "A1: Consultation Initiation and Setup (A1.1 Opening Greetings, A1.2 Self-Introduction, A1.3 Obtaining Consultation Questions, A1.4 In-Depth Exploration, A1.5 Declaration of Energy Connection)"
[0150] A2: Interpretation and Analysis (A2.1 Interpretation of the essence of relationships, A2.2 Obstacle identification, A2.3 Psychological analysis of others, A2.4 User's inner perception, A2.5 Future prediction);
[0151] A3: Interactive Response (A3.1 Direct Answer, A3.2 Providing Suggestions);
[0152] A4: Emotional Support (A4.1 Empathy and Support, A4.2 Positive Empowerment);
[0153] A5: Boundary Management (A5.1 Trust Protection, A5.2 Capability Boundary Declaration, A5.3 Payment Guidance);
[0154] A6: General Politeness (A6.1 Standard Politeness Phrases);
[0155] Output mapping: Locates implementation guidelines for the final strategy and generates structured response key points.
[0156] Step 402: Determine the strategy tag corresponding to the final output in the strategy tag system; determine the structured description guide according to the strategy tag.
[0157] For example, the strategy label is "A5.2 Capability Boundary Declaration". Based on the final strategy label, the corresponding descriptive information is located, and a structured description guide is generated. The specific implementation method of this process is selected by those skilled in the art based on the specific use case.
[0158] Step 403: Fine-tune the structured description guidance based on user history, emotional state, and / or question type to obtain an optimized response.
[0159] In one embodiment, the model uses a set of corresponding parameters to represent the user's user history, emotional state, or question type in the current conversation. Then, depending on whether these parameters exceed a certain value, the structured description guidance is adjusted in detail, such as adding reassuring statements to the structured description guidance, thereby realizing the mapping of abstract strategies to specific vertical domain responses.
[0160] To verify the effectiveness of the large-model-based counseling method of this invention, the embodiments of this invention are evaluated on multiple vertical domain datasets. These vertical domain datasets include: an emotional counseling dataset, a predictive analytics service dataset, and a mental health assessment dataset.
[0161] The embodiments of the present invention provide a set of specific examples of experimental results based on commonly used evaluation index systems, as follows:
[0162] The comparison results of the output quality (i.e., optimization success rate) of the existing technical methods and the large model-based consultation method of the present invention in multiple vertical fields are shown in Table 1 below.
[0163] Table 1 Output Quality Comparison Table
[0164]
[0165] The baseline methods in the prior art listed in Table 1 include: Random Selection (Selection) path generation; Best Single Path (BSP) using the globally best-performing single path; Majority Voting (MV); Supervised Router (SR) based on labeled training; and SMOOTHIE-Global (SMOOTHIE-G) unsupervised routing. As shown in the table, the large-model-based consultation method of this invention outperforms existing methods in the fields of emotional counseling, predictive analytics services, and mental health. The corresponding average success rate and standard deviation demonstrate the robustness of the large-model-based consultation method of this invention. It achieves the highest output quality on all datasets, improving by an average of 2.8 percentage points compared to supervised routing and 5.5 percentage points compared to the unsupervised baseline, while also exhibiting higher stability.
[0166] The comparison results of the safety rate of existing technical methods and the large model-based consultation method of the present invention in multiple vertical fields are shown in Table 2 below.
[0167] Table 2 Safety Performance Assessment Table
[0168]
[0169] The comparison results of the existing technical methods and the large model-based consulting method of the present invention in terms of user experience score (UX score) in multiple vertical domains are shown in Table 3 below.
[0170] Table 3 User Experience Evaluation Form
[0171]
[0172] The system performance indicators of the large model-based consulting method of this invention in multiple vertical fields are shown in Table 4 below.
[0173] Table 4 System Performance Indicators
[0174]
[0175] To verify the large-model-based consultation method of this invention, a specific example of ablation experiment results is also provided, as shown in Table 5 below.
[0176] Table 5 Ablation Experiment Results
[0177]
[0178] The large-model-based consultation method of this invention is particularly suitable for large-model-based consultation tasks in vertical fields such as emotional counseling, predictive analytics services, and mental health assessment, to achieve response optimization and output control. It can significantly improve output quality and system security while reducing annotation costs. Experimental results show that compared with traditional fixed models and single-path methods, this invention improves output quality (optimization success rate) by 8-15%, reduces annotation costs by more than 80%, and achieves 100% security through a logical rule mechanism.
[0179] like Figure 12 The diagram shown is an architectural schematic of a large-model-based consulting device according to an embodiment of the present invention. This large-model-based consulting device includes one or more processors 21 and a memory 22. Figure 12 Take a processor 21 as an example.
[0180] Processor 21 and memory 22 can be connected via a bus or other means. Figure 12 Taking the example of a connection between China and Israel via a bus.
[0181] Memory 22, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs and non-volatile computer-executable programs, such as the large-model-based consultation method in the embodiment. Processor 21 executes the large-model-based consultation method by running the non-volatile software programs and instructions stored in memory 22.
[0182] Memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 22 may optionally include memory remotely located relative to processor 21, which can be connected to processor 21 via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0183] The program instructions / modules are stored in the memory 22. When executed by one or more processors 21, they perform the large model-based consultation method in the above embodiments, for example, performing each step of the large model-based consultation method described above.
[0184] It is worth noting that the information interaction and execution process between the modules and units in the above-mentioned device and system are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention, and will not be repeated here.
[0185] Those skilled in the art will understand that all or part of the steps in the various methods of the embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, etc.
[0186] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A consultation method based on a large model, characterized in that, include: Obtain the user's input consultation information; The consultation information is used to construct a candidate path pool, and multiple candidate outputs are obtained to generate multiple paths corresponding to the consultation information. Generate a combined embedding for each of the candidate outputs; the expression for the combined embedding is: ;in, Indicates inquiry information. Indicates candidate output, Indicates that the pre-trained model The corresponding embedding mapping function will input sequence Mapped to 3D vector representation; Using the combined embedding, the local covariance matrix is estimated in the neighborhood of the consultation information to obtain the whitening transformation matrix; the expression for the whitening transformation matrix is as follows: ;in, Represents the local covariance matrix; The consensus embedding of the consultation information is solved using the combined embedding and the whitening transformation matrix. Based on the consensus embedding, the final quality index of the candidate output is determined to complete the label-free quality assessment. The expression for the consensus embedding is: ;in, Here is the Huber loss function. express 3D real space, This represents the square of the Euclidean norm with respect to the corresponding variable; Retrieve the K-nearest neighbor set of the consultation information from the historical database; determine the local covariance matrix, whitening transformation matrix, and consensus embedding according to the K-nearest neighbor set; calculate the density-weighted pairwise Mahalanobis distance within the K-nearest neighbor set; for all candidate outputs of the consultation information, determine the candidate output with the largest final quality index as the optimal candidate to complete the sample conditional routing. The optimal candidate is then subjected to security and process verification and correction to obtain the final output; A strategy tagging system is constructed for specific vertical fields; the final output is used to generate an optimized response based on the corresponding vertical field strategy tagging system to generate consultation answers.
2. The consultation method based on a large model according to claim 1, characterized in that, The method includes: Using the combined embedding, the whitening transformation matrix, and the consensus embedding, the nearest neighbor proximity of the consultation information is determined based on the Mahalanobis metric; the expression for the nearest neighbor proximity is: ;in, Represents the whitening transformation matrix. This indicates the consensus embedding. This indicates the combined embedding; Calculate density-weighted pairwise Mahalanobis distances within the neighborhood of the consultation information to construct a consistency graph; determine the webpage ranking results or feature vector centrality of the consistency graph as the consistency graph centrality; The candidate outputs are subjected to high-priority security and medium-priority process checks to determine the rule consistency factor; the expression for the rule consistency factor is: ;in, This is the rule penalty weighting coefficient. For a hierarchical set of rules, For the rule violation penalty function, Indicates inquiry information. Indicates candidate output; The final quality index of the candidate output is obtained by combining the nearest neighbor proximity, the consistent graph centrality, and the rule consistency factor based on the weighted geometric mean and normalized fusion.
3. The method for conditional quality scores of consultation samples based on a large model according to claim 1, characterized in that, The method further includes: When the maximum final quality metric is less than the routing threshold, the alternative path is determined as the optimal candidate according to the backoff priority.
4. The consultation method based on a large model according to claim 1, characterized in that, The method includes: Taboo topic detection is performed on the optimal candidate by keyword matching, and capability boundary detection is performed on the optimal candidate based on professional advice identification, so as to conduct security rule checks. When taboo topic detection and / or capability boundary detection are hit, the optimal candidate fails the security rule check, and the capability boundary declaration is determined as the final output; When the optimal candidate passes the security rule check, a process rule check is performed on the optimal candidate to determine the final output.
5. The consultation method based on a large model according to claim 4, characterized in that, The method includes: When the number of dialogue rounds of the optimal candidate is less than the number of rounds threshold, and the optimal candidate belongs to the suggestion type output, the optimal candidate fails the process rule check, and non-suggestion content is determined as the final output; wherein, the non-suggestion content includes in-depth exploration output or empathy support output; When the optimal candidate is the same as the historical output, the optimal candidate fails the process rule check, and the candidate output with the second largest final quality index is determined as the final output. If the optimal candidate fails the process rule check, the optimal candidate will be determined as the final output.
6. The consultation method based on a large model according to any one of claims 1-5, characterized in that, The method includes: Determine the strategy tag corresponding to the final output in the strategy tagging system; determine the structured description guide according to the strategy tag; The structured description guidance is fine-tuned based on user history, emotional state, and / or question type to obtain an optimized response.
7. A non-volatile computer storage medium, characterized in that, The computer storage medium stores computer-executable instructions, which are executed by one or more processors to perform the large-model-based consultation method according to any one of claims 1-6.
8. A consultation device based on a large model, characterized in that, include: At least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the processor for performing the large model-based consultation method according to any one of claims 1-6.
Citation Information
Patent Citations
Quality evaluation model training method, multi-round dialogue quality evaluation method and multi-round dialogue quality evaluation device
CN117556005A
Vector database retrieval method and device based on large model, terminal and medium
CN118312594A