Personal health evaluation method based on lightweight large language model
User data is collected through smart bracelets and combined with prompt templates to form structured input instructions. Professional suggestions are generated using closed-source large language models. Through efficient parameter adjustment technology and competitive evaluation framework for multi-model adversarial verification, the model is optimized to provide personalized health suggestions, solving the problems of large hardware dependence of existing systems and insufficient professionalism of models, and realizing the provision of efficient personalized health guidance services on lightweight equipment.
Patent Information
- Application Number
- CN202510362710.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-26
- Publication Date
- 2025-04-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the process of practicalization, the existing personal health management system faces the problems of high hardware dependence and insufficient professionalism of the model, which leads to the inability to use in real time on ordinary smart devices and the degree of personalization of health suggestions is insufficient.
User data is continuously collected through smart bracelets, structured input instructions are formed in combination with prompt templates, professional suggestions are generated using closed-source large language models, and competitive evaluation frameworks for efficient parameter adjustment technology and multi-model adversarial verification are optimized to provide personalized health suggestions.
It has achieved low-cost deployment on lightweight equipment, and provided health guidance services comparable to professional medical consultants, which significantly improved the personalization and practical value of health advice.
Smart Images

Figure CN119889704A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of health assessment, and in particular relates to a personal health assessment method based on a lightweight large language model. Background Art
[0002] In the field of personal health management, artificial intelligence technology is gradually penetrating from professional medical scenarios to daily life, but existing technical solutions face significant bottlenecks in the process of practical application. The current mainstream systems generally rely on large-scale cloud-based language models to analyze user health data. Although such models can generate professional health advice, their operation requires expensive high-performance server support and is difficult to use in real time on daily devices such as mobile phones and smart watches. At the same time, small open source models suitable for local deployment are often unable to accurately combine users' real-time physiological data (such as sleep quality and heart rate changes) to give personalized advice due to their limited understanding capabilities, which greatly reduces the practical value of the advice.
[0003] Technology exploration in the industry is mainly carried out along two paths: some solutions try to directly optimize small models and improve their professional capabilities through training with a large amount of health knowledge data, but this method requires retraining more than 90% of the model parameters, which not only consumes a lot of computing resources, but also easily causes the model to "memorize by rote" and lose its ability to respond flexibly; other solutions use rule engine technology and pre-set fixed judgment logic such as "rest is recommended if the heart rate exceeds 100 beats / minute". Although this method can run quickly, it cannot handle the complex relationship between the user's sleep quality and exercise intensity, and it is even more difficult to adapt to individual differences. It is worth noting that the existing evaluation system mostly uses standard test questions to test the knowledge reserve of the model, but health advice often does not have a single correct answer. This evaluation method cannot truly reflect the practicality and user acceptance of the advice.
[0004] In response to these core contradictions, the present invention proposes an innovative lightweight solution. Through the smart bracelet, the user's sleep, heart rate and other data are continuously collected for 30 days, the original physiological signals are combined with the prompt template, and a structured input instruction is passed to the closed-source large model to obtain its output professional advice (such as "recommendation to reduce caffeine intake and increase midday meditation"), thereby constructing a training question-answer pair that accurately matches the personalized scene. By adopting efficient parameter adjustment technology, only the core decision-making module of the model is optimized in a targeted manner, while retaining its basic capabilities, the model learns to combine multi-dimensional health data to generate personalized advice. In order to break through the evaluation problem, the present invention introduces a competitive scoring mechanism, allowing the optimized model to "compete on the same stage" with multiple mainstream models, and the advanced AI referee automatically judges the rationality of the advice, and finally objectively measures the model improvement effect through a dynamic scoring system. This technical path not only avoids the hardware dependence of the cloud-based large model, but also overcomes the lack of professionalism of the traditional small model, making it possible for ordinary smart watches to provide health guidance services comparable to professional medical consultants. Summary of the invention
[0005] In view of the above problems existing in the prior art, the present invention proposes a personal health assessment method based on a lightweight large language model, which has a reasonable design, solves the shortcomings of the prior art, and has good effects.
[0006] A personal health assessment method based on a lightweight large language model includes the following steps: Step 1: Process the original multimodal data exported by the bracelet; Step 2: Use a preset static prompt word template to achieve standardized switching from raw data to natural language instructions; Step 3: Build a single-round dialogue pair by calling the interface of the closed-source large language model; Step 4: Use a random multi-round dialogue concatenation method to form training samples that simulate multi-round dialogues; Step 5: Use the open source large model fine-tuning tool Unsloth to inject a LoRA matrix with a rank of 16 into the attention mechanism layer of the open source model LLaMA3.1; Step 6: Build an adversarial test environment including 3 closed-source models and 6 open-source models for competitive dynamic evaluation. After the evaluation, the personal health recommendations output by the fine-tuned LLaMA3.1 model can be used as the final health evaluation results.
[0007] Furthermore, the step 1 is specifically as follows: for the minute-level heart rate and blood oxygen single-value time series exported by the bracelet throughout the day, the data format is "timestamp-physiological indicator value", and a rule engine is established to implement two-level data processing: first, the original data stream is scanned in segments, and through the dynamic health threshold judgment module, when the heart rate value exceeds the preset heart rate upper limit for 5 consecutive minutes, the period is marked as an abnormal event, and the complete timestamp-value pair is retained at the minute granularity; for regular health periods that are not marked as abnormal events, data aggregation is performed according to a 30-minute time window to generate compressed entries with a record format of "start time-end time, minimum heart rate value-maximum value".
[0008] Furthermore, the step 2 is specifically as follows: embedding the data processed in step 1 into the static prompt word template in a fixed format in sequence, so as to form a standardized input prompt word of the trinity of "role definition - data display - instruction generation".
[0009] Furthermore, the step 3 is specifically as follows: uploading the standardized input prompt words outputted from step 2 to the API interface of the closed-source large model, obtaining the response text generated by the large model, i.e., personal health advice for the user, binding the standardized input prompt words with the response text returned by the model, and forming a single-round dialogue pair with a "user instruction-model answer" structure.
[0010] Furthermore, the step 4 is specifically as follows: 3 to 5 sentences are randomly selected from the single-round dialogue pairs multiple times, separated by special separators. <round1>to <roundx>The two pairs are connected in series, and x is the number of selected single-round dialogue pairs to form training samples that simulate multi-round dialogues.
[0011] Furthermore, the step 5 is specifically as follows: Unsloth injects the LoRA matrix into the query, key, value and projection matrices of the FFN layer in parallel, and the mathematical expression is: ; The original weight matrix Frozen, new trainable parameters , and scaling factor Constitute a low-rank adaptation module, is a hyperparameter.
[0012] Furthermore, in step 6, the three closed-source models are Gemini 1.5 Flash, Claude 3.5Sonnet, and GPT-4o, and the six open-source models include fine-tuned LlaMA3.1, traditional LlaMA3.1, Deepseek-v2, Gemma2, Neural-chat, and Starling-Lm, which specifically include the following sub-steps: Step 6.1: Randomly extract user data from the test data set to generate standardized input prompt words; Step 6.2: Use each participating model to infer the standardized input prompt words in turn to obtain the response text of each participating model, that is, the personal health suggestions of each participating model to the user; Step 6.3: A third-party closed-source big model performs a blind test evaluation. The third-party closed-source big model is not a participating model. The evaluation index system includes medical rationality check, degree of personalization of health advice, and output text length; Step 6.4: Use the ELO rating algorithm to quantify the competitive ability of each participating model. The score update formula is: ; ; in, , are the current scores of participating models A and B respectively, represents the expected winning rate of the participating model A, is the actual score, based on the evaluation of the third-party closed-source large model. If model A wins, then =1, if the participating models A and B are equal, then =0.5, if model B wins, then =0, is the dynamic adjustment coefficient, The updated score of participating model A; After 200 rounds of competition, the fine-tuned LLaMA3.1 model's ELO score increased from the initial 1204 to 1520, moving up two places from the fifth place before fine-tuning, surpassing some closed-source models to rank third; Step 6.5: Adjust and optimize the hyperparameters in the fine-tuning tool based on the results of the integral update.
[0013] Beneficial technical effects brought by the present invention: In view of the high computing resource consumption caused by all-parameter fine-tuning in traditional solutions and the lack of an objective evaluation system for the performance of personalized health advice models, this paper proposes a parameter-efficient hierarchical low-rank adaptation mechanism. By freezing the original model parameters and optimizing the low-rank adaptation matrix in a targeted manner, the training process can significantly reduce its dependence on hardware resources and achieve low-cost deployment of lightweight equipment. At the same time, an innovative competitive evaluation framework based on multi-model adversarial verification is constructed. Through automated multi-faceted evaluation and a dynamic ELO points system, a quantifiable and reproducible model capability evaluation system is established, overcoming the subjectivity and consistency defects of traditional manual evaluation, and providing closed-loop verification support for the performance optimization of personalized health advice models. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 This is the process of implementing health assessment using a lightweight large language model in the present invention.
[0015] Figure 2 A schematic diagram of constructing a single-round dialogue pair in the present invention.
[0016] Figure 3 This is a flow chart of the random multi-round dialogue splicing method in the present invention.
[0017] Figure 4 This is a flow chart of competitive dynamic evaluation in the present invention.
[0018] Figure 5 This is a graph of the integration results in the present invention. DETAILED DESCRIPTION
[0019] The specific implementation of the present invention is further described below in conjunction with specific embodiments: A personal health assessment method based on a lightweight large language model, such as Figure 1 As shown, the following steps are included: Step 1: Process the original multimodal data exported by the bracelet; Step 2: Use preset static prompt words and templates to achieve standardized switching from raw data to natural language instructions; Step 3: Build a single-round dialogue pair by calling the interface of the closed-source large language model; Step 4: Use a random multi-round dialogue concatenation method to form training samples that simulate multi-round dialogues; Step 5: Use the open source large model fine-tuning tool Unsloth to inject a LoRA matrix with a rank of 16 into the attention mechanism layer of the open source model LLaMA3.1; Step 6: Build an adversarial test environment including 3 closed-source models and 6 open-source models for competitive dynamic evaluation. After the evaluation, the personal health recommendations output by the fine-tuned LLaMA3.1 model can be used as the final health evaluation results.
[0020] Step 1 is as follows: For the minute-level heart rate and blood oxygen single-value time series exported by the bracelet throughout the day, the data format is "timestamp-physiological indicator value", and a rule engine is established to implement two-level data processing: first, the original data stream is scanned in segments, and through the dynamic health threshold judgment module, when the heart rate value exceeds the preset heart rate upper limit for 5 consecutive minutes, the period is marked as an abnormal event, and the complete timestamp-value pair is retained at the minute granularity; for regular health periods that are not marked as abnormal events, data is aggregated according to a 30-minute time window to generate compressed entries with a record format of "start time-end time, heart rate minimum value-maximum value" (such as 10:00-10:30, heart rate 68-80).
[0021] Table 1 Example of collected data records
[0022] ;
[0023] Step 2: Embed the data processed in step 1 into the static prompt word template in a fixed format to form a standardized input prompt word of "role definition-data display-instruction generation". The prompt word is as follows: You are a senior health consultant who specializes in providing personalized health advice using wearable device data. You will get a user's physiological index data for one week, including heart rate and blood oxygen level range records every half hour and abnormal high heart rate data every minute. Please analyze this data carefully and combine your professional knowledge to provide comprehensive and personalized health advice to the user; December 31, 2024 10:30-11:00 Heart rate: 57-63 Blood oxygen: 96%-99%; December 31, 2024 11:00-11:30 Heart rate: 59-80 Blood oxygen: 93%; 2024-12-31 11:42 Heart rate: 123; 2024-12-31 11:41 Heart rate: 125; December 31, 2024 11:42 Heart rate: 126; … 2024-12-31 11:56 Heart rate: 124; December 31, 2024 11:57 Heart rate: 122; December 31, 2024 11:58 Heart rate: 120; December 31, 2024 12:00-12:30 Heart rate: 73-116 Blood oxygen: 95%-100%; Your goal is to identify possible health risks or areas for improvement based on this heart rate and blood oxygen data, and provide personalized health recommendations. These recommendations should cover, but are not limited to: daily activities, diet, stress management, exercise, and overall health habits. Your analysis should delve into data patterns, such as heart rate changes at specific times of the day, or differences in blood oxygen levels between different days, and infer possible lifestyle factors or health conditions.
[0024] The core of this step is to convert raw data into semantically rich, easy-to-understand structured text. The design of the template fully considers the characteristics of the natural language processing model to maximize the model's ability to understand and analyze health data, while using the semantic guidance of the template to convert discrete numerical sequences into natural language queries with clear task orientation.
[0025] Step 3 is as follows: upload the standardized input prompt words output from step 2 to the API interface of the closed-source large model (such as Gemini2.0 Pro), obtain the response text generated by the large model, that is, the user's personal health advice, bind the standardized input prompt words with the response text returned by the model, and form a single-round dialogue pair with a "user instruction-model answer" structure, such as Figure 2 shown.
[0026] Step 4 is as follows: To solve the problem of dialogue ability degradation caused by single-round fine-tuning, Figure 3 As shown in the figure, a random multi-round dialogue concatenation method is used to randomly select 3 to 5 dialogues from a single-round dialogue pair multiple times, and separate them with a special separator. <round1>to <roundx>The training samples of simulated multi-round dialogues are formed by concatenating, where x is the number of selected single-round dialogue pairs. For example, the first round of dialogue includes user A's health data analysis request and corresponding suggestions, and the second round randomly splices user B's health data analysis request and corresponding suggestions, and there is no logical correlation between the rounds. This design enhances its ability to recognize round markers and adapt to state reset by forcing the model to process multiple sets of independent dialogue contexts in a single batch training.
[0027] Step 5 is as follows: Unsloth injects the LoRA matrix with rank 16 into the query, key, value and projection matrices of the FFN layer in parallel. =16 represents the low-rank decomposition dimension, by constraining the trainable parameter matrix and By freezing the original model parameters and optimizing only the newly added adapter module, the training memory usage is reduced to 18% of full parameter fine-tuning.
[0028] The mathematical expression is: ; The original weight matrix Frozen, new trainable parameters , and scaling factor Constitute a low-rank adaptation module, is a hyperparameter.
[0029] At the training configuration level, Unsloth sets the unique parameters per_device_train_batch_size=2 (defines the batch size of a single device) and gradient_accumulation_steps=4 (the number of gradient accumulation steps) to form an equivalent global batch size of 8, and cooperates with the BF16 mixed precision training mode to reduce the calculation error of matrix multiplication to 63% of the FP16 mode. The training strategy adopts a two-stage progressive learning rate scheduling: the initial stage is 2e -4 The learning rate achieves rapid convergence and then switches to the cosine annealing strategy (minimum 1e -5 ) for fine-tuning, combined with the Unsloth optimized batch_size=2 and gradient_accumulation_steps=4 hybrid configuration, it only takes 3.2 hours to complete 60 steps of training in a single-card RTX 3090 environment.
[0030] In step 6, the three closed-source models are Gemini 1.5 Pro, Claude 3.5 Sonnet, and GPT-4o, and the six open-source models include fine-tuned LlaMA3.1 (Llama3.1-finetuned), traditional LlaMA3.1 (Llama3.1-finetuned), Deepseek-v2, Gemma2, Neural-chat, and Starling-Lm. Figure 4 As shown, it specifically includes the following sub-steps: Step 6.1: Randomly extract user data from the test data set to generate standardized input prompt words; Step 6.2: Use each participating model to infer the standardized input prompt words in turn to obtain the response text of each participating model, that is, the personal health suggestions of each participating model to the user; Step 6.3: A third-party closed-source big model performs a blind test evaluation. The third-party closed-source big model is not a participating model. The evaluation index system includes medical rationality check (such as "blood oxygen <90% must be recommended to see a doctor"), the degree of personalization of health advice, and the length of the output text; Step 6.4: Use the ELO rating algorithm to quantify the competitive ability of each participating model. The score update formula is: ; ; in, , are the current scores of participating models A and B respectively. represents the expected winning rate of the participating model A, is the actual score, based on the evaluation of the third-party closed-source large model. If model A wins, then =1, if the participating models A and B are equal, then =0.5, if model B wins, then =0, is the dynamic adjustment coefficient, The updated score of participating model A; After 200 rounds of competition, the fine-tuned LLaMA3.1 model's ELO score increased from the initial 1204 to 1520, rising two places from the fifth place before fine-tuning, surpassing some closed-source models and ranking third, such as Figure 5 shown.
[0031] Step 6.5: Adjust and optimize the hyperparameters in the fine-tuning tool based on the results of the integral update.
[0032] Experiments show that the ELO score of the fine-tuned LLaMA3.1 model is improved by 27%, surpassing some large closed-source models, verifying the effectiveness of the lightweight solution.
[0033] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the protection scope of the present invention.< / roundx> < / roundx>
Claims
1. A personal health assessment method based on a lightweight large language model, characterized in that: The following steps are involved: Step 1: Process the original multimodal data exported by the bracelet; Step 2: Use a preset static prompt word template to achieve standardized switching from raw data to natural language instructions; Step 3: Build a single-round dialogue pair by calling the interface of the closed-source large language model; Step 4: Use a random multi-round dialogue concatenation method to form training samples that simulate multi-round dialogues; Step 5: Use the open source large model fine-tuning tool Unsloth to inject a LoRA matrix with a rank of 16 into the attention mechanism layer of the open source model LLaMA3.1; Step 6: Build an adversarial test environment including 3 closed-source models and 6 open-source models for competitive dynamic evaluation. After the evaluation, the personal health recommendations output by the fine-tuned LLaMA3.1 model can be used as the final health evaluation results.
2. According to claim 1, a personal health assessment method based on a lightweight large language model is characterized in that: The step 1 is specifically as follows: for the minute-level heart rate and blood oxygen single-value time series exported by the wristband throughout the day, the data format is "timestamp-physiological indicator value", and a rule engine is established to implement two-level data processing: first, the original data stream is segmented and scanned, and through the dynamic health threshold judgment module, when the heart rate value exceeds the preset heart rate upper limit for 5 consecutive minutes, the period is marked as an abnormal event, and the complete timestamp-value pair is retained at the minute granularity; For regular healthy periods that are not marked as abnormal events, data is aggregated according to a 30-minute time window to generate compressed entries in the record format of "start time-end time, minimum heart rate-maximum heart rate".
3. A personal health assessment method based on a lightweight large language model according to claim 2, characterized in that: The step 2 is specifically as follows: embedding the data processed in step 1 into the static prompt word template in a fixed format in sequence, so as to form a standardized input prompt word of the trinity of "role definition - data display - instruction generation".
4. A personal health assessment method based on a lightweight large language model according to claim 3, characterized in that: The step 3 is specifically as follows: uploading the standardized input prompt words outputted from step 2 to the API interface of the closed-source large model, obtaining the response text generated by the large model, i.e., the personal health advice for the user, binding the standardized input prompt words with the response text returned by the model, and forming a single-round dialogue pair with a "user instruction-model answer" structure.
5. A personal health assessment method based on a lightweight large language model according to claim 4, characterized in that: The specific step 4 is: randomly select 3 to 5 sentences from a single round of dialogue pairs multiple times, and separate them by special separators. <round1>to <roundx> The two pairs are connected in series, and x is the number of selected single-round dialogue pairs to form training samples that simulate multi-round dialogues.< / roundx> 6. A personal health assessment method based on a lightweight large language model according to claim 5, characterized in that: The specific step 5 is: Unsloth injects the LoRA matrix into the query, key, value and FFN layer projection matrices in parallel. The mathematical expression is: ; The original weight matrix Frozen, new trainable parameters , and scaling factor Constitute a low-rank adaptation module, is a hyperparameter.
7. A personal health assessment method based on a lightweight large language model according to claim 6, characterized in that: In step 6, the three closed-source models are Gemini 1.5 Flash, Claude 3.5 Sonnet, and GPT-4o, and the six open-source models include fine-tuned LlaMA3.1, traditional LlaMA3.1, Deepseek-v2, Gemma2, Neural-chat, and Starling-Lm, which specifically include the following sub-steps: Step 6.1: Randomly extract user data from the test data set to generate standardized input prompt words; Step 6.2: Use each participating model to infer the standardized input prompt words in turn to obtain the response text of each participating model, that is, the personal health suggestions of each participating model to the user; Step 6.3: A third-party closed-source big model performs a blind test evaluation. The third-party closed-source big model is not a participating model. The evaluation index system includes medical rationality check, degree of personalization of health advice, and output text length; Step 6.4: Use the ELO rating algorithm to quantify the competitive ability of each participating model. The score update formula is: ; ; in, , are the current scores of participating models A and B respectively. represents the expected winning rate of the participating model A, is the actual score, based on the evaluation of the third-party closed-source large model. If model A wins, then =1, if the participating models A and B are equal, then =0.5, if model B wins, then =0, is the dynamic adjustment coefficient, The updated score of participating model A; After 200 rounds of competition, the fine-tuned LLaMA3.1 model's ELO score increased from the initial 1204 to 1520, moving up two places from the fifth place before fine-tuning, surpassing some closed-source models to rank third; Step 6.5: Adjust and optimize the hyperparameters in the fine-tuning tool based on the results of the integral update.
Citation Information
Patent Citations
Intelligent strategy evaluation method for confrontation game
CN116245388A
Large language model shaping method for deeply simulating human characters
CN118113848A
Health monitoring method and device, wearable equipment and storage medium
CN118402758A
AI health management system based on large model
CN118606984A
Automatic input vital sign detection method and system
CN119324065A
Cited By
Intelligent closestool with human health monitoring analysis and early warning functions
CN120078385A