A medical quality control problem interaction method and system based on large model multi-round dialogue

CN123013970APending Publication Date: 2026-10-30JIANGXI YIZHICHU MEDICAL PATHOLOGICAL DIAGNOSIS MANAGEMENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611496226.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-24
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

单轮交互的局限性:单次质控查询往往无法覆盖复杂、模糊或需要追溯的上下文问题

Benefits of technology

通过对医疗文书进行多层级语义向量化处理,并引入均值感知机制和交叉注意力机制,能够深入理解文本的局部细节与全局上下文之间的复杂关联,捕捉跨层级的语义交互。这意味着模型能够更精确地理解医疗文本的含义,并结合特定的质控规则,生成更准确的质控判断。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123013970A_ABST
    Figure CN123013970A_ABST
Patent Text Reader

Abstract

The application relates to a medical quality control problem interaction method and system based on a large model multi-round dialogue; through multi-level semantic vectorization processing on medical document data, a mean perception mechanism and a cross attention mechanism are introduced to construct context enhanced features with global semantic background and hierarchical interaction information; on this basis, a multi-layer perception generation gate coefficient is combined to realize fusion of original local details and global context semantics, and enhanced feature representation for quality control discrimination is obtained; finally, a large model driven multi-round dialogue type quality control engine is constructed based on the enhanced features, the context window, the attention weight and the reasoning path of the query are dynamically adjusted, the model generates an interpretable quality control conclusion, and efficient, accurate and intelligent medical quality control is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical artificial intelligence, natural language processing, and medical quality control technology, and in particular to a medical quality control problem interaction method and system based on large-scale multi-turn dialogue. Background Technology

[0002] Medical quality control is a core component in ensuring patient safety and improving the level of medical services. Traditional quality control methods mainly rely on manual post-hoc random checks of medical records, which suffers from pain points such as low efficiency, incomplete coverage, inconsistent standard implementation, and delayed feedback. With the development of Natural Language Processing (NLP) technology, especially the rise of large language models, new possibilities have been provided for automated and intelligent medical quality control.

[0003] However, existing large-scale models face many challenges in medical quality control applications: Limitations of single-round interaction: A single quality control query often cannot cover complex, ambiguous, or contextual issues that require tracing. For example, a quality control point of "irrational medication use" may require tracing back multiple rounds of information, such as the patient's past medical history, allergy history, and test results, to accurately pinpoint the cause.

[0004] Fragmentation of quality control knowledge: Although large models possess general knowledge, they have knowledge blind spots in the quality control rules, business logic, and terminology system of specific organizations, which can easily lead to "illusions" and result in misjudgments or invalid outputs.

[0005] The isolation of contextual understanding: When processing long texts (such as complete medical records), models often fragment information from different levels and paragraphs, lacking a deep understanding of global semantics and logical dependencies between levels. For example, there may be an implicit causal or correlation between "fast heart rate" in a medical record and the electrocardiogram report from three days prior, as well as the medication taken that day. Existing models struggle to effectively capture such cross-level semantic interactions.

[0006] Therefore, this invention proposes a medical quality control problem interaction method and system based on large-scale model multi-turn dialogue. Summary of the Invention

[0007] This invention addresses the technical problems existing in the prior art by providing a medical quality control problem interaction method and system based on large-model multi-turn dialogue.

[0008] The technical solution of this invention to solve the above-mentioned technical problems is as follows: A medical quality control problem interaction method based on large-model multi-turn dialogue, comprising the following steps: S1: Obtain the medical document data to be quality controlled, and use a pre-trained large language model to perform multi-level semantic vectorization processing to generate a text-level feature map containing multiple semantic levels. S2: For any target level node, apply the mean-aware mechanism to construct a patch-level mean feature with global semantic background by aggregating information from all levels other than its own level; then, introduce a cross-attention mechanism, using the node as the query and the patch-level mean feature as the key and value, to calculate the semantic response weight between the node and the global background, and generate context-enhanced features rich in inter-level interaction information. S3: Channel concatenation of node features and context enhancement features is performed and input into a multilayer perceptron network to generate gating coefficients in the range [0,1]. By weighted averaging of the gating coefficients, the original local details and global context semantics are fused to obtain the final enhanced feature representation used for quality control discrimination. S4: Based on enhanced feature representation, a large model-driven multi-turn conversational quality control engine is built. In the first round, initial quality control questions or scan results are generated. In subsequent rounds, the context window, attention weights, and inference paths of the query are dynamically adjusted according to user feedback to guide the model to generate interpretable quality control conclusions.

[0009] Furthermore, the multi-level semantic vectorization process employs a Transformer-based encoder. By setting attention masks at different levels, semantic features with granularity ranging from fine to coarse are extracted. The levels include word level, sentence level, paragraph level, and document level, and each level feature map consists of multiple nodes.

[0010] Furthermore, the mean-aware mechanism includes: constructing perceptual features with a global perspective by mining the dependencies between a single node and feature maps at different levels. For nodes Aggregates information from all levels except itself. L is the total number of nodes, and the patch-level mean characteristic is calculated. The patch-level mean feature provides a dynamic global background benchmark for anomaly detection at the current level. ; Introducing a cross-attention mechanism to achieve efficient feature aggregation; using nodes As a query, with As keys and values, compute nodes Response weights relative to the global background in spatial location: ; Where d is the scaling dimension of the feature channel, and the corresponding interactive feature is... : , Where W is the value projection matrix.

[0011] Furthermore, S3 includes: Node With interaction features The data is concatenated along the channel dimension and input into a multilayer perceptron network to generate gating coefficients in the range [0,1]. : ; in, This represents the Sigmoid activation function. Indicates channel splicing operation; coefficient Dynamically, it represents the model's confidence in the original local details and its need for the global context; the final augmented features Obtained through a weighted average of the gating weights: .

[0012] Furthermore, the method for constructing the multi-turn conversational quality control engine includes: The enhanced feature representation is used as the input prefix or context vector of the large language model to guide the model to generate initial quality control questions in the first round of dialogue; In subsequent rounds, the attention mask of the large language model is dynamically adjusted based on the user's input questions or feedback to control the range of text the model focuses on; at the same time, the inference path is adaptively adjusted based on the semantic relevance of the current dialogue, so that the model focuses its inference along the level most relevant to the current question. Ultimately, the model output includes the quality control conclusions and their corresponding reasoning.

[0013] Furthermore, the method for dynamically adjusting the attention mask includes: In each round of dialogue, a mask vector is generated based on the keywords or question type input by the user. The mask vector is used to suppress or enhance the weight of feature maps at a specific level in the cross-attention calculation. The method for generating the mask vector is as follows: semantically match the user input text with each rule in the preset quality control rule base. The mask value of the level corresponding to the rule whose matching degree exceeds the threshold is set to 1, and the mask value of the other levels is set to 0 or a negative value. The mask vector is applied to the score matrix of the cross-attention mechanism, thereby dynamically adjusting the semantic level that the model focuses on.

[0014] Furthermore, methods for adaptively adjusting inference paths include: In each round of dialogue, the semantic similarity between the current user input and the feature maps at each level is calculated to generate a hierarchical attention vector. The hierarchical attention vector is then weighted and summed with the enhanced feature representation to obtain the basic inference features for this round of dialogue. ; in, Hierarchical attention vector The first in Each element takes the basic features of reasoning as input to the large language model for this round of reasoning, guiding the model to prioritize the semantic level most relevant to the current problem during reasoning, thereby achieving dynamic adjustment of the reasoning path.

[0015] A medical quality control question interaction system based on large-model multi-turn dialogue, applied to the aforementioned medical quality control question interaction method based on large-model multi-turn dialogue, the system comprising: The multi-level semantic encoding module uses a pre-trained large language model to perform multi-level semantic vectorization processing on the acquired medical document data, generating text-level feature maps including word-level, sentence-level, paragraph-level, and document-level features. The inter-level interaction perception module applies a mean perception mechanism to aggregate information from all levels except its own for any target level node, constructs patch-level mean features, and introduces a cross-attention mechanism to calculate the semantic response weight between the node and the global mean background using the target node as the query and the global mean background as the key and value, thereby generating context-enhanced features. The adaptive gating fusion module concatenates the original hierarchical node features with the contextual enhancement features, inputs them into the multilayer perceptron network to generate gating coefficients, and then fuses the original local details and global contextual semantics through a weighted average of the gating coefficients to obtain the final enhanced feature representation used for quality control discrimination. The multi-turn dialogue reasoning engine is a large-model-driven multi-turn dialogue quality control engine built on enhanced feature representation. In the first round, it generates initial quality control questions or scan results. In subsequent rounds, it dynamically adjusts the query context window, attention weights, and reasoning paths based on user feedback to guide the model to generate interpretable quality control conclusions.

[0016] Furthermore, the multi-turn dialogue reasoning engine includes: Dynamic Prompt building blocks are used to concatenate enhanced feature representations, dialogue history, and the user's current input into a formatted Prompt, which is then fed into the large language model. The context window management unit is used to record and manage key information in multi-turn dialogues. It uses a sliding window or an importance-based summary mechanism to retain key information in the context window to support long-distance dependency reasoning. The reasoning path backtracking unit is used to extract the corresponding nodes and levels, generate an interpretable reasoning chain, and output original textual evidence when the user requests an explanation or provides evidence.

[0017] The beneficial effects of this invention are: By performing multi-level semantic vectorization on medical documents and introducing mean-aware and cross-attention mechanisms, the model can gain a deeper understanding of the complex relationships between local details and global context, capturing cross-level semantic interactions. This means the model can more accurately understand the meaning of medical texts and, combined with specific quality control rules, generate more accurate quality control judgments.

[0018] By constructing a "text-level feature map" and utilizing mean-aware and cross-attention mechanisms, the global semantic information of the text can be effectively aggregated, and the response relationship between nodes and the global context can be understood. Simultaneously, an adaptive gating fusion mechanism and a dynamically adjusted dialogue inference engine are introduced. The gating coefficients can dynamically fuse original local details with global contextual semantics, and a weighted average is performed based on the model's confidence level, improving the robustness of the feature representation. Attached Figure Description

[0019] Figure 1 This is a flowchart illustrating a medical quality control problem interaction method and system based on a large-model multi-turn dialogue. Detailed Implementation

[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0021] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.

[0022] In the description of this application, the term "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.

[0023] like Figure 1 As shown in one embodiment: a medical quality control question interaction method based on large-model multi-turn dialogue includes the following steps: S1: Obtain the medical document data to be quality controlled, and use a pre-trained large language model to perform multi-level semantic vectorization processing to generate text-level feature maps containing multiple semantic levels; wherein, the multi-level semantic vectorization processing adopts a Transformer-based encoder, and extracts semantic features with fine-grained to coarse-grained granularity by setting attention masks at different levels. The levels include word level, sentence level, paragraph level and document level, and each level feature map is composed of multiple nodes.

[0024] S2: For any target level node, a mean-aware mechanism is applied to construct a patch-level mean feature with a global semantic background by aggregating information from all levels except its own. Subsequently, a cross-attention mechanism is introduced, using the node as the query and the patch-level mean feature as the key and value, to calculate the semantic response weight between the node and the global context, generating context-enhanced features rich in inter-level interaction information. Specifically, for a node in the target level (e.g., the sentence-level representation of a sentence), it is aggregated with the feature information of all other levels except its own. The aggregation method can be to calculate the average of all other level features to obtain a "patch-level mean feature". This mean feature represents the average semantics of the current node in the global perspective of the entire text. The cross-attention mechanism calculates the "relevance" or "response degree" of the target node (e.g., a sentence) in understanding the global text context (represented by the mean feature). A high response weight means that the node is highly relevant to the global context, or that the information of the node is crucial for understanding the global context.

[0025] S3: Channel concatenation of node features and context enhancement features is performed and input into a multilayer perceptron network to generate gating coefficients in the range [0,1]. By weighted averaging of the gating coefficients, the original local details and global context semantics are fused to obtain the final enhanced feature representation used for quality control discrimination. S4: Based on enhanced feature representation, a large model-driven multi-turn conversational quality control engine is built. In the first round, initial quality control questions or scan results are generated. In subsequent rounds, the context window, attention weights, and inference paths of the query are dynamically adjusted according to user feedback to guide the model to generate interpretable quality control conclusions.

[0026] In one embodiment, the mean-aware mechanism includes: constructing a perceptual feature with a global perspective by mining the dependencies between a single node and feature maps at different levels. For nodes Aggregates information from all levels except itself. L is the total number of nodes, and the patch-level mean characteristic is calculated. The patch-level mean feature provides a dynamic global background benchmark for anomaly detection at the current level. ; Introducing a cross-attention mechanism to achieve efficient feature aggregation; using the current node As a query, with As keys and values, compute nodes Response weights relative to the global background in spatial location: ; Where d is the scaling dimension of the feature channel, and T is the matrix transpose operator, which matches the current target node (query) with each feature dimension in the global background to calculate the spatial response weight (i.e., similarity or relevance) between the "semantics of the current node" and the "global average semantics". The corresponding interaction feature is... : , Where W is the value projection matrix.

[0027] In this embodiment, traditional models, when processing a sentence or paragraph, may only focus on its meaning, ignoring its position within the entire document and its connections to other parts. The mean-aware mechanism aims to ensure that each node (word, sentence, paragraph, or chapter) "perceives" the overall information of all other nodes (excluding itself); for a specific target node (such as a sentence), it "sees" the overall meaning of all other sentences, paragraphs, and the entire document. The cross-attention mechanism calculates the similarity (usually a dot product) between the query (target node) and the key (global context), then normalizes it using softmax to obtain a weight. This weight represents the degree of association between the target node and the global context. A high weight means the target node's information is highly relevant to the global context, while a low weight indicates a weaker association; based on the calculated weight, global context information is "fused" into the target node. This is not just a simple weighted summation, but rather, through an attention mechanism, the model "knows" which information the target node should extract from the global context. The resulting "context-enhanced features" simultaneously contain the local details of the target node itself and the rich interaction information between it and the global context.

[0028] In one embodiment, S3 includes: Node With interaction features The data is concatenated along the channel dimension and input into a multilayer perceptron network to generate gating coefficients in the range [0,1]. : ; in, This represents the Sigmoid activation function. Indicates channel splicing operation; coefficient Dynamically, it represents the model's confidence in the original local details and its need for the global context; the final augmented features Obtained through a weighted average of the gating weights: .

[0029] In this embodiment, "original hierarchical node features" (i.e., the original information of the nodes themselves) and "context-enhanced features" (features containing global background information) are combined. The multilayer perceptron network learns how to fuse these features based on the combination of original and enhanced features. The gating mechanism allows the model to adaptively decide whether to favor the original, more refined local information or the contextual information refined from the global background during fusion. This enables the model to flexibly select the optimal feature representation based on the specific medical document content.

[0030] In one embodiment, the method for constructing the multi-turn conversational quality control engine includes: The enhanced feature representation is used as the input prefix or context vector of the large language model to guide the model to generate initial quality control questions in the first round of dialogue; In subsequent rounds, the attention mask of the large language model is dynamically adjusted based on the user's input questions or feedback to control the range of text the model focuses on; at the same time, the inference path is adaptively adjusted based on the semantic relevance of the current dialogue, so that the model focuses its inference along the level most relevant to the current question. Ultimately, the model output includes the quality control conclusions and their corresponding reasoning.

[0031] The method for dynamically adjusting the attention mask includes: In each round of dialogue, a mask vector is generated based on the keywords or question type input by the user. The mask vector is used to suppress or enhance the weight of feature maps at a specific level in the cross-attention calculation. The method for generating the mask vector is as follows: semantically match the user input text with each rule in the preset quality control rule base. The mask value of the level corresponding to the rule whose matching degree exceeds the threshold is set to 1, and the mask value of the other levels is set to 0 or a negative value. The mask vector is applied to the score matrix of the cross-attention mechanism, thereby dynamically adjusting the semantic level that the model focuses on.

[0032] Methods for adaptively adjusting inference paths include: In each round of dialogue, the semantic similarity between the current user input and the feature maps at each level is calculated to generate a hierarchical attention vector. The hierarchical attention vector is then weighted and summed with the enhanced feature representation to obtain the basic inference features for this round of dialogue. ; in, Hierarchical attention vector The first in Each element takes the basic features of reasoning as input to the large language model for this round of reasoning, guiding the model to prioritize the semantic level most relevant to the current problem during reasoning, thereby achieving dynamic adjustment of the reasoning path.

[0033] A medical quality control question interaction system based on large-model multi-turn dialogue, applied to the aforementioned medical quality control question interaction method based on large-model multi-turn dialogue, the system comprising: The multi-level semantic encoding module uses a pre-trained large language model to perform multi-level semantic vectorization processing on the acquired medical document data, generating text-level feature maps including word-level, sentence-level, paragraph-level, and document-level features. The inter-level interaction perception module applies a mean perception mechanism to aggregate information from all levels except its own for any target level node, constructs patch-level mean features, and introduces a cross-attention mechanism to calculate the semantic response weight between the node and the global mean background using the target node as the query and the global mean background as the key and value, thereby generating context-enhanced features. The adaptive gating fusion module concatenates the original hierarchical node features with the contextual enhancement features, inputs them into the multilayer perceptron network to generate gating coefficients, and then fuses the original local details and global contextual semantics through a weighted average of the gating coefficients to obtain the final enhanced feature representation used for quality control discrimination. The multi-turn dialogue reasoning engine is a large-model-driven multi-turn dialogue quality control engine built on enhanced feature representation. In the first round, it generates initial quality control questions or scan results. In subsequent rounds, it dynamically adjusts the query context window, attention weights, and reasoning paths based on user feedback to guide the model to generate interpretable quality control conclusions.

[0034] Furthermore, the multi-turn dialogue reasoning engine includes: Dynamic Prompt building blocks are used to concatenate enhanced feature representations, dialogue history, and the user's current input into a formatted Prompt, which is then fed into the large language model. The context window management unit is used to record and manage key information in multi-turn dialogues. It uses a sliding window or an importance-based summary mechanism to retain key information in the context window to support long-distance dependency reasoning. The reasoning path backtracking unit is used to extract the corresponding nodes and levels, generate an interpretable reasoning chain, and output original textual evidence when the user requests an explanation or provides evidence.

[0035] Example 1: Taking the quality control of a pneumonia inpatient medical record as an example, the method and process are described in detail.

[0036] Medical document data to be quality controlled: Obtain a pneumonia inpatient medical record, which includes admission record, progress notes (including records from multiple days), imaging reports (such as chest CT), laboratory reports (such as complete blood count and C-reactive protein), medication records, discharge summary, etc.

[0037] Multi-level semantic vectorization processing: The above medical record data is processed using a pre-trained large language model based on Transformer (e.g., an LLM optimized for the medical field).

[0038] Word-level features: Convert each word in the medical record into a vector representation.

[0039] Sentence-level features: The word vectors in a sentence are aggregated through a model to generate a vector representation of the sentence.

[0040] Paragraph-level features: Aggregate sentence vectors in a paragraph to generate a vector representation of the paragraph.

[0041] Chapter-level features: Treat each chapter of the medical record (such as admission record, progress record, etc.) as an independent chapter or divide continuous progress records to generate a higher-level semantic representation.

[0042] Generate text-level feature maps: The final result is a text-level feature map containing word-level, sentence-level, paragraph-level, and document-level (or different disease stages). For example, the disease progress record may be subdivided into document-level nodes such as "early admission", "mid-treatment", and "before discharge".

[0043] Target-level node: Suppose we are focusing on the chapter-level node "mid-treatment" in the course of the disease to determine whether the use of antibiotics is appropriate.

[0044] Mean sensing mechanism: Global semantic context construction: Aggregate the vector representations of all hierarchical information except for the "mid-treatment" node (including other chapter-level nodes such as "early admission" and "before discharge," as well as all paragraph-level, sentence-level, and word-level nodes) to calculate a "patch-level mean feature." This feature represents the global average semantic information of the entire medical record outside the "mid-treatment" time point.

[0045] Cross-attention mechanism: Query: The feature vector of the chapter-level node "Mid-Treatment".

[0046] Keys and values: A global semantic context constructed from “patch-level mean features”.

[0047] Calculating semantic response weights: Through cross-attention, the model calculates the relevance weights between the "mid-treatment" node and the global context. For example, if the global context contains a large amount of information about abnormal blood test results (such as elevated white blood cell count), and the "mid-treatment" node describes the start of broad-spectrum antibiotic use, then both will have high response weights, indicating that the antibiotic use is relevant to the overall condition.

[0048] Context-enhanced feature generation: The calculated semantic response weights are applied to the global context to generate context-enhanced features rich in inter-level interaction information. This feature not only includes local information from the "mid-treatment stage" but also incorporates the correlation strength with other key information (such as test reports and other disease stages).

[0049] Channel concatenation: The original "mid-treatment" chapter-level node features (local details) are concatenated with the generated context-enhanced features (global context) along the channel dimension.

[0050] Multilayer Perceptron (MLP) network: The concatenated features are input into the MLP, generating a gating coefficient between [0,1]. This coefficient represents the model's confidence in the original local details and its dependence on the global context. For example, if there are clear infection indicators in the medical record supporting the use of the current antibiotic, the gating coefficient may be biased towards preserving more local details; conversely, if the information is ambiguous, it may be more dependent on the global context.

[0051] Weighted average fusion: A weighted average of the original local details and global contextual semantics is applied using gating coefficients to obtain the final enhanced feature representation used for quality control judgment. For example: Enhanced features = Gating coefficient * Original local details + (1 - Gating coefficient) * Global context semantics This step integrates the details of the medical record with the overall diagnostic and treatment logic, enabling the model to understand the condition more comprehensively.

[0052] Building a quality control engine: Based on the enhanced feature representation obtained from the above steps, a large model-driven multi-turn conversational quality control engine is built.

[0053] First round of interaction: Quality control question generation: Based on the enhanced features of "mid-treatment", the model generates a preliminary quality control question: "Has the ceftriaxone used by this patient during the mid-treatment period been adjusted according to the latest infection indicators and drug sensitivity results?" or directly scans the results: "Ceftriaxone use detected. Please confirm whether it complies with the latest treatment guidelines." Subsequent rounds of interaction: User feedback: The quality control officer (user) may need further information, such as: "Please provide a detailed complete blood count and C-reactive protein report." or "Does this patient have a history of allergy to penicillin antibiotics?" Dynamic adjustment: Context window: The model dynamically adjusts the query context window based on user feedback. If a user asks about allergy history, the model will focus on retrieving the "allergy history" section of the medical record.

[0054] Attention weights: The model dynamically adjusts attention weights based on the keywords in the user's question (such as "allergy history" or "drug sensitivity results"), prioritizing hierarchical features related to these keywords.

[0055] Reasoning path: The model adjusts the reasoning path based on the semantics of the current dialogue, which may shift from a direct judgment of drug dosage to an in-depth analysis of the basis for drug selection.

[0056] Explainable conclusions: Ultimately, the model will generate explainable quality control conclusions with accompanying reasoning, such as: "Conclusion: Antibiotic use is appropriate. Basis: The patient's white blood cell count remained above the normal range during the mid-treatment period, and C-reactive protein was elevated. According to the drug sensitivity report, ceftriaxone is a sensitive drug, and there is no record of allergy." This embodiment, through multi-level semantic vectorization, inter-level interaction awareness, and adaptive gating fusion, can deeply understand the complex information dependencies across levels and modules in medical documents. Combined with a multi-turn conversational quality control engine, it can simulate the interaction process of a human quality control officer. By dynamically adjusting queries and inferences, it effectively solves problems such as insufficient single-turn interaction and fragmented quality control knowledge, significantly improving the efficiency and accuracy of quality control in pneumonia medical records and providing interpretable conclusions. Example 2: Performance of inter-level interactive perception and adaptive gating fusion in identifying quality control points of "irrational medication prescription".

[0057] Suppose there is a "temporary medical order" in the medical record to administer a new type of antipsychotic drug, aripiprazole, to the patient, but at the same time the "attending physician's ward round record" mentions that the patient's "condition has been significantly relieved and the mental state has returned to normal."

[0058] Target-level node: Feature vector of the aripiprazole entry in "Temporary Medical Orders".

[0059] Mean-aware mechanism: The model will aggregate all other hierarchical information except for this "temporary medical order" entry, including but not limited to: Other chapter-level nodes (such as the initial diagnosis in the "Admission Record", the description of the patient's condition in the first few days in the "Progress Record", the blood count, liver and kidney function indicators in the "Laboratory Report", and the "Imaging Report").

[0060] Other paragraph-level, sentence-level, and word-level information.

[0061] Global semantic context construction: The calculated "patch-level mean features" will contain key information such as "the condition has been significantly relieved and the mental state has returned to normal" because it comes from all other text except the target medical order.

[0062] Cross-attention: The features of the target node (aripiprazole prescription) are used as the query, and the global semantic context is used as the key and value. The model calculates the semantic response weights between "aripiprazole" and global contextual information such as "the condition has been significantly relieved".

[0063] Results: Since there is a logical conflict between "the condition has been significantly relieved" and "continue to use aripiprazole" (i.e., the drug may no longer be needed when the condition improves), the cross-attention mechanism calculates a low response weight, indicating that the medical order is not highly correlated with or inconsistent with the patient's current overall condition.

[0064] Channel splicing: The features of the original "temporary medical order" (including local details such as drug name, dosage, and frequency) are spliced ​​with the context-enhanced features (including the correlation strength with information such as "symptom relief").

[0065] MLP and gating coefficients: Input concatenated features into MLP to generate gating coefficients (ranging from [0,1]).

[0066] Case A (Rational Medication Use): If the medical record clearly states that "although the condition has improved, consolidation treatment is still needed. To prevent relapse, the original medication regimen should continue," then the original features and context-enhanced features will corroborate each other, and g may be close to 1, tending to retain more local details, ultimately enhancing the features.

[0067] Case B (Inappropriate Medication): As mentioned earlier, if the condition is "significantly relieved" but aripiprazole is still prescribed, the context-enhanced feature will strongly indicate inappropriate use. The model will adjust g to be biased towards 0, placing greater emphasis on global contextual information and stressing the judgment of global information.

[0068] Example 2 demonstrates that the inter-level interactive perception and adaptive gating fusion mechanism can effectively break the contextual isolation of medical texts and deeply integrate information from different levels and modules. This results in performance far exceeding existing technologies when identifying complex quality control points such as "irrational medication prescriptions." This mechanism can more accurately capture the subtleties in medical logic, providing a more reliable basis for medical quality control.

[0069] Example 3: Specific implementation of a multi-turn dialogue reasoning engine in handling complex quality control problems.

[0070] This example uses a quality control question about whether a patient has undergone unnecessary imaging examinations to illustrate the specific implementation of a multi-turn dialogue reasoning engine: First round of interaction: Generate initial quality control questions / scan results; Input: Enhanced feature representation obtained after processing S1, S2, and S3 (including patient symptom description, test results, completed imaging reports, etc.).

[0071] Engine working: Prompt build: The large model-driven engine enhances feature representations as input prefixes or context vectors.

[0072] Problem Generation: Based on the enhanced features, the model may generate an initial scan result or a quality control problem. "Scan results: The patient underwent two chest CT scans within a 3-day period, on May 7, 2025 and May 10, 2025, respectively. Please further assess the necessity of these scans." "Quality control issue: Was the chest CT scan performed on May 10, 2025, sufficient for the patient's medical evaluation? Please make a judgment based on clinical symptoms, previous examination results, etc." Subsequent rounds of interaction: dynamic adjustment and reasoning; User feedback / follow-up questions: Quality control personnel (users) may ask follow-up questions on the initial issue, for example: "Please provide a detailed report of the chest CT scan and list any positive findings." What relevant clinical symptoms did the patient have before the examination? Are there other non-imaging methods that can achieve similar diagnostic results? Dynamic tuning of the engine: Context window management snap-in: Record key information: The engine will record key information provided by the user (such as "examination report", "clinical symptoms", "non-imaging methods").

[0073] Sliding window / summary: For long medical records, the engine will use a sliding window or an importance-based summary mechanism to keep the parts most relevant to the user's current problem (such as relevant chest CT reports, pre-examination medical records) in the context window so that the model can retrieve them efficiently.

[0074] Dynamic attention mask: Generate a mask vector: Based on the user-input keywords "examination report" and "clinical symptoms," the engine generates a mask vector. For example, it matches the user-input text against a quality control rule base (such as "guidelines for imaging examinations"). If a "guidelines for imaging examinations" rule is matched, the mask value for the corresponding layer is 1; if a "non-imaging diagnostic alternative" rule is matched, the mask value for the corresponding layer is also 1; while for layers less relevant to the current problem (such as "cost management"), the mask value may be 0 or negative.

[0075] Effect on attention mechanism: This mask vector acts on the cross-attention score matrix inside the model, dynamically adjusting the model's attention weights for different levels of feature maps. For example, when a user asks for "examination indications," the model will focus on levels related to "indications," such as symptom descriptions in "medical records" and abnormal indicators in "lab reports," while reducing attention to levels such as "discharge summary."

[0076] Inference path adaptive adjustment: Calculate hierarchical attention: The engine calculates the semantic similarity between the current user input (such as "Are the examination indications sufficient?") and the feature maps at each level (word level, sentence level, paragraph level, and document level, especially "medical record" and "test report").

[0077] Generate a hierarchical attention vector: Based on similarity, generate a hierarchical attention vector. For example, the hierarchy related to "medical records" and "lab reports" will have a high attention score.

[0078] Constructing basic inference features: The attention vector of this level is weighted and summed with the enhanced feature representation to obtain the "basic inference features" of this round of dialogue.

[0079] Guided Model Inference: This "basic feature for inference" serves as the input to the large language model for this round of inference, guiding the model to prioritize semantic levels most relevant to the current problem. For example, the model will prioritize searching for clinical evidence supporting or opposing the examination in the "medical record" rather than performing a general information scan.

[0080] Output: Explainable quality control conclusions: For example: "Conclusion: The chest CT scan performed on May 10, 2025, was unnecessary. Reasoning: Prior to the examination, the patient's main symptoms were cough and sputum production (inconsistent with imaging indications), and blood routine and CRP test results were normal. There were no other clear clinical clues to support this imaging examination. According to the 2022 guidelines for the diagnosis and treatment of community-acquired pneumonia, this examination is unnecessary in this situation." Extraction of Reasoning Evidence: During the reasoning process of a large model, the attention mechanism assigns different weights to different parts of the input. The model determines which parts are more important for generating the final conclusion. The reasoning path backtracking unit analyzes these internal attention weights, thereby ranking the weights of corresponding nodes and levels. In practice, it prioritizes extracting text content from nodes and levels with high weights. When a user requests an explanation, the model outputs original textual evidence with high response weights (such as specific symptom descriptions in the "medical record" or abnormal values ​​in the "test report"), along with their corresponding weight values, to quantify their importance in the model's decision-making and make its reasoning process transparent.

[0081] Example 3 demonstrates how a multi-turn dialogue reasoning engine can effectively handle complex and traceable information in a real-world quality control scenario by dynamically adjusting the context window, attention mask, and reasoning path. This interactive and interpretable reasoning capability enables large models to play a more intelligent and reliable role in the field of medical quality control, not only identifying problems but also providing clear judgment criteria, greatly enhancing the depth and breadth of quality control work.

[0082] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0083] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A medical quality control question interaction method based on large-scale model multi-turn dialogue, characterized in that, Includes the following steps: S1: Obtain the medical document data to be quality controlled, and use a pre-trained large language model to perform multi-level semantic vectorization processing to generate a text-level feature map containing multiple semantic levels. S2: For any target level node, apply the mean-aware mechanism to construct a patch-level mean feature with a global semantic background by aggregating information from all other levels except its own level. Subsequently, a cross-attention mechanism is introduced, using nodes as queries and patch-level mean features as keys and values, to calculate the semantic response weights between nodes and the global context, generating context-enhanced features rich in inter-level interaction information; S3: Channel concatenation of node features and context enhancement features is performed and input into a multilayer perceptron network to generate gating coefficients in the range [0,1]. By weighted averaging of the gating coefficients, the original local details and global context semantics are fused to obtain the final enhanced feature representation used for quality control discrimination. S4: Based on enhanced feature representation, a large model-driven multi-turn conversational quality control engine is built. In the first round, initial quality control questions or scan results are generated. In subsequent rounds, the context window, attention weights, and inference paths of the query are dynamically adjusted according to user feedback to guide the model to generate interpretable quality control conclusions.

2. The medical quality control problem interaction method based on large-model multi-turn dialogue according to claim 1, characterized in that, The multi-level semantic vectorization process employs a Transformer-based encoder. By setting attention masks at different levels, semantic features with granularity ranging from fine to coarse are extracted. The levels include word level, sentence level, paragraph level, and document level, and each level feature map consists of multiple nodes.

3. The medical quality control problem interaction method based on large-model multi-turn dialogue according to claim 1, characterized in that, The mean-aware mechanism includes: constructing perceptual features with a global perspective by mining the dependencies between a single node and feature maps at different levels. For nodes Aggregates information from all levels except itself. L is the total number of nodes, and the patch-level mean characteristic is calculated. The patch-level mean feature provides a dynamic global background benchmark for anomaly detection at the current level. ; Introducing a cross-attention mechanism to achieve efficient feature aggregation; using nodes As a query, with As keys and values, compute nodes Response weights relative to the global background in spatial location: ; Where d is the scaling dimension of the feature channel, and the corresponding interactive feature is... : , Where W is the value projection matrix.

4. The medical quality control problem interaction method based on large-model multi-turn dialogue according to claim 3, characterized in that, S3 includes: Node With interaction features The data is concatenated along the channel dimension and input into a multilayer perceptron network to generate gating coefficients in the range [0,1]. : ; in, This represents the Sigmoid activation function. Indicates channel splicing operation; coefficient Dynamically, it represents the model's confidence in the original local details and its need for the global context; the final augmented features Obtained through a weighted average of the gating weights: 。 5. The medical quality control problem interaction method based on large-model multi-turn dialogue according to claim 4, characterized in that, The construction method of the multi-turn conversational quality control engine includes: The enhanced feature representation is used as the input prefix or context vector of the large language model to guide the model to generate initial quality control questions in the first round of dialogue; In subsequent rounds, the attention mask of the large language model is dynamically adjusted based on the user's input questions or feedback to control the range of text the model focuses on; at the same time, the inference path is adaptively adjusted based on the semantic relevance of the current dialogue, so that the model focuses its inference along the level most relevant to the current question. Ultimately, the model output includes the quality control conclusions and their corresponding reasoning.

6. The medical quality control problem interaction method based on large-model multi-turn dialogue according to claim 5, characterized in that, The method for dynamically adjusting the attention mask includes: In each round of dialogue, a mask vector is generated based on the keywords or question type input by the user. The mask vector is used to suppress or enhance the weight of feature maps at a specific level in the cross-attention calculation. The method for generating the mask vector is as follows: semantically match the user input text with each rule in the preset quality control rule base. The mask value of the level corresponding to the rule whose matching degree exceeds the threshold is set to 1, and the mask value of the other levels is set to 0 or a negative value. The mask vector is applied to the score matrix of the cross-attention mechanism, thereby dynamically adjusting the semantic level that the model focuses on.

7. The medical quality control problem interaction method based on large-model multi-turn dialogue according to claim 6, characterized in that, Methods for adaptively adjusting inference paths include: In each round of dialogue, the semantic similarity between the current user input and the feature maps at each level is calculated to generate a hierarchical attention vector. The hierarchical attention vector is then weighted and summed with the enhanced feature representation to obtain the basic inference features for this round of dialogue. ; in, Hierarchical attention vector The first in Each element takes the basic features of reasoning as input to the large language model for this round of reasoning, guiding the model to prioritize the semantic level most relevant to the current problem during reasoning, thereby achieving dynamic adjustment of the reasoning path.

8. A medical quality control problem interaction system based on large-scale model multi-turn dialogue, characterized in that, The system includes: The multi-level semantic encoding module uses a pre-trained large language model to perform multi-level semantic vectorization processing on the acquired medical document data, generating text-level feature maps including word-level, sentence-level, paragraph-level, and document-level features. The inter-level interaction perception module applies a mean perception mechanism to aggregate information from all levels except its own for any target level node, constructs patch-level mean features, and introduces a cross-attention mechanism to calculate the semantic response weight between the node and the global mean background using the target node as the query and the global mean background as the key and value, thereby generating context-enhanced features. The adaptive gating fusion module concatenates the original hierarchical node features with the contextual enhancement features, inputs them into the multilayer perceptron network to generate gating coefficients, and then fuses the original local details and global contextual semantics through a weighted average of the gating coefficients to obtain the final enhanced feature representation used for quality control discrimination. The multi-turn dialogue reasoning engine is a large-model-driven multi-turn dialogue quality control engine built on enhanced feature representation. In the first round, it generates initial quality control questions or scan results. In subsequent rounds, it dynamically adjusts the query context window, attention weights, and reasoning paths based on user feedback to guide the model to generate interpretable quality control conclusions.

9. A medical quality control problem interaction system based on large-model multi-turn dialogue as described in claim 8, characterized in that, The multi-turn dialogue reasoning engine includes: Dynamic Prompt building blocks are used to concatenate enhanced feature representations, dialogue history, and the user's current input into a formatted Prompt, which is then fed into the large language model. The context window management unit is used to record and manage key information in multi-turn dialogues. It uses a sliding window or an importance-based summary mechanism to retain key information in the context window to support long-distance dependency reasoning. The reasoning path backtracking unit is used to extract the corresponding nodes and levels, generate an interpretable reasoning chain, and output original textual evidence when the user requests an explanation or provides evidence.