A method and device for generating information for hepatocellular carcinoma risk stratification and treatment recommendations
By constructing an electronic medical record-style input sequence containing clinical variable markers and using a large language model constrained by treatment guidelines for reasoning, the problems of logical lack and uninterpretability of general models in hepatocellular carcinoma data processing are solved, and highly reliable treatment recommendations are generated.
Patent Information
- Application Number
- CN202610097089.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-29
AI Technical Summary
Existing general-purpose large language models lack strict constraints on specific medical logic when processing hepatocellular carcinoma medical data. They are prone to generating non-factual content and the calculation process is uninterpretable, resulting in limited credibility of the output data in application scenarios with high credibility requirements.
By acquiring structured clinical data related to hepatocellular carcinoma of the target subjects, the data is converted into electronic medical record style narrative text containing clinical semantics using a pre-set electronic medical record narrative template, and key clinical variable markers are embedded to construct the model input sequence. The model is then used for inference by a large language model trained with decision tree constraints based on the hepatocellular carcinoma diagnosis and treatment guidelines and a multi-objective reinforcement learning strategy, outputting a structured text stream, and extracting comprehensive decision support information using parsing rules.
It achieves highly reliable clinical decision support, ensuring that the generated information strictly follows clinical guidelines in logic, and that the intermediate reasoning process is clear and verifiable, significantly improving the accuracy and logical consistency of treatment recommendations.
Smart Images

Figure CN122117363A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical big data processing technology, and in particular to a method and apparatus for generating information on risk stratification and treatment recommendations for hepatocellular carcinoma. Background Technology
[0002] In the field of medical data management and decision support for hepatocellular carcinoma, the processing of clinical information heavily relies on structured staging systems and treatment guidelines. Existing computer-aided systems typically map patient data such as tumor size, number, and liver function indicators to specific staging categories based on pre-defined guideline rules, and retrieve corresponding standardized treatment pathway information. With the advancement of artificial intelligence technology, large language models, leveraging their advantages in natural language processing, have begun to be applied to process complex electronic medical record text data. The aim is to provide clinicians with information retrieval, data summarization, and supplementary reference information by analyzing massive amounts of unstructured medical text, becoming an important research direction in current medical information processing technology.
[0003] Currently, there are two main data processing technology approaches in this field. The first is the traditional decision support system based on rule matching. Its working principle is to transform clinical guidelines into logical decision trees, dividing patient data into fixed groups through discrete key variables, and then outputting a single or limited set of recommendations. The second is a question-answering system based on a general large language model. This type of technology typically uses a pre-trained model fine-tuned with medical corpora, taking case descriptions as text input and using probabilistic prediction mechanisms to generate relevant medical questions and answers or preliminary analysis results. In addition, some technologies utilize deep learning models to extract features from medical imaging data and, under specific data filtering conditions, classify and calculate the applicability of local treatment methods.
[0004] Existing general-purpose generative large language models suffer from significant shortcomings in the logicality and credibility of data processing. Because these models primarily optimize for text fluency and lack strict constraints on logic specific to business domains (such as medical diagnosis), they are prone to generating non-factual content when handling complex, long-chain reasoning tasks involving multivariate dependencies. Furthermore, the internal computation processes of existing models are typically black-box, lacking interpretable intermediate verification steps and making it impossible to trace the basis of the reasoning results. This limits the credibility of the output data in applications where accuracy is paramount. Summary of the Invention
[0005] This invention provides a method and apparatus for generating information on risk stratification and treatment recommendations for hepatocellular carcinoma, which addresses the shortcomings of existing technologies that use large language models, lack strict constraints on specific medical logic, are prone to producing illusions, and have unexplainable calculation processes, thereby achieving highly reliable clinical decision support.
[0006] This invention provides a method for generating information on hepatocellular carcinoma risk stratification and treatment recommendations, including: Obtain structured clinical data related to hepatocellular carcinoma in the target population; Based on a pre-set electronic medical record narrative template, the structured clinical data is converted into electronic medical record style narrative text containing clinical semantics, and key clinical variable markers corresponding to the structured clinical data are embedded in the electronic medical record style narrative text to construct the model input sequence. The input sequence of the model is fed into a pre-trained large language model for inference operations, and a structured text stream is output. The large language model is trained based on decision tree constraints constructed from the hepatocellular carcinoma diagnosis and treatment guidelines and multi-objective reinforcement learning strategies. Comprehensive decision support information is extracted from the structured text stream using preset parsing rules; the comprehensive decision support information includes risk stratification results determined based on intermediate inference variables, and a personalized treatment plan ranking list associated with guideline-based text.
[0007] According to the method provided by the present invention, the step of converting the structured clinical data into electronic medical record-style narrative text containing clinical semantics based on a pre-set electronic medical record narrative template, and embedding key clinical variable markers corresponding to the structured clinical data into the electronic medical record-style narrative text to construct a model input sequence includes: Obtain a structured dataset containing sparse key variables, and map the sparse key variables to the corresponding slots in a preset electronic medical record narrative template; By leveraging natural language generation rules, the filled template is transformed into coherent electronic medical record-style narrative text, thus providing data augmentation from sparse coded data to natural language text. Explicit thought chain markers are embedded in the electronic medical record-style narrative text; the explicit thought chain markers correspond to key clinical variables that influence hepatocellular carcinoma decision-making, including performance status score, liver function classification, key biochemical indicators, tumor number, and maximum tumor diameter. The electronic medical record-style narrative text embedded with the explicit thought chain markers is serialized to generate the model input sequence.
[0008] According to the method provided by the present invention, the training process of the pre-trained large language model includes a first stage of clinical knowledge familiarization fine-tuning and a second stage of experience accumulation reinforcement learning. The specific steps in the first phase of clinical knowledge familiarization and fine-tuning include: A logical decision tree was constructed based on the aforementioned guidelines for the diagnosis and treatment of hepatocellular carcinoma, and the reasoning path of the logical decision tree was converted into standard reasoning text containing clinical variable queries, staging judgments, and treatment recommendations. Construct a supervised fine-tuning sample set containing electronic medical record-style narrative input, structured intermediate markers, and the standard inference text; Based on the supervised fine-tuning sample set, the basic language model is trained under supervision using the autoregressive cross-entropy loss function, so as to inject the decision tree constraints into the model parameters. The steps of the second phase of experience-based reinforcement learning include: Given an input prompt, multiple candidate output sequences are generated by sampling using the current model strategy; For each candidate output sequence, calculate the multi-dimensional composite reward value; Based on the multi-dimensional composite reward value, the model parameters are updated using a group relative policy optimization algorithm to maximize the expected value of the composite reward value.
[0009] According to the method provided by the present invention, the step of calculating the multi-dimensional composite reward value includes calculating at least one of the following reward components: The process reward is used to verify whether the intermediate variable markers extracted from the candidate output sequence are consistent with the clinical facts in the input data; The format reward is used to verify whether the candidate output sequence contains a complete set of required tokens and whether the values of the tokens conform to a preset specification. Treatment ranking reward is used to calculate a similarity index between the ranking of treatment plans in the candidate output sequence and the ranking recommended by clinical guidelines; Survival prediction reward is used to calculate the error metric between the predicted survival data and the actual survival data in the candidate output sequence.
[0010] According to the method provided by the present invention, the step of calculating the treatment ranking reward includes: The recommended treatment plans and their order of arrangement are parsed from the candidate output sequence to determine the ranking of the treatment plans in the candidate output sequence. Obtain the standard treatment recommendation list and recommendation level of each regimen determined by the decision tree of the hepatocellular carcinoma diagnosis and treatment guidelines, and use it as the recommendation ranking of the clinical guidelines; The normalized discount cumulative gain algorithm is used to calculate the ranking quality score of the treatment plan ranking in the candidate output sequence relative to the ranking recommended by the clinical guidelines, and the ranking quality score is used as the treatment ranking reward.
[0011] According to the method provided by the present invention, the survival prediction data includes predicted survival time and segmented survival endpoint prediction results, and the actual survival data includes actual survival time and survival status. The steps for calculating the survival prediction reward specifically include: When the survival status is a definite death event, the deviation between the predicted survival time and the actual survival time is calculated as the basis for reward; When the survival status is censored data, a positive reward is given if the predicted survival time is greater than the actual survival time. The accuracy of the segmented survival endpoint prediction results is weighted and fused with the prediction error of the predicted survival time to obtain the final survival prediction reward.
[0012] According to the method provided by the present invention, the step of updating the model parameters based on the multi-dimensional composite reward value using a group relative policy optimization algorithm further includes executing a decoupling optimization strategy: Based on the different components of the multidimensional composite reward value, the group dominance value related to the treatment recommendation task and the group dominance value related to the survival prediction task are calculated respectively. The model parameters are updated using the group dominance values related to the treatment recommendation task and the group dominance values related to the survival prediction task. The model parameters are updated separately in different update steps, or the two are weighted and aggregated before updating the model parameters, in order to mitigate the interference of multi-task gradients.
[0013] According to the method provided by the present invention, the step of extracting comprehensive decision support information from the structured text stream using preset parsing rules includes: Regular expressions are used to extract intermediate inference variables and final recommendation results wrapped in specific tags from the structured text stream; The preset rule verification module is invoked to check whether the extracted intermediate inference variables are complete, and whether the final recommendation result contains any taboos that conflict with the intermediate inference variables. If the verification passes, the intermediate inference variables and the final recommendation result are integrated into the comprehensive decision support information; if the verification fails, an error message or downgrade is triggered.
[0014] According to the method provided by the present invention, the comprehensive decision support information is presented in the form of a structured report, the content of which includes at least one of the following: Hepatocellular carcinoma staging results calculated based on risk scores; A list of treatment options sorted by suitability score, along with the corresponding guideline text for each option; Prognostic data including short-term survival probability and continuous survival time estimates.
[0015] The present invention also provides an information generation device for hepatocellular carcinoma risk stratification and treatment recommendations, comprising: The data acquisition module is used to acquire structured clinical data on hepatocellular carcinoma of the target subjects. The input sequence construction module is used to convert the structured clinical data into electronic medical record style narrative text containing clinical semantics based on a preset electronic medical record narrative template, and to embed key clinical variable markers corresponding to the structured clinical data into the electronic medical record style narrative text to construct the model input sequence. The large model processing module is used to input the input sequence of the model into a pre-trained large language model for inference operations and output a structured text stream. The large language model is trained based on decision tree constraints constructed from the hepatocellular carcinoma diagnosis and treatment guidelines and multi-objective reinforcement learning strategies. The recommendation information generation module is used to extract comprehensive decision support information from the structured text stream using preset parsing rules; the comprehensive decision support information includes risk stratification results determined based on intermediate inference variables, and a personalized treatment plan ranking list associated with guideline-based text.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations as described above.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations as described above.
[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations as described above.
[0019] The present invention provides a method and apparatus for generating information on hepatocellular carcinoma risk stratification and treatment recommendations. Through data augmentation technology based on electronic medical record templates, it transforms sparse structured clinical data into natural language narrative text rich in semantics. It constructs an electronic medical record-style input sequence containing key clinical variable markers and utilizes a large language model trained based on treatment guideline decision tree constraints and multi-objective reinforcement learning strategies for reasoning. This addresses the technical shortcomings of existing general-purpose large language models, such as lack of strict constraints on specific medical logic, susceptibility to illusions, and uninterpretable computational processes. This method transforms freely generated text predictions into controlled structured logical derivations. By parsing and extracting the output text stream, it ensures that the generated comprehensive decision support information strictly adheres to clinical guidelines logically, and that the intermediate reasoning process is clear and verifiable. This achieves highly reliable clinical decision support and significantly improves the accuracy and logical consistency of treatment recommendations. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the information generation method for risk stratification and treatment recommendations for hepatocellular carcinoma provided by the present invention.
[0022] Figure 2 This is a schematic diagram of the information generation device for risk stratification and treatment recommendations for hepatocellular carcinoma provided by the present invention.
[0023] Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] To better illustrate the technical concept of the embodiments of this application, we will first further analyze the actual data processing difficulties existing in the current hepatocellular carcinoma auxiliary decision-making technology.
[0026] In existing clinical data processing technologies, traditional rule-based decision-making systems typically employ forced discretization logic when handling continuous clinical variables (such as specific tumor diameter values, AFP concentrations, or bilirubin levels). This involves truncating continuous data into several fixed interval levels based on preset thresholds. While this approach reduces computational complexity, it inevitably leads to the loss of fine-grained information from the original data. This is particularly true for individualized data whose values are on the edge of grading standards or have unique distributional characteristics. The system struggles to capture the true risk differences through coarse discrete labels, thus limiting the accuracy of risk stratification.
[0027] Furthermore, existing decision support technology architectures typically treat different stages of the clinical diagnosis and treatment process—including staging, treatment prioritization, and survival prediction—as independent mathematical tasks, modeling and training them separately. This task-separated modeling approach ignores the objectively existing inherent logical connections between various clinical outcomes. For example, staging directly determines prognosis, and prognosis, in turn, validates treatment choices. This leads to a lack of correlation or even logical conflicts between the reference information output by different models, failing to provide users with a logically consistent comprehensive decision-making basis. Based on this, embodiments of this application propose a new technical architecture aimed at solving the aforementioned deep-seated data processing challenges.
[0028] Before introducing the technical solutions of the embodiments of the present invention, the terms and concepts involved in the embodiments of the present invention will be explained illustratively.
[0029] Clinical data refers to a collection of objective records about a target subject (such as a case to be analyzed), including but not limited to structured numerical or categorical indicators (such as performance status score (PS), Child-Pugh liver function classification, maximum tumor diameter, AFP concentration, etc.) and unstructured textual descriptive information.
[0030] Unstructured medical record text: refers to medical documents recorded in natural language that lack a predefined database field structure, such as descriptions of present illness, discharge summaries, morphological descriptions and diagnostic conclusion paragraphs in imaging examination reports.
[0031] Large language model: refers to a generative artificial intelligence model based on a deep neural network architecture (such as Transformer) and pre-trained on massive text data, which has the ability to understand natural language instructions and generate coherent text; in this application, it specifically refers to a computational model that has been fine-tuned by clinical guideline instructions and optimized by multi-objective reinforcement learning, and is capable of performing medical logical reasoning.
[0032] Parsing rules: refer to a set of pre-defined computer logic protocols for extracting information from a text stream. For example, using regular expressions or specific string matching algorithms, the rules are used to locate the position of specific markers in the model's output text and extract the content inside the markers into structured fields.
[0033] Structured text stream: refers to the character sequence output by a large language model during inference. This sequence is not a pure natural language paragraph, but a text stream that contains specific machine-readable tags (such as XML tags, JSON format fragments) and natural language descriptions, and organizes information according to a predetermined hierarchical relationship.
[0034] Comprehensive decision support information refers to the final reference dataset generated after parsing, verifying and integrating the structured text stream output by the model. It usually includes staging results derived from risk scores, a list of candidate treatment options ranked by suitability, and survival prediction values or probability curves.
[0035] Explicit thought chain markers: refer to specific text symbols (e.g., ...) embedded in the input or output sequence of a model.<check_PS> ...< / check_PS> This is used to force the model to explicitly display intermediate steps in its reasoning process (such as extracting key variables and judging logical nodes), making the reasoning process visible and verifiable by the machine.
[0036] Multidimensional composite reward value: refers to the scalar feedback signal used to evaluate the quality of model generation during the reinforcement learning training phase. This value is calculated by weighting multiple evaluation indicators (such as the correctness of intermediate processes, compliance of output format, similarity of ranking results to guidelines, and error value of survival prediction).
[0037] Normalized Discounted Cumulative Gain (NDCG): This refers to an evaluation metric in the field of information retrieval. In this application, it is used to quantify the similarity between the treatment plan ranking list output by the model and the standard ranking list recommended by clinical guidelines. This algorithm assigns higher weights to the recommendations that rank higher.
[0038] Group Relative Policy Optimization (GRPO) is a reinforcement learning optimization algorithm that samples a set of candidate outputs for the same input cue and updates the model policy by calculating the relative advantage of each output within the group. It typically does not require training an independent value network.
[0039] Contraindications: In the data processing logic of this application, contraindications refer to specific combinations of clinical features (such as the presence of severe liver dysfunction) that are logically mutually exclusive with specific treatment plans (such as large-scale hepatectomy), serving as hard constraint rules for verifying the validity of the model output results.
[0040] Guideline-based texts: These refer to text paragraphs or clauses cited in a knowledge base built upon authoritative clinical practice guidelines (such as CNLC, BCLC, etc.) to explain the rationale for specific staging determinations or treatment recommendations.
[0041] Prognostic prediction data refers to the calculated and predicted value of the future survival status of the target object, including but not limited to the survival probability at a specific time point (such as 1 year, 3 years, 5 years) or the continuous survival time estimate.
[0042] The executing entity of this invention embodiment can be a computer device. Specifically, the computer device can be various electronic computing devices including a processor and memory, such as: Servers: These include local servers deployed in hospital data centers or cloud server clusters providing cloud-based medical AI services. This is the most common implementation because inference operations for large language models typically require significant computing power (such as GPU resources).
[0043] Workstations or personal computers (PCs): For example, doctor workstation terminals in a doctor's office, which are equipped with relevant decision support software.
[0044] Mobile terminals: In some lightweight deployments or scenarios that use API calls, mobile devices such as doctors' tablets or smartphones can also be used (in this case, heavy computing tasks may be completed in the cloud, and the terminal is mainly responsible for data input, output and interaction).
[0045] Subsystems within a medical information system (HIS / EMR system): These are integrated as functional modules within the existing hospital information system.
[0046] Figure 1 This is a flowchart illustrating the method for generating information on hepatocellular carcinoma risk stratification and treatment recommendations provided by the present invention. The method includes: Step 101: Obtain structured clinical data on hepatocellular carcinoma of the target subjects.
[0047] In the embodiments of this application, acquiring high-quality structured clinical data is the first step in achieving precise decision support. This step specifically includes three sub-processes: collection of multi-source heterogeneous data, standardization and cleaning, and extraction of core features.
[0048] First, the system interfaces with the Hospital Information System (HIS), Laboratory Information Management System (LIS), and Picture Archiving and Communication System (PACS) through pre-defined data interfaces to collect the original electronic medical record data of the target subjects. The collected data types cover structured indicators recorded in numerical or graded form (such as performance status PS score 0-4, Child-Pugh A / B / C classification, AFP value, etc.), unstructured information recorded in free text paragraphs (such as description of present medical history, morphological descriptions in CT / MRI imaging reports, pathological diagnosis conclusions), and semi-structured report fields containing discrete key values.
[0049] Subsequently, the system performs data cleaning and standardization. For numerical variables, the system automatically performs unit conversion (e.g., unifying the bilirubin unit to μmol / L) and outlier detection, eliminating or correcting logically paradoxical data caused by input errors. For categorical variables, a pre-built medical terminology mapping dictionary is used to uniformly map different expressions such as "primary liver cancer," "HCC," and "Hepatoma" to standard terms. For unstructured text, natural language processing (NLP) tools are used for preliminary parsing to identify and normalize key medical entities.
[0050] Finally, based on the decision-making logic defined in hepatocellular carcinoma (HCC) treatment guidelines (such as CNLC or BCLC), the system extracts a set of core structured features from the processed full dataset. These features constitute the foundational fact set for model inference, specifically including: performance status score (PS) characterizing the patient's general health status; Child-Pugh classification assessing liver reserve function (involving sub-items such as albumin, bilirubin, and ascites); number of tumor nodules and maximum tumor diameter describing tumor burden characteristics; and vascular invasion (such as portal vein tumor thrombus) and extrahepatic metastasis status indicating disease malignancy and stage progression. Through this process, the system transforms the original, disorganized medical record information into a set of standardized, machine-readable structured feature vectors, laying a solid data foundation for subsequent template-based data augmentation and model inference.
[0051] Step 102: Based on the preset electronic medical record narrative template, the structured clinical data is converted into electronic medical record style narrative text containing clinical semantics, and the key clinical variable markers corresponding to the structured clinical data are embedded in the electronic medical record style narrative text to construct the model input sequence.
[0052] First, the system retrieves electronic medical record description templates stored in the knowledge base. These templates are designed based on the writing standards of real clinical medical records (such as the paragraph structure of chief complaint-present illness-past medical history-examination results), and each template has several reserved dynamic data slots. The system maps the acquired structured feature vectors (such as {PS: 1, Tumor_Size: 6cm, PVTT: No}) to the corresponding slots. For example, filling "Tumor_Size: 6cm" into the slot of the imaging description paragraph generates a natural language segment: "An enhanced CT scan of the abdomen shows a space-occupying lesion in the right lobe of the liver, with a maximum cross-sectional diameter of approximately 6 centimeters."
[0053] Secondly, natural language generation rules are used to refine and connect the filled template, transforming it into an electronic medical record-style narrative text rich in clinical semantics. This process not only connects discrete data but also simulates real doctor-written medical records by adding medical conjunctions, synonym substitutions, and contextual descriptions (such as adding descriptions of patients reporting no obvious abdominal pain or bloating or other common negative symptoms). This data augmentation technique enables the model to learn how to locate key information in complex natural language contexts, thereby improving its robustness in processing real unstructured medical records.
[0054] Finally, to explicitly guide the model's attention during training or inference, the system embeds key clinical variable markers (i.e., explicit thought chain markers) into the generated narrative text. The system inserts XML or JSON-style tags near locations in the text where key features are mentioned, or in independent inference cue sections at the end of the text, wrapping the actual values of the structured data within them. For example, after describing the imaging results, it inserts...<check_tumor_size> 6cm< / check_tumor_size> and<check_vascular_invasion> None< / check_vascular_invasion> Finally, the system performs tokenization on this mixed text containing natural language descriptions and explicit logical markers, generating an input vector sequence that can be directly read by the large language model. In this way, the model's input sequence not only contains the medical record text but also key clinical variable markers, thereby guiding the model to establish a logical mapping relationship from text features to diagnostic decisions.
[0055] Step 103: Input the input sequence of the model into a pre-trained large language model for inference operations and output a structured text stream. The large language model is trained based on decision tree constraints constructed from the hepatocellular carcinoma diagnosis and treatment guidelines and multi-objective reinforcement learning strategies.
[0056] After constructing the model input sequence containing key clinical variable markers, the inference operation phase begins. The core of this step lies in processing the input sequence using a pre-trained domain-specific large language model. This large language model is not a general text generation model, but rather one that has undergone special optimization mechanisms during training. Specifically, the model has internalized decision tree constraint logic based on hepatocellular carcinoma treatment guidelines and value preferences learned through multi-objective reinforcement learning strategies within its parameter space.
[0057] When a computer loads the input sequence of the above model into the large language model, the model initiates an autoregressive generation process. During this process, the model doesn't simply predict the next word based on probability; instead, it follows its internally learned guidelines and constraints, simulating the thought process of a clinician to make step-by-step deductions. This deduction process is reflected in the fact that the model output is not a random natural language description, but a structured text stream following a predefined format. This structured text stream unfolds logically. First, based on the clinical features in the input sequence, the model generates text fragments representing intermediate reasoning states, such as confirmation information on key nodes like the patient's physical condition and liver function classification. Then, based on the logical branches of the decision tree, the model calculates and outputs risk stratification results. Finally, the model comprehensively considers multiple potential treatment methods and outputs a list of treatment options with recommended priorities and corresponding survival prediction data. Throughout the output process, specific markers are automatically inserted into the appropriate positions in the text stream to define the boundaries of different information fields, thus forming a machine-readable structured output.
[0058] This process ensures that the final generated text stream contains both rich natural language interpretations and a rigorous logical structure, providing a standardized data foundation for subsequent information extraction and verification.
[0059] Step 104: Extract comprehensive decision support information from the structured text stream using preset parsing rules.
[0060] The comprehensive decision support information includes risk stratification results determined based on intermediate inference variables, and a personalized treatment plan ranking list associated with guideline-based text.
[0061] First, regarding the risk stratification results determined based on intermediate inference variables, the large language model does not directly output the final staging conclusion during the inference process. Instead, it is trained to explicitly extract and identify a series of key intermediate inference variables from complex medical record texts. These variables directly correspond to the core discriminant indicators of the clinical staging system, specifically including performance status score, liver function reserve grade, maximum tumor diameter, specific number of tumors, and location and extent of vascular invasion. The model uses the extracted variable combinations and strictly follows pre-set staging logic rules for judgment. For example, when the model confirms that the intermediate variables are "PS score 0, Child-Pugh A, single tumor with a diameter less than 2 cm, and no vascular invasion," it will automatically deduce and lock the corresponding stage label of the case as "Stage Ia." In addition, the trained large language model also analyzes the survival outcomes of similar patients by associating massive amounts of clinical data to predict the median survival of the current patient, and then estimates a more refined patient risk level score (e.g., 0-100) based on quantile regression techniques. Therefore, the model can not only generate accurate staging codes and corresponding evidence, but also provide accurate digital risk stratification predictions. This mechanism ensures that the phased conclusions are derived from objective data and logic, rather than being randomly generated by a model, thus guaranteeing the accuracy and verifiability of the risk assessment.
[0062] Secondly, regarding the personalized treatment plan ranking list linked to guideline-based text, the system, based on risk stratification, further generates treatment recommendations for the specific patient. Unlike the static and general list of plans in traditional guidelines, this embodiment outputs a dynamic ranking list calculated by a multi-objective reinforcement learning model. The model scores and ranks various candidate treatments based on the individualized, subtle characteristics of the current patient. For example, for patients at the same stage, if the patient has good liver function tolerance and the tumor is superficial, the model will prioritize surgical resection; while for patients at the same stage but with specific comorbidities, the model may prioritize minimally invasive ablation or interventional therapy. More importantly, each recommended plan in the list is forcibly associated with a guideline-based text. This text is authoritative evidence retrieved and generated by the model under decision tree constraints, detailing the specific clauses, levels of evidence, or recommendation levels in the clinical practice guidelines supporting the recommendation. For example, when recommending hepatectomy, the system simultaneously displays the text: "According to the CNLC guidelines, for stage Ia patients with good liver function reserve, hepatectomy is the preferred radical treatment option (Evidence Level I)." In this way, the integrated decision support information perfectly blends data-driven personalized calculations with rule-driven authoritative evidence, not only providing doctors with optimal treatment pathway suggestions but also clearly elucidating the basis and logic behind the decisions, greatly enhancing the clinical credibility of the decision support system.
[0063] The raw output of a large language model is typically a long text stream containing natural language descriptions, specific tokens, and potentially redundant information. To transform this into standardized data that can be directly displayed by a user interface or further processed by downstream systems, a rigorous information extraction and validation process must be performed. Specifically, this step first starts a regular expression-based text parser that scans the complete output text generated by the model, identifying and locating predefined tokens. The parser then extracts content fragments wrapped in different tags in parallel, mapping intermediate inference variables (such as model-identified performance status scores, liver function grades, tumor size classifications, etc.) and final recommendation results (such as staging conclusions, treatment plan lists, and survival prediction values) to structured object fields in memory.
[0064] After initial extraction, the system immediately triggers a logical verification mechanism to ensure the validity and security of the extracted information. This verification process uses the extracted intermediate inference variables as input conditions and checks for logical paradoxes in the final recommendation result by querying a pre-defined mutual exclusion rule base. For example, the system will check if the intermediate variable indicates that the patient has portal vein thrombosis, but the recommendation result includes liver transplantation as a contraindication, or if the intermediate variable indicates that the liver function is Child-C, but a large-scale hepatectomy is recommended. Once such logical conflicts are found, or if format errors such as missing key markers or unclosed labels are detected, the system will mark the inference as invalid and trigger an exception prompt or perform downgrade processing according to a preset strategy. Only when the extracted information is complete and passes all logical consistency checks will the system integrate and encapsulate the cleaned staging conclusion, the ranked treatment plan and its matching guideline clause evidence, and the quantified survival prediction data to generate the final comprehensive decision support information object for front-end display or archiving. This process not only realizes the transformation from unstructured generated text to structured data, but also adds a crucial quality control mechanism to the generative artificial intelligence-based medical decision-making system.
[0065] The method for generating information on hepatocellular carcinoma risk stratification and treatment recommendations provided in this invention utilizes data augmentation technology based on electronic medical record templates to convert sparse structured clinical data into natural language narrative text rich in semantics. It constructs an electronic medical record-style input sequence containing key clinical variable markers and employs a large language model trained based on treatment guideline decision tree constraints and multi-objective reinforcement learning strategies for reasoning. This addresses the technical shortcomings of existing general-purpose large language models, such as lack of strict constraints on specific medical logic, susceptibility to illusions, and uninterpretable computational processes. This method transforms freely generated text predictions into controlled structured logical derivations. By parsing and extracting the output text stream, it ensures that the generated comprehensive decision support information strictly adheres to clinical guidelines logically, and that the intermediate reasoning process is clear and verifiable. This achieves highly reliable clinical decision support and significantly improves the accuracy and logical consistency of treatment recommendations.
[0066] Furthermore, the specific implementation method for constructing the model input sequence by converting the structured clinical data into electronic medical record-style narrative text containing clinical semantics based on a pre-set electronic medical record narrative template, and embedding key clinical variable markers corresponding to the structured clinical data into the electronic medical record-style narrative text, includes: First, the system acquires structured datasets from a wide range of sources but with low information density (such as the publicly available cancer registry database SEER or anonymized research reports from hospitals). These datasets typically contain only sparse key variables, such as simple key-value pairs: {Age: 55, Gender: M, Tumor_Count: Multiple, Max_Size: 8.5cm}. The system pre-configures multiple electronic medical record narrative templates covering different disease scenarios (such as initial diagnosis, recurrence, and postoperative follow-up). These templates define standard medical record paragraph structures and reserve variable slots at specific semantic locations. The system uses a field matching algorithm to map the acquired sparse key variables one by one and fill them into the corresponding slots in the templates.
[0067] Secondly, the system utilizes a natural language generation rule engine to process the filled template. The engine not only fills in the blanks but also dynamically adjusts sentence structure and modifiers based on variable values to ensure the generated text conforms to the language conventions of medical documents. For example, when "Tumor_Count: Multiple" is entered, the engine automatically generates a description of multiple scattered nodules visible in the liver and may randomly add some reasonable background descriptions (such as abnormal liver morphology and irregular capsule), thereby transforming the original structured data into a coherent, natural, and clinically semantically rich electronic medical record-style narrative text. This process achieves data augmentation from sparse coded data to dense natural language text, expanding the semantic diversity of the training data.
[0068] Secondly, the system embeds explicit thought chain markers into the generated narrative text. To ensure the model notices key decision-making factors when reading this synthesized medical record, the system inserts special markers at specific logical nodes in the text flow. These markers correspond to the four core dimensions influencing hepatocellular carcinoma diagnosis and treatment decisions: performance status score (reflecting overall tolerance), liver function classification (reflecting liver reserve), key biochemical indicators, tumor number, and maximum tumor diameter (reflecting tumor burden). For example, the system will insert explicit thought chain markers immediately after describing the liver imaging.<check_tumor_number> Multiple< / check_tumor_number> This label is correct.
[0069] Finally, the system uses a word segmenter to serialize the electronic medical record-style narrative text embedded with explicit thought chain markers. The word segmenter converts the text and tags into an index sequence in the model's vocabulary, generating the final model input sequence. This sequence retains the reading experience of simulating a real medical record while providing the model with clear logical anchors through explicit tags, enabling it to learn more efficiently the complete thought process from extracting features from medical record descriptions to making inferences based on those features during subsequent training.
[0070] Furthermore, the training process of the pre-trained large language model is implemented in this embodiment through a two-stage paradigm that closely integrates domain knowledge guidance and multi-objective strategy optimization. The specific steps are as follows: Phase 1: Fine-tuning of clinical knowledge familiarization.
[0071] The core objective of this phase is to transform the expert logic contained in authoritative hepatocellular carcinoma (HCC) treatment guidelines (such as CNLC and BCLC) into parameterized knowledge that can be internalized by the model. In practice, the first step is to construct a logical decision tree and transform the knowledge representation of the guidelines. The hierarchical conditions and recommendations regarding staging and treatment selection in the guideline text are abstracted and encoded into a structured logical decision tree. Each internal node of this tree represents a key clinical judgment (e.g., whether extrahepatic metastasis exists), branches represent the judgment results, and leaf nodes are associated with the final set of treatment recommendations and their level of evidence. Subsequently, standard reasoning text is synthesized: each complete reasoning path from the root node to a leaf node in this decision tree is manually written or automatically converted into a "standard reasoning text" using rule templates. This text simulates the reasoning process of an ideal expert, explicitly including step-by-step confirmation of clinical variables (e.g., the first step: a performance status score of 0), staging judgment (e.g., according to the CNLC criteria, it belongs to stage Ia), and treatment recommendations based on that stage (e.g., recommended treatment options include surgical resection or local ablation), along with concise reasoning.
[0072] Based on this, the construction of the supervised fine-tuning sample set was completed. The input of the sample is a narrative text in the style of an electronic medical record simulating a real-world scenario (containing natural language descriptions and key variables), with structured intermediate markers inserted; the target output of the sample is the corresponding standard inference text. Through a large number of such paired samples, the basic language model (such as LLaMA, GPT, etc., pre-trained on a general corpus) is trained under supervision using an autoregressive cross-entropy loss function. By minimizing the difference between predicted and target terms, the model gradually learns to map the clinical narrative and key variables in the input to a structured inference output that conforms to the logic of guideline decision trees, thereby initially "injecting" rigorous clinical decision constraints into its parameters.
[0073] Phase Two: Accumulating Experience to Enhance Learning.
[0074] After the model acquires basic clinical knowledge, this stage further optimizes the model's decision-making quality in complex scenarios through reinforcement learning, particularly improving the rationality of treatment plan ranking and the accuracy of survival prediction. The system employs the Group Relative Policy Optimization (GRPO) algorithm to perform this process. This algorithm does not require training an additional value network, effectively reducing training resource consumption and improving stability.
[0075] Specifically, for each given input cue (i.e., case description) in the training set, the system uses the current model strategy to sample multiple times, generating a set of (e.g., 8 or 16) different candidate output sequences. These sequences may differ in reasoning details, treatment recommendation order, or presentation style.
[0076] Subsequently, the system calculates a multi-dimensional composite reward value for each candidate output sequence. This reward value is a comprehensive score; it is not a single-dimensional evaluation but rather an aggregation of feedback signals from multiple dimensions, including logical correctness, format conformity, treatment ranking quality, and survival prediction error. For example, if an output sequence accurately extracts all key variables, generates a treatment ranking highly consistent with guidelines, and produces survival prediction values close to real data, it will receive a higher reward value.
[0077] Finally, based on the calculated multi-dimensional composite reward value, the system updates the model parameters using a group-relative policy optimization algorithm. This algorithm adjusts the model's generation probability by comparing the advantages of different candidate sequences within the same group (i.e., the deviation of a sequence's reward value from the group's average reward value). The optimization objective is to maximize the mathematical expectation of the composite reward value, thereby encouraging the model to generate, in future inferences, more likely, high-quality responses that are logically sound, conform to guidelines, and make accurate predictions. This achieves a leap from imitating human language to mastering expert decision-making logic.
[0078] Through continuous training in these two stages, the resulting large language model not only mastered domain knowledge of hepatocellular carcinoma diagnosis and treatment, but also possessed the ability to generate high-quality, verifiable, and clinically usable decision support information under complex, multi-objective constraints.
[0079] Furthermore, in the process of optimizing reinforcement learning strategies, in order to guide the large language model to simultaneously master accurate clinical reasoning logic and long-term prognostic assessment capabilities, a multi-dimensional composite reward function containing four key components was designed.
[0080] First, the computational process reward and the format reward constitute the basic compliance constraints of the model output. The process reward focuses on the consistency check of logic. The system compares the intermediate variable markers extracted from the model output sequence (such as the model-inferred physical condition or liver function grade) with the actual clinical fact labels in the input data one by one. If the two match perfectly, a positive reward is given; otherwise, a penalty is given, thus forcing the model to faithfully adhere to the original medical record data. The format reward focuses on the integrity of the output structure. The system uses a preset validator to check whether the output sequence strictly contains all the necessary marker sets (such as the simultaneous inclusion of stage labels, treatment list labels, and survival prediction labels), and verifies whether the values within these markers are within the predefined norm list, ensuring that the generated text can be parsed error-free by downstream programs.
[0081] Secondly, regarding the core treatment decision-making capability, the system calculates treatment ranking rewards. Since the selection of clinical treatment options is often not a simple black-and-white choice but a priority-based ranking problem, this step employs evaluation logic from the information retrieval domain. The system first parses the model-recommended treatment options and their order of precedence from the candidate output sequence, constructing a model-predicted treatment ranking list. Simultaneously, based on the decision tree logic of hepatocellular carcinoma treatment guidelines, the system determines the preferred, secondary, and non-recommended treatments for the current case under the standard guidelines, forming a standard treatment recommendation list and a corresponding recommendation level (i.e., relevance score) for each option. Subsequently, the system uses the Normalized Discounted Cumulative Gain (NDCG) algorithm to compare and calculate the scores. This algorithm is position-sensitive, assigning higher weights to the top positions in the list. If the model can rank the treatment option with the highest guideline recommendation level at the top of the list, the calculated ranking quality score is higher, and the model receives a greater reward. This mechanism effectively trains the model's ranking ability in multi-option trade-offs.
[0082] Finally, the system calculates survival prediction rewards based on the model's prognostic assessment capabilities. Considering the common censoring in clinical survival data (i.e., some patients are not yet dead at the end of follow-up), the calculation process is divided into two cases. When the actual survival data indicates a clear death event, the system directly calculates the numerical deviation between the model's predicted survival time and the actual survival time; the smaller the deviation, the higher the reward. However, when the actual survival data is censored (i.e., the patient is still alive at the last follow-up), if the model's predicted survival time is less than the censored time (i.e., predicting the patient's death before the last follow-up), this is logically a clear error, and the system will penalize it. Conversely, if the predicted time is greater than the censored time, it is considered logically compatible and a positive reward is given. Furthermore, to balance the accuracy of short-term and long-term predictions, the system also weights and fuses the classification prediction accuracy of segmented survival endpoints (e.g., 1-year, 3-year, and 5-year survival rates) with the regression prediction errors of the aforementioned continuous time intervals to generate the final survival prediction reward, thereby guiding the model to establish an accurate prognostic concept over time.
[0083] In a preferred embodiment, the multi-dimensional composite reward value R ( , y Process rewards R proc Format rewards R fmt Treatment ranking rewards R treat Survival prediction reward R and length penalty item V len The result is obtained by linear weighted summation. The specific calculation methods for each component are as follows: (1) Process Reward proc ).
[0084] The process reward aims to verify the accuracy of nine key intermediate variables extracted during model inference (including physical condition, liver function classification, key biochemical indicators, tumor size, tumor number, and vascular invasion). Its calculation formula is as follows: ; in: k Indicates the index of the key intermediate variable, with a value range from 1 to 9; This indicates that the model extracts and predicts the first [item] from the input text. k The values of the intermediate variables; f k This represents the true first number in the input data. k The label value of the intermediate variable; This is an indicator function. It takes the value 1 when the condition within the curly braces is true (i.e., the predicted value is equal to the true value), and takes the value 0 otherwise.
[0085] (2) Format Reward fmt ).
[0086] The format reward aims to check whether the model output strictly adheres to a predefined structured format, thereby reducing the risk of the model generating illusions and improving parsability. Its calculation formula is as follows: ; in: M Indicates the size of the required tag set (i.e., the total number of required tags); tag m Indicates the first m Required tags (e.g.) <stage>or<treatment_list> ); s (⋅) represents the label verification function, which determines whether the label appears correctly and uniquely in the output sequence. If the label exists, is correctly closed, and does not appear repeatedly, the function value is 1; otherwise, it is 0.
[0087] (3) Treatment Ranking Reward (R) treat ).
[0088] The treatment ranking reward uses the Normalized Discounted Cumulative Gain (NDCG) algorithm to evaluate the ranking quality of candidate treatments, encouraging the model to prioritize treatments consistent with guidelines. The calculation formula is as follows: in, DCG This represents the cumulative discount gain, used to measure the sorting quality of the current prediction list; IDCG This represents the cumulative gain from the ideal discount, i.e., the optimal sorting list recommended by the standard guide. DCG The value is used for normalization. i This indicates the position (rank index) of the treatment plan in the treatment list output by the model. The model represents the first time. i Recommended treatment plan for the individual rank; Y ∗ This represents a set of standard recommended treatment options determined based on clinical guideline decision trees; Represents the correlation discriminant function, if the th i The rank recommendation scheme belongs to the standard recommendation set. Y ∗ If the value is 1 (or the corresponding weight score is taken according to the recommendation level), then the value is 0; otherwise, the value is 0. log2(i+1) is the position discount factor. The later the position, the greater the decrease in its contribution to the total score.
[0089] (4) Survival prediction reward (R) surv ).
[0090] The survival prediction reward assesses both the accuracy of continuous time predictions and the accuracy of staged survival status classifications. This reward combines different computational logics for death event samples and censored samples.
[0091] For samples with confirmed deaths, the reward calculation formula is as follows: For censored samples (i.e., patients still alive at the end of follow-up), the reward calculation formula is as follows: The total survival prediction reward is defined as: R surv =R stage_surv +R month .
[0092] in: Indicates the predicted survival time of the model (in months); t represents the patient's actual time of death; t c Indicates the patient's censoring time (i.e., the time of the last follow-up visit); τ death and τ censor These are the temperature coefficient or scaling parameter used to control the rate of reward decay; max(0,t c - This indicates that the error is calculated only if the predicted death time is earlier than the censoring time (a logical contradiction). If the predicted time is later than the censoring time, it is considered reasonable and the error is 0. R stage_surv The predicted reward component represents the segmented survival endpoint (e.g., 1-year, 3-year, and 5-year survival status classifications); R month This indicates that R is calculated based on continuous time. survival Quantity.
[0093] (5) Length Reward (V) len ).
[0094] Length rewards are used to penalize excessively long outputs, thereby improving the readability and conciseness of clinical reports. The calculation formula is as follows: V len =min(1, k max / k pred ); Where: k max This indicates the maximum allowed length of the preset output sequence (number of tokens). k pred This indicates the actual length of the output sequence currently generated by the model.
[0095] (6) Composite Reward The final composite reward value used to update the model parameters is the weighted sum of the above components: R( ,y)=R proc +R fmt +R treat +R surv +V len The composite reward mechanism defined by the above formula can guide the large language model to simultaneously consider the rigor of reasoning logic, the standardization of output format, the rationality of treatment recommendation ranking, and the accuracy of prognosis prediction during the reinforcement learning process.
[0096] Furthermore, when training a large language model using multi-objective reinforcement learning, since the treatment recommendation task focuses on discrete logical reasoning and ranking, while the survival prediction task focuses on continuous numerical regression or time series prediction, simply adding the rewards of the two together for a single gradient update often leads to conflicting gradient directions, causing the model to neglect one aspect during optimization. Therefore, this embodiment adopts a decoupling optimization strategy.
[0097] First, the system independently calculates two sets of dominance values based on different components of the calculated multi-dimensional composite reward value. Specifically, the system calculates the first set of dominance values, i.e., the dominance value related to the treatment recommendation task, using only the treatment ranking reward and related process and format reward components. Simultaneously, the system calculates the second set of dominance values, i.e., the dominance value related to the survival prediction task, using only the survival prediction reward and related process and format reward components. When calculating the dominance values, a within-group normalization method is used, meaning the dominance value of a given output sequence is equal to its specific reward component minus the average reward component of the sampled sequences in that group, divided by the standard deviation.
[0098] Subsequently, the system uses these two independent sets of dominance values to update the model parameters, specifically employing either an alternating update mode or a weighted aggregation mode. In the alternating update mode, the system alternately performs optimizations for different tasks in different update steps. For example, in odd-numbered iterations, the system only uses the group dominance values related to the treatment recommendation task to calculate the policy gradient and update the model parameters, focusing on improving the accuracy of treatment ranking; in even-numbered iterations, the system only uses the group dominance values related to the survival prediction task for updates, focusing on calibrating the predictive ability of survival time. This temporal decoupling effectively avoids the direct cancellation of heterogeneous gradients in the same batch of data. In the weighted aggregation mode, in the same parameter update, the system first calculates the gradient vector derived from the group dominance values related to the treatment recommendation task and the gradient vector derived from the group dominance values related to the survival prediction task, respectively. Then, a dynamic balancing coefficient is introduced to weight and aggregate the two gradient vectors to obtain the final updated gradient. In this way, the system can finely control the contribution of different tasks to the model weight update while ensuring overall model parameter sharing, thereby effectively mitigating multi-task gradient interference and achieving simultaneous improvement in treatment recommendation and survival prediction performance.
[0099] Furthermore, in the step of extracting comprehensive decision-making support information from the structured text stream using preset parsing rules, the system first executes an information extraction process based on text pattern matching. The structured text stream output by the large language model contains data fragments wrapped by predefined specific markers. The system uses character matching algorithms such as regular expressions to scan and locate the text stream. The extraction operation is divided into two levels: first, extracting intermediate inference variables, which reflect the model's identification results of key case features, such as physical condition scores, specific liver function grades, the number and diameter range of tumors, and the specific location of vascular invasion; second, extracting the final recommendation results, including the disease staging conclusion derived by the model, the sorted set of treatment plans, and the quantitative prediction value of prognosis. The system separates these two types of information from the linear text stream and maps them into structured data objects in computer memory.
[0100] Subsequently, the system invokes a pre-defined rule verification module to perform a logical review of the extracted data. This review process includes integrity and consistency checks. Integrity checks confirm that all core intermediate variables influencing the decision have been successfully extracted, preventing information loss due to model output truncation or formatting errors. Consistency checks are the core step; the system uses the extracted intermediate inference variables as preconditions and logically compares them with the final recommendation results. The system has a built-in contraindication rule base based on clinical guidelines. For example, if intermediate variables indicate a patient has portal vein thrombosis, and the recommendation includes a liver transplant option; or if liver function indicators show a decompensated state, and the recommendation includes a large-scale liver resection, the system will immediately identify such combinations of contraindications with conflicting medical logic.
[0101] Based on the verification results, the system executes corresponding processing strategies. If the verification passes, the system logically integrates the verified intermediate inference variables with the final recommendation results, encapsulating them into comprehensive decision support information. If the verification fails, the system will trigger an error message, informing the user that the model output has potential risks, or execute a downgraded processing strategy, such as only displaying the basic staging information with lower risks while blocking potentially misleading treatment recommendations, to ensure the safety of clinical decision support.
[0102] The final comprehensive decision support information is presented in a structured report on the terminal interface. The report is meticulously formatted and includes three core dimensions. First, it presents the hepatocellular carcinoma staging result. This is not a simple label, but a precise stratification conclusion calculated based on the extracted risk score, clearly indicating the patient's current disease progression stage. Second, it lists treatment options, strictly ordered vertically according to suitability scores, with the most recommended option at the top. Each treatment option in the list is accompanied by specific guidelines, citing supporting clauses or levels of evidence from authoritative guidelines, ensuring interpretability of the decision. Finally, it presents prognostic prediction data, showing the patient's short-term survival probability at key time points such as one year, three years, or five years, as well as continuous survival estimates based on regression prediction. This provides intuitive data support for physicians to assess treatment benefits and for communicating the condition to patients and their families.
[0103] The beneficial effects of the technical solutions provided by the embodiments of the present invention mainly include the following aspects: First, it achieves a logical closed loop and integrated output of multidimensional clinical decision-making information.
[0104] Compared to the fragmented workflow of existing technologies that separate staging, treatment recommendations, and prognostic assessment into independent tasks, this invention constructs a unified computational architecture that jointly outputs risk stratification results, treatment plan ranking lists, and survival prediction data within the same inference chain. This design not only eliminates information loss caused by cross-model calls but also ensures a high degree of consistency in data logic between staging conclusions, treatment recommendations, and prognostic predictions, providing clinicians with comprehensive, interconnected, and end-to-end decision support.
[0105] Second, it significantly improves the interpretability of the reasoning process and the compliance with clinical guidelines.
[0106] This invention successfully transforms the generation process of traditional large language models into a transparent logical derivation process by introducing decision tree-based logical constraints during the model training phase and forcing the model to explicitly output intermediate inference variables during the inference phase. This mechanism ensures that every treatment recommendation is traceable to specific clinical characteristics and guideline provisions, effectively suppressing the risk of generative models generating non-factual content and ensuring that auxiliary decision-making information strictly conforms to clinical norms.
[0107] Third, multi-objective collaborative optimization improves the clinical usability and accuracy of decision-making.
[0108] The composite reward function designed in this invention overcomes the limitations of traditional models that only pursue single-text accuracy. It can simultaneously optimize the correctness of reasoning logic, the parsability of output format, the quality of treatment plan ranking (such as the NDCG index), and the error of survival prediction. This makes the generated auxiliary information not only medically rigorous and structurally easy to integrate with downstream systems, but also more in line with real-world clinical best practices in prioritizing treatment plans.
[0109] Fourth, it enhances the stability and convergence efficiency of model training.
[0110] To address the gradient conflict that may arise from the differences in task characteristics between treatment recommendation (discrete ranking) and survival prediction (continuous regression), this invention employs a task-characteristic-based decoupling optimization strategy. By independently calculating and aggregating the group advantage values of different tasks, gradient interference in multi-task learning is effectively mitigated, the convergence stability of the reinforcement learning process is improved, and the model is ensured to achieve optimal performance across multiple task objectives.
[0111] Fifth, it possesses low-cost system maintainability and guideline adaptability.
[0112] This invention employs a design philosophy that separates logical constraints from model parameters. When clinical guidelines are updated, the system can quickly adapt to the new guidelines by primarily updating the external logical decision tree structure and prompt word templates, without requiring full parameter retraining of the large language model. This significantly reduces the long-term maintenance cost and iteration cycle of the system.
[0113] The following describes the information generation device for hepatocellular carcinoma risk stratification and treatment recommendations provided in the embodiments of the present invention. The information generation device for hepatocellular carcinoma risk stratification and treatment recommendations described below can be referred to in correspondence with the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations described above.
[0114] This invention provides an information generation device for hepatocellular carcinoma risk stratification and treatment recommendations. (See also...) Figure 2 ,include: Data acquisition module 210 is used to acquire structured clinical data of hepatocellular carcinoma of the target subject; The input sequence construction module 220 is used to convert the structured clinical data into electronic medical record style narrative text containing clinical semantics based on a preset electronic medical record narrative template, and to embed key clinical variable markers corresponding to the structured clinical data into the electronic medical record style narrative text to construct the model input sequence. The large model processing module 230 is used to input the model input sequence into a pre-trained large language model for inference operations and output a structured text stream. The large language model is trained based on decision tree constraints constructed from the hepatocellular carcinoma diagnosis and treatment guidelines and multi-objective reinforcement learning strategies. The recommendation information generation module 240 is used to extract comprehensive decision support information from the structured text stream using preset parsing rules; the comprehensive decision support information includes risk stratification results determined based on intermediate inference variables, and a personalized treatment plan ranking list associated with guideline-based text.
[0115] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communications bus 840. The processor 810 can call logical instructions in the memory 830 to execute a method for generating information on hepatocellular carcinoma risk stratification and treatment recommendations. This method includes: acquiring structured clinical data of hepatocellular carcinoma of the target object; converting the structured clinical data into electronic medical record-style narrative text containing clinical semantics based on a pre-set electronic medical record narrative template, and embedding key clinical variable markers corresponding to the structured clinical data into the electronic medical record-style narrative text to construct a model input sequence; inputting the model input sequence into a pre-trained large language model for inference operations, outputting a structured text stream, wherein the large language model is trained based on decision tree constraints constructed from hepatocellular carcinoma diagnosis and treatment guidelines and a multi-objective reinforcement learning strategy; and extracting comprehensive decision support information from the structured text stream using preset parsing rules; the comprehensive decision support information includes risk stratification results determined based on intermediate inference variables and a personalized treatment plan ranking list associated with guideline-based text.
[0116] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0117] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations provided by the above methods. The method includes: acquiring structured clinical data of hepatocellular carcinoma of the target object; converting the structured clinical data into electronic medical record style narrative text containing clinical semantics based on a preset electronic medical record narrative template, and embedding key clinical variable markers corresponding to the structured clinical data into the electronic medical record style narrative text to construct a model input sequence; inputting the model input sequence into a pre-trained large language model for inference operations and outputting a structured text stream, wherein the large language model is trained based on decision tree constraints and multi-objective reinforcement learning strategies constructed based on hepatocellular carcinoma diagnosis and treatment guidelines; and extracting comprehensive decision support information from the structured text stream using preset parsing rules. The comprehensive decision support information includes risk stratification results determined based on intermediate inference variables and a personalized treatment plan ranking list associated with guideline-based text.
[0118] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements an information generation method for hepatocellular carcinoma risk stratification and treatment recommendations provided by the methods described above. This method includes: acquiring structured clinical data of hepatocellular carcinoma of a target object; converting the structured clinical data into electronic medical record-style narrative text containing clinical semantics based on a pre-set electronic medical record narrative template, and embedding key clinical variable markers corresponding to the structured clinical data into the electronic medical record-style narrative text to construct a model input sequence; inputting the model input sequence into a pre-trained large language model for inference operations, outputting a structured text stream, wherein the large language model is trained based on decision tree constraints constructed from hepatocellular carcinoma diagnosis and treatment guidelines and a multi-objective reinforcement learning strategy; and extracting comprehensive decision support information from the structured text stream using preset parsing rules; the comprehensive decision support information includes risk stratification results determined based on intermediate inference variables and a personalized treatment plan ranking list associated with the guideline-based text.
[0119] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0120] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / stage>
Claims
1. A method for generating information on risk stratification and treatment recommendations for hepatocellular carcinoma, characterized in that, include: Obtain structured clinical data related to hepatocellular carcinoma in the target population; Based on a pre-set electronic medical record narrative template, the structured clinical data is converted into electronic medical record style narrative text containing clinical semantics, and key clinical variable markers corresponding to the structured clinical data are embedded in the electronic medical record style narrative text to construct the model input sequence. The input sequence of the model is fed into a pre-trained large language model for inference operations, and a structured text stream is output. The large language model is trained based on decision tree constraints constructed from the hepatocellular carcinoma diagnosis and treatment guidelines and multi-objective reinforcement learning strategies. Comprehensive decision support information is extracted from the structured text stream using preset parsing rules; the comprehensive decision support information includes risk stratification results determined based on intermediate inference variables, and a personalized treatment plan ranking list associated with guideline-based text.
2. The method according to claim 1, characterized in that, The step of constructing the model input sequence based on a pre-set electronic medical record narrative template, which converts the structured clinical data into electronic medical record-style narrative text containing clinical semantics, and embeds key clinical variable markers corresponding to the structured clinical data into the electronic medical record-style narrative text, includes: Obtain a structured dataset containing sparse key variables, and map the sparse key variables to the corresponding slots in a preset electronic medical record narrative template; By leveraging natural language generation rules, the filled template is transformed into coherent electronic medical record-style narrative text, thus providing data augmentation from sparse coded data to natural language text. Explicit thought chain markers are embedded in the electronic medical record-style narrative text; the explicit thought chain markers correspond to key clinical variables that influence hepatocellular carcinoma decision-making, including performance status score, liver function classification, key biochemical indicators, tumor number, and maximum tumor diameter. The electronic medical record-style narrative text embedded with the explicit thought chain markers is serialized to generate the model input sequence.
3. The method as described in claim 1, characterized in that, The training process of the pre-trained large language model includes a first stage of clinical knowledge familiarization fine-tuning and a second stage of experience accumulation reinforcement learning. The specific steps in the first phase of clinical knowledge familiarization and fine-tuning include: A logical decision tree was constructed based on the aforementioned guidelines for the diagnosis and treatment of hepatocellular carcinoma, and the reasoning path of the logical decision tree was converted into standard reasoning text containing clinical variable queries, staging judgments, and treatment recommendations. Construct a supervised fine-tuning sample set containing electronic medical record-style narrative input, structured intermediate markers, and the standard inference text; Based on the supervised fine-tuning sample set, the basic language model is trained under supervision using the autoregressive cross-entropy loss function, so as to inject the decision tree constraints into the model parameters. The steps of the second phase of experience-based reinforcement learning include: Given an input prompt, multiple candidate output sequences are generated by sampling using the current model strategy; For each candidate output sequence, calculate the multi-dimensional composite reward value; Based on the multi-dimensional composite reward value, the model parameters are updated using a group relative policy optimization algorithm to maximize the expected value of the composite reward value.
4. The method as described in claim 3, characterized in that, The step of calculating the multi-dimensional composite reward value includes calculating at least one of the following reward components: The process reward is used to verify whether the intermediate variable markers extracted from the candidate output sequence are consistent with the clinical facts in the input data; The format reward is used to verify whether the candidate output sequence contains a complete set of required tokens and whether the values of the tokens conform to a preset specification. Treatment ranking reward is used to calculate a similarity index between the ranking of treatment plans in the candidate output sequence and the ranking recommended by clinical guidelines; Survival prediction reward is used to calculate the error metric between the predicted survival data and the actual survival data in the candidate output sequence.
5. The method as described in claim 4, characterized in that, The steps for calculating treatment ranking rewards include: The recommended treatment plans and their order of arrangement are parsed from the candidate output sequence to determine the ranking of the treatment plans in the candidate output sequence. Obtain the standard treatment recommendation list and recommendation level of each regimen determined by the decision tree of the hepatocellular carcinoma diagnosis and treatment guidelines, and use it as the recommendation ranking of the clinical guidelines; The normalized discount cumulative gain algorithm is used to calculate the ranking quality score of the treatment plan ranking in the candidate output sequence relative to the ranking recommended by the clinical guidelines, and the ranking quality score is used as the treatment ranking reward.
6. The method as described in claim 4, characterized in that, The survival prediction data includes predicted survival time and segmented survival endpoint prediction results, and the actual survival data includes actual survival time and survival status. The steps for calculating the survival prediction reward specifically include: When the survival status is a definite death event, the deviation between the predicted survival time and the actual survival time is calculated as the basis for reward; When the survival status is censored data, a positive reward is given if the predicted survival time is greater than the actual survival time. The accuracy of the segmented survival endpoint prediction results is weighted and fused with the prediction error of the predicted survival time to obtain the final survival prediction reward.
7. The method as described in claim 4, characterized in that, The step of updating the model parameters based on the multi-dimensional composite reward value using the group relative policy optimization algorithm further includes executing a decoupling optimization strategy: Based on the different components of the multidimensional composite reward value, the group dominance value related to the treatment recommendation task and the group dominance value related to the survival prediction task are calculated respectively. The model parameters are updated using the group dominance values related to the treatment recommendation task and the group dominance values related to the survival prediction task. The model parameters are updated separately in different update steps, or the two are weighted and aggregated before updating the model parameters, in order to mitigate the interference of multi-task gradients.
8. The method as described in claim 1, characterized in that, The step of extracting comprehensive decision support information from the structured text stream using preset parsing rules includes: Regular expressions are used to extract intermediate inference variables and final recommendation results wrapped in specific tags from the structured text stream; The preset rule verification module is invoked to check whether the extracted intermediate inference variables are complete, and whether the final recommendation result contains any taboos that conflict with the intermediate inference variables. If the verification passes, the intermediate inference variables and the final recommendation result are integrated into the comprehensive decision support information; if the verification fails, an error message or downgrade is triggered.
9. The method as described in claim 1 or 8, characterized in that, The comprehensive decision support information is presented in the form of a structured report, the content of which includes at least one of the following: Hepatocellular carcinoma staging results calculated based on risk scores; A list of treatment options sorted by suitability score, along with the corresponding guideline text for each option; Prognostic data including short-term survival probability and continuous survival time estimates.
10. An information generation device for hepatocellular carcinoma risk stratification and treatment recommendations, characterized in that, include: The data acquisition module is used to acquire structured clinical data related to hepatocellular carcinoma of the target subjects. The input sequence construction module is used to convert the structured clinical data into electronic medical record style narrative text containing clinical semantics based on a preset electronic medical record narrative template, and to embed key clinical variable markers corresponding to the structured clinical data into the electronic medical record style narrative text to construct the model input sequence. The large model processing module is used to input the input sequence of the model into a pre-trained large language model for inference operations and output a structured text stream. The large language model is trained based on decision tree constraints constructed from the hepatocellular carcinoma diagnosis and treatment guidelines and multi-objective reinforcement learning strategies. The recommendation information generation module is used to extract comprehensive decision support information from the structured text stream using preset parsing rules. The comprehensive decision support information includes risk stratification results determined based on intermediate inference variables and a personalized treatment plan ranking list associated with guideline-based text.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations as described in any one of claims 1 to 9.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations as described in any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the information generation method for hepatocellular carcinoma risk stratification and treatment recommendations as described in any one of claims 1 to 9.