Method for training thought type recognition model and method for recognizing undesirable thought
By splicing dialogue background samples and dialogue samples and using attention masks for parallel processing, an initial thought type recognition model is trained, which solves the problem of identifying bad thought patterns in multi-person, multi-turn dialogue scenarios using large language models, achieving more accurate identification of bad thought patterns and improved training speed.
Patent Information
- Application Number
- CN202510834812.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-06-20
AI Technical Summary
Large language models lack the ability to deeply analyze the semantics of multi-role interactions in group dialogues in multi-person, multi-turn dialogue scenarios, making it difficult to effectively monitor and identify erroneous thinking.
By concatenating dialogue background samples with multiple dialogue samples to form a group dialogue sample, and using attention masks for parallel processing, an initial thought type recognition model is trained to obtain a target thought recognition model, which identifies the test probability distribution of multiple dialogue samples in the thought type space.
It improves the accuracy of identifying maladaptive thinking patterns in multi-person, multi-turn dialogues, increases training speed, and optimizes the training process.
Smart Images

Figure CN120687918B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, specifically to a training method for a thinking type recognition model, a method for recognizing bad thinking, an apparatus, device, medium, and program product. Background Technology
[0002] With the continuous development of artificial intelligence technology, large language models, with their powerful semantic analysis and knowledge reasoning capabilities, have demonstrated significant advantages in areas such as text summarization, topic extraction, and machine translation. Through their efficient processing of one-way text, they have greatly improved the efficiency of content generation and information processing.
[0003] However, the limitations of large language models become increasingly apparent in multi-person, multi-turn dialogue scenarios. While existing large language models can assist in analyzing dialogue content to some extent, they primarily focus on one-way text processing and lack the ability to deeply analyze the semantics of multi-role interactions in group dialogues. Furthermore, existing large language models have not yet developed targeted solutions for specific tasks such as identifying maladaptive thinking, making it difficult to effectively monitor and identify maladaptive thinking generated during group decision-making. Summary of the Invention
[0004] In view of the above problems, this disclosure provides a training method for a thinking type recognition model, a method for recognizing bad thinking, an apparatus, device, medium, and program product.
[0005] According to one aspect of this disclosure, a training method for a thought type recognition model is provided, comprising: concatenating dialogue background samples with multiple dialogue samples to obtain group dialogue samples, wherein the multiple dialogue samples are determined based on multi-turn dialogues between multiple objects, and each dialogue sample is obtained by concatenating an object profile of an object and dialogue content generated by the object; inputting the group dialogue samples and an attention mask into an initial thought type recognition model, such that the initial thought type recognition model processes the multiple dialogue samples in parallel based on the dependency information of the multiple dialogue samples included in the dialogue background samples and the attention mask, to obtain a test probability distribution of the multiple dialogue samples in a thought type space; and training the initial thought type recognition model based on the multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain a target thought recognition model.
[0006] According to one aspect of this disclosure, a method for identifying undesirable thought patterns is provided, comprising: in response to being in the i-th round of dialogue, concatenating dialogue background determined from a database, object profiles of multiple objects participating in the group dialogue, and dialogue content from the first round to the i-th round to obtain input data for the i-th round; inputting the input data for the i-th round into a target thought pattern recognition model to obtain the recognition probability distribution of the dialogue content of the i-th round in a thought pattern space; and mapping the recognition probability distribution to a thought pattern recognition result based on a preset mapping function, wherein the thought pattern recognition result is an undesirable thought pattern or a normal thought pattern.
[0007] Another aspect of this disclosure provides a training apparatus for a thought type recognition model, comprising: a concatenation module for concatenating dialogue background samples with multiple dialogue samples to obtain group dialogue samples, wherein the multiple dialogue samples are determined based on multi-turn dialogues between multiple objects, and each dialogue sample is obtained by concatenating the object profile of the object and the dialogue content generated by the object; a processing module for inputting the group dialogue samples and an attention mask into an initial thought type recognition model, so that the initial thought type recognition model performs parallel processing on the multiple dialogue samples based on the dependency information of the multiple dialogue samples included in the dialogue background samples and the attention mask, to obtain the test probability distribution of the multiple dialogue samples in the thought type space; and a training module for training the initial thought type recognition model based on the multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain a target thought recognition model.
[0008] Another aspect of this disclosure provides a device for identifying malfunctioning thought patterns, comprising: a data determination module, configured to, in response to a dialogue in the i-th round, concatenate dialogue background determined from a database, object profiles of multiple objects participating in the group dialogue, and dialogue content from the first to the i-th round to obtain input data for the i-th round; an input module, configured to input the input data for the i-th round into a target thought pattern recognition model to obtain the recognition probability distribution of the dialogue content in the i-th round in a thought pattern space; and a mapping module, configured to, based on a preset mapping function, map the recognition probability distribution to a thought pattern recognition result, wherein the thought pattern recognition result is either a malfunctioning thought pattern or a normal thought pattern.
[0009] Another aspect of this disclosure provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0010] Another aspect of this disclosure provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.
[0011] Another aspect of this disclosure provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method.
[0012] According to the training method of the thought type recognition model disclosed herein, dialogue background samples and dialogue samples are concatenated. Dialogue samples are composed of an object's profile and dialogue content. The dependency information of multiple dialogue samples in the attention mask is used to achieve parallel processing of multiple dialogue samples by the initial thought type recognition model. The initial thought type recognition model is then trained using the test probability distribution of multiple dialogue samples obtained through parallel processing in the thought type space. Since each dialogue sample is obtained by concatenating an object profile and dialogue content, each dialogue content is endowed with object features, enabling the model to capture multi-role interaction semantics and providing support for multi-person, multi-turn dialogue scenarios. Simultaneously, the parallel computation of the attention mask optimizes the training process, at least partially solving the problem in related technologies where large language models struggle to effectively monitor and identify undesirable thought processes generated by groups during decision-making. This achieves the technical effect of improving training speed while ensuring more accurate identification of undesirable thought processes of different individuals in multi-person, multi-turn dialogues. Attached Figure Description
[0013] The foregoing contents, as well as other objects, features, and advantages of this disclosure, will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0014] Figure 1 The diagram illustrates an application scenario of a training method for a thinking type recognition model and an ill-thinking recognition method according to embodiments of the present disclosure.
[0015] Figure 2 A flowchart illustrating a training method for a thought type recognition model according to an embodiment of the present disclosure is shown schematically.
[0016] Figure 3 An architectural diagram of an initial thought type recognition model according to an embodiment of the present disclosure is illustrated schematically;
[0017] Figure 4 An attention mask applied to an initial thought type recognition model according to an embodiment of the present disclosure is illustrated schematically;
[0018] Figure 5 An architectural diagram of an initial thought type recognition model according to another embodiment of the present disclosure is illustrated schematically;
[0019] Figure 6 An attention mask applied to an initial thought type recognition model according to another embodiment of this disclosure is illustrated schematically;
[0020] Figure 7A flowchart illustrating the generation of multiple dialogue samples according to embodiments of the present disclosure is shown schematically;
[0021] Figure 8 A flowchart illustrating a method for identifying erroneous thoughts according to an embodiment of the present disclosure is shown schematically.
[0022] Figure 9 This schematic diagram illustrates a structural block diagram of a training apparatus for a thought type recognition model according to an embodiment of the present disclosure;
[0023] Figure 10 A schematic diagram illustrating the structure of a device for identifying distorted thinking according to an embodiment of the present disclosure is shown; and
[0024] Figure 11 A block diagram of an electronic device suitable for implementing a training method for a thinking type recognition model and a method for recognizing bad thinking, according to embodiments of the present disclosure, is shown schematically. Detailed Implementation
[0025] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.
[0026] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0027] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0028] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0029] In the technical solution disclosed herein, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding operation entry points are provided for users to choose to authorize or refuse.
[0030] In scenarios involving automated decision-making using personal information, the methods, devices, and systems provided in this disclosure all offer users corresponding entry points for choosing to agree to or reject the automated decision-making results. If the user chooses to reject, the process proceeds to the expert decision-making stage. Here, "automated decision-making" refers to the activity of automatically analyzing and evaluating an individual's behavioral habits, interests, or economic, health, and credit status through computer programs, and then making a decision. Here, "expert decision-making" refers to the activity of making decisions by personnel who specialize in a particular field, possess specialized experience, knowledge, and skills, and have reached a certain level of professional expertise.
[0031] The research revealed that during discussions, due to factors such as participants' lack of ability to propose high-quality solutions, differing interests within and outside the meeting, and time constraints, meeting decisions were often made by the highest decision-maker or simply based on the principle of majority rule. This exhibited undesirable thinking patterns such as group dependency, rigidity, and divergent thinking. Furthermore, solutions proposed under this decision-making approach were often based on limited information, thus carrying a significant risk of decision failure.
[0032] With the continuous development of artificial intelligence technology, especially large language model technology, natural language processing (NLP) has made significant progress in text processing. However, traditional NLP techniques mainly focus on text summarization, topic extraction, and machine translation, lacking techniques for group dialogue semantic analysis, particularly for identifying problematic thinking patterns. Furthermore, while classic large language model technology can assist in understanding and analyzing meeting content to some extent, it cannot natively support the perception of each individual in a group dialogue. The meeting content must be relayed to the model through a user role, and there is a lack of effective methods to achieve good classification accuracy for the highly uneven distribution of problematic thinking patterns.
[0033] In view of this, embodiments of the present disclosure provide a training method for a thought type recognition model, comprising: concatenating dialogue background samples with multiple dialogue samples to obtain group dialogue samples, wherein the multiple dialogue samples are determined based on multi-turn dialogues between multiple objects, and each dialogue sample is obtained by concatenating the object profile of the object and the dialogue content generated by the object; inputting the group dialogue samples and an attention mask into an initial thought type recognition model, so that the initial thought type recognition model performs parallel processing on the multiple dialogue samples based on the dependency information of the multiple dialogue samples included in the dialogue background samples and the attention mask, to obtain the test probability distribution of the multiple dialogue samples in the thought type space; and training the initial thought type recognition model based on the multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain a target thought recognition model.
[0034] Figure 1 The illustration shows a training method for a thinking type recognition model and an application scenario diagram for a method for recognizing bad thinking according to embodiments of the present disclosure.
[0035] like Figure 1 As shown, application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0036] Users can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 via the network 104 to receive or send messages, etc. Various communication client applications can be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).
[0037] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be various electronic devices with displays and support web browsing, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0038] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0039] It should be noted that the training method for the thinking type recognition model and the method for identifying erroneous thinking provided in this embodiment can generally be executed by server 105. Correspondingly, the training device for the thinking type recognition model and the device for identifying erroneous thinking provided in this embodiment can generally be located in server 105. The training method for the thinking type recognition model and the method for identifying erroneous thinking provided in this embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105. Correspondingly, the training device for the thinking type recognition model and the device for identifying erroneous thinking provided in this embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with the first terminal device 101, the second terminal device 102, the third terminal device 103, and / or server 105.
[0040] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0041] The following will be based on Figure 1 The described scene, through Figures 2-8 The training method of the thinking type recognition model and the method of identifying bad thinking in the disclosed embodiments are described in detail.
[0042] Figure 2 A flowchart illustrating a training method for a thought type recognition model according to an embodiment of the present disclosure is shown.
[0043] like Figure 2 As shown, the method includes operations S210 to S230.
[0044] In operation S210, the dialogue background sample is concatenated with multiple dialogue samples to obtain a group dialogue sample. The multiple dialogue samples are determined based on multi-turn dialogues between multiple objects. Each dialogue sample is obtained by concatenating the object's object profile and the dialogue content generated by the object.
[0045] In operation S220, the group dialogue samples and attention mask are input into the initial thinking type recognition model so that the initial thinking type recognition model can process multiple dialogue samples in parallel based on the dependency information of multiple dialogue samples included in the dialogue background samples and attention mask, and obtain the test probability distribution of multiple dialogue samples in the thinking type space.
[0046] In operation S230, the initial thinking type recognition model is trained based on multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain the target thinking recognition model.
[0047] Multi-turn dialogues between multiple parties can correspond to multi-person multi-turn dialogue scenarios or group dialogue scenarios, such as multi-person seminars or multi-person meetings. Dialogue background samples can include information such as the background and objectives of group dialogues.
[0048] The participants can be those attending a seminar or meeting, and the dialogue can be the participants' remarks during the seminar or meeting. The content of the dialogue is the dialogue content itself.
[0049] Each dialogue sample includes the dialogue content of any object in a round of dialogue and the object profile of that object.
[0050] A profile of an individual can include one or more of the following: basic information, personality traits, professional background, interests and hobbies, and social networks. Basic information may include name, age, gender, and contact information; personality traits may include extroversion, introversion, and optimism; professional background may include industry, position, and work experience; interests and hobbies may include reading, sports, and travel preferences; and social networks may include frequently used social media platforms and personal networks. Knowledge and skills...
[0051] In some embodiments, a social network may also include relationships between multiple objects. For example, if object A and object B have a teacher-student relationship, this relationship can help the model understand the dialogue logic more accurately. For instance, by clarifying the superior-subordinate or friend relationships between the two parties, the power structure and emotional inclination in the speech can be determined, thereby better judging whether the dialogue content of the current object belongs to an unhealthy thinking type.
[0052] The subject profile can be actively filled in by the subject in the mind type recognition system, or it can be extracted from publicly available online information after obtaining basic information such as the subject's name. For example, it can be obtained through platforms such as Wikipedia. The mind type recognition system may include a mind type recognition model.
[0053] Dialogue background samples can be appended before multiple dialogue samples, and in some embodiments, the multiple dialogue samples can be appended according to their generation order. Alternatively, they can be appended according to a preset arrangement order.
[0054] The initial thought type recognition model can be a pre-trained language model, such as a pre-trained Large Language Model (LLM). The initial thought type recognition model can be configured with system prompts related to thought type recognition and attention masking. This allows the initial thought type recognition model to utilize and process the input group dialogue samples and attention masks based on the system prompts.
[0055] Attention masks can include dependency information for each dialogue sample when the initial thought type recognition model processes each dialogue sample, such as the location or index information of dependent dialogue samples that have a dependency relationship with each dialogue sample.
[0056] When processing each dialogue sample, the initial thought type recognition model can utilize the dependency information of each dialogue sample included in the attention mask to achieve parallel processing of multiple dialogue samples. This improves the processing speed of the initial thought type recognition model when processing multiple dialogue samples, thereby increasing the training speed of the initial thought type recognition model. Simultaneously, the model's acquisition of dependency information through the attention mask enhances the accuracy of dependency information acquisition, thus improving processing accuracy.
[0057] The label probability distribution can be one-to-one with the dialogue samples. In some embodiments, each dialogue sample can form a sample group with the label probability distribution, such as: [<speaker:utterance,label> [...], where speaker can be an object profile, utterance can be the dialogue content, speaker:utterance is the dialogue sample, and label is the label probability distribution corresponding to the dialogue sample. By concatenating the object profile and the dialogue content generated by the object to obtain the dialogue sample, and inputting this dialogue sample into the initial thought type recognition model, the initial thought type recognition model can recognize the dialogue content of multiple roles, i.e., multiple objects, solving the problem that related technologies can only process a single role.
[0058] According to the training method of the thought type recognition model disclosed herein, dialogue background samples and dialogue samples are concatenated. Dialogue samples are composed of an object's profile and dialogue content. The dependency information of multiple dialogue samples in the attention mask is used to achieve parallel processing of multiple dialogue samples by the initial thought type recognition model. The initial thought type recognition model is then trained using the test probability distribution of multiple dialogue samples obtained through parallel processing in the thought type space. Since each dialogue sample is obtained by concatenating an object profile and dialogue content, each dialogue content is endowed with object features, enabling the model to capture multi-role interaction semantics and providing support for multi-person, multi-turn dialogue scenarios. Simultaneously, the parallel computation of the attention mask optimizes the training process, at least partially solving the problem in related technologies where large language models struggle to effectively monitor and identify undesirable thought processes generated by groups during decision-making. This achieves the technical effect of improving training speed while ensuring more accurate identification of undesirable thought processes of different individuals in multi-person, multi-turn dialogues.
[0059] According to embodiments of this disclosure, the attention mask is obtained in the following manner.
[0060] For each dialogue sample, the dialogue sample is segmented to obtain multiple sample words; based on the positional information of the multiple sample words included in each of the multiple dialogue samples and the generation order of the multiple dialogue samples in the multi-turn dialogue, an attention mask is obtained.
[0061] A pre-defined word segmenter can be used to segment each dialogue sample, resulting in multiple sample words. Then, positional information within the dialogue sample is assigned to each sample word, thus obtaining the positional indexes of multiple samples.
[0062] Based on the word position information within a dialogue sample (i.e., word order) and the generation order of multiple dialogue samples, the dependencies between dialogue samples and between sample words are determined: for example, subsequent dialogues can depend on preceding ones, and subsequent sample words within the same dialogue sample can depend on preceding sample words. An attention mask is then generated based on these dependencies.
[0063] According to embodiments of this disclosure, an attention mask is constructed based on dialogue sample word segmentation and location information. The dialogue sample is segmented into sample words and assigned a location index. By combining the word order relationship of the samples with the order in which the dialogue is generated, dependency rules between dialogue samples and between sample words are determined, and an attention mask is generated according to these rules. This effectively models temporal dependencies and semantic associations in multi-turn dialogues, avoiding the model's erroneous association of dialogue content with no dependencies. Furthermore, the structured attention mask facilitates parallel computation of the initial thought type recognition model.
[0064] According to embodiments of this disclosure, the dependency information includes the location information of dependent dialogue samples that have a dependency relationship with the dialogue sample; based on the location information of multiple sample words included in each of the multiple dialogue samples and the generation order of the multiple dialogue samples in the multi-turn dialogue, an attention mask is obtained, which may include the following operations.
[0065] For each dialogue sample, based on the positional information of multiple sample words in the dialogue sample, the sample words at the target position are tagged to obtain the tagged words; based on the generation order of multiple dialogue samples in multiple rounds of dialogue, the first dialogue sample whose generation order is after the tagged words is determined; the positional information corresponding to the multiple sample words included in the first dialogue sample is masked to obtain the masking result for the dialogue sample, wherein the second dialogue sample whose generation order is before the tagged words of the dialogue sample is the dependent dialogue sample of the dialogue sample; based on the masking result of multiple dialogue samples, the attention mask is obtained.
[0066] Multiple dialogue samples can be concatenated in the order they were generated to obtain a concatenated sample. The positional information of dependent dialogue samples that are related to the dialogue sample can include the positional information of multiple sample words of the dependent dialogue sample. For example, if dependent dialogue sample a is the 6th dialogue sample in the concatenated sample and it includes sample word 1 and sample word 2, then the positional information of dependent dialogue sample a can include (6, 1) and (6, 2).
[0067] For each dialogue sample, based on the position information of the sample words within the dialogue sample, the sample words at pre-set target positions, such as the end of a sentence or a specific position, are marked to obtain marked words.
[0068] It is possible to obtain spliced samples and map the spliced samples from the sample sequence to the position information sequence. Thus, for each dialogue sample, in the process of obtaining the masking result, the position information corresponding to the first dialogue sample after the marker word in the position information sequence can be masked. Thus, the second dialogue sample before the marker word and the dialogue sample itself are the data that the initial thought type recognition model needs to rely on when processing the dialogue sample.
[0069] In some embodiments, the first dialogue sample following the marker word in the concatenated samples can be determined according to the generation order of multiple dialogue samples. The position information corresponding to the first dialogue sample is then masked to obtain the masking result.
[0070] The first dialogue sample is the sample following the marker word; that is, the dialogue sample including the marker word has no dependency on the first dialogue sample. Masking can be assigned a value of 0 or -∞ to generate a structured attention mask. Position information without masking can be assigned a value of 1.
[0071] The masking results of all dialogue samples can be aggregated and integrated into a unified matrix form, thus finally obtaining the attention mask used for model calculation. This mask clearly defines the attention and masking relationships between sample words in each dialogue sample.
[0072] According to embodiments of this disclosure, the last word in each dialogue sample is designated as the target word, and an attention mask is generated for model training by labeling it. This guides the initial thought type recognition model to calculate the probability distribution in the thought type space only for the last token of each input data during training. This approach not only avoids redundant calculations for irrelevant tokens, significantly improving the model's computational efficiency in long text dialogue scenarios, but also forces the model to focus on words carrying key semantics at the end of the dialogue, accurately capturing real-time thought changes. Combined with the dialogue generation order, it optimizes the temporal logic understanding of multi-turn dialogues, ultimately enabling the trained target thought recognition model to maintain contextual understanding capabilities while achieving efficient allocation of computational resources, thus improving the real-time performance and accuracy of thought type recognition.
[0073] According to embodiments of this disclosure, by labeling sample words at specific locations and locating the first dialogue sample with no dependencies based on the generation order of dialogue samples, and masking its corresponding location information, a structured mask matrix reflecting the logical dependencies of the dialogue is constructed. This allows the model obtaining the attention mask to accurately capture the temporal associations and semantic dependencies between samples in multi-turn dialogues, while masking irrelevant information flow and improving the model's understanding of the dialogue context. It is also more suitable for identifying thought patterns in group dialogue scenarios, enabling the model to focus more on effective dependency paths and reduce redundant computation. Simultaneously, it provides dependency information support for parallel processing, enhancing processing accuracy and inference efficiency.
[0074] According to embodiments of this disclosure, the initial thought type recognition model performs parallel processing on multiple dialogue samples based on the dependency information of multiple dialogue samples included in the dialogue background sample and attention mask, to obtain the test probability distribution of multiple dialogue samples in the thought type space, which may include the following operations.
[0075] For each dialogue sample, based on the location information of dependent dialogue samples that have a dependency relationship with the dialogue sample, the dependent dialogue samples of the dialogue sample are determined from multiple dialogue samples; based on the dialogue background sample and the dependent dialogue samples, the test probability distribution of the sample words at the target position in the thought type space is calculated, and the test probability distribution of the dialogue sample in the thought type space is obtained.
[0076] The initial thought type identification model can be based on dialogue background samples, dependent dialogue samples, and preceding sample words in the dialogue samples that are located before the target position. That is, the initial thought type identification model performs semantic parsing on the sample words at the target position in the current dialogue sample, combining the contextual information provided by dependent dialogue samples, dialogue background samples, and preceding sample words. It then calculates the test probability values of sample words at the target position belonging to different thought types in the thought type space and calculates the test probability distribution.
[0077] The probability distribution of the sample words at the target position in the thought type space can be used as the probability distribution of the entire dialogue sample in the thought type space.
[0078] According to embodiments of this disclosure, associated samples are accurately located by relying on the location information of dialogue samples, and the probability distribution of thought type space is calculated by focusing on the target location sample words in combination with dialogue background samples. This allows for dynamic acquisition of contextual information through dependency relationships, enabling the model to deeply capture the semantic connections and logical connections between dialogues and achieve parallel computation of dialogue samples.
[0079] Figure 3 An architectural diagram of an initial thought type recognition model according to an embodiment of the present disclosure is illustrated.
[0080] like Figure 3 As shown, the initial thought type recognition model of this disclosure includes a tokenizer, multiple decoder layers, and a linear classifier. The decoder layers include multiple normalization layers, a self-attention mechanism, and a feed-forward neural network (FFN).
[0081] In multi-person conference scenarios, group dialogue samples can be conference sequences, which include a background dialogue sample at the beginning and dialogue samples concatenated in the order of their generation. The conference sequence is input into a word segmenter for word segmentation and vector mapping to obtain a vector sequence. This vector sequence, along with an attention mask, is then input into the first decoder layer of a multi-decoder layer for feature extraction. The output of the first decoder layer yields dialogue features corresponding to each dialogue sample, which are then input into the next decoder layer. This process of feature extraction is repeated layer by layer to obtain the target dialogue features for each dialogue sample after multi-level feature extraction.
[0082] By inputting the target dialogue features of each dialogue sample into a linear classifier, the original hidden_state dimension * vocabulary dimension output layer of the linear classifier is modified to a hidden_state dimension * thought type dimension, thereby enabling the conversion of the target dialogue features into a test probability distribution in the thought type space. The dimension of the thought type dimension is typically the number of bad thought types + 1.
[0083] The test probability distribution of the i-th dialogue sample in the thought type space is the thought type distribution of the i-th classification point. Therefore, by combining this with the label probability distributions in the label list corresponding to the test probability distribution of the i-th dialogue sample, we can obtain Focal Loss and perform gradient backpropagation. The database can store the label list and meeting minutes; the meeting sequence can be obtained from the meeting minutes.
[0084] In some embodiments, the identifier of the object in each round, such as name, can be filled into the corpus, such as the positions of system, user, assistant.
[0085] Figure 4 An attention mask is schematically shown in an architecture diagram of an initial thought type recognition model according to an embodiment of the present disclosure.
[0086] like Figure 4 As shown, each small cell in each column of the attention mask corresponds to a sample word, and small cells of different colors correspond to different dialogue samples. Each small cell can also correspond to different positional information. Through this attention mask, the initial thought type recognition model can know that it needs to use the preceding dependent dialogue samples when processing subsequent dialogue samples, thus facilitating parallel processing instead of relying on fixed temporal relationships for serial processing.
[0087] Since the sample words at the end of each dialogue sample are marked with an end-of-speech token (EOS token), an attention mask can be generated using this mark. During the model's forward inference process, the test probability distribution and loss are calculated only for the marked positions.
[0088] In some embodiments, <s>It can represent the beginning, <c>Characterizing sample words in dialogue samples <e>The characterization ends. Similarly, <s>、 <c> 、 <e>Different representations of content can also be continued as needed.
[0089] Figure 5 An architectural diagram of an initial thought type recognition model according to another embodiment of the present disclosure is illustrated.
[0090] like Figure 5 As shown, another embodiment of the initial thought type recognition model includes embeddings, multiple decoder layers (N×Decoder Layer), a root mean square layer normalization (RMSNorm) layer, and a linear classifier layer (LM Head). Each decoder layer includes an RMSNorm, a self-attention mechanism, and FFN.
[0091] Group dialogue samples can be represented by the Input IDs in the graph. Output Logits is the test probability distribution of the dialogue samples in the thought type space.
[0092] In QKV→RoPE→SDPA, QKV represents the query vector, key vector, and value vector, which are the three key matrices in the self-attention mechanism. Their function is to calculate the attention weights between positions in the input sequence through matrix operations. RoPE stands for Rotary Position Embedding. Its function is to introduce positional information into the self-attention mechanism, allowing the model to perceive the positional order of elements in the input sequence, solving the problem of poor performance of ordinary positional encoding for long sequences. SDPA stands for Scaled Dot-Product Attention. Its function is to calculate attention weights based on the Q, K, and V matrices, achieving efficient attention computation.
[0093] Gate×Up→Down: This usually involves the gate control mechanism Gate, as well as upsampling and downsampling operations.
[0094] Figure 6 An attention mask applied to an initial thought type recognition model according to another embodiment of this disclosure is illustrated.
[0095] like Figure 6 As shown, in another embodiment of this disclosure, the attention mask applied to the initial thought type recognition model can be calculated for each sample word, where each sample word depends on the preceding sample word during model processing. Thus, a test probability distribution is generated for each sample word.
[0096] According to embodiments of this disclosure, the dialogue content is generated by a dialogue generation agent loaded with an object profile; the dialogue generation agent is used to simulate the object; multiple dialogue samples are obtained in the following manner.
[0097] In response to being in the i-th round of dialogue, multiple dialogue-generating agents obtain historical dialogue content prior to the i-th round from the group dialogue topic, and generate thinking information and dialogue content to be sent based on the historical dialogue content and the negative thinking generation instruction generated according to a preset probability. Where i=1, the historical dialogue content is either the dialogue background sample or, in the actual group dialogue scenario, dialogue content generated by any of the objects in response to the dialogue background sample. In response to the target dialogue-generating agent receiving a permission to send instruction from the chair agent, the target dialogue-generating agent sends the dialogue content to be sent to the group dialogue topic, obtaining dialogue content to be verified. The target dialogue-generating agent is determined by the chair agent based on the thinking information of each of the multiple dialogue-generating agents. When the verification agent obtains the dialogue content to be verified from the group dialogue topic and determines that the verification result of the dialogue content to be verified is passed, the multiple dialogue-generating agents use the dialogue content to be verified as the dialogue content for the i-th round. The object profile loaded by the target dialogue-generating agent and the dialogue content of the i-th round are concatenated to obtain the dialogue sample for the i-th round.
[0098] The historical dialogue content can include the dialogue content from round 1 to round i-1.
[0099] Multiple dialogue samples can be obtained by extending dialogue samples from real-world group dialogue scenarios through multiple agents. For example, the actual n-turn dialogue in a real-world group dialogue scenario can be used as historical dialogue content, and multiple agents can generate subsequent dialogue samples based on this historical content. Alternatively, they can be obtained by multiple agents engaging in dialogue based on dialogue background samples. i can be a positive integer greater than or equal to 1.
[0100] Multiple intelligent agents may include a chairperson intelligent agent, multiple dialogue generation intelligent agents, verification intelligent agents, etc. In some embodiments, such as a simulated jury scenario, they may also include a jury initiation intelligent agent, a jury voting intelligent agent, and a jury termination intelligent agent.
[0101] Once multiple agents are started, they can subscribe to the GroupChattopic, a group dialogue topic used for public communication between agents, and the Permission topic, used to issue speaking permissions. Multiple dialogue-generating agents can load object profiles and object memories. Object memories can include various knowledge and skills of the object; for example, if the object is a programmer, the object memory would include programming common sense; if it is a subway driver, the object memory would include information such as the subway's speed and length.
[0102] An intelligent agent is an entity jointly constructed by program code and a large inference model. The program code is responsible for implementing the agent's logical control, task scheduling, and information interaction; the large inference model provides core semantic understanding and content generation capabilities. After receiving instructions and data from the program code, it outputs text content that meets the requirements through deep learning algorithms. The large inference model can be a pre-trained or fine-tuned large language model.
[0103] Multiple dialogue-generating agents can be initialized with probabilities of generating random negative thoughts, thus enabling them to randomly generate dialogue content reflecting negative thoughts. Alternatively, negative thought generation commands can be manually generated to instruct the dialogue-generating agents to produce dialogue content reflecting negative thoughts.
[0104] The chair agent can plan the dialogue agenda based on dialogue background samples. In the case of a meeting within a group dialogue scenario, the dialogue background samples will include the meeting background, such as the meeting introduction, meeting objectives, and other information. The chair agent can also subscribe to the "SpeakApply" topic, which other agents can use to express their willingness to speak. The chair agent can also publish dialogue background samples to the "GroupChat" topic.
[0105] Each dialogue generation agent subscribed to the GroupChat topic merges dialogue background samples, historical dialogue content up to the i-th round, and probability-based negative thought generation instructions into prompt words. These, along with callable retrieval tools such as RAG mcp workshop, are then fed into the inference model. The inference model autonomously chooses whether to invoke the retrieval tool. The retrieval tool receives the object profile and object memory loaded by the dialogue generation agent, then retrieves preset operation information or preset dialogue content matching the object's settings from the database and returns it to the inference language model. This helps the inference model optimize its thought information and the dialogue content to be sent.
[0106] After generating thought information and dialogue content to be sent, the dialogue generation agent will temporarily store the generated thought information and dialogue content to be sent in its own storage space, and then publish the thought information to the SpeakApply topic.
[0107] The chairman agent obtains thinking information from the SpeakApply topic, waits to collect the thinking information of all dialogue-generating agents in the current round, adds the entire dialogue content sequence and thinking information to the input, calls the inference model inside the chairman agent to determine who has the highest willingness to speak, and then publishes the identifier of the target dialogue-generating agent with the highest willingness to speak to the Permission topic, or sends a permission to send a command to the target dialogue-generating agent.
[0108] Each dialogue-generating agent retrieves the identifier of the dialogue-generating agent with the highest willingness to speak from the Permission topic and verifies that it matches its own identifier. Then, it updates its internal state, which consists of organizing and summarizing its past thoughts. If allowed to speak, it publishes the dialogue content to be sent to the GroupChat topic. This process then iterates through the above steps of generating thought information and dialogue content, as well as the following steps. Iteration stops when one of the following occurs: the chair agent determines that the expected dialogue goal has been achieved; the preset maximum number of discussion rounds is reached; the input data of any agent exceeds the maximum text length that the large model can process; or a stop command is manually sent.
[0109] In some embodiments, depending on the scenario, the object profile and object memory can be obtained by converting the file format and recognizing the content of a preset object background file, and can be stored in a database.
[0110] In the jury scenario, the generation of each dialogue is the responsibility of the chair agent, the dialogue generating agent, and the voting agent. The chair agent is responsible for summarizing the case background information and initiating the discussion at the beginning of the jury discussion, observing the dialogue history during the jury discussion and initiating the vote at an appropriate time, and ending the jury meeting and giving the jury conclusion when all dialogue generating agents reach a consensus, the dialogue round reaches the limit, or it is found that the reason for not reaching a consensus is that a few dialogue generating agents are set to rigid thinking.
[0111] According to embodiments of this disclosure, by combining pre-probability-triggered negative thought generation instructions, personalized dialogue generation by an agent driven by object profiling, and a speaking decision mechanism based on thought information filtering, the automated construction of multi-turn dialogue samples is achieved. This can at least partially solve the problem of scarce data for identifying negative thoughts. By dynamically injecting negative thought instructions with pre-probability, complex dialogue samples with annotations can be generated in batches, significantly improving the diversity and realism of the dataset. Furthermore, by utilizing object profiling to drive dialogue generation, each agent simulates a role with differentiated characteristics, enhancing the realism of the dialogue scenario. Target speakers are filtered based on thought information, and a verification mechanism ensures content quality, avoiding interference from invalid or low-quality dialogue. Ultimately, logically coherent, semantically rich, and realistic dialogue samples are generated, providing high-quality data support for the subsequent training of thought type recognition models.
[0112] According to embodiments of this disclosure, the verification agent includes: an object verification agent and a speech background verification agent; the training method for the thought type recognition model may further include the following operations.
[0113] The object verification agent, based on a database, verifies the degree of matching between the dialogue content to be verified and the object profile loaded by the target dialogue generation agent, and obtains the first sub-verification result. The database includes the object profile and the preset operation information or preset dialogue content corresponding to the object profile. The speech background verification agent verifies the degree of matching between the dialogue content to be verified and the dialogue background sample, and obtains the second sub-verification result. If both the first sub-verification result and the second sub-verification result are deemed to be passed, the verification result of the initial dialogue content is determined to be passed.
[0114] Verification agents can include: object verification agents, speech background verification agents, and malicious thought instruction verification agents.
[0115] Based on case background information, such as dialogue background samples and object profiles, the dialogue generation agent generates the dialogue content for the current round. The role verification agent, the negative thought instruction verification agent, and the case information verification agent can then verify whether the dialogue content conforms to their settings. For example, the negative thought instruction verification agent can determine whether the current round requires triggering a negative thought generation instruction based on a preset probability of negative thought generation. If the trigger probability is met, it verifies whether the generated dialogue content contains the specified negative thought pattern.
[0116] If any validating agent detects that the dialogue content is unqualified, the dialogue generating agent will modify the previously generated dialogue content until the generated dialogue content is approved by all validating agents. The agent that verifies "bad thinking" instructions does not require the dialogue generating agent to always exhibit bad thinking; instead, it selectively displays bad thinking in several rounds, and the output of each round is labeled with the corresponding bad thinking type. Finally, the dialogue content and bad thinking labels are compiled, and the label probability distribution of the dialogue samples corresponding to the dialogue content labeled with bad thinking is calculated.
[0117] In some embodiments, negative thought patterns can be labeled manually by thought experts after obtaining multiple dialogue samples, or automatically labeled using a general large model to construct an intelligent agent, and then reviewed by experts. Specifically, during labeling, corresponding statements can be labeled when negative thought patterns such as forced substitution, disconnection, language communication barriers, groupthink, blind application of experience, inability to distinguish between assumptions and facts, and excessive leaps in thought appear in the sample dialogue sequence.
[0118] According to embodiments of this disclosure, a multi-dimensional collaborative verification mechanism is constructed. An object verification agent performs semantic matching verification between dialogue content and object profiles based on a database. This is combined with a speech background verification agent verifying the consistency of dialogue background samples, and a probabilistic triggering detection of malicious thought patterns by a malicious thought instruction verification agent, forming a comprehensive content verification system. This ensures that the generated dialogue content simultaneously satisfies role consistency, background relevance, and controllable thought patterns, thereby preventing role behavior breakdown, better guaranteeing the semantic coherence of dialogue content and case background information, and preventing information deviation, among other technical effects.
[0119] Figure 7 A flowchart illustrating the generation of multiple dialogue samples according to an embodiment of the present disclosure is shown.
[0120] like Figure 7 As shown, when generating multiple dialogue samples, multiple agents can be included, each with a different function or role. For example, the chairperson agent 701 is used to plan the dialogue agenda based on the dialogue background sample. Agents 702-708 can all be dialogue generation agents. After each dialogue generation agent is allowed to speak and sends the dialogue content to be sent to the group dialogue topic, the verification agent needs to verify the dialogue content to be sent. For example, it needs to verify whether the content conforms to the role setting, whether it conforms to the bad thinking instructions, and whether the reasoning based on the case background information, i.e., the dialogue background sample, is reasonable, based on personal information, i.e., dialogue history data. If the verification fails, pass:regenerate is triggered, i.e., this operation is ignored and the dialogue content is regenerated.
[0121] According to embodiments of this disclosure, training an initial thinking type recognition model based on multiple test probability distributions and label probability distributions corresponding to the multiple test probability distributions to obtain a target thinking recognition model may include the following operations.
[0122] For each test probability distribution, the difficulty weight is determined based on the preset sample importance and the difference between the test probability distribution and the preset value; the initial loss value is determined based on the difficulty weight, the test probability distribution, and the label probability distribution; the group loss is extracted from multiple initial loss values to obtain the target loss value; the parameters of the initial thinking type recognition model are adjusted based on the target loss value to obtain the target thinking recognition model.
[0123] The preset sample importance can be determined based on the importance of dialogue samples, with a preset value of 1. The difficulty weight can be determined by... Different dialogue samples can have different preset sample importance. The higher the difficulty weight, the more difficult it is for the dialogue sample to be correctly classified by the model. During training, the model will allocate more attention resources to it to optimize the feature extraction and classification decision-making ability for such difficult samples.
[0124] The initial loss value is determined based on the difficulty weight, test probability distribution and label probability distribution, as shown in the following formula (1).
[0125] (1)
[0126] in, The probability distribution for the nth test The initial loss function, For class weight vectors, This is the onthot vector of the label probability distribution for the current round. As a difficulty weight, To predetermine the importance of the sample, 'a' is the base of the logarithm.
[0127] There are no restrictions on the method of group loss extraction; it can be average calculation, group feature extraction, etc. The target loss value is obtained by extracting the group loss from multiple initial loss values, as shown in the following formula (2).
[0128] (2)
[0129] in, Let be the target loss function. This represents the number of test probability distributions.
[0130] According to embodiments of this disclosure, an initial loss value is constructed by dynamically adjusting the sample difficulty weights by combining preset sample importance and prediction bias, and the model training objective is optimized through a group loss extraction strategy. This solves the problems of homogeneous sample importance and the easy neglect of difficult samples in traditional models. Through dynamic difficulty weights, the model can adaptively focus on key information and difficult samples in complex dialogue scenarios, avoiding training bias caused by uneven sample difficulty. By using hierarchical calculation of the initial and target loss values, the optimization of individual samples and the learning of group data features are precisely balanced, improving the model's understanding depth of multi-turn dialogue semantic logic. Finally, guided by the target loss value, the parameters of the initial thought type recognition model are optimized, thereby enhancing the model's generalization ability, accuracy, and robustness in thought type recognition tasks.
[0131] Figure 8 A flowchart illustrating a method for identifying erroneous thinking according to an embodiment of the present disclosure is shown.
[0132] like Figure 8 As shown, the method includes operations S810 to S830.
[0133] In operation S810, in response to being in the i-th round of dialogue, the dialogue background determined from the database, the object profiles of multiple objects participating in the group dialogue, and the dialogue content from the 1st to the i-th round are concatenated to obtain the input data for the i-th round.
[0134] In operation S820, the input data of the i-th round is input into the target thought recognition model to obtain the recognition probability distribution of the dialogue content of the i-th round in the thought type space.
[0135] When operating S830, based on a preset mapping function, the recognition probability distribution is mapped to the thinking type recognition result, which is either a bad thinking type or a normal thinking type.
[0136] i can be a positive integer greater than or equal to. The dialogue content of the i-th round and the previous rounds can be concatenated in chronological order to obtain the input data for the i-th round.
[0137] By inputting the input data of the i-th round into the target thought recognition model, the target thought recognition model can segment the input data of the i-th round into words and calculate the recognition probability distribution of the last word in the input data of the i-th round, thereby obtaining the recognition probability distribution of the dialogue content of the i-th round in the thought type space.
[0138] The preset mapping function is not limited and can be any function that can realize the probability distribution to the thinking type recognition result, such as: softmax function, threshold discrimination function, etc.
[0139] Unhealthy thinking patterns include divergent thinking, rigid thinking, and dependent thinking.
[0140] According to the implementation of this disclosure, by using a multi-dimensional data splicing example and integrating dialogue background, object profile, and historical dialogue content to construct input data, rich contextual semantic information can be provided to the model. This enables the target thinking recognition model to accurately capture the temporal logic and role characteristics in the dialogue, significantly improving the accuracy of identifying undesirable thinking types. Furthermore, by focusing on the probability distribution calculation of the last word segment, the semantic focus of the dialogue can be effectively located, achieving a rapid and accurate judgment of the thinking type in the current round.
[0141] Based on the training method of the aforementioned thinking type recognition model, this disclosure also provides a training device for the thinking type recognition model. The following will combine... Figure 9 The device is described in detail.
[0142] Figure 9 A schematic block diagram of a training apparatus for a thought type recognition model according to an embodiment of the present disclosure is shown.
[0143] like Figure 9 As shown, the training device 900 for the thinking type recognition model in this embodiment includes a splicing module 910, a processing module 920, and a training module 930.
[0144] The splicing module 910 is used to splice the dialogue background sample with multiple dialogue samples to obtain a group dialogue sample. The multiple dialogue samples are determined based on multi-turn dialogues between multiple objects. Each dialogue sample is obtained by splicing the object profile of the object and the dialogue content generated by the object. In one embodiment, the splicing module 910 can be used to perform the operation S210 described above, which will not be repeated here.
[0145] The processing module 920 is used to input the group dialogue samples and attention mask into the initial thinking type recognition model, so that the initial thinking type recognition model can process multiple dialogue samples in parallel based on the dependency information of multiple dialogue samples included in the dialogue background samples and attention mask, and obtain the test probability distribution of multiple dialogue samples in the thinking type space; in one embodiment, the processing module 920 can be used to perform the operation S210 described above, which will not be repeated here.
[0146] The training module 930 is used to train the initial thinking type recognition model based on multiple test probability distributions and the label probability distributions corresponding to the multiple test probability distributions to obtain the target thinking recognition model. In one embodiment, the training module 930 can be used to perform the operation S210 described above, which will not be repeated here.
[0147] Figure 10 A schematic block diagram of a device for identifying irrational thinking according to an embodiment of the present disclosure is shown.
[0148] The bad thinking identification device 1000 of this embodiment includes a data determination module 1010, an input module 1020 and a mapping module 1030.
[0149] The data determination module 1010 is used to, in response to being in the i-th round of dialogue, splice together the dialogue background determined from the database, the object profiles of multiple objects participating in the group dialogue, and the dialogue content from the first round to the i-th round to obtain the input data for the i-th round; in one embodiment, the data determination module 1010 can be used to perform the operation S810 described above, which will not be repeated here.
[0150] The input module 1020 is used to input the input data of the i-th round into the target thought recognition model to obtain the recognition probability distribution of the dialogue content of the i-th round in the thought type space. In one embodiment, the input module 1020 can be used to perform the operation S820 described above, which will not be repeated here.
[0151] The mapping module 1030 is used to map the recognition probability distribution to the thinking type recognition result based on a preset mapping function. The thinking type recognition result is either a bad thinking type or a normal thinking type. In one embodiment, the mapping module 1030 can be used to perform the operation S830 described above, which will not be repeated here.
[0152] According to embodiments of this disclosure, any plurality of modules among the splicing module 910, processing module 920, training module 930, data determination module 1010, input module 1020, and mapping module 1030 can be combined into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this disclosure, at least one of the splicing module 910, processing module 920, training module 930, data determination module 1010, input module 1020, and mapping module 1030 can be at least partially implemented as hardware circuitry, such as a field-programmable gate array (FPGA), a programmable logic array (PLA), a system-on-a-chip, a system-on-a-substrate, a system-on-package, an application-specific integrated circuit (ASIC), or implemented in hardware or firmware by any other reasonable means of integrating or packaging the circuitry, or implemented in software, hardware, or firmware, or in any suitable combination of any of these three implementation methods. Alternatively, at least one of the splicing module 910, processing module 920, training module 930, data determination module 1010, input module 1020, and mapping module 1030 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0153] Figure 11 A block diagram of an electronic device suitable for implementing a training method for a thinking type recognition model and a method for recognizing bad thinking, according to embodiments of the present disclosure, is shown schematically.
[0154] like Figure 11 As shown, an electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage portion 1108 into a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0155] RAM 1103 stores various programs and data required for the operation of electronic device 1100. Processor 1101, ROM 1102, and RAM 1103 are interconnected via bus 1104. Processor 1101 performs various operations of the method flow according to embodiments of the present disclosure by executing programs in ROM 1102 and / or RAM 1103. It should be noted that the programs may also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 may also perform various operations of the method flow according to embodiments of the present disclosure by executing programs stored in said one or more memories.
[0156] According to embodiments of this disclosure, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to a bus 1104. The electronic device 1100 may also include one or more of the following components connected to the input / output (I / O) interface 1105: an input section 1106 including a keyboard, mouse, etc.; an output section 1107 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the input / output (I / O) interface 1105 as needed. A removable medium 1111, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1110 as needed so that computer programs read from it can be installed into the storage section 1108 as needed.
[0157] This disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs that, when executed, implement the method according to the embodiments of this disclosure.
[0158] According to embodiments of this disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this disclosure, the computer-readable storage medium may include ROM 1102 and / or RAM 1103 and / or one or more memories other than ROM 1102 and RAM 1103 described above.
[0159] Embodiments of this disclosure also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the training method for the thinking type recognition model and the method for identifying erroneous thinking provided in the embodiments of this disclosure.
[0160] When the computer program is executed by the processor 1101, it performs the functions defined in the system / apparatus of this disclosure embodiments. According to embodiments of this disclosure, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0161] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 1109, and / or installed from the removable medium 1111. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0162] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 1109, and / or installed from removable medium 1111. When the computer program is executed by processor 1101, it performs the functions defined in the system of this disclosure embodiment. According to embodiments of this disclosure, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0163] According to embodiments of this disclosure, program code for executing the computer programs provided in embodiments of this disclosure can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can execute entirely on a user's computing device, partially on a user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0164] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0165] Those skilled in the art will understand that the features described in the various embodiments of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this disclosure. In particular, the features described in the various embodiments of this disclosure can be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.
[0166] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.< / e> < / c> < / s> < / e> < / c> < / s>
Claims
1. A training method for a thinking type recognition model, characterized in that, The method includes: A group dialogue sample is obtained by concatenating a dialogue background sample with multiple dialogue samples. The multiple dialogue samples are determined based on multi-turn dialogues between multiple objects. Each dialogue sample is obtained by concatenating the object profile of the object and the dialogue content generated by the object. The dialogue sample is text. The group dialogue samples and attention mask are input into the initial thinking type recognition model so that the initial thinking type recognition model can process multiple dialogue samples in parallel based on the dialogue background samples and the dependency information of multiple dialogue samples included in the attention mask, and obtain the test probability distribution of multiple dialogue samples in the thinking type space. Based on multiple test probability distributions and label probability distributions corresponding to the multiple test probability distributions, the initial thinking type recognition model is trained to obtain the target thinking recognition model. The initial thinking type recognition model is a pre-trained language model. The attention mask is obtained in the following way: For each dialogue sample, the dialogue sample is segmented into multiple sample words; The attention mask is obtained based on the positional information of multiple sample words included in each of the multiple dialogue samples and the generation order of the multiple dialogue samples in the multi-turn dialogue. The dependency information includes the positional information of dependent dialogue samples that have a dependency relationship with the dialogue sample; the process of obtaining the attention mask based on the positional information of multiple sample words included in each of the multiple dialogue samples and the generation order of the multiple dialogue samples in the multi-turn dialogue includes: For each dialogue sample, based on the position information of multiple sample words in the dialogue sample, the sample words at the target position are tagged to obtain tagged words; Based on the generation order of the multiple dialogue samples in the multi-turn dialogue, the first dialogue sample whose generation order is after the marker word is determined among the multiple dialogue samples. The position information corresponding to each of the multiple sample words included in the first dialogue sample is masked to obtain the masking result for the dialogue sample. Among the multiple dialogue samples, the second dialogue sample whose generation order is before the marker word of the dialogue sample is the dependent dialogue sample of the dialogue sample. The position information of the dependent dialogue sample is not masked. The attention mask is obtained based on the masking results of multiple dialogue samples.
2. The method according to claim 1, characterized in that, The initial thought type recognition model, based on the dialogue background samples and the dependency information of multiple dialogue samples included in the attention mask, processes multiple dialogue samples in parallel to obtain the test probability distribution of multiple dialogue samples in the thought type space, including: For each dialogue sample, based on the location information of dependent dialogue samples that have a dependency relationship with the dialogue sample, including the dependency information, the dependent dialogue samples of the dialogue sample are determined from a plurality of dialogue samples. Based on the dialogue background sample and the dependent dialogue sample, the test probability distribution of the sample word at the target position in the thought type space is calculated, and the test probability distribution of the dialogue sample in the thought type space is obtained.
3. The method according to claim 1, characterized in that, The dialogue content is generated by a dialogue generation agent loaded with the object's profile; the dialogue generation agent is used to simulate the object; multiple dialogue samples are obtained through the following methods: In response to being in the i-th round of dialogue, the multiple dialogue-generating agents obtain the historical dialogue content before the i-th round from the group dialogue topic, and generate thinking information and dialogue content to be sent based on the historical dialogue content and the bad thinking generation instruction generated according to a preset probability. In the case of i=1, the historical dialogue content is the dialogue background sample or the dialogue content generated by any of the objects in the actual group dialogue scenario for the dialogue background sample. In response to a target dialogue generating agent among the plurality of dialogue generating agents receiving a permission to send instruction sent by the chair agent, the target dialogue generating agent sends the dialogue content to be sent to the group dialogue topic to obtain the dialogue content to be verified. The target dialogue generating agent is determined by the chair agent based on the thinking information of the plurality of dialogue generating agents. When the verification agent obtains the dialogue content to be verified from the group dialogue topic and determines that the verification result of the dialogue content to be verified is that the verification is passed, the multiple dialogue generation agents use the dialogue content to be verified as the dialogue content of the i-th round. The target dialogue generating agent loads the object profile and the dialogue content of the i-th round, and then concatenates them to obtain the dialogue sample of the i-th round.
4. The method according to claim 3, characterized in that, The verification agent includes: an object verification agent and a speech background verification agent; the method further includes: The object verification agent is based on a database and verifies the degree of matching between the dialogue content to be verified and the object profile loaded by the target dialogue generation agent to obtain a first sub-verification result. The database includes the object profile and preset operation information or preset dialogue content corresponding to the object profile. The speech background verification agent verifies the degree of matching between the dialogue content to be verified and the dialogue background sample, and obtains the second sub-verification result. If both the first and second sub-verification results indicate that the verification result of the initial dialogue content is passed, the verification result is determined to be passed.
5. The method according to claim 1, characterized in that, The initial thought type recognition model is trained based on multiple test probability distributions and corresponding label probability distributions to obtain a target thought recognition model, including: For each test probability distribution, a difficulty weight is determined based on the preset sample importance and the difference between the test probability distribution and the preset value; The initial loss value is determined based on the difficulty weight, the test probability distribution, and the label probability distribution. The target loss value is obtained by performing group loss extraction on multiple initial loss values; The parameters of the initial thinking type recognition model are adjusted based on the target loss value to obtain the target thinking recognition model.
6. A method for identifying distorted thinking patterns, characterized in that, The method includes: In response to being in the i-th round of dialogue, the dialogue background determined from the database, the object profiles of multiple objects participating in the group dialogue, and the dialogue content from the 1st to the i-th round are concatenated to obtain the input data for the i-th round. The input data of the i-th round is input into the target thinking recognition model to obtain the recognition probability distribution of the dialogue content of the i-th round in the thinking type space; Based on a preset mapping function, the recognition probability distribution is mapped to the thinking type recognition result, which is either a bad thinking type or a normal thinking type. The target thinking recognition model is trained by the thinking type recognition model training method according to any one of claims 1 to 5.
7. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Call prediction model training method, call prediction method and device
CN119150014A
Method and apparatus for text sentiment recognition, computer storage medium, and electronic device
WO2025077885A1