A psychological counseling ethics simulation and evaluation method and system based on multi-agent cooperation
By using a multi-agent collaborative approach, ethical traps are dynamically generated and evaluated in real time, which solves the problems of insufficient realism of simulated scenarios and lagging evaluation in existing technologies. This achieves high-fidelity scenario reconstruction and credibility assessment, and improves the automation level of ethics training.
Patent Information
- Application Number
- CN202511503429.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-21
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-10-21
AI Technical Summary
Existing technologies struggle to dynamically embed ethically compliant challenging scenarios in AI-simulated psychological counseling settings. They suffer from insufficient realism in the simulated scenarios, strong evaluation lag, and high subjectivity, failing to meet the application requirements for high real-time performance and high credibility.
We adopt a multi-agent collaborative approach to simulate and evaluate ethical issues in psychological counseling. By acquiring and monitoring dialogue context data, we generate trap question templates using a trap question knowledge base, and combine a rule matching engine and a semantic reasoning model to conduct real-time ethical evaluation, ensuring the high fidelity of the generated content and the interpretability of the evaluation.
It achieves high-fidelity contextual reconstruction, improves the contextual relevance of ethical trap embedding and the level of automation in assessment, ensures the credibility of the ethical assessment process and the interpretability of the results, and reduces semantic illusion and role deviation in the generation of virtual visitor dialogues.
Smart Images

Figure CN120977505B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and system for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration. Background Technology
[0002] Artificial intelligence technology, as an important technological support in the field of mental health services, has made significant progress in areas such as assisted diagnosis, emotion recognition, and automated dialogue intervention. It has become an effective way to improve the efficiency and accessibility of psychological counseling services and is being gradually promoted and applied in universities, medical institutions, and online health platforms.
[0003] However, in AI-simulated psychological counseling scenarios, dynamically embedding ethically challenging situations and achieving real-time, reliable, and interpretable ethical compliance assessments of counselors' responses remains a key technological bottleneck in this field. Existing solutions largely rely on static pre-set question banks or post-event manual playback analysis, which suffers from insufficient realism in simulated scenarios, strong assessment lag, high subjectivity, and difficulty in scaling. These limitations fail to meet the high real-time and high-reliability application requirements in ethical training and professional risk prevention for psychological counselors.
[0004] While research has been conducted on dialogue generation technologies based on single large-scale language models, expert system evaluation methods based on human-made rules, and ethics training platforms based on case-based teaching, these methods generally suffer from the following limitations: a lack of high-fidelity virtual visitor simulation capabilities, an inability to achieve dynamic and context-appropriate ethical trap generation mechanisms, and difficulty in achieving low-latency compliance judgments. Furthermore, existing methods often suffer from risks such as generated content deviating from real-world contexts (i.e., the "illusion" problem), opaque ethical judgment processes, and uninterpretable conclusions, which restrict their in-depth application in professional ethics training.
[0005] Therefore, how to build a fully automated and trustworthy technical system covering "highly credible virtual visitor behavior generation - dynamic ethical trap embedding - real-time multi-level compliance assessment" in the AI-driven simulated consultation process has become a core technical challenge that urgently needs to be solved. Summary of the Invention
[0006] To address the technical problems existing in the background art, this invention proposes a method and system for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration.
[0007] This invention proposes a method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration, comprising the following steps:
[0008] S1. Acquire and monitor the updated dialogue context data consisting of virtual visitor statement data and counselor response statement data. When the updated dialogue context data meets the preset triggering conditions, match the target trap question template data from the trap question knowledge base based on the updated dialogue context data. Concatenate the target trap question template data with the visitor role data to form the second prompt word data. Input the second prompt word data into the pre-trained second generation model to obtain and output the trap statement data.
[0009] S2. Obtain the counselor's response statement data to the trap statement data, and input the response statement data into the rule matching engine and the ethics rule base to obtain the first violation judgment result data;
[0010] S3. If the first violation judgment result data indicates compliance, the response statement data and the ethical principle prompt template are combined into the third prompt word data. The third prompt word data is then input into the pre-trained semantic reasoning model to obtain the second violation judgment result data containing the violation probability value.
[0011] Preferably, the method further includes the following steps before step S1:
[0012] S0. Receive real-time dialogue context data, perform data preprocessing on the real-time dialogue context data to obtain the corresponding first structured prompt word data, and input the first structured prompt word data into the pre-trained first generation model to generate virtual visitor statement data.
[0013] Preferably, the data preprocessing specifically includes:
[0014] K similar case fragments were retrieved from the case database based on real-time dialogue context data.
[0015] The first prompt word data is generated by concatenating K similar case fragments, character setting data, and real-time dialogue context data.
[0016] Specifically, retrieving K similar case fragments from the case database includes:
[0017] Calculate the semantic similarity score between the real-time dialogue context data and the case data in the case library;
[0018] Calculate the text matching score between the real-time dialogue context data and the case data in the case library;
[0019] Obtain the expected matching score between the pre-labeled emotion tags in the case data and the expected emotion level of the current conversation;
[0020] A comprehensive score is calculated by weighting semantic similarity score, text matching score, and matching score. The data of the top K similar case segments are then selected from the comprehensive scores from high to low.
[0021] The weighted calculation specifically includes:
[0022] Overall score = Semantic similarity score + Text matching score + Expected match score;
[0023] in, As the first weighting coefficient, This is the second weighting coefficient. It is the third weighting coefficient, and .
[0024] Preferably, the preset triggering condition includes at least one of the following:
[0025] The updated dialogue context data successfully matched the preset high-risk keyword list;
[0026] The semantic similarity between the updated dialogue context data and the context summary in the trap question knowledge base exceeds a first preset threshold.
[0027] The risk labels obtained after risk classification of the updated dialogue context data are matched with the target risk type.
[0028] Preferably, the step of matching the target trap question template data from the trap question knowledge base based on the updated dialogue context data specifically includes:
[0029] The updated dialogue context data is converted into a context vector, and the inner product similarity between the context vector and all pre-stored context summary vectors in the trap question knowledge base is calculated.
[0030] The trap question template corresponding to the context summary with the highest inner product similarity is selected as the target trap question template data.
[0031] Preferably, the role setting data includes the virtual visitor's role tags, problem focus, emotional nodes, and dialogue rules. The dialogue rules specifically include repeating keywords in the counselor's response data, responding in the direction of the counselor's response data, answering the counselor's questions before raising one's own questions, and the number of words in a single event description not exceeding a preset number. The visitor role data includes age, gender, type of counseling question, and current emotional tag.
[0032] Preferably, the training process of the first generative model specifically includes:
[0033] The first training sample set is obtained by acquiring multi-turn dialogue data from a database of classic cases of psychological counseling clients. Each piece of data in the first training sample set includes the first input text in the form of an instruction and the corresponding real client's response text.
[0034] Using the first input text as training data and the real visitor's response text as the training target, supervised fine-tuning is performed on the pre-trained first large-scale language model to obtain the trained first generative model.
[0035] Preferably, the training process of the second generative model specifically includes:
[0036] Data from the knowledge base of ethical trap questions is used as the second training sample set. Each piece of data in the second training sample set includes a second input text composed of trap question templates and visitor role settings, and a corresponding trap statement text with a natural tone that has been manually polished.
[0037] Using the second input text as training data and the text of natural tone trap sentences as training targets, supervised fine-tuning of the pre-trained second large-scale language model is performed to obtain the trained second generative model.
[0038] The training process of the semantic reasoning model specifically includes:
[0039] Construct a binary classification training sample set. Each sample in the binary classification training sample set includes a consultant's reply statement and a sub-label, specifically a violation or compliance label.
[0040] The consultant's response statement and the ethical principle prompt template are concatenated and used as input to the pre-trained third large-scale language model. The output layer of the pre-trained third large-scale language model is then fine-tuned using sub-labels to output violation probability values, resulting in a trained semantic reasoning model.
[0041] Preferably, the step of inputting the reply statement data into the rule matching engine and matching it with the ethics rule base to obtain the first violation determination result data specifically includes:
[0042] The rule matching engine scans the response statement data and outputs all matched keywords and their corresponding rule identifiers;
[0043] The first violation determination result data is generated based on the hit keywords and rule identifiers. The first violation determination result data includes at least a violation identifier, a list of triggered rule identifiers, and a list of hit keywords.
[0044] The ethical rule base is constructed in the following way: the text clauses of the code of ethics for psychological counseling are decomposed one by one, and at least one keyword is extracted for each clause to form a keyword-rule pair for storage; the rule matching engine is a multi-pattern string matching engine based on the AC automaton algorithm.
[0045] This invention proposes a psychological counseling ethics simulation and evaluation system based on multi-agent collaboration, comprising:
[0046] The context-adaptive trap question generation module is used to acquire and monitor the updated dialogue context data, which consists of virtual visitor statement data and counselor response statement data. When the updated dialogue context data meets the preset triggering conditions, the module matches the target trap question template data from the trap question knowledge base based on the updated dialogue context data. The module then concatenates the target trap question template data with the visitor role data to form the second prompt word data. The second prompt word data is then input into the pre-trained second generation model to obtain and output the trap statement data.
[0047] The multi-level compliance assessment module is used to obtain the consultant's response statement data to the trap statement data, input the response statement data into the rule matching engine and match it with the ethical rule base to obtain the first violation judgment result data; if the first violation judgment result data indicates compliance, the response statement data is combined with the ethical principle prompt template to form the third prompt word data, and the third prompt word data is input into the pre-trained semantic reasoning model to obtain the second violation judgment result data containing the violation probability value;
[0048] The data storage module is used to store the case database, the trap question knowledge base, and the ethics rule base.
[0049] The proposed method and system for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration significantly reduces semantic illusion and role deviation in the virtual client dialogue generation process by combining case database retrieval constraints with generation guidance technology, achieving high-fidelity situational restoration. Through semantic matching of dialogue context and implicit adaptation of generation style, it effectively enhances the contextual relevance and unpredictability of ethical trap embedding, ensuring the authenticity of evaluation pressure. Through the synergistic effect of rule matching engine and semantic reasoning model, it ensures zero omissions in rigid clauses while achieving semantic-level identification and interpretable tracing of potential ethical risks, thereby systematically improving the automation level, result credibility, and supervisory guidance value of the ethical evaluation process. Attached Figure Description
[0050] Figure 1 This is a flowchart illustrating the workflow of a psychological counseling ethics simulation and evaluation method based on multi-agent collaboration proposed in this invention.
[0051] Figure 2 This is a schematic diagram of the system architecture of a psychological counseling ethics simulation and evaluation system based on multi-agent collaboration proposed in this invention.
[0052] Figure 3 This is a schematic diagram of the system architecture of one implementation of a psychological counseling ethics simulation and evaluation system based on multi-agent collaboration proposed in this invention. Detailed Implementation
[0053] Reference Figures 1-3 This invention proposes a method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration, comprising the following steps:
[0054] S0. Receive real-time dialogue context data, perform data preprocessing on the real-time dialogue context data to obtain the corresponding first structured prompt word data, and input the first structured prompt word data into the pre-trained first generation model to generate virtual visitor statement data.
[0055] In this embodiment, data preprocessing specifically includes: retrieving K similar case fragment data from the case database based on real-time dialogue context data; and concatenating the K similar case fragment data, role setting data, and real-time dialogue context data into first prompt word data.
[0056] In this embodiment, K similar case fragments are retrieved from the case database. Specifically, this includes: calculating the semantic similarity score between the real-time dialogue context data and the case data in the case database; calculating the text matching score between the real-time dialogue context data and the case data in the case database; obtaining the expected matching score between the pre-labeled emotion tags in the case data and the expected emotion level of the current dialogue; calculating a comprehensive score by weighting the semantic similarity score, text matching score, and matching score; sorting the comprehensive scores from high to low; and selecting the top K similar case fragments after sorting.
[0057] Specifically, the weighted calculation includes:
[0058] Overall score = Semantic similarity score + Text matching score + Expected match score;
[0059] in, As the first weighting coefficient, This is the second weighting coefficient. It is the third weighting coefficient, and .
[0060] Specifically, the real-time dialogue context data is represented as a vector in the classic case library of psychological counseling clients, and the top-K candidates are obtained through FAISS-IVF1024 retrieval:
[0061] ;
[0062] in, For example sentence vectors; This is the BM25 sparse score, which is the text matching score. Emotion-resistance label; The information set of the case sentences (including) , , R is the top-K candidate set.
[0063] Overall rating:
[0064] ;
[0065] in, For comprehensive scoring; Score the semantic similarity. Score the text matching. The expected matching score; The encoding vector for context C; The emotion-resistance label for context C; C represents the context. This is a collection of information from example sentences.
[0066] Specifically, the weighting parameter is usually set to =0.60, =0.25, =0.15, to balance semantic relevance and role consistency. K is generally set to 5 to ensure that subsequent generation has sufficient factual anchors.
[0067] In this embodiment, the training process of the first generative model specifically includes: acquiring multi-turn dialogue data from a database of classic cases of psychological counseling clients as a first training sample set, wherein each piece of data in the first training sample set includes a first input text in an instruction format and a corresponding real client response text; using the first input text as training data and the real client response text as the training target, supervising fine-tuning the pre-trained first large-scale language model to obtain the trained first generative model.
[0068] In this embodiment, the role setting data includes the virtual visitor's role tags, problem focus, emotional nodes, and dialogue rules. The dialogue rules specifically include repeating keywords in the counselor's response data, responding in the direction of the counselor's response data, answering the counselor's questions before raising one's own questions, and the number of words in a single event description not exceeding a preset number of words.
[0069] Specifically, with K=5, after the retrieval process is completed, the system will combine the top 5 similar case fragments, sorted in descending order of comprehensive score, into a "Style Example" component. This component, together with "Role Cards," "Memory Summary," and "Real-time Dialogue Context," forms a highly structured prompt input.
[0070] The "Role Card" component explicitly defines the behavioral parameters of the virtual visitor, including: role labels (such as age and occupation), problem focus (such as academic anxiety), current emotional state (such as high resistance), and a strict set of dialogue rules. This set of rules requires the model to follow these guidelines: repeating keywords from the counselor's statements, responding in accordance with the current topic, using a dialogue structure of answering first and then asking questions, limiting the length of each statement to no more than 80 words, and maintaining a conversational style. These rules collectively constitute a clear "role behavior script." The "Memory Summary" component compresses and summarizes key information from historical dialogues to ensure topical coherence of the generated content and prevent the model from deviating from the established dialogue context in subsequent generation processes. The "Style Examples" component provides high-fidelity resistance or derogatory sentence structures from real-world cases, offering directly referable and imitable language expression templates for large-scale language models. The entire prompt word design uses a "fill-in-the-blank" framework structure, and through the synergistic constraints of the above components, the generation space of the language model is limited to a range highly semantically consistent with real-world cases. This design effectively suppresses hallucinations and role drift during the generation process. Finally, the structured cue words are input into a large language model. The system dynamically adjusts the model's temperature parameter based on the "impedance level" determined in real-time retrieval results: 0.5 for high impedance to enhance determinism, 0.65 for medium impedance to balance deterministic diversity, and 0.8 for low impedance to improve response diversity. This mechanism maintains semantic determinism in the generated content while preserving a moderate level of linguistic diversity.
[0071] Through the above implementation methods, the system ensures that every sentence generated by the virtual visitor agent is based on real cases ("verifiable"), thereby providing a highly credible dialogue environment for the subsequent ethical trap agent to naturally and coherently embed ethical challenges.
[0072] S1. Acquire and monitor the updated dialogue context data, which consists of virtual visitor statement data and counselor response statement data. When the updated dialogue context data meets the preset triggering conditions, match the target trap question template data from the trap question knowledge base based on the updated dialogue context data. Concatenate the target trap question template data with the visitor role data to form the second prompt word data. Input the second prompt word data into the pre-trained second generation model to obtain and output the trap statement data.
[0073] In this embodiment, the preset triggering conditions include at least one of the following: the updated dialogue context data successfully matches the preset high-risk keyword list; the semantic similarity between the updated dialogue context data and the context summary in the trap question knowledge base exceeds a first preset threshold; and the risk label obtained after risk classification of the updated dialogue context data matches the target risk type.
[0074] In this embodiment, the target trap question template data is matched from the trap question knowledge base based on the updated dialogue context data. Specifically, this includes: converting the updated dialogue context data into a context vector, calculating the inner product similarity between the context vector and all pre-stored context summary vectors in the trap question knowledge base, and selecting the trap question template corresponding to the context summary with the highest inner product similarity as the target trap question template data.
[0075] In this embodiment, the visitor role data includes age, gender, type of consultation question, and current emotional label.
[0076] In this embodiment, the training process of the second generative model specifically includes: acquiring data from the knowledge base of ethical trap questions as the second training sample set, each piece of data in the second training sample set including a second input text composed of trap question templates and visitor role settings, and a corresponding trap sentence text with a natural tone that has been manually polished; using the second input text as training data and the trap sentence text with a natural tone as the training target, performing supervised fine-tuning on the pre-trained second large-scale language model to obtain the trained second generative model.
[0077] S2. Obtain the counselor's response to the trap statement data, input the response statement data into the rule matching engine and match it with the ethics rule base to obtain the first violation judgment result data.
[0078] S3. If the first violation judgment result data indicates compliance, the response statement data and the ethical principle prompt template are combined into the third prompt word data. The third prompt word data is then input into the pre-trained semantic reasoning model to obtain the second violation judgment result data containing the violation probability value.
[0079] In this embodiment, the training process of the semantic reasoning model specifically includes: constructing a binary classification training sample set, where each sample includes a consultant's response statement and a sub-label, specifically either violation or compliance; concatenating the consultant's response statement with an ethical principle prompt template as input, feeding it into a pre-trained third large-scale language model, and using the sub-label to perform supervised fine-tuning on the output layer of the pre-trained third large-scale language model to output a violation probability value, thus obtaining the trained semantic reasoning model.
[0080] Specifically, the response statement data is input into the rule matching engine and matched with the ethics rule base to obtain the first violation judgment result data, which includes:
[0081] The rule matching engine scans the response data and outputs all matched keywords and their corresponding rule identifiers;
[0082] The first violation judgment result data is generated based on the hit keywords and rule identifiers. The first violation judgment result data includes at least the violation identifier, the list of triggered rule identifiers, and the list of hit keywords.
[0083] The ethical rule base is constructed in the following way: the text clauses of the code of ethics for psychological counseling are decomposed one by one, and at least one keyword is extracted for each clause to form a keyword-rule pair for storage; the rule matching engine is a multi-pattern string matching engine based on the AC automaton algorithm.
[0084] Specifically, the code of ethics for psychological counseling is the "Chinese Code of Ethics for Clinical and Counseling Psychology." The 114 rigid clauses of the "Chinese Code of Ethics for Clinical and Counseling Psychology" are represented as a knowledge graph in a symbolic-semantic joint space. In this context, node V represents ethical keywords, and edge E represents clause-level causal / conditional dependencies.
[0085] Through a zero-latency matching process of "keyword-rule pairs", natural language dialogue fragments are... Mapped to violation tags :
[0086] ;
[0087] Among them, 114 represents the number of 114 rigid clauses; Represents the logical symbol " ", indicates logical OR; Match(,) is a lightweight AC automaton; The logical OR result is 114 principle violation values (0 / 1), meaning if at least one principle is violated, then... If it is 1, then... The threshold is 0; the threshold is fixed at 1 to ensure zero missed detections. If The module for storing violation reasons is immediately triggered: the violation rule number, the original text of the corresponding clause, the violation keywords, and the context fragments are written into the violation log table for subsequent explanation and supervision. This is a natural dialogue segment; The keyword for the i-th rigid clause; This is the i-th rigid clause (one of the 114 rigid clauses); The 114 rigid clauses are labeled (red violation).
[0088] S4. Send the first violation judgment result data or the second violation judgment result data to the supervisor terminal for display, and update the dialogue status data for subsequent dialogue processes.
[0089] In this embodiment, after obtaining the second violation determination result data, the method further includes:
[0090] When the probability of violation is greater than or equal to a preset threshold, violation details data is generated. The violation details data includes potential violation clause identifiers, reasoning text, and suggested wording text.
[0091] Reference Figures 1-3 This invention proposes a psychological counseling ethics simulation and evaluation system based on multi-agent collaboration, comprising:
[0092] The high-confidence visitor generation module is used to receive real-time dialogue context data, perform data preprocessing on the real-time dialogue context data to obtain the corresponding first structured prompt word data, and input the first structured prompt word data into the pre-trained first generation model to generate virtual visitor statement data.
[0093] The context-adaptive trap question generation module is used to acquire and monitor the updated dialogue context data, which consists of virtual visitor statement data and counselor response statement data. When the updated dialogue context data meets the preset triggering conditions, the module matches the target trap question template data from the trap question knowledge base based on the updated dialogue context data. The module then concatenates the target trap question template data with the visitor role data to form the second prompt word data. The second prompt word data is then input into the pre-trained second generation model to obtain and output the trap statement data.
[0094] The multi-level compliance assessment module is used to obtain the consultant's response data to the trap statement data. The response data is input into the rule matching engine and matched with the ethical rule base to obtain the first violation judgment result data. If the first violation judgment result data indicates compliance, the response data is combined with the ethical principle prompt template to form the third prompt word data. The third prompt word data is input into the pre-trained semantic reasoning model to obtain the second violation judgment result data containing the violation probability value.
[0095] The output module is used to send the first violation judgment result data or the second violation judgment result data to the supervisor terminal for display, and update the dialogue status data for subsequent dialogue processes.
[0096] The data storage module is used to store the case database, the trap question knowledge base, and the ethics rule base.
[0097] Example 1
[0098] Taking the example of a third-year male student who suffers from exam anxiety after failing his final exams and seeks both psychological counseling and tutoring, this article fully demonstrates how the "Three-Database Three-Agent" approach works end-to-end:
[0099] The module includes a highly credible visitor generation module (a persona of college students' exam anxiety), a context-adaptive trap question generation module ("multiple relationships"), and a multi-level compliance assessment module (whether to reject multiple relationships).
[0100] like Figure 3 As shown, after the system starts, the highly reliable visitor generation module, facing an empty context, first retrieves the top-5 real-world fragments from the "College Students' Exam Anxiety" case library that are closest to "failing grades, parental expectations, and academic tutoring." Specifically, it first calculates the semantic similarity score between the real-time dialogue context data and the case data in the case library, the text matching score between the real-time dialogue context data and the case data in the case library, and the expected matching score between the pre-labeled emotion tags in the case data and the expected emotion level of the current dialogue. Then, it performs a weighted calculation based on the semantic similarity score, text matching score, and matching score to obtain a comprehensive score, and sorts the data from highest to lowest comprehensive score, selecting the top 5 similar case fragments. The role card is then locked with the tag "21-year-old male, extremely stressed academically," with a temperature set to 0.5. The large model generates the first round of dialogue within 220ms: "Teacher... I failed calculus again this time, the third time already. I don't dare tell my parents, the pressure is too much." The sentence maintains a high degree of consistency with the original case in terms of vocabulary and emotional rhythm, providing a reliable foundation for subsequent trap embedding.
[0101] The counselor responds in a realistic, supportive manner: "It sounds like you're under a lot of stress. Can you tell me what scares you the most?" At this point, the system only records the conversation without triggering any intervention, but pushes a new round of context into the message queue in real time, allowing the context-adaptive trap question generation module to complete the next calculation within 50ms.
[0102] The context-adaptive trap question generation module, or trap agent, immediately maps the "multiple relationships" risk vector to the trap question knowledge base Ethics-TrapKB, matching the "multiple relationships" context fragment. The system selects the TOP-1 template "Teacher, you're a good student, can you tutor me? I really don't know what to do," and issues an implicit style instruction: "Use first-person spoken language, less than 75 words, include 'pinky promise' and 'oath,' and no ethical terms are allowed." Within 280ms, the model generates the trap sentence: "Teacher, I'm under so much pressure, I've failed so many subjects, can you be my tutor?" The consultant can hardly detect that it is a test script.
[0103] After the consultant responded with "Okay, I promise you, let's work hard together," the sentence was immediately sent to the multi-level compliance assessment module. The AC automaton instantly matched the rule pair R-103 (Code of Ethics 3.3 Multiple Relationships) formed by the keyword "promise you" and the context "multiple relationships." The system immediately identified a rigid violation, resulting in a compliance score of C1=0; a red pop-up window was sent to the supervisor within 0.9 seconds, along with an automatically pushed revised wording: "Regarding academic tutoring, I'm sorry, I cannot serve as one. I suggest you find a professional tutor." Because the explicit violation had been triggered, the semantic secondary screening was skipped.
[0104] The highly reliable visitor generation module, where the visitor agent continues to search the case library based on the context, generating follow-up sentences until the maximum number of counseling rounds is reached. The entire session triggered multiple relationships twice, with one explicit violation and no implicit violations missed. The system automatically compiles and generates a "College Student Exam Anxiety Supervision Report," including the original text of the clauses, relevant keywords, contextual fragments, suggested responses, and compliance score curves. All data is encrypted and archived, supporting post-event interpretable playback.
[0105] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration, characterized in that, Includes the following steps: S1. Acquire and monitor the updated dialogue context data consisting of virtual visitor statement data and counselor response statement data. When the updated dialogue context data meets the preset triggering conditions, match the target trap question template data from the trap question knowledge base based on the updated dialogue context data. Concatenate the target trap question template data with the virtual visitor role data to form the second prompt word data. Input the second prompt word data into the pre-trained second generation model to obtain and output the trap statement data. The virtual visitor role data includes age, gender, type of consultation question, and current emotional label; S2. Obtain the counselor's response statement data to the trap statement data, and input the response statement data into the rule matching engine and the ethics rule base to obtain the first violation judgment result data; S3. If the first violation judgment result data indicates compliance, the response statement data and the ethical principle prompt template are combined into the third prompt word data. The third prompt word data is then input into the pre-trained semantic reasoning model to obtain the second violation judgment result data containing the violation probability value.
2. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration according to claim 1, characterized in that, Step S1 is preceded by: S0. Receive real-time dialogue context data, perform data preprocessing on the real-time dialogue context data to obtain the corresponding first structured prompt word data, and input the first structured prompt word data into the pre-trained first generation model to generate virtual visitor statement data.
3. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration as described in claim 2, characterized in that, The data preprocessing specifically includes: K similar case fragments were retrieved from the case database based on real-time dialogue context data. The data of K similar case fragments, role setting data, and real-time dialogue context data are concatenated to form the first structured prompt word data; the role setting data includes the virtual visitor's role label, problem focus, emotional nodes, and dialogue rules; the dialogue rules are specifically: repeating the keywords in the counselor's reply statement data, responding in the direction of the topic in the counselor's reply statement data, answering the counselor's questions first and then raising one's own questions, and the number of words in a single event description does not exceed the preset number of words; Specifically, retrieving K similar case fragments from the case database includes: Calculate the semantic similarity score between the real-time dialogue context data and the case data in the case library; Calculate the text matching score between the real-time dialogue context data and the case data in the case library; Obtain the expected matching score between the pre-labeled emotion tags in the case data and the expected emotion level of the current conversation; A comprehensive score is calculated by weighting semantic similarity score, text matching score, and matching score. The data of the top K similar case segments are then selected from the comprehensive score from high to low. The weighted calculation specifically includes: Overall score = Semantic similarity score + Text matching score + Expected match score; in, As the first weighting coefficient, This is the second weighting coefficient. It is the third weighting coefficient, and .
4. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration as described in claim 1, characterized in that, The preset triggering condition includes at least one of the following: The updated dialogue context data successfully matched the preset high-risk keyword list; The semantic similarity between the updated dialogue context data and the context summary in the trap question knowledge base exceeds a first preset threshold. The risk labels obtained after risk classification of the updated dialogue context data are matched with the target risk type.
5. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration according to claim 1, characterized in that, The process of matching target trap question template data from the trap question knowledge base based on updated dialogue context data specifically includes: The updated dialogue context data is converted into a context vector, and the inner product similarity between the context vector and all pre-stored context summary vectors in the trap question knowledge base is calculated. The trap question template corresponding to the context summary with the highest inner product similarity is selected as the target trap question template data.
6. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration according to claim 2, characterized in that, The training process of the first generative model specifically includes: The first training sample set is obtained by acquiring multi-turn dialogue data from a database of classic cases of psychological counseling clients. Each piece of data in the first training sample set includes the first input text in the form of an instruction and the corresponding real client's response text. Using the first input text as training data and the real visitor's response text as the training target, supervised fine-tuning is performed on the pre-trained first large-scale language model to obtain the trained first generative model.
7. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration according to claim 1, characterized in that, The training process of the second generative model specifically includes: Data from the knowledge base of ethical trap questions is used as the second training sample set. Each piece of data in the second training sample set includes a second input text composed of trap question template data and virtual visitor role data, and a corresponding trap statement text with a natural tone that has been manually polished. Using the second input text as training data and the text of natural tone trap sentences as training targets, supervised fine-tuning of the pre-trained second large-scale language model is performed to obtain the trained second generative model. The training process of the semantic reasoning model specifically includes: Construct a binary classification training sample set. Each sample in the binary classification training sample set includes a consultant's reply statement and a sub-label, specifically a violation or compliance label. The consultant's response statement and the ethical principle prompt template are concatenated and used as input to a pre-trained third large-scale language model. The output layer of the pre-trained third large-scale language model is then fine-tuned using sub-labels to output violation probability values, resulting in a trained semantic reasoning model.
8. The method for simulation and evaluation of psychological counseling ethics based on multi-agent collaboration according to claim 1, characterized in that, The step of inputting the response statement data into the rule matching engine and matching it with the ethics rule base to obtain the first violation judgment result data specifically includes: The rule matching engine scans the response statement data and outputs all matched keywords and their corresponding rule identifiers; The first violation determination result data is generated based on the hit keywords and rule identifiers. The first violation determination result data includes at least a violation identifier, a list of triggered rule identifiers, and a list of hit keywords. The ethical rule base is constructed in the following way: the text clauses of the code of ethics for psychological counseling are decomposed one by one, and at least one keyword is extracted for each clause to form a keyword-rule pair for storage; the rule matching engine is a multi-pattern string matching engine based on the AC automaton algorithm.
9. A psychological counseling ethics simulation and evaluation system based on multi-agent collaboration, characterized in that, include: The context-adaptive trap question generation module is used to acquire and monitor the updated dialogue context data, which consists of virtual visitor statement data and counselor response statement data. When the updated dialogue context data meets the preset triggering conditions, the module matches the target trap question template data from the trap question knowledge base based on the updated dialogue context data. The module then concatenates the target trap question template data with the virtual visitor role data to form the second prompt word data. The second prompt word data is then input into the pre-trained second generation model to obtain and output the trap statement data. The virtual visitor role data includes age, gender, type of consultation question, and current emotional label; The multi-level compliance assessment module is used to obtain the consultant's response statement data to the trap statement data, and input the response statement data into the rule matching engine to match it with the ethics rule base to obtain the first violation judgment result data. If the first violation determination result data indicates compliance, the response statement data and the ethical principle prompt template are combined into the third prompt word data. The third prompt word data is then input into the pre-trained semantic reasoning model to obtain the second violation determination result data containing the violation probability value. The data storage module is used to store the case database, the trap question knowledge base, and the ethics rule base.
Citation Information
Patent Citations
Psychological counseling dialogue evaluation system based on large language model
CN118983091A
Psychological consultation method, device and equipment based on artificial intelligence and storage medium
CN119153040A