From meal text to carbohydrate to postprandial glucose rise: QLoRA fine-tuning of the Qwen3-4B language model and gradient-boosting prediction in type 2 diabetes
Bou Ali, M. N.; Lassoued, N.; Ben Amor, B.; Nasr, S.; Aouididi, M. A.
Show abstract
Background. In people with type 2 diabetes (T2D), postprandial glucose weighs on glycaemic control, and carbohydrate counting is difficult. Patients can describe their meal but rarely quantify it. Objective. To assess (1) whether a small open large language model (LLM), fine-tuned on public data, estimates the carbohydrate content of a meal described in words, and (2) what this carbohydrate adds to the prediction of the postprandial glucose rise in two public cohorts. Methods. Step 1: the Qwen3-4B LLM was fine-tuned with QLoRA on Nutrition5k dishes and compared with an automatically matched USDA food composition table and with Qwen3-4B and Qwen3-8B used without training, on test dishes (internal control) and on 100 real meals of ShanghaiT2DM patients, whose reference carbohydrate was computed from the recorded quantities. Step 2: the maximum glucose rise between 0 and 120 minutes ({Delta}Gmax) was predicted by personalised gradient boosting (M2), compared with a spline linear regression and with the Chronos-2 foundation model, using only information available at meal start and person-level cross-validation, in ShanghaiT2DM (people with T2D recruited in two Shanghai hospitals; carbohydrate estimated by the LLM) and CGMacros (free-living adults in Santa Barbara, California; carbohydrate entered in the dataset, no text). Step 3: the model was transferred between datasets. 95% confidence intervals (CI) were obtained by cluster BCa bootstrap (2,000 resamples). Results. On the 100 real meals, the carbohydrate mean absolute error (MAE) of the fine-tuned model was 12.2 [9.9, 15.2] g, almost half that of the table (22.6 g; paired difference -10.5 [-16.8, -6.0] g) and nearly a third of that of the same model without fine-tuning (34.3 g), with a bias of -10.3 g; on test dishes it was 2.2 [2.0, 2.5] g. Personalised gradient boosting (M2) reached a correlation between predicted and observed rises of r = 0.63 [0.55, 0.69] in CGMacros (1,286 meals, 45 adults) and 0.49 [0.42, 0.54] in ShanghaiT2DM (2,339 meals, 99 people with T2D), about twice the linear reference (r = 0.32 and 0.23); for a rise above 50 mg/dL, its area under the ROC curve (AUROC) was 0.80 and 0.74, versus 0.64 and 0.68 with pre-meal glucose alone. Adding carbohydrate to pre-meal glucose changed r by 0.095 [0.068, 0.128] in CGMacros and by 0.004 [-0.010, 0.017] in ShanghaiT2DM; difference between datasets: 0.091 [0.060, 0.126]. Applied from one dataset to the other, the model lost correlation ({Delta}r = -0.11 [-0.17, -0.05] towards ShanghaiT2DM and -0.12 [-0.19, -0.04] towards CGMacros). The full "text [->] LLM [->] glucose" chain was evaluated in ShanghaiT2DM only. Conclusion. An open 4-billion-parameter LLM, fine-tuned with QLoRA on public data and usable offline, almost halves the error of carbohydrate counting for real meals described in words compared with an automatically matched table, with an underestimation of large meals. Personalised gradient boosting, based on pre-meal glucose and the person's usual response, doubles the correlation of a linear reference for predicting the glucose rise in both cohorts. Carbohydrate improved this prediction in CGMacros but not in ShanghaiT2DM; the two datasets differ in many respects, and the cause of this gap is not established.
Matching journals
The top 7 journals account for 50% of the predicted probability mass.
Similar papers in this journal
- Discovery of biomarkers for glycaemic deterioration before and after the onset of type 2 diabetes: an overview of the data from the epidemiological studies within the IMI DIRECT Consortium 93%
- Phenotype-based targeted treatment of SGLT2 inhibitors and GLP-1 receptor agonists in type 2 diabetes 91%
- Circulating metabolites and the risk of type 2 diabetes: a prospective study of 11,896 young adults from four Finnish cohorts 91%
Similar papers in this journal
- Hepatic and abdominal adiposity in type 2 diabetes as assessed with machine learning on CT scans 90%
- A Microbiome-targeting Fiber-enriched Nutritional Formula is Well Tolerated and Improves Quality of Life and Hemoglobin A1c in Type 2 Diabetes: A Double-Blind, Randomized, Placebo-Controlled Trial 90%
- Heterogeneity of Treatment Effects Across Nine Glucose-Lowering Drug Classes in Type 2 Diabetes: Extension of the LEGEND-T2DM Network Study 90%
Similar papers in this journal
- Precision Diagnostic Approach to Predict 5-year Risk for Microvascular Complications in Type 1 Diabetes 91%
- 1 H-NMR metabolomics-based surrogates to impute common clinical risk factors and endpoints 90%
- Daily variation in blood glucose levels during continuous enteral nutrition in patients on the Intensive Care Unit: a retrospective observational study 89%
Similar papers in this journal
Similar papers in this journal
- Decoding the hallmarks of GLP-1RA weight-loss super responders 92%
- Weight trajectories after last Tirzepatide or Semaglutide prescription across a federated health network 90%
- Study Research Protocol for Phenome India-CSIR Health Cohort Knowledgebase (PI-CHeCK): A Prospective multi-modal follow-up study on a nationwide employee cohort. 89%
"Similar papers" are the closest papers from that journal in the model's embedding space. They show what the match is built on, but the ranking comes mostly from a classifier over the whole training set, not from these examples alone.