A life behavior intervention method based on causal inference and a large language model
Patent Information
- Application Number
- CN202611073254.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-20
- Publication Date
- 2026-10-09
AI Technical Summary
[0004]现有技术存在以下缺点:第一,现有方法在干预建议生成环节缺乏因果层面的可验证性,基于规则或经验匹配生成的干预建议无法在个体因果模型中预先验证其能否产生预期的因果效应,导致推送建议的合理性和可溯源性不足
[0016]有益效果:本发明提出一种基于因果推断与大语言模型的生活行为干预方法,通过将体成分分型作为因果发现的先验约束嵌入带无环约束的因果发现框架,使学习得到的基准因果图能够精准适配肌肉型健康、隐匿性肥胖、肌少性肥胖和消瘦型等不同人群的生理代谢特性,解决了同一因果结构假设无法适用于所有体成分分型人群的缺陷;同时通过构建基于滑动时间窗口的因果效应量置信区间重叠率判定机制,持续监测各因果边权重的动态漂移,并利用拓扑排序与因果效应量变化幅度相结合的方式精准定位上游根源变量,解决了现有技术忽视因果结构动态时变性的问题,避免了基于历史固定因果图进行干预引发的级联诊断偏差;本发明在将根因变量与漂移路径映射为候选干预动作后,先利用结构方程模型中的因果干预算子计算各候选动作对目标健康指标的预期因果效应并进行量化筛选,再将筛选后的备选方案输入大语言模型结合用户动态画像生成个性化干预建议,并在推送前构建因果校验层对模型输出进行反向转换验证,确保干预建议在个体因果模型中能够产生预期的因果改善效果,解决了现有方法在干预建议生成环节缺乏因果可验证性、推送建议合理性和可溯源性不足的缺陷,形成了从因果发现、漂移检测、根因定位、干预生成到反馈闭环的完整可追溯因果链。
Smart Images

Figure CN122889266A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent health management technology, and in particular to a method for intervening in lifestyle behaviors based on causal inference and a large language model. Background Technology
[0002] With the widespread adoption of wearable devices and smart mobile terminals, health monitoring and intervention based on multimodal lifestyle data has become a research hotspot in the field of intelligent health management. The core of lifestyle intervention lies in establishing the causal relationship between an individual's daily behavior and health outcomes, thereby developing actionable, personalized intervention plans. However, significant differences exist in the physiological characteristics and metabolic response mechanisms of different body composition subtypes, making it difficult to apply the same causal structure hypothesis to all populations. Furthermore, the causal structure of human behavior is not static but dynamically changes with variations in the external environment and internal state. Causal inference needs to shift from static assessment to dynamic monitoring, posing a significant challenge to the accuracy and timeliness of behavioral interventions.
[0003] Existing methods typically utilize wearable devices to continuously collect multimodal time-series behavioral data such as sleep, activity, and diet. Statistical learning or causal discovery algorithms are then used to learn the correlation structure between behavioral variables from the data, and a personalized behavioral causal graph model is constructed based on this. On this basis, the system identifies abnormal states by monitoring the deviation of current behavioral indicators from historical stable periods. When multiple behavioral indicators are detected to deviate from the normal range simultaneously, the structural information of the causal graph is used to locate the upstream root cause variables that may trigger a chain reaction of abnormalities. For the identified root cause behaviors, most existing systems rely on preset rule bases or historical experience to match corresponding intervention actions, ultimately pushing behavior improvement suggestions to users in the form of text or message reminders. After the user executes the suggestions, the system collects data again to evaluate the intervention effect, forming a preliminary monitoring-intervention-evaluation closed-loop process.
[0004] Existing technologies have the following drawbacks: First, existing methods lack causal verifiability in the intervention suggestion generation stage. Intervention suggestions generated based on rule or experience matching cannot be pre-verified in an individual causal model to produce the expected causal effect, resulting in insufficient rationality and traceability of the pushed suggestions. Second, existing methods have not established a dynamic monitoring and adaptive update mechanism for the continuous drift of behavioral causal structures. When a user's causal structure changes with the environment or state, the system still relies on a historically fixed causal graph for root cause localization and intervention decisions, leading to a cascading failure of diagnostic bias and intervention inaccuracies. Summary of the Invention
[0005] In order to overcome the shortcomings and deficiencies of existing technologies, this invention provides a life behavior intervention method based on causal inference and large language model.
[0006] The technical solution adopted in this invention is a method for life behavior intervention based on causal inference and a large language model, comprising the following steps: S1, collecting user body composition indicators and multimodal life behavior time-series data, embedding body composition typing as a prior constraint into a causal discovery framework with acyclic constraints to solve the weighted adjacency matrix, and extracting time-series causal edges to generate a baseline directed acyclic causal graph; S2, for each causal edge in the baseline causal graph, constructing a baseline confidence interval based on stable period data, and calculating a real-time confidence interval using a sliding time window, determining whether the causal edge has drifted by comparing the overlap rate of the two intervals with a preset threshold, and summarizing the drifted edge set; S3, performing topological sorting on the baseline causal graph to obtain a global causal sequence, extracting a candidate root cause set based on the drifted edge set, and then... The root variable is located by topological position and the magnitude of change in causal effect size, and the complete drift causal path is output by traversing downstream along the causal graph; S4, candidate intervention actions are generated based on the root variable and drift path, mapped to causal intervention sub-substituted into the structural equation model to calculate the expected causal effect on the target variable and screen alternative intervention schemes. The alternative intervention actions, expected causal effect, drift causal structured description and user dynamic profile are input into the large language model to perform hierarchical inference, and the intervention suggestion is output after causal verification; S5, user behavior data after intervention is collected, the posterior confidence interval of the causal effect size between the root variable and the target variable is calculated, a causal positive index is constructed as a reward signal, the system parameters are updated online based on the reward signal and the accumulated samples trigger offline retraining.
[0007] Furthermore, the weighted adjacency matrix is solved in S1 using the formula... The constraints are ,in This represents the augmented feature matrix after standardization. Indicates the number of samples. Represents the weighted adjacency matrix. Represents the regularization coefficient. Describing the Frobenius norm, Indicates the L-term. Represents the acyclic constraint function. Represents the matrix trace operation. Represents matrix exponentiation. This represents the Hadamard product. This represents the total number of behavioral feature dimensions.
[0008] Furthermore, the overlap rate of the two intervals in S2 is calculated using the formula... ,in Indicates the overlap rate. and These represent the upper and lower bounds of the baseline confidence interval, respectively. and These represent the upper and lower bounds of the real-time confidence interval, respectively. This indicates the operation of finding the maximum value. This indicates the minimum value operation.
[0009] Furthermore, in S3, the root dependent variable is located based on a topological sorting sequence. Magnitude of change in causal effect ,in Represents a global causal sequence. Indicates the first in the sequence One variable, This represents the total number of behavioral feature dimensions. Indicates from variable Pointer variable The magnitude of change in causal side effect quantity. This indicates the real-time weight of the causal edge after the drift occurs. This represents the baseline weight of the causal edge during the stable period. This represents absolute value operations.
[0010] Furthermore, the expected causal effect calculation in S4 uses the formula ,in Represents the mathematical expectation. Indicates the target body component index variable, Indicates the root dependent variable Apply intervention to make it take the value The intercept term of the structural equation model is represented. Representing the root cause variable For target variable The causal effect coefficient, Represent the target variable The set of all parent node variables in the cause-effect graph. Represents any variable in the parent node set. Represents parent node variables For target variable The causal effect coefficient.
[0011] Furthermore, the causal positivity index in S5 adopts the formula... ,in Indicates the causal homing rate. This represents the posterior confidence interval of the causal effect size between the root dependent variable and the target variable after intervention. This represents the baseline confidence interval during the stable period. This represents the confidence interval for the window interval when the drift occurs. The function representing the overlap rate calculation of two confidence intervals; reward signal. according to With preset threshold The comparison is more certain when hour ,when hour ,when hour ,in This represents the proportion coefficient that distinguishes between no improvement and increased instability. This indicates the threshold for determining the return to normal based on the differences in body composition classification.
[0012] Further, S2 includes the following sub-steps: S21, reusing the stable period time series data, adopting a block-based self-sampling resampling strategy for each directed edge in the baseline causal graph, setting the block length and performing multiple block resamplings with replacement on the stable period data, calculating the corresponding causal effect quantity for each sampling, and constructing a baseline confidence interval by taking the specified quantile of the sampling result; S22, setting the online drift detection window duration, sliding the window samples forward daily, and using the same block-based self-sampling method to calculate the real-time confidence interval for the behavioral time series data within the latest continuous window duration; S23, calculating the overlap rate between the real-time confidence interval and the baseline confidence interval, and assigning differentiated values to the overlap rate threshold based on the volume component classification; S24, comparing the overlap rate of each causal edge with the corresponding threshold, determining the causal edge that has drifted, and summarizing all drifted edges to output the drift edge set.
[0013] Further, S3 includes the following sub-steps: S31, performing topological sorting on the baseline directed acyclic causal graph to obtain a global causal sequence, identifying upstream variables as root variables and downstream variables as structural variables; S32, reading the drift edge set, extracting the source variables of all drift edges to generate a candidate root cause set, sorting the candidate root causes according to the topological sequence, prioritizing the upstream variable as the root cause variable, and comparing the change magnitude of the causal effect of each edge if multiple candidate root causes are at the same level, taking the one with the largest change magnitude as the priority root cause; S33, starting from the root cause variable obtained by positioning, traversing downstream along the baseline causal graph to output the complete drift causal path; S34, transmitting the root cause variable obtained by positioning and the drift causal path together to the subsequent intervention inference steps.
[0014] Further, S4 includes the following sub-steps: S41, generating a candidate intervention action set by retrieving a preset structured intervention action library based on the root cause variable and drift path. When there are sufficient historical intervention samples, intervention actions with higher historical execution rates are selected first. When there are insufficient historical intervention samples, initial candidate intervention actions are generated by enumerating health domain knowledge. S42, mapping each candidate intervention action to a causal interference estimator and substituting it into the structural equation model to solve the expected causal effect of each candidate action on the target body component index. The first preset number of items are selected as candidate intervention schemes by sorting them in descending order of effect size. S43, integrating body component classification, behavioral guidelines, user basic attributes, and historical intervention response records to construct a user dynamic profile. The candidate intervention actions, expected causal effects, drift causal structured descriptions, and user dynamic profiles are input into a large language model to perform hierarchical inference. S44, after the large language model outputs intervention suggestions, a causal verification layer is constructed to convert the generated intervention suggestions into causal interference estimators. After the verification is passed, the intervention suggestions are pushed to the user.
[0015] Further, S5 includes the following sub-steps: S51, after the user executes the intervention suggestion, continuously collect multimodal behavioral time-series data and user intervention compliance information during the intervention implementation phase, substitute the post-intervention behavioral data into the baseline causal graph structure, and use a block-based self-service resampling process to calculate the posterior confidence interval corresponding to the causal effect size between the root variable and the target variable; S52, construct a causal homing index, calculate the ratio of the overlap rate between the posterior confidence interval and the baseline confidence interval to the overlap rate of the window interval when drift occurs, and determine the reward signal based on the comparison result between the homing index and the preset threshold; S53, based on the reward signal, simultaneously perform online fine-tuning of the prior constraint-related parameters and the large language model prompt word template, adopt an online gradient descent update method and configure a fixed update step size, and perform parameter iterative optimization after each round of intervention feedback is completed; S54, when the system accumulates a sufficient number of user intervention feedback samples, trigger the offline retraining process, use the historical overall intervention success rate as the optimization target to globally reconstruct and update the user-specific baseline causal graph, and send the updated causal graph back to the drift detection step for closed-loop iteration.
[0016] Beneficial Effects: This invention proposes a lifestyle intervention method based on causal inference and a large language model. By embedding body composition typing as a prior constraint for causal discovery into a causal discovery framework with acyclic constraints, the learned baseline causal graph can accurately adapt to the physiological and metabolic characteristics of different populations, such as muscular healthy individuals, those with hidden obesity, sarcopenic obesity, and lean individuals. This addresses the limitation that the same causal structure hypothesis cannot be applied to all body composition types. Simultaneously, by constructing a causal effect confidence interval overlap rate determination mechanism based on a sliding time window, the dynamic drift of each causal edge weight is continuously monitored. Furthermore, by combining topological sorting with the magnitude of causal effect changes, upstream root variable is accurately located. This solves the problem of existing technologies neglecting the dynamic time-varying nature of the causal structure and avoids reliance on historical data. This invention addresses the cascading diagnostic biases caused by interventions using fixed causal graphs. After mapping root variables and drift paths to candidate intervention actions, it first uses causal intervention quantifiers in structural equation modeling to calculate the expected causal effect of each candidate action on the target health indicator and performs quantitative screening. Then, the screened candidate solutions are input into a large language model combined with user dynamic profiles to generate personalized intervention suggestions. Before pushing the suggestions, a causal verification layer is constructed to perform reverse transformation verification of the model output, ensuring that the intervention suggestions can produce the expected causal improvement effect in the individual causal model. This solves the shortcomings of existing methods in the intervention suggestion generation stage, such as lack of causal verifiability, insufficient rationality and traceability of the pushed suggestions. It forms a complete and traceable causal chain from causal discovery, drift detection, root cause localization, intervention generation to feedback loop. Attached Figure Description
[0017] Figure 1 This is a flowchart illustrating the overall process of the method of the present invention. Figure 2 This is a flowchart of method step S2 of the present invention; Figure 3 This is a flowchart of method step S3 of the present invention; Figure 4 This is a flowchart of method step S4 of the present invention; Figure 5 This is a flowchart of step S5 of the method of the present invention. Detailed Implementation
[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. The application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0019] like Figure 1As shown, a life behavior intervention method based on causal inference and a large language model includes the following steps: S1, collecting user body composition indicators and multimodal life behavior time-series data, embedding body composition typing as a prior constraint into a causal discovery framework with acyclic constraints to solve the weighted adjacency matrix, and extracting time-series causal edges to generate a baseline directed acyclic causal graph; S2, for each causal edge in the baseline causal graph, constructing a baseline confidence interval based on stable period data, and calculating a real-time confidence interval using a sliding time window, determining whether the causal edge has drifted by comparing the overlap rate of the two intervals with a preset threshold, and summarizing the drifted edge set; S3, performing topological sorting on the baseline causal graph to obtain a global causal sequence, extracting a candidate root cause set based on the drifted edge set, and sorting by topological position and... The change magnitude of the causal effect size locates the root variable, and the complete drift causal path is output by traversing downstream along the causal graph; S4, candidate intervention actions are generated based on the root variable and the drift path, mapped to causal intervention sub-substituted into the structural equation model to calculate the expected causal effect on the target variable and screen alternative intervention schemes. The alternative intervention actions, expected causal effect, drift causal structured description and user dynamic profile are input into the large language model to perform hierarchical inference. After causal verification, intervention suggestions are output; S5, user behavior data after intervention is collected, the posterior confidence interval of the causal effect size between the root variable and the target variable is calculated, a causal positive index is constructed as a reward signal, and the system parameters are updated online based on the reward signal and the accumulated samples trigger offline retraining.
[0020] In step S1, body composition data of users during the stable observation period is collected, including body mass index, body fat percentage, and skeletal muscle mass. Based on these indicators, users are categorized into one of four body composition types: muscular health, hidden obesity, sarcopenic obesity, or lean body composition. Simultaneously, multimodal lifestyle behavior time-series data is continuously collected via wearable wristbands and smartphones, including six dimensions of behavioral characteristics: sleep duration, sleep regularity, moderate-to-vigorous activity time, sedentary time, eating regularity, and food calories. The stable observation period is set to 30 days. The original behavioral feature matrix for this period is extracted, and an augmented feature matrix with first-order lag terms is constructed, expanding the feature dimensions to 12. The augmented matrix is then standardized to have a mean of 0 and a standard deviation of 1. The prior constraints corresponding to volume component classification are embedded into a causal discovery optimization framework with acyclic constraints. The regularization coefficient is set to 0.05. The weighted adjacency matrix is solved, and the temporal causal edges pointing from historical lagged variables to the current variable are extracted to generate a baseline directed acyclic causal graph. The number of nodes in the causal graph is 12, and the weight of the directed edge ranges from -1 to 1. The absolute value of the weight reflects the strength of the causal effect. The causal graph and the weighted adjacency matrix are then passed to subsequent steps.
[0021] In step S2, drift determination is performed on the weighted adjacency matrix weights corresponding to each directed edge in the baseline causal graph. The time-series data from the 30-day stabilization period in step S1 is reused, and block-based self-sampling is performed on each edge. The block length is set to 5 days, and 1000 block-based resamplings with replacement are performed on the stabilization period data. The corresponding causal effect is calculated for each sample, and the 2.5th percentile and 97.5th percentile of the sampled results are used to construct a 95% baseline confidence interval. The online drift detection window duration is set to 7 days, and the window samples are updated daily. The same block-based self-sampling method is used on the latest continuous 7-day behavioral time-series data, with the same block length of 5 days and 1000 resampling cycles, to calculate the real-time 95% confidence interval. The overlap rate between the real-time confidence interval and the baseline confidence interval is calculated; this overlap rate is between 0 and 1. The preset overlap rate threshold is assigned a differentiated value based on the body composition classification in step S1: the threshold is 0.60 for muscular healthy and lean body types, 0.55 for hidden obesity, and 0.50 for sarcopenic obesity. If the overlap rate of a causal edge is less than the corresponding classification threshold, it is determined that the causal edge has drifted. All drifted edges are collected to form a drift edge set and then passed to step S3.
[0022] In step S3, topological sorting is performed on the directed acyclic causal graph constructed in step S1. The 12 behavioral feature variables are arranged from upstream to downstream according to causal relationships to obtain a global causal sequence. The variable at the beginning of the sequence is the upstream root source variable, and the variable at the end is the downstream structural variable. The drift edge set output in step S2 is read, and the source variables of all drift edges are extracted to form a candidate root cause set. If the set includes multiple variables, the candidate root causes are sorted according to the global causal sequence, and the variable with the highest position in the sequence is selected as the root cause variable. If multiple candidate root causes are at the same level in the topological sequence, the change magnitude of the causal effect of the drift edge corresponding to each candidate root cause is compared one by one. The change magnitude is calculated as the absolute value of the difference between the absolute value of the real-time weight and the absolute value of the baseline weight, and the candidate root cause with the largest change magnitude is selected as the priority root cause. Starting from the finally determined root cause variable, traverse downstream layer by layer along the directed edge direction of the baseline causal graph, summarize all nodes that can be reached from the root cause variable via the directed path and their connecting edges, output the complete drift causal path, and output the root cause variable and drift path together to step S4.
[0023] In step S4, based on the root cause variable and drift path output in step S3, a set of candidate intervention actions is generated by retrieving the system's preset structured intervention action library. When the number of historical intervention samples of the user is greater than or equal to 10, intervention actions and their variations with a historical execution rate higher than 70% are selected first. When the number of historical intervention samples is less than 10, initial candidate intervention actions are generated by enumerating three types of rules in the health domain knowledge base: dietary adjustment, increased activity, and improved sleep. The number of candidate actions is controlled between 5 and 8. Each candidate intervention action is mapped to a causal intervention quantifier and substituted into the linear structural equation model output by the causal discovery framework with acyclic constraints in step S1. The expected causal effect value of each candidate action on the target body composition index is solved one by one. This effect value is expressed as the change in weight or body fat percentage, in kg or percentage. All candidate actions are sorted in descending order of expected effect value, and the top 3 are selected as alternative intervention plans. The system integrates component classification, behavioral guidelines of 12-dimensional behavioral features, user age and gender, and other basic attributes and historical intervention response records to construct a dynamic user profile. The structured descriptions of candidate intervention actions, expected causal effect values, and drift causal paths, along with the dynamic user profile, are uniformly input into the large language model. After performing hierarchical reasoning, the large language model outputs candidate intervention suggestions. Subsequently, a causal verification layer is constructed to perform reverse verification on the output content. After the verification is passed, the intervention suggestions are pushed to the user and the process proceeds to step S5.
[0024] In step S5, after the user executes the intervention suggestion pushed in step S4, multimodal behavioral time-series data and user intervention compliance information are continuously collected during the intervention implementation phase, with a collection cycle of 7 days. Intervention compliance is expressed as the percentage of actual execution days to the suggested execution days. The post-intervention behavioral data is substituted into the baseline causal graph structure obtained in step S1, and the block-based self-service resampling process consistent with step S2 is reused. The block length is 5 days, and the number of resampling times is 1000. The 95% posterior confidence interval corresponding to the causal effect size between the root dependent variable and the target component index is calculated. A causal recovery index is constructed, which is the ratio of the overlap rate between the post-intervention confidence interval and the baseline confidence interval to the overlap rate between the window confidence interval and the baseline confidence interval when the drift occurs. A recovery index value greater than 1 indicates positive recovery of the causal structure. A positive reward threshold is set based on body composition classification: 0.80 for muscular healthy and lean body types, 0.75 for hidden obesity, and 0.70 for sarcopenic obesity. A positive reward signal is assigned when the positive reward index is greater than or equal to the corresponding threshold; a zero reward signal is assigned when the positive reward index is between the threshold multiplied by 0.60 and the threshold; and a negative reward signal is assigned when the positive reward index is less than or equal to the threshold multiplied by 0.60. Based on the reward signal, online fine-tuning is performed on the prior constraint-related regularization coefficients and the large language model prompt word template, with an update step size set to 0.01. Parameter iteration is performed after each round of intervention feedback. When the system accumulates 50 user intervention feedback samples, an offline retraining process is triggered, globally reconstructing and updating the user-specific baseline causal graph. The updated causal graph is then fed back to step S2 to achieve closed-loop iteration.
[0025] Preferably, the weighted adjacency matrix is solved in S1 using the formula The constraints are ,in This represents the augmented feature matrix after standardization. Indicates the number of samples. Represents the weighted adjacency matrix. Represents the regularization coefficient. Describing the Frobenius norm, Indicates the L-term. Represents the acyclic constraint function. Represents the matrix trace operation. Represents matrix exponentiation. This represents the Hadamard product. This represents the total number of behavioral feature dimensions.
[0026] Specifically, the formula for solving the weighted adjacency matrix is constructed based on the dual objectives of minimizing prediction residuals and parameter sparsity. The prediction residuals measure the linear prediction error of each variable in the augmented feature matrix given the values of other variables. Minimizing this error allows the adjacency matrix to accurately capture the conditional dependencies between variables. The regularization term applies an L1 norm penalty to shrink the weights of unnecessary causal edges in the adjacency matrix to 0, thereby achieving sparsity of the causal structure and avoiding overfitting. The acyclic constraint function uses matrix exponentiation and trace operations to transform the discrete directed acyclic graph constraint into a continuously differentiable equality constraint. The function value is greater than 0 when a directed cycle exists in the graph structure corresponding to the adjacency matrix, and equal to 0 only when the graph structure is completely acyclic. This transforms the discrete combinatorial optimization problem into a continuous optimization problem with equality constraints, facilitating gradient descent solutions. The number of rows in the augmented feature matrix corresponds to the total number of samples within a 30-day stable observation period, and the number of columns corresponds to 12 dimensions of behavioral features including first-order lag. The regularization coefficient is set to 0.05 to balance fitting accuracy and sparsity. This value is finely adjusted in the range of 0.01 to 0.10 based on volume component classification. The total number of feature dimensions is 12, consisting of 6 original behavioral features and 6 first-order lag features. All operations are performed in the real number domain.
[0027] Preferably, the overlap rate of the two intervals in S2 is calculated using the formula... ,in Indicates the overlap rate. and These represent the upper and lower bounds of the baseline confidence interval, respectively. and These represent the upper and lower bounds of the real-time confidence interval, respectively. This indicates the operation of finding the maximum value. This indicates the minimum value operation.
[0028] Specifically, the overlap rate calculation formula is used to quantitatively characterize the degree of overlap between the real-time confidence interval and the baseline confidence interval. The numerator calculates the length of the intersection of the two intervals, ensuring the intersection length is non-negative by comparing the difference between the smaller of the upper bounds and the larger of the lower bounds with 0. The denominator calculates the total span of the union of the two intervals, obtaining the minimum continuous range encompassing both intervals by comparing the difference between the maximum of the upper bounds and the minimum of the lower bounds. This ratio eliminates the influence of differences in the weights of different causal edges, uniformly mapping the overlap rate value to the 0-1 interval for easy threshold comparison. The upper and lower bounds of the baseline confidence interval are derived from the 2.5 percentile and 97.5 percentile of the causal effect distribution obtained from 1000 block-based bootstrapping resampling operations. The upper and lower bounds of the real-time confidence interval are calculated using the same block-based bootstrapping method based on the latest continuous 7-day sliding window data. The closer the overlap rate is to 1, the higher the degree of overlap between the two confidence intervals. That is, the causal effect reflected by the weight of the causal edge in the current window is not significantly different from that in the stable period. The closer the value is to 0, the more obvious the causal structure has changed. When the overlap rate is 0, it means that the two intervals have no intersection at all, that is, the causal effect has drifted outside the distribution range of the stable period.
[0029] Preferably, the root dependent variable location in S3 is based on a topological sorting sequence. Magnitude of change in causal effect ,in Represents a global causal sequence. Indicates the first in the sequence One variable, This represents the total number of behavioral feature dimensions. Indicates from variable Pointer variable The magnitude of change in causal side effect quantity. This indicates the real-time weight of the causal edge after the drift occurs. This represents the baseline weight of the causal edge during the stable period. This represents absolute value operations.
[0030] Specifically, the topological sorting sequence arranges all nodes in the directed acyclic graph from front to back according to the direction of the directed edges, ensuring that for any directed edge in the graph, its starting point is always positioned before its ending point in the sequence. This sequence is generated from the causal graph corresponding to the weighted adjacency matrix in step S1 using a depth-first or breadth-first traversal algorithm, and the sequence length is 12, corresponding to all behavioral feature variables. The magnitude of change in causal effect is taken as the absolute value of the difference between the absolute value of the real-time weight and the absolute value of the baseline weight. The baseline weight is the median value of the causal effect obtained through 1000 block-based self-sampling during the stable period, and the real-time weight is the median value of the causal effect calculated through the same resampling process within the latest 7-day sliding window. Taking the absolute value ensures that the magnitude of change is always non-negative, quantifying the degree of drift without distinguishing the direction. When multiple candidate root causes are at the same level in the topological sequence, i.e. there is no directed path to each other, the magnitude of change of the drift edge corresponding to each candidate root cause is compared, and the variable with the largest magnitude of change is selected as the root cause. This criterion is based on the fact that the larger the magnitude of change, the more drastic the change in the causal influence of the variable, and therefore the more likely it is to be the root cause of downstream chain anomalies.
[0031] Preferably, the expected causal effect calculation in S4 uses the formula ,in Represents the mathematical expectation. Indicates the target body component index variable, Indicates the root dependent variable Apply intervention to make it take the value The intercept term of the structural equation model is represented. Representing the root cause variable For target variable The causal effect coefficient, Represent the target variable The set of all parent node variables in the cause-effect graph. Represents any variable in the parent node set. Represents parent node variables For target variable The causal effect coefficient.
[0032] Specifically, the formula for calculating the expected causal effect originates from the parameterized expression of the linear relationship between variables in the causal graph using the linear structural equation model in step S1. The target component index variable, as the response variable, is jointly influenced by all its parent node variables and the root cause intervention variable. This formula directly substitutes the causal intervention quantifier into the structural equation model, fixing the root cause variable at a specific intervention value while keeping the values of other parent node variables constant, to calculate the conditional expected value of the target variable as a quantitative estimate of the intervention effect. The intercept term reflects the baseline level of the target variable when all predictor variables are zero. The coefficients of the root cause variable and each parent node variable are the weights of the corresponding directed edges in the weighted adjacency matrix, obtained by training the causal discovery optimization framework on stable period data. In actual calculations, the behavioral variable corresponding to the candidate intervention action is set as the target change value, and the values of other parent node variables are taken from the measured mean within the latest 7-day sliding window. After substitution, the expected change in the target component index is obtained, in kg or percentage. The top three are selected as candidate intervention programs after being sorted in descending order of expected effect value.
[0033] Preferably, the causal positivity index in S5 adopts a formula. ,in Indicates the causal homing rate. This represents the posterior confidence interval of the causal effect size between the root dependent variable and the target variable after intervention. This represents the baseline confidence interval during the stable period. This represents the confidence interval for the window interval when the drift occurs. The function representing the overlap rate calculation of two confidence intervals; reward signal. according to With preset threshold The comparison is more certain when hour ,when hour ,when hour ,in This represents the proportion coefficient that distinguishes between no improvement and increased instability. This indicates the threshold for determining the return to normal based on the differences in body composition classification.
[0034] Specifically, the causal recovery index formula quantifies the degree of causal structure recovery after intervention by using the ratio of two overlap rates. The numerator is the overlap rate between the post-intervention confidence interval and the baseline confidence interval, used to characterize the degree to which the current causal effect size approaches the historical steady state. The denominator is the overlap rate between the confidence interval at the time of drift and the baseline confidence interval, used to characterize the severity of drift as a normalization benchmark. A ratio greater than 1 indicates that the post-intervention structure is better than the deviation state at the time of drift, equal to 1 indicates no change, and less than 1 indicates continued deterioration. The reward signal is determined by comparing the recovery index with the body component subtyping differentiation threshold, resulting in three discrete values. The threshold is set between 0.70 and 0.80 according to the sensitivity of different subtypings to causal stability, and a coefficient of 0.60 is used to distinguish between no significant improvement and deterioration. Block-based self-service resampling is performed with a block length of 5 days to ensure that the time-series correlation is not destroyed, and 1000 resampling times ensure the statistical stability of the confidence interval estimation. The online fine-tuning update step size is set to 0.01 to ensure the stability of parameter iteration, and the offline retraining trigger sample size is 50 to ensure sufficient statistical power.
[0035] Preferred, such as Figure 2 As shown, S2 includes the following sub-steps: S21, reuse the stable period time series data, adopt a block-based self-sampling resampling strategy for each directed edge in the baseline causal graph, set the block length and perform multiple block resampling with replacement on the stable period data, calculate the corresponding causal effect quantity for each sampling, and construct the baseline confidence interval by taking the specified quantile of the sampling result; S22, set the online drift detection window duration, slide the window samples forward daily, and use the same block-based self-sampling method to calculate the real-time confidence interval for the behavioral time series data within the latest continuous window duration; S23, calculate the overlap rate between the real-time confidence interval and the baseline confidence interval, and assign differentiated values to the overlap rate threshold according to the volume component classification; S24, compare the overlap rate of each causal edge with the corresponding threshold, determine the causal edge that has drifted, and summarize all drifted edges to output the drift edge set.
[0036] Specifically, in S21, the 30-day stable period time series data from step S1 is reused. For each directed edge in the baseline causal graph, a block length of 5 days is set. The 30-day data is resampled with replacement 1000 times. Each time, 6 non-overlapping 5-day data blocks are randomly selected and concatenated to form a new 30-day sample. The causal effect size under this sample is calculated. The 2.5 percentile and 97.5 percentile of the 1000 calculation results are used as the lower and upper bounds of the 95% baseline confidence interval. In S22, the online drift detection window is set to 7 days, sliding forward day by day in calendar days. The same block bootstrap method is used for the behavioral time series data within the latest consecutive 7 days. The block length is also 5 days, but only 1 block can be formed. Since there is a complete data block, an overlapping block strategy is used to generate multiple sub-samples for 1000 resampling operations and to calculate the real-time 95% confidence interval. In S23, the overlap rate between the real-time confidence interval and the baseline confidence interval is calculated. This value is the ratio of the intersection length of the two intervals to the total span of the union, and the value is between 0 and 1. The overlap rate threshold is assigned according to the body composition classification differences: the threshold for muscular healthy body is 0.60, the threshold for hidden obesity is 0.55, the threshold for sarcopenic obesity is 0.50, and the threshold for lean body is 0.60. In S24, the overlap rate of each causal edge is compared with its corresponding classification threshold. If the overlap rate is less than the threshold, the causal edge is determined to have drifted. All the determined drifted edges are summarized and output as a drift edge set and passed to step S3.
[0037] Preferred, such as Figure 3 As shown, S3 includes the following sub-steps: S31, performing topological sorting on the baseline directed acyclic causal graph to obtain a global causal sequence, identifying upstream variables as root variables and downstream variables as structural variables; S32, reading the drift edge set, extracting the source variables of all drift edges to generate a candidate root cause set, sorting the candidate root causes according to the topological sequence, prioritizing the upstream variable as the root cause variable, and comparing the change magnitude of the causal effect of each edge if multiple candidate root causes are at the same level, taking the one with the largest change magnitude as the priority root cause; S33, starting from the root cause variable obtained by positioning, traversing downstream along the baseline causal graph to output the complete drift causal path; S34, transmitting the root cause variable obtained by positioning and the drift causal path together to the subsequent intervention inference steps.
[0038] Specifically, in S31, a depth-first topological sorting algorithm is performed on the baseline directed acyclic causal graph generated in step S1. All 12 behavioral feature nodes are arranged from front to back according to the direction of the directed edges, ensuring that the index of the source node of each directed edge in the sequence is less than that of the target node. Nodes with index 1 are determined as the upstream root variable, and nodes with index 12 are determined as the downstream structural variable. In S32, the drift edge set output in step S2 is read, and the source nodes of all drift edges are extracted to form a candidate root cause set. The candidate root causes are sorted according to the topological sorting sequence, prioritizing the candidate variable with the smallest index as the root cause variable. If multiple candidate root causes have different index numbers in the topological sequence... If they are the same, meaning they are at the same level, then the magnitude of the change in causal effect of each drift edge is calculated one by one, that is, the absolute value of the difference between the real-time median weight and the baseline median weight. The candidate root cause with the largest change magnitude is taken as the final priority root cause. In S33, starting from the root cause variable obtained by positioning, the system traverses downstream level by level along the direction of the directed edge, collecting all nodes that can be reached from the root cause variable through one or more directed edges. The root cause variable and all directed edges and intermediate nodes between these nodes are combined to generate a complete drift causal path. In S34, the specific behavioral name of the root cause variable and the structured description of all nodes and edges in the drift causal path are packaged together and output to step S4 for intervention reasoning.
[0039] Preferred, such as Figure 4 As shown, S4 includes the following sub-steps: S41, based on the root cause variable and drift path, a set of candidate intervention actions is generated by retrieving a preset structured intervention action library. When there are sufficient historical intervention samples, intervention actions with higher historical execution rates are selected first. When there are insufficient historical intervention samples, initial candidate intervention actions are generated by enumerating health domain knowledge. S42, each candidate intervention action is mapped to a causal interference estimator and substituted into the structural equation model to solve the expected causal effect of each candidate action on the target body component index. The first preset number of items are selected as candidate intervention schemes by sorting the effect size in descending order. S43, body component typing, behavioral guidelines, user basic attributes and historical intervention response records are integrated to construct a user dynamic profile. The candidate intervention actions, expected causal effects, drift causal structured descriptions and user dynamic profiles are input into the large language model to perform hierarchical inference. S44, after the large language model outputs intervention suggestions, a causal verification layer is constructed to convert the generated intervention suggestions into causal interference estimators. After the verification is passed, the intervention suggestions are pushed to the user.
[0040] Specifically, in S41, a pre-defined structured intervention action library is retrieved based on the root cause variable and the drift path. This library includes executable actions targeting behaviors such as sleep duration, activity intensity, and eating patterns. When the number of historical intervention samples for a user is greater than or equal to 10, intervention actions and variations with a historical execution rate higher than 70% are selected. When the number of historical intervention samples is less than 10, initial candidate actions are generated by enumerating three categories of rules: dietary adjustment, increased activity, and improved sleep. The total number of candidate actions is controlled between 5 and 8. In S42, each candidate action is mapped to a causal interference estimator and substituted into a linear structural equation model. The root cause variable is fixed as the target change and its parent node variable is kept at its maximum value. The new 7-day measured mean is used to calculate the expected change in the target body component indicators. The top 3 intervention options are selected by sorting the expected effect values from largest to smallest. In S43, a dynamic profile is constructed by integrating body component typing, behavioral guidelines of 12-dimensional behavioral features, user age and gender, and historical intervention response records. The structured descriptions of the alternative actions, expected effect values, and drift paths, along with the profile, are input into the large language model for hierarchical inference. In S44, after the large language model outputs intervention suggestions, a causal verification layer is constructed. The suggestions are converted into intervention variables and substituted into the structural equation to verify whether the expected effect is positive. If the verification is successful, the suggestion is pushed to the user; if it fails, the large model is triggered to re-infer until the verification is successful.
[0041] Preferred, such as Figure 5 As shown, S5 includes the following sub-steps: S51, after the user executes the intervention suggestion, continuously collect multimodal behavioral time-series data and user intervention compliance information during the intervention implementation stage, substitute the post-intervention behavioral data into the baseline causal graph structure, and use a block-based self-service resampling process to calculate the posterior confidence interval corresponding to the causal effect size between the root variable and the target variable; S52, construct a causal homing index, calculate the ratio of the overlap rate between the posterior confidence interval and the baseline confidence interval to the overlap rate of the window interval when drift occurs, and determine the reward signal based on the comparison result between the homing index and the preset threshold; S53, based on the reward signal, simultaneously perform online fine-tuning of the prior constraint-related parameters and the large language model prompt word template, adopt an online gradient descent update method and configure a fixed update step size, and perform parameter iterative optimization after each round of intervention feedback is completed; S54, when the system accumulates a sufficient number of user intervention feedback samples, trigger the offline retraining process, use the historical overall intervention success rate as the optimization target to globally reconstruct and update the user-specific baseline causal graph, and send the updated causal graph back to the drift detection step for closed-loop iteration.
[0042] Specifically, in S51, multimodal behavioral time-series data is continuously collected every 7 days after the user implements the intervention suggestion, including 6 dimensions of indicators across three categories: sleep, activity, and diet. User intervention compliance is also recorded, i.e., the percentage of actual implementation days out of the suggested implementation days. The post-intervention behavioral data is then substituted into the baseline causal graph structure and the block-based bootstrapping method is reused, with a block length of 5 days and 1000 resampling times. The 95% posterior confidence interval of the causal effect size between the root variable and the target body component indicator is calculated. In S52, a causal regression index is constructed, which is the ratio of the overlap rate between the posterior confidence interval and the baseline confidence interval to the overlap rate between the window confidence interval and the baseline confidence interval at the time of drift. This index is then used based on body component... The classification sets a threshold for positive feedback: 0.80 for muscular healthy and lean types, 0.75 for hidden obesity, and 0.70 for sarcopenic obesity. A positive reward signal of +1 is assigned when the positive feedback index is greater than or equal to the threshold; a zero reward signal of 0 is assigned when it is between the threshold multiplied by 0.60 and the threshold; and a negative reward signal of -1 is assigned when it is less than or equal to the threshold multiplied by 0.60. In S53, online gradient descent is performed to fine-tune the regularization coefficient and the large model prompt word template based on the reward signal, with a fixed update step size of 0.01, iterating once after each round of intervention. In S54, offline retraining is triggered when the accumulated user feedback samples reach 50, and the causal graph is globally reconstructed with the historical intervention success rate as the optimization objective and then fed back to step S2.
[0043] A lifestyle behavior intervention method based on causal inference and a large language model is proposed. Body component typing is embedded as a priori constraint in the causal discovery process, enabling the baseline causal graph to accurately reflect the unique behavioral and metabolic patterns of different populations, avoiding adaptation bias caused by a uniform causal structure assumption. Based on this, a dynamic drift detection mechanism is introduced, using a sliding window to monitor the effect size fluctuations of causal edges in real time. Innovatively, a dual criterion of topological ranking and effect change magnitude is employed to accurately locate upstream root causes among multiple abnormal variables, solving the diagnostic and tracing challenges of time-varying causal structures and concurrent anomalies of multiple indicators. In the intervention generation stage, the expected effects of each candidate action are quantified and ranked using structural equation modeling interference econometrics. Then, the inference generation capability of the large language model and user profiles are combined for personalized adaptation. A causal verification layer is added before push notification to perform reverse verification of the model output, ensuring the rationality and traceability of the intervention suggestions within the individual causal chain. The system also achieves continuous parameter optimization through a feedback loop driven by post-intervention positive indicators, forming a complete and reliable causal intervention chain.
[0044] To address the heterogeneity of causal structures among different body composition subtypes, a dedicated prior constraint is constructed based on body composition subtypes and embedded into an acyclic causal discovery algorithm, making the learned directed acyclic graph specific to the population. To address the difficulty in locating the root cause when causal structures are dynamically time-varying and multiple indicators exhibit concurrent anomalies, the overlap rate of the confidence interval with causal edge weights is used as the drift criterion. This is combined with topological ranking and effect size variation to locate the upstream root variable, ensuring that interventions target the source rather than downstream manifestations. To address the lack of causal verifiability in suggestions generated by large language models, the model output is converted inversely into an intervention quantifier for causal effect matching verification at the validation layer. If the verification fails, re-inference is triggered, ensuring the causal rationality of the final recommended solution from a mechanistic perspective.
[0045] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various equivalent changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for intervening in daily life behaviors based on causal inference and a large language model, characterized in that, Includes the following steps: S1. Collect user body composition indicators and multimodal life behavior time series data, embed body composition classification as a prior constraint into a causal discovery framework with acyclic constraints to solve the weighted adjacency matrix, extract time series causal edges to generate a baseline directed acyclic causal graph; S2, For each causal edge in the baseline causal graph, construct a baseline confidence interval based on the stable period data, and calculate the real-time confidence interval using a sliding time window. Determine whether the causal edge has drifted by comparing the overlap rate of the two intervals with a preset threshold, and summarize the set of drifted edges. S3: Perform topological sorting on the baseline causal graph to obtain the global causal sequence, extract the candidate root cause set based on the drift edge set, locate the root cause variable according to the topological position and the magnitude of change of causal effect, and traverse downstream along the causal graph to output the complete drift causal path. S4 generates candidate intervention actions based on root variables and drift paths, maps them to causal intervention econometrics, substitutes them into the structural equation model to calculate the expected causal effect on the target variable, and screens alternative intervention schemes. The alternative intervention actions, expected causal effects, drift causal structure descriptions, and user dynamic profiles are input into the big language model to perform hierarchical reasoning. After causal verification, intervention suggestions are output. S5 collects user behavior data after intervention, calculates the posterior confidence interval of the causal effect size between the root variable and the target variable, constructs a causal positive index as a reward signal, updates system parameters online based on the reward signal, and accumulates samples to trigger offline retraining.
2. The method for intervening in daily life behaviors based on causal inference and a large language model according to claim 1, characterized in that, The weighted adjacency matrix in S1 is solved using the formula... The constraints are ,in This represents the augmented feature matrix after standardization. Indicates the number of samples. Represents the weighted adjacency matrix. Represents the regularization coefficient. Denotes the Frobenius norm. Indicates the L-term. Represents the acyclic constraint function. Represents the matrix trace operation. Represents matrix exponentiation. This represents the Hadamard product. This represents the total number of behavioral feature dimensions.
3. The method for intervening in daily life behaviors based on causal inference and a large language model according to claim 1, characterized in that, The overlap rate of the two intervals in S2 is calculated using the formula. ,in Indicates the overlap rate. and These represent the upper and lower bounds of the baseline confidence interval, respectively. and These represent the upper and lower bounds of the real-time confidence interval, respectively. This indicates the operation of finding the maximum value. This indicates the minimum value operation.
4. The method for intervening in daily life behaviors based on causal inference and a large language model according to claim 1, characterized in that, The root dependent variable in S3 is located based on a topological sorting sequence. Magnitude of change in causal effect ,in Represents a global causal sequence. Indicates the first in the sequence One variable, This represents the total number of behavioral feature dimensions. Indicates from variable Pointer variable The magnitude of change in causal side effect quantity. This indicates the real-time weight of the causal edge after the drift occurs. This represents the baseline weight of the causal edge during the stable period. This represents absolute value operations.
5. The method for intervening in daily life behaviors based on causal inference and a large language model according to claim 1, characterized in that, The expected causal effect calculation in S4 uses the formula... ,in Represents the mathematical expectation. Indicates the target body component index variable, Indicates the root dependent variable Apply intervention to make it take the value The intercept term of the structural equation model is represented. Representing the root cause variable For target variable The causal effect coefficient, Represent the target variable The set of all parent node variables in the cause-effect graph. Represents any variable in the parent node set. Represents parent node variables For target variable The causal effect coefficient.
6. The method for intervening in life behaviors based on causal inference and a large language model according to claim 1, characterized in that, The causality positivity index in S5 uses the formula... ,in Indicates the causal homing rate. This represents the posterior confidence interval of the causal effect size between the root dependent variable and the target variable after intervention. This represents the baseline confidence interval during the stable period. This represents the confidence interval for the window interval when the drift occurs. The function representing the overlap rate calculation of two confidence intervals; reward signal. according to With preset threshold The comparison is more certain when hour ,when hour ,when hour ,in This represents the proportion coefficient that distinguishes between no improvement and increased instability. This indicates the threshold for determining the return to normal based on the differences in body composition classification.
7. The method for intervening in life behaviors based on causal inference and a large language model according to claim 1, characterized in that, S2 includes: Reuse the time series data during the stable period, adopt a block-based self-sampling strategy for each directed edge in the baseline causal graph, set the block length and perform multiple block resamplings with replacement on the stable period data, calculate the corresponding causal effect size for each sampling, and construct the baseline confidence interval by taking the specified quantile of the sampling results. Set the duration of the online drift detection window, slide the window samples forward daily, and use the same block bootstrap method to calculate the real-time confidence interval for the behavioral time series data within the latest continuous window duration. Calculate the overlap rate between the real-time confidence interval and the baseline confidence interval, and assign differentiated values to the overlap rate threshold based on the volume component classification; The overlap rate of each causal edge is compared with the corresponding threshold to determine the causal edge that has drifted, and all drifted edges are summarized to output the drifted edge set.
8. The method for intervening in life behaviors based on causal inference and a large language model according to claim 1, characterized in that, S3 includes: A topological sort is performed on the baseline directed acyclic causal graph to obtain a global causal sequence. Variables located upstream in the sequence are identified as root variables, and variables located downstream are identified as structural variables. The set of drift edges is read, and the source variables of all drift edges are extracted to generate a set of candidate root causes. The candidate root causes are sorted according to the topological sequence, and the upstream variable is selected as the root cause variable. If multiple candidate root causes are located at the same level, the magnitude of change of causal effect of each edge is compared, and the root cause with the largest magnitude of change is selected as the priority root cause. Starting with the root cause variable obtained from the location, traverse downstream along the baseline causal graph to output the complete drift causal path; then transfer the root cause variable obtained from the location and the drift causal path together to the intervention reasoning step.
9. A method for intervening in life behaviors based on causal inference and a large language model according to claim 1, characterized in that, S4 includes: Based on the root cause variable and the drift path, a set of candidate intervention actions is generated by retrieving a pre-set structured intervention action library. When there are enough historical intervention samples, intervention actions with higher historical execution rates are selected first. When there are insufficient historical intervention samples, initial candidate intervention actions are generated by enumerating health domain knowledge. Each candidate intervention action is mapped to a causal interference estimator and substituted into a structural equation model to solve for the expected causal effect of each candidate action on the target body component index. Pre-set numbers of items are then selected as candidate intervention schemes based on descending effect size. A dynamic user profile is constructed by integrating body component typing, behavioral guidelines, user basic attributes, and historical intervention response records. The candidate intervention actions, expected causal effects, drift causal structure descriptions, and the dynamic user profile are input into a large language model for hierarchical inference. After the large language model outputs intervention suggestions, a causal verification layer is built to convert the generated intervention suggestions back into causal interference estimators. Once the verification is successful, the intervention suggestions are pushed to the user.
10. A method for intervening in life behaviors based on causal inference and a large language model according to claim 1, characterized in that, S5 includes: After users implement intervention recommendations, we continuously collect multimodal behavioral time-series data and user intervention compliance information during the intervention implementation phase. We substitute the post-intervention behavioral data into the baseline causal graph structure and use a block-based self-service resampling process to calculate the posterior confidence intervals corresponding to the causal effect size between the root variable and the target variable. Construct a causal correction index, calculate the ratio of the overlap rate between the posterior confidence interval and the baseline confidence interval to the overlap rate of the window interval when the drift occurs, and determine the reward signal based on the comparison result between the correction index and the preset threshold. Based on the reward signal synchronization, online fine-tuning is performed on the parameters related to prior constraints and the prompt word template of the large language model. An online gradient descent update method is adopted and a fixed update step size is configured. After each round of intervention feedback is completed, parameter iterative optimization is performed. When the system accumulates a sufficient number of user intervention feedback samples, it triggers an offline retraining process. The user-specific baseline causal graph is globally reconstructed and updated with the overall historical intervention success rate as the optimization goal. The updated causal graph is then sent back to the drift detection step for closed-loop iteration.