Skip to content
DraconiticResearch
Search Sources API
194,216 studies31 sourcesUpdated 8 min ago
PreprintCC BY-NC-NDmedRxiv

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

  1. 1Faculty of Medicine of Monastir, University of Monastir, Monastir, Tunisia

Abstract

BackgroundIn 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.

ObjectiveTo 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.

MethodsStep 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).

ResultsOn 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.

ConclusionAn 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 persons 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.

Related

  1. Effects of Breakfasts with Different Carbohydrate Contents and Glycemic Index Values on Postprandial Subjective Satiety and Plasma Gut Hormone Concentrations in Healthy Adults: An Exploratory Secondary Analysis of an Acute Randomized Crossover Controlled-Feeding Study
    Qian Ma, Wenjing Liu, Mengmeng Zheng +3
    NutrientsPeer-reviewedCC BY 4.0NutritionCrossref
  2. Construction of a Standardized Time-Lapse Imaging Database and a Gradient Boosting Ensemble Framework for Integrating Zygote Morphokinetic Parameters with Conventional Embryo Assessment
    M. ZHAO, J. LIU, D. HAN +5
    medRxivPreprintPublic domainFull textObstetrics, gynaecology & paediatricsmedRxiv
  3. Gradient boosting models for gallstone disease classification: A comparative study using demographic and clinical data
    Kazi Sakib Hasan, Sumaiya Hossain Puspita
    PLOS OnePeer-reviewedCC BYFull textGeneral biologyGeneral mathematicsPLOSEurope PMCPMC
  4. Persistent atrial fibrillation in older adults : Comparison of seven models and development of a gradient boosting machine classifier in a single-center observational study
    Mierzhati Maimaiti, Alapate Abuduguli, Shenhong Liu +2
    MedicinePeer-reviewedCC BY-NCFull textGeneral medicineEurope PMCPMC
  5. Dual-layer edge intelligence for secure real-time medical IoT: a Zero-Trust sequential framework integrating soft-voting intrusion detection and Histogram Gradient Boosting
    Reema Shaheen, Adnan Shahid Khan, Irshad Ahmed Abbasi
    Frontiers in Public HealthPeer-reviewedCC BY 4.0Epidemiology & public healthCrossref
BibTeX
@misc{ali2026from,
  title = {{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}},
  author = {M. N. Bou Ali and N. Lassoued and B. Ben Amor and S. Nasr and M. A. Aouididi},
  howpublished = {medRxiv},
  year = {2026},
  month = oct,
  doi = {10.64898/2026.10.15.26365634},
  url = {https://www.medrxiv.org/content/10.64898/2026.10.15.26365634v1},
  note = {CC BY-NC-ND},
}
RIS
TY  - UNPB
TI  - 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
AU  - M. N. Bou Ali
AU  - N. Lassoued
AU  - B. Ben Amor
AU  - S. Nasr
AU  - M. A. Aouididi
PY  - 2026
DA  - 2026/10/15
PB  - medRxiv
DO  - 10.64898/2026.10.15.26365634
UR  - https://www.medrxiv.org/content/10.64898/2026.10.15.26365634v1
AB  - BackgroundIn 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.  ObjectiveTo 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.  MethodsStep 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).  ResultsOn 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.  ConclusionAn 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 persons 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.
ER  -