Introduction

The prevalence of obesity has increased enormously over the last decades. Over 1.8 billion people lived with overweight or obesity in 2017 (WHO factsheet). Obesity is associated with various diseases and metabolic problems such as type 2 diabetes (T2DM), dyslipidemia, cardiovascular diseases, and cancer1,2.

Treating obesity is extremely difficult. While diet-induced weight loss strategies lead to modest results, bariatric surgery is the most effective treatment of obesity, leading to improved glucose tolerance already within days3,4. Roux-en-Y gastric bypass (RYGB) has been the gold standard in bariatric surgery. One-Anastomosis gastric bypass (OAGB) emerged as a potentially more beneficial procedure for the resolution of T2DM5,6, but recent randomized controlled trials have challenged this7,8,9. Additionally, individual metabolic phenotypes of participants undergoing bariatric surgery, such as differential glucose response between sexes10, have resulted in the need for understanding and modeling in detail the glycemic responses in different patient cohorts before and after surgery.

Conventional methods for assessing glucose responses after the oral glucose tolerance test (OGTT) and the mixed meal test (MMT) have relied on averaging the means of patient responses for each individual separately. Previously used methods in assessing the results of these tests, therefore, yield a robust estimation of blood glucose regulation but lack detailed characteristics of the overall blood glucose/insulin response at the population level and neglect individual differences. Additionally, OGTT is sparsely sampled, and individual estimates may be missing from the available data. Artificial intelligence techniques to better understand blood glucose regulation have emerged in recent years11. For example, the Eindhoven Diabetes Education Simulator (E-DES) model has been successfully used for OGTT to develop personalized models of glucose and insulin sensitivity and to explore the heterogeneity in the responses12. In another study, methods quantifying glucose fluxes between tissues using tracers have been applied to create predictive models of glucose-insulin interactions in MMT analyses13. Zeevi et al.14 developed a machine-learning algorithm integrating blood parameters, dietary habits, anthropometrics, physical activity, and gut microbiota to estimate the glucose and insulin responses accurately. A Gaussian process has been previously used in modeling OGTT responses in participants with and without cystic fibrosis to provide measures of beta-cell function with quantified uncertainty15.

In this study, we developed hierarchical multi-output Gaussian process (HMOGP) regression, which is the combination of hierarchical Gaussian process (HGP) and multi-output Gaussian process (MOGP). The hierarchical Gaussian process (HGP) is beneficial when part of the data reveals different characteristics, such as the considerable inter-individual variability usually observed in postprandial glucose and insulin responses16. On the other hand, the multi-output Gaussian process (MOGP) is able to deal with multiple correlated outputs (such as glucose and insulin dynamics) and to provide more accurate predictions than simply modeling these outputs separately17,18,19. Similar techniques to HMOGP have been successfully applied before in different domains such as anomaly detection20, multi-task learning21, and mobile cellular network analysis22, performing better than MOGP and GP. We expanded these techniques to the medical domain in OGTT and MMT responses with necessary adaptations. HMOGP allows us (1) to model the insulin and glucose response together via multi-output (2) while considering the individual-level differences through a hierarchical structure. It also (3) quantifies uncertainty in predictions, making it suitable for datasets with noise or missing values, and (4) can model non-linearities and complex temporal dynamics in postprandial responses, providing more accurate predictions than simpler models23. Here, we apply a hierarchical multi-output Gaussian process (HMOGP) regression model to analyze and characterize postprandial glucose and insulin dynamics following two types of bariatric surgery. We use data from both oral glucose tolerance tests (OGTT) and mixed meal tests (MMT) to compare Roux-en-Y gastric bypass (RYGB) and One-Anastomosis gastric bypass (OAGB). Our findings reveal that while both procedures improve metabolic responses, RYGB induces a more pronounced glucose and insulin response than OAGB. We also identify distinct metabolic patterns between sexes and demonstrate that our computational approach provides detailed, personalized insights into post-surgical outcomes, which can lead to new knowledge in personalized metabolic interventions.

Methods

The primary clinical outcomes of this randomized clinical trial (NCT02882685), which compares Roux-en-Y and One-Anastomosis gastric bypass, have been previously published in Heinonen et al.9, Saarinen et al.24. This manuscript presents secondary analyses of the detailed postprandial glucose and insulin dynamics from the trial data. These specific computational modeling analyses were not prespecified in the original trial protocol.

Subjects

We included participants with obesity (n = 44, aged 46.6 years, with 14 men and 30 women, 26 participants with obesity, 18 participants with obesity and T2DM, matched for age and diabetes status between the operation types). Participants were examined before and at 6th and 12th months after bariatric surgery with either Roux-en-Y gastric bypass (RYGB; n = 24, 8 men, 16 women, n = 9 with T2DM) or One-Anastomosis gastric bypass (OAGB; n = 20, 6 men, 14 women, n = 9 with T2DM). 33% of men vs. 43% of women had T2DM. The subjects were recruited from Helsinki University Hospital through the Department of Gastrointestinal Surgery. The full randomized clinical trial is registered at clinicaltrials.gov with no. NCT02882685 and the randomization and selection process of the participants and study dropouts are described in detail in Saarinen et al.24 and Heinonen et al.9. All participants from Helsinki University Hospital with OGTT data available were included in the current study. No data or participants were removed from the analysis. Written informed consent was obtained from all participants. The study protocol was designed and performed according to the principles of the Helsinki Declaration and approved by the Ethical Committee of the Helsinki University Central Hospital.

Bariatric surgery

In RYGB, the gastric pouch was created with one horizontal 45 mm and two vertical 60 mm staplers. The length of the biliary limb was 80 cm, and that of the alimentary limb was 130 cm. In OAGB, a tubular gastric pouch was created using 60 mm staplers along a 38Fr bougie starting at the crow’s foot with a horizontal 45 mm stapler and the omega loop being 210 cm long. The length of the bypasses was standardized between the procedures to allow for equal comparison. A 210 cm biliopancreatic limb in OAGB and 80 cm biliopancreatic and 130 cm alimentary limbs in RYGB were chosen to obtain equally long bypassed intestines in both groups24.

Clinical examinations and body composition

Weight and height were measured after an overnight fast in light clothing. Whole-body composition was measured by Dual-energy X-ray absorptiometry (DEXA) using a Lunar Prodigy whole-body scanner (GE Medical Systems, Madison, WI).

Analytical blood samples

Fasting laboratory tests, including HbA1c and plasma lipids, were performed as described by Heinonen et al.25.

Mixed meal test (MMT) and oral glucose tolerance test (OGTT)

Glucose metabolism was measured after an overnight fast with a 3-hour oral glucose tolerance test (OGTT, 75 g of glucose), with time points 0 (before the ingestion of the glucose drink) and post-glucose samples at 30, 60, 120, and 180 min. We additionally performed a 6-hour Mixed Meal Test (MMT) on a separate day, where a fasting blood sample was collected before ingesting the liquid meal of 2620 kJ (627 kcal) with a balanced distribution of fat (24 g), carbohydrates (76 g) and protein (24 g) (Resource® 2.5 Compact, Nestle Health Science), with post-meal samples at 15, 30, 60, 120, 180, 240 and 360 min for measuring glucose and insulin.

Data features

Each patient underwent both OGTT and MMT tests across three different visits: once preoperatively and then at the 6th and 12th months post-operatively. Six participants missed the baseline OGTT visit, while 10 and 6 missed the 6th and 12th month visits, respectively. In MMT, 4 and 5 participants missed the 6th and 12th month visits, respectively. Additionally, 3% of the overall data was missing due to vomiting or nausea, which interrupted the test.

Statistical method and reproducibility

Blood glucose and insulin evolve as a function of time. Here, we model them using a Gaussian process, which is a continuous stochastic process and can be considered a probability distribution over functions23,26. The standard Gaussian process regression is defined as:

$${{{\boldsymbol{y}}}} \sim {{{\mathcal{N}}}}\left(f(t),\sigma I\right),$$
(1)

where \({{{\boldsymbol{y}}}}\in {{\mathbb{R}}}^{T}\) are the observation points, t {1, …, T} the input locations, and σ the measurement error. The function f(t) is defined as the Gaussian process \(f(t) \sim {{{\mathcal{GP}}}}(0,{{{\bf{K}}}})\) with kernel matrix K. However, applying this approach directly to our problem is not straightforward. First, we know that glucose and insulin responses are strongly correlated, and applying Gaussian process regression on them separately would miss this correlation. Therefore, we propose to use Multi-Output Gaussian Process regression17,18,19, which is able to calculate the cross-covariance between functions and is the proper choice for modeling insulin and glucose together. If we define \({{{\boldsymbol{f}}}}=[{f}_{{{{\rm{glucose}}}}},{f}_{{{{\rm{insulin}}}}}]\):

$${f}_{{{{\rm{glucose}}}}}(t)={{{{\bf{L}}}}}_{11}\,{\hat{f}}_{{{{\rm{glucose}}}}}(t)$$
(2)
$${f}_{{{{\rm{insulin}}}}}(t)={{{{\bf{L}}}}}_{21}\,{\hat{f}}_{{{{\rm{glucose}}}}}(t)+{{{{\bf{L}}}}}_{22}\,{\hat{f}}_{{{{\rm{insulin}}}}}(t)$$
(3)

where \({\hat{f}}_{{{{\rm{glucose}}}}},{\hat{f}}_{{{{\rm{insulin}}}}}\in {{\mathbb{R}}}^{T}\) are independent GPs and L is the Cholesky factor matrix of the corresponding correlation matrix C, then \({{{\boldsymbol{f}}}}\in {{\mathbb{R}}}^{T\times D}\), where D is the output dimension (glucose, insulin), has the multi-output GP distribution. However, the challenge of the data is not limited to the output correlation. The second issue is that individuals have slightly different blood glucose and insulin responses. Hierarchical Gaussian process regression modeling can solve this issue by learning the population average response curve and individual deviations from the average response separately16. Let fn(t) denote the response curve for a single patient, f population(t) the average response curve across all participants, and \({{{{\boldsymbol{f}}}}}_{n}^{{{{\rm{patient}}}}}(t)\) the deviation of the patient from the average response. Then, hierarchical GP can be represented as:

$${{{{\boldsymbol{f}}}}}_{n}(t)={{{{\boldsymbol{f}}}}}^{{{{\rm{population}}}}}(t)+{{{{\boldsymbol{f}}}}}_{n}^{{{{\rm{patient}}}}}(t)$$
(4)

where \({{{{\boldsymbol{f}}}}}^{{{{\rm{population}}}}},{{{{\boldsymbol{f}}}}}_{n}^{{{{\rm{patient}}}}}\in {{\mathbb{R}}}^{T\times D}\) have multi-output Gaussian process distributions. We apply the same hierarchical approach to model the constant terms for fasting glucose and insulin, as follows:

$${{{{\boldsymbol{\mu }}}}}_{n}={{{{\boldsymbol{\mu }}}}}^{{{{\rm{population}}}}}+{{{{\boldsymbol{\mu }}}}}_{n}^{{{{\rm{patient}}}}}$$
(5)

where μn is fasting glucose and insulin for a single patient, μpopulation corresponds to the normally distributed population average of fasting glucose and insulin, and \({{{{\boldsymbol{\mu }}}}}_{n}^{{{{\rm{patient}}}}}\) denotes the normally distributed individual deviation from the population average.

Overall, we modeled the data using the Hierarchical Multi-Output Gaussian process (HMOGP), where hierarchy allows us to consider the deviations of individual responses, and multi-output models the correlation of insulin and glucose response. Let the whole data be denoted by \({{{\boldsymbol{y}}}}\in {{\mathbb{R}}}^{N\times T\times D}\), where N is the total number of participants, T is the number of time points, and D = 2 refers to the two possible outputs (glucose, insulin). If we index the patient by n, time by t, and output by d, the blood glucose and insulin level yn,t of patient n at time t can be represented as

$${{{{\boldsymbol{y}}}}}_{n,t} \sim {{{\mathcal{N}}}}\left(\,{{{{\boldsymbol{f}}}}}_{n}(t),\Sigma \right),$$
(6)

where Σ is the diagonal measurement error matrix, and the latent function fn is formulated as

$${{{{\boldsymbol{f}}}}}_{n}(t)={{{{\boldsymbol{\mu }}}}}^{{{{\rm{population}}}}}+{{{{\boldsymbol{\mu }}}}}_{n}^{{{{\rm{patient}}}}}+{{{{\boldsymbol{f}}}}}^{{{{\rm{population}}}}}(t)+{{{{\boldsymbol{f}}}}}_{n}^{{{{\rm{patient}}}}}(t).$$
(7)

We applied this model separately to the different visits (Baseline, 6th month, 12th month) and tests (OGTT, MMT). The only shared parameter across these models was the measurement error. For comparisons by operation, sex, and T2DM, we divided the dataset accordingly and modeled them separately. Further details of the model parameters and priors can be found in Supplementary Note.

Stan software27 was used to draw samples from the posterior distributions using the Markov Chain Monte Carlo inference. We used posterior samples to calculate Bayesian credible intervals (CI) and p-values as described in Gelman et al.28. Furthermore, we evaluated four metrics to investigate the characteristics of the postprandial glucose and insulin responses: peak value (PV), time-normalized area under the curve (AUC), peaking time (PT), and time in the risk zone (TiH; Hyperglycemia for glucose  >7.0 mmol/l and Hyperinsulinemia for insulin  >50 mU/l). These metrics are illustrated in Fig. 1. In the clinical analyses, non-normally distributed variables were log10-transformed before the parametric analyses. Differences at baseline between the groups were analyzed by Student’s t-tests and between visits with generalized linear mixed modeling adjusting for sex, T2DM, and operation type (Stata Statistical software ver. 7.0). These results are presented as means and 95% confidence intervals (CI).

Fig. 1: Definition of the metrics evaluated in the experiments.
Fig. 1: Definition of the metrics evaluated in the experiments.
Full size image

Peaking time (PT) and time in the risk zone (TiH; hyperglycemia for glucose > 7.0 mmol/l and hyperinsulinemia for insulin > 50 mU/l) are represented in minutes, and peak value (PV) and time-normalized area under the curve (AUC) are represented in mmol/l for glucose and mU/l for insulin.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Results

Throughout the manuscript, we investigated the glucose and insulin responses of all participants following an oral glucose tolerance test (OGTT) and a mixed meal test (MMT) over the entire dataset and in different subgroups divided by operation, sex, and T2DM using hierarchical multi-output Gaussian process (HMOGP) regression, which is suitable for longitudinal data. In MMT, 76 g of glucose was combined with protein and fats, while OGTT had only 75 g of glucose. Supplementary Fig. 1 and Supplementary Fig.2 show HMOGP predictions by individuals, which validate the model fit for different persons. Note that Supplementary Figs. 1 and 2 contain only the participants with the complete set of observations while the model was fitted using all the participants.

Glucose and insulin responses sharpen post-surgery in OGTT and MMT

From baseline to the 12th month of post-surgery, the glucose-insulin response improved in both tests (Fig. 2). During OGTT, AUCs of glucose and insulin concentrations substantially decreased from baseline to 6th and 12th months (Supplementary Table 3). Similarly, PVs of both glucose and insulin were reduced considerably from baseline to the 12th month (Supplementary Table 2), and PT at the 12th month occurred 12 minutes earlier for glucose and 11 minutes earlier for insulin compared to baseline (Supplementary Table 1). TiH for glucose was reduced by 53 min during weight loss, already bringing about large metabolic benefits (Supplementary Table 4). Overall, OGTT demonstrated a sharpened and markedly earlier glucose and insulin response with lower peak values following bariatric surgery (Fig. 2).

Fig. 2: Average glucose and insulin responses in oral glucose tolerance test (OGTT) and mixed meal test (MMT) over time.
Fig. 2: Average glucose and insulin responses in oral glucose tolerance test (OGTT) and mixed meal test (MMT) over time.
Full size image

This figure compares the model-predicted average glucose and insulin responses preoperatively (Preop.) at Baseline and post-operatively (Postop.) at the 6th and 12th month visits. It shows how metabolic responses to an oral glucose tolerance test (OGTT) and a mixed meal test (MMT) change over the 12-month period following surgery. Shaded areas represent 95% confidence intervals (CI) derived from n = 1000 simulation samples, which indicate the statistical certainty of the predicted average response curves.

In MMT, AUCs of both glucose and insulin showed a substantial reduction from baseline to the 12th month (Supplementary Table 3). Unlike in OGTT, PVs of glucose and insulin markedly increased over 12 months (Supplementary Table 2). PT occurred 48 minutes and 11 minutes earlier for glucose and insulin, respectively, from baseline to the 12th month (Supplementary Table 1). Additionally, there was a total reduction of 83 minutes in TiH for glucose from baseline to the 12th month (Supplementary Table 4). These findings indicate a sharper and more pronounced glucose-insulin response, with notably higher peak values and earlier peak times after bariatric surgery in MMT (Fig. 2).

Higher postprandial glucose-insulin response in MMT vs. OGTT after bariatric surgery

OGTT and MMT evaluate participants’ metabolic status through differential ingestion of macronutrients between the tests. To elucidate the differences between the tests before and after bariatric surgery, we next analyzed the average postprandial response in glucose and insulin, comparing MMT and OGTT by including similar follow-up times of 180 minutes in both tests (Fig. 3). PVs of glucose and insulin were higher after OGTT than MMT at baseline, but other metrics did not differ considerably at baseline (Supplementary Tables 1, 2, 3, 4). Post-operatively at the 6th and 12th months, glucose and insulin responses (AUC, PV, and PT) were all considerably enhanced in MMT compared with OGTT (Supplementary Tables 1, 2, 3, 4). TiH for glucose did not differ between the tests during weight loss. While both tests are performed in the same individuals and on the following days, these differences could be attributed to differential absorption of glucose in combination with other macronutrients in MMT vs. OGTT post-operatively and to postprandially enhanced insulin stimulus originating from proteins and fats included in MMT.

Fig. 3: Comparison of average preoperative (Preop.) and postoperative (Postop.) responses in oral glucose tolerance test (OGTT) vs. mixed meal test (MMT).
Fig. 3: Comparison of average preoperative (Preop.) and postoperative (Postop.) responses in oral glucose tolerance test (OGTT) vs. mixed meal test (MMT).
Full size image

This figure directly contrasts the model-predicted average glucose and insulin responses between the oral glucose tolerance test (OGTT) and the mixed meal test (MMT) at each study visit. This comparison highlights how the body’s glucose and insulin regulation differs when challenged with glucose alone versus a more complex mixed meal. Shaded areas represent 95% confidence intervals (CI) derived from n = 1000 simulation samples, which indicate the statistical certainty of the predicted average response curves.

Glucose-insulin response is higher and longer after RYGB than OAGB

To shed light on the potential differential responses between two types of bariatric surgery, we modeled RYGB (n = 24) and OAGB (n = 20) groups separately. Figure 4 and Fig. 5 show population comparison for OGTT and MMT tests, respectively. In the OGTT, the RYGB and OAGB groups had comparable glucose and insulin responses at baseline. The RYGB group showed a trend towards a larger AUC of glucose compared to the OAGB group (p = 0.09) at the 12th month and had a substantially larger AUC of insulin at the 6th month (Supplementary Table 3). PV of glucose for the RYGB group was higher than the OAGB group at the 12th month (10.0 mmol/l vs. 7.8 mmol/l). For insulin, the RYGB group had a higher PV at the 6th month and a trend towards it at the 12th month (p = 0.062, Supplementary Table 2). PTs showed no difference between operations (Supplementary Table 1). TiH for glucose was longer in the RYGB vs. the OAGB group at the 12th month (70 min vs. 47 min), but this difference was nearly notable already at baseline (125 min vs. 105 min, p = 0.088, Supplementary Table 4). During the entire weight-loss period, the mean TiH reduction of glucose was similar between RYGB and OAGB (55 min vs. 58 min) (Fig. 6).

Fig. 4: Oral glucose tolerance test (OGTT) responses by bariatric surgery type.
Fig. 4: Oral glucose tolerance test (OGTT) responses by bariatric surgery type.
Full size image

This figure compares the average glucose and insulin responses during an oral glucose tolerance test (OGTT) for participants who underwent Roux-en-Y gastric bypass (RYGB) versus those with One-Anastomosis gastric bypass (OAGB). It isolates the responses to the glucose intake only to show the specific metabolic differences between the two surgical procedures. Shaded areas represent 95% confidence intervals (CI) derived from n = 1000 simulation samples, which indicate the statistical certainty of the predicted average response curves.

Fig. 5: Mixed meal test (MMT) responses by bariatric surgery type.
Fig. 5: Mixed meal test (MMT) responses by bariatric surgery type.
Full size image

This figure compares the average glucose and insulin responses during a mixed meal test (MMT) for participants who underwent Roux-en-Y gastric bypass (RYGB) versus those with One-Anastomosis gastric bypass (OAGB). The figure highlights how the two surgical procedures affect the metabolic response to a mixed meal, a more complex physiological challenge than glucose alone. Shaded areas represent 95% confidence intervals (CI) derived from n = 1000 simulation samples, which indicate the statistical certainty of the predicted average response curves.

Fig. 6: Comparison of metabolic metrics by Roux-en-Y gastric bypass (RYGB) and One-Anastomosis gastric bypass (OAGB) over oral glucose tolerance test (OGTT) and mixed meal test (MMT).
Fig. 6: Comparison of metabolic metrics by Roux-en-Y gastric bypass (RYGB) and One-Anastomosis gastric bypass (OAGB) over oral glucose tolerance test (OGTT) and mixed meal test (MMT).
Full size image

This figure presents a box-plot comparison of each metabolic metric (peaking time (PT), peak value (PV), area under the curve (AUC), and time in the risk zone (TiH)) derived from n = 1000 simulation samples. See Supplementary Tables 1, 2, 3, 4 for the 95 % CIs and p-values.

In MMT, the RYGB group had similar PV of glucose but slightly higher PV of insulin than the OAGB group at baseline (Supplementary Table 2). During weight loss, the enhanced glucose and insulin responses in RYGB vs. OAGB were pronounced, with notably higher PVs (Supplementary Table 2) and AUCs (Supplementary Table 3) of both glucose and insulin at 6th and 12th months. PTs of glucose and insulin were similar between the groups at all visits (Supplementary Table 1). Interestingly, the RYGB group experienced more TiH for glucose at the 6th month (83 min vs. 53 min) and a trend towards it at the 12th month (69 min vs. 54 min, p = 0.054) compared with the OAGB group, despite similar baseline values between the groups (Supplementary Table 4). This may be partly due to the higher PV of glucose observed in RYGB. Over the 12 months, the reduction in TiH for glucose was 64 minutes for RYGB and 82 minutes for OAGB.

Overall, RYGB surgery induced a more pronounced glucose and insulin response in both tests, particularly in MMT, compared with OAGB, suggesting clinical differences between the procedures that can be taken into account in operation selection. Additionally, the pronounced PV and AUC in the RYGB group may drive the differences between MMT and OGTT in the postprandial response after surgery.

Higher postprandial glucose but not insulin response in men vs. women

Next, to account for other metabolic subgroups included in our cohort, we modeled women (n = 30) and men (n = 14) as different groups. Supplementary Figs. 4, 5, 6 show population comparison for OGTT and MMT tests, respectively. In OGTT, men exhibited a higher AUC of insulin and higher PVs of glucose and insulin compared to women at baseline Supplementary Table 3). Men had consistently higher postprandial PV of glucose response at all visits (Supplementary Table 2). At the 12th month, men had a higher AUC of glucose (Supplementary Table 3), later PTs for both glucose and insulin (Supplementary Table 1), and longer TiH for glucose with a smaller reduction in hyperglycemic time compared with women (31 min vs. 62 min) from baseline to 12th month (Supplementary Table 4).

In MMT, men and women showed similar baseline characteristics (Supplementary Fig. 5). Men exhibited higher AUCs of glucose and insulin at the 6th month (Supplementary Table 3) along with higher PV of glucose at the 6th and 12th months (Supplementary Table 2) compared with women. At the 6th month, the PTs of glucose and insulin occurred later with men (Supplementary Table 1), and men also had longer TiH for glucose. However, the sexes had similar improvement in TiH during the weight loss (Supplementary Table 4).

Higher postprandial glucose but lower insulin response in T2DM vs. non-T2DM

We additionally evaluated the postprandial glucose and insulin responses between persons with T2DM (n = 18) separately from those without (n = 26) (Supplementary Figs. 7, 8, 9). As expected in OGTT, at all visits, persons with T2DM had higher PV and AUC, later PT and longer TiH for glucose, and later PT and lower PV for insulin (Supplementary Tables 1, 2, 3, 4). In MMT, PV and AUC of glucose were higher, and TiH for glucose was longer with T2DM at all visits. PV of insulin was lower than in persons without T2DM at the 12th month (Supplementary Tables 1, 2, 3, 4). Both groups improved in their glucose and insulin responses during weight loss.

Metabolic features in all participants improve during weight loss

At baseline, both RYGB and OAGB groups had similar metabolic features. Women had a higher fat percentage than men, and persons with T2DM had higher HbA1c and fasting plasma glucose than persons without T2DM. During the weight loss, body weight, fat kilograms, fat percentage, fasting glucose, insulin, and lipid levels improved considerably in all groups (Supplementary Table 5). A slightly more prominent decrease in HbA1c in favor of OAGB vs. RYGB was observed, and HDL-cholesterol, fat kilograms, and fat percentage improved better in men vs. women. In persons with T2DM, weight, HbA1c, and fasting glucose improved more than in those without T2DM. (Supplementary Table 5).

HMOGP model outperforms the conventional trapezoidal data analysis

We additionally analyzed the data by conventional methods of estimating PT, PV and calculating the AUC and TiH during the test with the linear trapezoid method. The comparison with HMOGP showed that HMOGP consistently predicted AUC and TiH with improved uncertainty compared to the conventional data analysis. Additionally, HMOGP was able to give realistic PT and PV estimations compared to the linear trapezoid method, as these parameters only relied on the timing of the observations in fundamental statistical analysis. Supplementary Table 6 shows the comparison of HMOGP predictions with trapezoidal data analysis.

Discussion

We applied hierarchical multi-output Gaussian process (HMOGP) regression to analyze glucose and insulin dynamics in OGTT and MMT, identifying distinct metabolic responses based on bariatric surgery type and sex. Our findings reveal sharper and earlier glucose-insulin peaks with faster restoration to baseline in both OGTT and MMT post-surgery, along with more pronounced postprandial glucose-insulin responses in MMT than in OGTT and in RYGB compared to OAGB. Our findings underscore RYGB’s role in enhanced glycemic control, while OAGB could be preferred in milder metabolic disturbances or when hypoglycemia may be a risk. RYGB’s sharper glucose peaks may have vascular implications, favoring OAGB for participants with cardiovascular disease. Additionally, we observed sex-based metabolic differences with men exhibiting a more unhealthy glucose-insulin profile throughout weight loss and distinctions between individuals with and without T2DM. We thus present that the HMOGP approach can be used to model postprandial glucose-insulin responses in detail in different groups of participants for personalized treatment strategies, allowing new means of understanding and improving individual glycemic responses in metabolic conditions.

Our study proposes the hierarchical multi-output Gaussian process (HMOGP) regression machine-learning model as a suitable tool for modeling postprandial glucose-insulin data in detail for both OGTT and MMT. Previous studies have used the standard Gaussian process for modeling OGTT responses in participants with and without cystic fibrosis15, but HMOGP has not been applied to OGTT or MMT in relation to obesity or weight loss. Traditional linear regression models or simple curve-fitting approaches assume independence between glucose and insulin and fail to capture individual variability. Non-hierarchical Gaussian processes do not handle individual variations as effectively as the hierarchical structure in HMOGP23,29. Additionally, fixed-effect models like ANOVA, or simpler mechanistic models, cannot accommodate individual-to-population hierarchy and multi-output dependencies. In conventional linear trapezoid calculations, the outcomes rely strongly on the exact measurement time points. Our HMOGP method will allow a more granular understanding of how a patient compares with the population in insulin and glucose responses after surgery. The additional advantages are suitability for the correlated structure of glucose and insulin dynamics, for datasets with noise or missing values (typical in OGTT and MMT), improved accuracy of the prediction, and the ability to handle complex, multivariate data.

Both OGTT and MMT assess the pancreatic beta-cell response, which includes activation of the gut-related insulin-stimulating hormones. While OGTT is the standard for evaluating glucose intolerance and T2DM, MMT provides a more comprehensive physiological stimulus, as glucose combined with protein and fats enhances insulin secretion30. The duration of the postprandial glucose and insulin peaks was considerably elevated and shortened after both metabolic tests, confirming enhanced insulin stimulus and improved glucose clearance from the circulation post-operatively. Our results align with previous studies reporting that RYGB leads to a rapid increase in both postprandial blood glucose and insulin levels31. These metabolic benefits likely stem from gut reconfiguration post-surgery, including altered nutrient absorption and enhanced stimulation of L-cells, leading to a 10-fold increase in insulin-stimulating GLP-1 secretion32, and an increase in other gut hormones33. Gut mucosa hyperplasia post-operation promotes glucose absorption34 while improved pancreatic islet coordination may enhance insulin release35, collectively accelerating insulin secretion and glucose clearance. The enhanced post-surgical glucose-insulin response, earlier peak timing, and faster glucose normalization offer substantial benefits, as hyperglycemia is linked to vascular dysfunction, cardiovascular risk, oxidative stress, inflammation, and cognitive decline36. Interestingly, earlier timing of the glucose-insulin peaks in OGTT also seems to indicate the effectiveness of the antidiabetic drugs37 and reflect improved insulin sensitivity and secretion in T2DM38, while delayed glucose peaks reflect pancreatic beta-cell dysfunction37. In addition, increasing OGTT curve complexity is associated with better glucose tolerance39. However, sharp glycemic peaks after OGTT have also been linked to atherosclerosis40 and higher pulse pressure41, suggesting potential risks in certain metabolic conditions. The metabolic impact of such peaks in MMT remains unexplored. The metabolic and predictive value of the sharp and early glucose-insulin peaks will be better understood in the future.

In this study, RYGB resulted in a higher peak glucose-insulin response, larger AUC, and prolonged glucose levels above 7.0 mmol/l compared to OAGB, though both procedures showed similar peak timing and return to baseline. This difference was particularly evident in MMT post-surgery. While earlier non-randomized studies suggested a superior glucose profile after OAGB due to differences in bypassed intestine length42, randomized controlled trials (RCTs) with comparable anatomy have found RYGB and OAGB to be metabolically equivalent at 1- and 2-year follow-ups8,9. The RCT on the same data as in this study reports similar improvements in fasting glucose, HbA1c, and postprandial glucose and insulin AUCs in OGTT9 as well as comparable glycemic responses to carbohydrate intake measured by continuous glucose monitoring43. Our findings suggest that the more pronounced glucose-insulin peak in RYGB stems from its anatomical differences, where nutrients reach key gut areas more rapidly, leading to faster glucose absorption and a sharper insulin response compared to OAGB. This accelerated glycemic response may enhance early glucose control. In contrast, OAGB’s more gradual glucose absorption presents a smoother curve and may thus lower post-bariatric hypoglycemia risk, making it a preferable option for participants with preserved beta-cell function or milder metabolic disturbances. Although higher glycemic peaks in RYGB are linked to vascular risks like atherosclerosis and hypertension40,41, studies indicate better hypertension improvement and reduced antihypertensive medication use post-RYGB9. Given these dynamics, OAGB could, however, be a safer choice for individuals with a history of cardiovascular disease. Nonetheless, bariatric surgery remains a powerful metabolic intervention, providing substantial glycemic benefits regardless of the procedure44.

Men exhibited higher peak glucose in OGTT compared to women, higher peak glucose and insulin, and longer TiH post-operatively in both OGTT and MMT, suggesting a more unhealthy profile in obesity and after weight loss. Typically, women have lower fasting plasma glucose, higher 2-hour glucose, and greater increases in 2-hour glucose following OGTT than men, though HbA1c levels are reported to be comparable between sexes45. Insulin sensitivity is also generally better in women46. Research on obesity is sparse, with older studies indicating that men have higher peak glucose at 1 hour during OGTT, but women surpass them at 2-3 hours47. Recent data show that bariatric surgery leads to similar T2DM resolution between sexes, though only in men. AUC of insulin during OGTT predicts weight loss48,49. Previous studies have not compared OGTT and MMT responses before and after bariatric surgery and between sexes. We confirm a blunted glucose-insulin response in both sexes in obesity, an unhealthier glucose profile for men throughout the weight loss, and sex-related advantages with sharper and quicker glucose-insulin responses post-operatively in favor of women.

Bariatric surgery results in excellent rates of T2DM remission50, but its effects on postprandial glycemia between persons with or without T2DM are not yet well characterized. Some studies suggest less weight loss in persons with T2DM51 but do not assess postprandial glycemic response. In our study, individuals with T2DM lost more weight and showed better metabolic improvements but had higher glucose, lower insulin responses, and a flatter curve at all visits compared to non-diabetic individuals. This altered response reflects considerable changes in glucose and insulin dynamics in T2DM, warranting more individualized characterization of postprandial glycemic responses.

The strengths of this study include the standardized OGTT and MMT measurements on the same individuals undergoing bariatric surgery, with follow-up extending to 6th and 12th months. The used cohort and its subgroups are representative of a general population undergoing bariatric surgery9,24 making the results generalizable. The comparisons between RYGB and OAGB are from a randomized controlled trial designed to compare these procedures, using identical bypass limb lengths and equal stratification of participants by sex, age, and T2DM status. These factors enhance the reliability of comparisons. Additionally, the MMT’s extended follow-up period of 360 minutes is a unique strength of this study. Analyzing responses across time and in subgroups further improves relevance by identifying procedure-specific, sex-related, and diabetes-associated patterns. While a larger, more diverse cohort would allow finer subgroup analyses, this study still provides valuable insights. Future research with an expanded dataset across different ethnicities could validate these findings. It is also worth noting that OGTT and MMT were performed on consecutive days, which may introduce slight day-to-day variation.

Conclusions

Utilizing Hierarchical Multi-Output Gaussian Process (HMOGP) regression modeling to analyze postprandial OGTT and MMT responses presents an advanced approach to studying postprandial glucose-insulin responses in obesity and weight loss. The employed HMOGP regression is capable of estimating individual-level effects—the personalized treatment response—in addition to the effects at the population level while accounting for and correcting for measurement errors and thus improving accuracy in complex multivariate data. This method not only unveils differences between metabolic cohorts after bariatric surgery but also a differential response between the two operation types and sexes. This can lead to new knowledge in choosing the right treatments for participants and a more accurate modeling method for assessing OGTT and MMT responses in the clinic. Our study suggests that, based on postprandial glucose dynamics, RYGB may be favorable over OAGB in hyperglycemic patients without risk for hypoglycemia or vascular diseases, where OAGB could be preferred. Thus, HMOGP regression offers a versatile tool for investigating and predicting glycemic responses in metabolic conditions, paving the way for personalized interventions in metabolic health.