Dynamic dementia risk before and after incident diabetes mellitus: a combined case-control and cohort study Authors: Yuling Liu, Yiwen Dai, Yang Pan, Xinqing Yang, Menghan Zhu, Xuyang Diao, Jingya Ma, Xinghe Huang, Fanfan Zheng Published: 2026 ABSTRACT AbstractBackgroundEvidence on the temporal dynamics of dementia risk before incident diabetes remains limited. We aimed to investigate the temporal pattern of dementia risk before and after incident diabetes, compared with matched controls.MethodsCase-control and cohort analyses were conducted by using data from the UK Biobank. Propensity score matching was performed to match participants with and without diabetes. Conditional logistic regression was adopted in case-control analysis to estimate dementia risk before incident diabetes. Cox proportional-hazard regression models were adopted in cohort analysis to estimate dementia risk following a diabetes diagnosis.ResultsA total of 44,166 participants with diabetes and 132,498 matched diabetes-free participants were included. During the 10-year period before diabetes, dementia occurred in 344 (0.78%) participants who later had diabetes and 530 (0.40%) diabetes-free participants. Compared to participants without diabetes, the dementia risk was significantly higher in participants with diabetes (Odds Ratio [OR]: 2.14, 95% Confidence Interval [CI]: 1.83–2.50), with the ORs gradually increasing as the time approached the diagnosis date. The adjusted OR was 3.86 (95% CI: 3.11–4.80) for dementia in the 2 years before diabetes. After a diabetes diagnosis, a higher risk for dementia remained in participants with incident diabetes (Hazard Ratio [HR]: 1.82, 95%CI: 1.68–1.97). Similar results were found for Alzheimer’s disease and vascular dementia (VD), with VD showing a risk of over 6-fold.ConclusionsDementia risk starts to increase 10 years before diabetes, and the 2-year period preceding diagnosis might represent a high-risk period that calls for closer cognitive monitoring for vulnerable individuals.Supplementary InformationThe online version contains supplementary material available at https://doi.org/10.1186/s12889-026-28216-0.Keywords: Dementia, Dynamic risk pattern, Diabetes, Early prevention, Propensity score matching Introduction Dementia is one of the major global health burdens because of its high disability and mortality [1, 2]. The global population of people living with dementia was 57 million in 2019, with projections indicating that this number will rise to 153 million by 2050 [3]. Moreover, dementia not only leads to a wide range of health issues and decreased life quality [4], but also imposes high economic costs and social burden [5]. Although the US Food and Drug Administration (FDA) has approved several amyloid-reduction drugs in recent years, they are quite expensive, have strict eligibility, and warrant long-term monitoring for possible side effects [6, 7], making the early prevention strategy one of the most effective approaches in dealing with dementia. Thus, early identification of risk factors, especially those modifiable ones, is crucial for developing risk-reduction strategies for dementia [6, 8]. Diabetes mellitus was listed as one of the fourteen major risk factors for dementia [8], with many studies demonstrating its association with an elevated risk of subsequent dementia [9, 10]. Several physiological mechanisms, such as insulin resistance, inflammation, and vascular damage, have been proposed to explain the association [11, 12]. Nevertheless, as chronic diseases with a long pre-clinical period, diabetes and dementia shared a broad range of risk factors (obesity, hypertension, smoking, physical inactivity, air pollution, low education level, etc.) [8, 13, 14], which generally emerged several years or even decades before the clinical diagnosis of the diseases. Therefore, it is reasonable to assume that the risk of dementia may have already increased before the clinical diagnosis of diabetes. However, previous studies mainly focused on the association between prediabetes or diabetes and subsequent dementia risk, whereas the pre-diagnostic period has not been thoroughly investigated. The few studies that have explored this period primarily assessed cognitive changes around diabetes onset rather than dementia incidence, and generally spanned relatively short periods preceding diagnosis. Such approaches may not adequately capture the long-term cumulative risk of dementia. In this context, evidence on when the incidence of dementia starts to increase before the clinical diagnosis of incident diabetes, and the magnitude of the increase, may be of great significance for the development of risk-reduction strategies for dementia. Therefore, this study aimed to explore the temporal dynamics of dementia risk before and after diabetes diagnosis by adopting a combined case-control and cohort design and utilizing long-term longitudinal data from the UK Biobank, a large-scale cohort with complete records of diseases and diagnosis time. Methods Study design and population This study used data from the UK Biobank, an ongoing, public database that enrolled more than 500,000 community dwellers aged ≥ 40 years in the United Kingdom during its baseline survey from 2006 to 2010. The UK Biobank study collected a range of sociodemographic, lifestyle, physical, and health-related data through a touchscreen questionnaire, verbal interview, and physical measurements. Further details about the design and data collection of the UK Biobank can be found on the official website (https://www.ukbiobank.ac.uk/) and in published articles [15, 16]. The UK Biobank has received ethical consent from the Northwest Multi-Centre Research Ethics Committee and informed consent from all the participants. Figure 1 presents the flowchart of participant selection for this study. Firstly, among the 502,411 participants assessed at baseline, 53,184 participants had a record of diabetes diagnosis. A complete-case approach was adopted, whereby participants with missing data on covariates were excluded. After excluding participants with gestational diabetes only, without age or date of diabetes diagnosis, or missing data on covariates, the remaining 44,612 participants with data on age or date of diabetes diagnosis and 133,836 propensity score matching (PSM)-matched participants without diabetes (1:3 matching) were included in the analysis. The index date was defined as the diabetes diagnosis date for participants with diabetes and was applied to the matched controls. Next, 1784 participants aged < 10 years at the index date, most likely reflecting data entry errors or recall bias, or who had dementia > 10 years before the index date were excluded. Finally, 44,166 participants with data on age or date of diabetes diagnosis and 132,498 matched diabetes-free participants were included in the case-control study to evaluate the dementia risk before diabetes. After excluding participants with dementia before the index date, 43,822 participants with data on age or date of diabetes diagnosis and 131,968 matched comparisons were included in the cohort study to evaluate the dementia risk after diabetes diagnosis. Flow chart of participant selection for this study Ascertainment of diabetes Diabetes was determined as the first recorded diagnosis, using self-reported data (Field ID: 2443, 20002), hospital inpatient records, and mortality register data with the International Classification of Diseases, Tenth Revision (ICD-10) codes of E10 to E14. The date of incident diabetes was ascertained as the earliest diagnosis date from medical records, or calculated based on self-reported age/year of diabetes diagnosis and date of birth. For participants with multiple diabetes records, only the earliest record was retained for analysis. Detailed information is provided in Supplementary Table 1. General diabetes-free comparisons General comparisons without diabetes were matched using the PSM approach based on the following variables: age, sex, race, education, current smoking, current drinking, and physical activity. For each matched pair, the index date of the comparison was identical to the diabetes diagnosis date of their paired participants with diabetes. Ascertainment of dementia All-cause dementia, Alzheimer’s disease (AD), and vascular dementia (VD) were ascertained by algorithmically defined dementia using self-reported data, medical records, and mortality register data in the UK Biobank (Field ID: 42018, 42020, and 42022) [17]. Date of dementia onset was defined as the earliest recorded diagnosis from all data sources. The detailed ICD-10 codes used to define dementia are presented in Supplementary Table 2. All outcomes were followed up to December 31, 2022. Covariates Based on previous literature, we selected the following indicators as covariates [18, 19]: age, sex, race (White or non-White [Mixed, Asian, Black, Chinese, and other ethnicities]), education (higher educational level or not), body mass index (BMI), low-density lipoprotein cholesterol (LDL-C), current smoking (yes or no), current drinking (at least once per week or not), physical activity (yes or no), hypertension (yes or no), depressed mood (yes or no), stroke (yes or no), coronary heart disease (yes or no), statin use (yes or no), and apolipoprotein E4 (ApoE4) status (carrier, noncarrier, or untyped). Higher educational level was defined as a college or university degree or other professional qualifications. BMI was calculated as weight in kilograms divided by height in meters squared. LDL-C was measured at baseline via direct enzymatic methods. Current drinking was defined as drinking alcohol at least once per week. Physical activity was defined as attending moderate or vigorous physical activity for more than 10 min at least twice per week. Hypertension was defined according to systolic blood pressure ≥ 140 mmHg, diastolic blood pressure ≥ 90 mmHg, self-reported diagnosis of hypertension, or use of antihypertensive medications at baseline. Depressed mood was defined as a participant reporting experiencing feelings of down, depression, or hopelessness nearly every day or more than half the days over the past 2 weeks. Stroke and coronary heart disease were defined according to self-reported data through a touchscreen questionnaire and verbal interview at baseline. The use of statins (yes or no) was obtained at baseline through a verbal interview. ApoE4 status was defined based on genomic data. Supplementary Table 3 presents the details of the covariates above, and a directed acyclic graph (DAG) illustrating the assumed relationship among these variables was constructed based on the DAGitty version 3.1 [20] (Supplementary Fig. 1). Statistical analysis The baseline characteristics are described as the mean (SD) for continuous variables and frequency (percentage) for categorical variables. Standardized mean differences (SMDs) are presented to quantify the magnitude of differences between participants with and without diabetes, with an absolute SMD threshold of < 0.1 indicating adequate balance. PSM with the nearest-neighbor method was performed to match participants with and without a diabetes diagnosis at a 1:3 ratio, based on age, sex, race, education, current smoking, current drinking, and physical activity. This study investigated first-time dementia events in the 10 years before the index date and those occurring after the index date. The preceding 10-year period was divided into 2-year intervals to ensure sufficient dementia events within each interval while capturing temporal changes in risk. In the case-control analysis, conditional logistic regression was used to estimate the odds ratios (ORs) for dementia risk during the 10-year period before diabetes diagnosis in each time interval (> 0 to ≤ 10 years, > 8 to ≤ 10 years, > 6 to ≤ 8 years, > 4 to ≤ 6 years, > 2 to ≤ 4 years, > 0 to ≤ 2 years before the index date). For each time interval, incident dementia within the period was defined as the outcome event, with dementia status in each time interval as the dependent variable and diabetes status as the primary independent variable. In the cohort analysis, participants with a recorded dementia event before the index date were excluded. Multivariate Cox proportional-hazard regression models were then applied to investigate the association between diabetes and incident dementia, with follow-up time from the index date to the earliest occurrence of incident dementia, death, or the end of follow-up and dementia status (0 or 1) as the dependent variable. The aforementioned covariates were included for adjustment as baseline values. Several sensitivity analyses were conducted. First, given the possibility of simultaneous diagnoses of diabetes and dementia within one hospital admission, participants diagnosed with dementia within 28 days before the diabetes diagnosis were assumed to relate to one hospital admission and were excluded from the analysis of the time interval of > 0 to ≤ 2 years before the index date [21]. For a more robust assessment, we further utilized longer exclusion windows of 3, 6, and 12 months before the index date. Second, we repeated the main analyses after excluding participants with type 1 diabetes. Third, to assess the robustness of PSM variables selection, we additionally matched on BMI, hypertension, coronary heart disease, depressed mood, and Townsend deprivation index (TDI) in the matching process, and further adjusted for waist circumference and TDI. Fourth, we repeated the main analyses stratified according to sex and the age at the index date (< 65 years and ≥ 65 years). Fifth, to assess the robustness of findings against missing data, we performed a multiple imputation sensitivity analysis. Five imputed datasets were created, and the obtained results were combined using Rubin’s rule [22]. Finally, in the cohort analysis, we adopted competing risk models to account for death as a competing event in the association between diabetes diagnosis and incident dementia, and also performed a sensitivity analysis within the Cox model by treating diabetes as a time-varying variable. All analyses were two-sided, with a threshold of statistical significance set at 0.05, and performed in SAS 9.4 (SAS Institute, Cary, NC). Results Baseline characteristics Table 1 presents the characteristics of 176,664 participants with complete data, of whom 44,166 participants were identified to have a diabetes diagnosis. Overall, participants with diabetes had a higher level of BMI (31.3 [5.7] vs. 27.4 [4.4]); had a larger proportion of hypertension (34,884 [79.0%] vs. 79,472 [60.0%]), depressed mood (3304 [7.5%] vs. 6357 [4.8%]), stroke (1737 [3.9%] vs. 2592 [2.0%]), coronary heart disease (5862 [13.3%] vs. 7152 [5.4%]), and statin use (21,176 [48.0%] vs. 21,571 [16.3%]) compared with participants without diabetes. Supplementary Table 4 presents the characteristics of participants before PSM. Table 1Baseline characteristics of study population at the interval of 0–10 years before diagnosis after PSMCharacteristicDiabetes(n = 44166)General comparisons(n = 132498)Absolute SMDn (%) or mean [SD]n (%) or mean [SD]Before PSMAfter PSMAge, years59.6 (7.3)59.6 (7.3)0.38980.0008Sex0.32180.0049 Male25,759 (58.3)77,596 (58.6) Female18,407 (41.7)54,902 (41.4)Race0.25180.0100 White40,345 (91.4)121,403 (91.6) Other3821 (8.6)11,095 (8.4)High level of education16,666 (37.7)49,814 (37.6)0.23450.0029BMI, kg/m231.3 (5.7)27.4 (4.4)0.83120.7747LDL-C, mmol/L3.1 (0.9)3.6 (0.9)0.55030.5108Current smoking5484 (12.4)16,640 (12.6)0.08230.0043Current drinking25,761 (58.3)77,256 (58.3)0.32070.0004Active physical activity31,892 (72.2)95,754 (72.2)0.19930.0013Hypertension34,884 (79.0)79,472 (60.0)0.58590.4218Depressed mood3304 (7.5)6357 (4.8)0.14000.1119Stroke1737 (3.9)2592 (2.0)0.16570.1171Coronary heart disease5862 (13.3)7152 (5.4)0.37320.2732Statin medication21,176 (48.0)21,571 (16.3)0.87680.7209ApoE4 carriers9545 (21.6)31,662 (23.9)0.06030.0545SD standard deviation, SMD standardized mean difference, PSM propensity score matching, BMI body mass index, LDL-C low-density lipoprotein cholesterol, ApoE4 apolipoprotein E4 Baseline characteristics of study population at the interval of 0–10 years before diagnosis after PSM SD standard deviation, SMD standardized mean difference, PSM propensity score matching, BMI body mass index, LDL-C low-density lipoprotein cholesterol, ApoE4 apolipoprotein E4 Dementia events before diabetes diagnosis After PSM, 44,166 participants with diabetes and 132,498 matched participants without diabetes were included. As shown in Table 2, the all-cause dementia incidence was higher in participants with diabetes than participants without diabetes during the 10-year period before the index date, with 344 (0.78%) participants later diagnosed with diabetes and 530 (0.40%) matched participants experiencing all-cause dementia events before the index date (OR: 2.14, 95% CI: 1.83–2.50, p<.001). Table 2All-cause dementia events before and after diabetes diagnosisTime interval: years before the index dateDiabetes (n = 44166)General comparisons (n = 132498)No. of eventsIncidence of each interval, %No. of eventsIncidence of each interval, %ORa, (95% CI) p a ORb, (95% CI) p b > 0 to ≤ 2 years231/43,7430.53193/131,2290.153.68 (3.03–4.47)< 0.0013.86 (3.11–4.80)< 0.001> 2 to ≤4years55/43,9450.13149/131,8350.111.11 (0.81–1.51)0.5171.22 (0.85–1.73)0.280> 4 to ≤6years25/44,0550.0685/132,1650.060.88 (0.57–1.38)0.5821.08 (0.66–1.76)0.773> 6 to ≤8years11/44,1160.0250/132,3480.040.66 (0.34–1.27)0.2120.71 (0.34–1.49)0.365> 8 to ≤ 10 years10/44,1660.0240/132,4980.030.75 (0.38–1.50)0.4160.47 (0.20–1.12)0.087> 0 to 10 years344/44,1660.78530/132,4980.401.99 (1.74–2.29)< 0.0012.14 (1.83–2.50)< 0.001Diabetes (n = 43822)General comparisons (n = 131968)Time intervalNo. of eventsIncidence, %No. of eventsIncidence, %HRa, (95% CI) p a HRb, (95% CI) p b After the index date1523/43,8223.482702/131,9682.051.75 (1.64–1.86)< 0.0011.82 (1.68–1.97)< 0.001a Calculated for each time intervalb Calculated for each time interval and adjusted for age, sex, higher education, race, BMI, LDL-C, current smoking, current drinking, physical activity, hypertension, depressed mood, stroke, coronary heart disease, statin medication, and ApoE4 carriers All-cause dementia events before and after diabetes diagnosis a Calculated for each time interval b Calculated for each time interval and adjusted for age, sex, higher education, race, BMI, LDL-C, current smoking, current drinking, physical activity, hypertension, depressed mood, stroke, coronary heart disease, statin medication, and ApoE4 carriers The ORs of all-cause dementia showed numerically higher values as the time approached the index date (Table 2; Fig. 2), although only the adjusted OR in the 2-year time interval before the index date were statistically significant (OR: 3.86, 95% CI: 3.11–4.80, p<.001). All-cause dementia risk before and after diabetes diagnosis. Note. Odds ratios (OR) and hazard ratios (HR) are calculated for each time interval and adjusted for age, sex, higher education, race, BMI, LDL-C, current smoking, current drinking, physical activity, hypertension, depressed mood, stroke, coronary heart disease, statin medication, and ApoE4 carriers For AD and VD, small dementia case numbers in the 6–8 year interval (AD: n = 4; VD: n = 5), the 8–10 year interval (AD: n = 1; VD: n = 4), and the 4–6 year interval for VD (n = 0) resulted in the combinations of certain time intervals into 6–10 year for AD and 4–10 year for VD. After the redefinition, both AD and VD showed consistently higher event incidence across the entire 10-year period before the index date, and the results remained similar to all-cause dementia (Table 3). Specifically, within the 2-year time interval right before the diagnosis of diabetes, VD had an increased risk of over 6-fold (OR: 6.45, 95% CI: 3.83–10.85, p<.001), based on 65 cases among participants with diabetes and 38 cases among matched comparisons. Table 3Subtypes of dementia events (Alzheimer’s disease and vascular dementia) before and after diabetes diagnosisTime interval: years before the index dateDiabetesGeneral comparisonsNo. of eventsIncidence of each interval, %No. of eventsIncidence of each interval, %ORa, (95% CI) p a ORb, (95% CI) p b Alzheimer’s disease > 0 to ≤ 2 years89/44,0290.2098/132,0870.072.76 (2.07–3.69)< 0.0013.13 (2.25–4.35)< 0.001 > 2 to ≤ 4 years20/44,1210.0573/132,3630.060.82 (0.50–1.35)0.4361.07 (0.60–1.90)0.823 > 4 to ≤ 6 years8/44,1550.0226/132,4650.020.92 (0.42–2.04)0.8431.16 (0.48–2.80)0.743 > 6 to ≤ 10 years5/44,1970.0137/132,5910.030.41 (0.16–1.03)0.0580.46 (0.17–1.25)0.126 > 0 to ≤ 10 years126/44,1970.29235/132,5910.181.62 (1.30–2.02)< 0.0011.88 (1.47–2.39)< 0.001Vascular dementia > 0 to ≤ 2 years65/44,1450.1538/132,4350.035.43 (3.59–8.19)< 0.0016.45 (3.83–10.85)< 0.001 > 2 to ≤ 4 years10/44,1770.0222/132,5310.021.36 (0.65–2.88)0.4161.19 (0.47–3.02)0.720 > 4 to ≤ 10 years9/44,2030.0217/132,6090.011.59 (0.71–3.56)0.2621.07 (0.30–3.87)0.920 > 0 to ≤ 10 years85/44,2030.1978/132,6090.063.39 (2.48–4.64)< 0.0013.27 (2.27–4.72)< 0.001DiabetesGeneral comparisonsNo. of eventsIncidence, %No. of eventsIncidence, %HRa, (95% CI) p a HRb, (95% CI) p b Alzheimer’s disease627/44,0711.421231/132,3560.931.58 (1.43–1.74)< 0.0011.74 (1.54–1.96)< 0.001Vascular dementia502/44,1181.14562/132,5310.422.76 (2.45–3.12)< 0.0012.56 (2.19–2.98)< 0.001a Calculated for each time intervalb Calculated for each time interval and adjusted for age, sex, higher education, race, BMI, LDL-C, current smoking, current drinking, physical activity, hypertension, depressed mood, stroke, coronary heart disease, statin medication, and ApoE4 carriers Subtypes of dementia events (Alzheimer’s disease and vascular dementia) before and after diabetes diagnosis a Calculated for each time interval b Calculated for each time interval and adjusted for age, sex, higher education, race, BMI, LDL-C, current smoking, current drinking, physical activity, hypertension, depressed mood, stroke, coronary heart disease, statin medication, and ApoE4 carriers Dementia events after diabetes diagnosis The median follow-up duration was 9.9 years (Interquartile range[IQR], 4.0-12.6 years) for participants with diabetes and 12.8 years (IQR, 12.0–13.5 years) for participants without diabetes, with total person-years of 366,488.1 and 1,633,854.1, respectively. A total of 4225 cases of all-cause dementia, 1858 cases of AD, and 1064 cases of VD were identified after the index date. After adjusting for multiple covariates, participants with diabetes displayed significantly higher risks of developing all-cause dementia (Hazard Ratio [HR]: 1.82, 95%CI: 1.68–1.97, p<.001), AD (HR: 1.74, 95%CI: 1.54–1.96, p<.001) and VD (HR: 2.56, 95%CI: 2.19–2.98, p<.001) compared with participants without diabetes (Tables 2 and 3). Sensitivity analyses Results remained stable in sensitivity analyses using alternative thresholds of exclusion windows in the time interval of > 0 to ≤ 2 years before index date (Supplementary Table 5), after excluding participants with type 1 diabetes (Supplementary Table 6), and after expanding PSM variables and additional adjustments (Supplementary Tables 7–8). For analyses stratified by sex, the adjusted ORs remained similar to the main analyses, with no significant interaction observed (Supplementary Table 9). For analyses stratified by the age at the index date (< 65 years and ≥ 65 years), the direction of the adjusted ORs was consistent across both strata with the main analyses. Statistically significant interactions were detected in the overall pre-diagnosis period (P for interaction = 0.0287) and the post-diagnosis period (P for interaction = 0.0083), indicating a more pronounced association in younger participants. Notably, the wide confidence interval in the younger group during the 2-year period before diagnosis might be due to the limited number of dementia cases (Supplementary Table 10). Results remained consistent in multiple imputation analysis addressing missing data (Supplementary Table 11). In addition, the higher risk persisted after using death as a competing event and treating diabetes as a time-varying variable in cohort analysis (Supplementary Tables 12–13). Discussion In the present study, which combined case-control and cohort analyses, we found that the risk of incident dementia started to increase as early as 10 years before the diagnosis of diabetes. There was a significant over 3-fold risk of dementia during the 2-year period before the diagnosis, and an elevated risk persisted after incident diabetes. The findings were similar for AD and VD and remained consistent across sex and age subgroups. The most noteworthy finding in our study is that the risk of dementia started to increase at least 10 years before incident diabetes. When the 10-year period was divided into several 2-year intervals, the dementia risk before diabetes gradually increased as the time of diabetes diagnosis approached, with the 2-year period before the diagnosis exhibiting the highest OR of 3.86. The increased risk may reflect the cumulative burden of diabetes-related risk factors. As far as we know, diabetes is associated with multiple risk factors, including several modifiable ones such as unhealthy diet, insufficient sleep, social isolation, and air pollution, as well as comorbidities such as hypertension, obesity, and depression [13, 23, 24], all of which also contribute to dementia [8, 14, 25]. These shared risk factors typically emerge early in the pre-clinical phase, followed by a long temporal window during which deleterious influences accumulate. Correspondingly, the elevated dementia risk 2 years before diabetes may result from the prolonged exposure and cumulative damage, culminating in a qualitative change in cognition as diabetes onset approached. This pattern raises the possibility that diabetes-related dysregulation could potentially accelerate cognitive deterioration upon reaching a pre-diagnostic threshold. It is worth noting that the UK Biobank participants are typically healthier than the general population, with a lower prevalence of shared risk factors for diabetes and dementia, such as smoking [26]. This bias may lead to an underestimation of the associations. Nevertheless, studies from other general populations showed that prediabetes is associated with accelerated cognitive decline or higher dementia risk [27–29], indicating that hyperglycemia-induced alterations may already exert cognitive influence in the pre-diagnostic period. Given this consistency with our findings, the healthy volunteer bias in UK Biobank may therefore attenuate but not reverse the observed association. Another possible explanation based on previous studies involves hyperglycemia-induced vascular changes and dysfunction, which occurs years before clinical diabetes manifestation [30]. Given the established role of cerebrovascular pathology in dementia [31], this vascular alteration may be particularly relevant. Notably, our study showed an OR of over 6-fold for VD in the 2-year period before diabetes diagnosis. While compelling, this finding warrants careful interpretation. As diabetes and VD share overlapping factors contributing to vascular damage [32, 33], this association may partly reflect a cumulative burden of pre-existing vascular compromise rather than being driven solely by hyperglycemia. Nevertheless, prior studies indicate that individuals with prediabetes already exhibit accelerated cognitive decline compared with normoglycemic individuals [27, 28]. These findings suggest that cumulative vascular burden may not be the sole contributor, and that hyperglycemia itself may accelerate vascular damage and hasten the clinical manifestation of VD. In this context, the period preceding diabetes diagnosis may represent a phase of heightened vulnerability. The markedly elevated dementia risk before diabetes diagnosis still necessitates circumspect interpretation. This temporal association may reflect the cumulative burden of risk factors and vascular damage. Alternatively, the potential for reverse causation requires careful consideration, given that cognitive decline or prodromal dementia may impair glycemic control and lead to diabetes through progressive deterioration of lifestyle behaviors and self-care capacity. Nevertheless, several Mendelian randomization studies substantiate a causal role for diabetes or hyperglycemia in dementia [34, 35]. This suggests that while reverse causation may be involved in the observed temporal patterns, it is unlikely to represent a sole or principal determinant. Nevertheless, further studies are expected to validate and expand these associations. Previous studies have proposed several potential biological pathways underlying the relationship between glycemic status and dementia. Firstly, some evidence suggests that insulin resistance in the brain impairs synaptic, metabolic, and immune response functions, potentially damaging cognitive function and increasing the dementia risk [36, 37]. Since insulin resistance occurs years before prediabetes or diabetes diagnosis [38], this hypothesis provides a plausible explanation for the higher dementia risk observed before diabetes in our study. Other prior studies have indicated that brain structural alterations related to dementia may manifest before diabetes diagnosis. A prospective study found that white matter microstructural abnormalities were already present at the pre-diabetes stage, with greater white matter hyperintensity (WMH) volumes in hyperglycemic individuals than normoglycemic controls [39]. As white matter is critical for neural information processing [40], and WMH is associated with dementia and brain aging [41, 42], this finding may provide a neuropathological explanation. Additionally, oxidative stress induced by persistent hyperglycemia, coupled with increased inflammatory responses, has been proposed as a potential trigger of sustained neuroinflammation [43, 44]. Nevertheless, further research is needed to explore the underlying mechanisms. Currently, a few studies have explored cognitive decline before diabetes onset. A study from the English Longitudinal Study of Ageing (ELSA) analyzed annual cognitive decline rates before incident diabetes, yet found no significant difference in cognitive decline rates between those with and without future incident diabetes [45]. A later study using data from the China Health and Retirement Longitudinal Study (CHARLS) reported similar results to those of the aforementioned study [46], whereas our study revealed an increased dementia risk even before diabetes. This discrepancy may stem from the different study designs of the previous studies, as those studies all measured absolute cognitive change over the relatively short period before diabetes diagnosis, leaving out the long-term cumulative changes before the study period. In contrast, with the risk of incident dementia as our primary outcome, it is possible that the significantly increased dementia risk in the 2-year interval before diabetes may reflect the cumulated quantitative cognitive changes over the earlier stages approaching the diabetes diagnosis. In this context, our study may facilitate a more comprehensive understanding of the temporal pattern in the dementia risk before diabetes diagnosis. Previous studies have primarily found higher dementia risk after diabetes diagnosis. A meta-analysis of 122 prospective studies showed that diabetes was associated with a 1.43-fold increased risk of all-cause dementia and AD, and a 1.91-fold increased risk for VD [9]. These findings are consistent with our findings of a lower magnitude of risk elevation for all-cause dementia and AD, and a higher magnitude for VD. This pattern may suggest divergent pathogenic mechanisms underlying AD and VD, with VD potentially exhibiting greater susceptibility to diabetes. Moreover, our findings identify a temporal pattern in which a particular period of increased dementia risk can be observed even before the diabetes diagnosis, supporting the potential importance of enhancing cognitive monitoring during this early phase. This aligns with the recommendations of the Standards of Care in Diabetes-2025 by the American Diabetes Association (ADA), which advocate early screening, annual monitoring, and lifestyle management at the pre-diabetes stage to prevent diabetes and related comorbidities [47]. Nevertheless, more high-quality randomized controlled trials are needed to establish optimal interventions for high-risk populations during the early pre-clinical stage. The first strength of this study is the large sample size, which provides sufficient statistical power to assess dementia risks before and after diabetes, along with detailed information on diabetes diagnosis for long-term retrospective data collection. Second, algorithmically defined health outcomes were identified by a standardized approach in UK Biobank, which captured the earliest documented date of a given outcome across of source, ensuring a high positive predictive value for dementia diagnosis (82.5%) [17]. Third, PSM was used to minimize the confounding bias when matching participants with and without diabetes. The present study has the following limitations. First, we cannot establish a causal relationship or rule out reverse causation due to the observational study design. Second, individuals who later receive a diabetes diagnosis tend to have more frequent healthcare encounters, which may inflate the observed association by increasing detection opportunities for cognitive concerns. Although we cannot rule out differential ascertainment bias due to the lack of primary care data, the observed association magnitude exceeds what might be expected from surveillance alone. Nevertheless, caution is warranted when interpreting the pre-diagnostic results. Third, despite the multivariable PSM and adjustment for many confounders, residual confounders may still exist. And due to the time-varying nature of many confounders, their changes over time may influence the estimated associations; however, with limited repeated measurements, we adjusted only for baseline data. Fourth, the current study population is predominantly white (91.6%), limiting the generalizability to other ethnic groups and necessitating further validation in other populations. Finally, due to data within the UK Biobank, the primary analyses did not distinguish between type 1 and type 2 diabetes, nor classify diabetes by treatment type or severity. Although type 2 diabetes accounts for the vast majority of diabetes, the different mechanisms between the two may influence the results. However, a sensitivity analysis excluding type 1 diabetes yielded consistent results, suggesting that clinical heterogeneity does not substantially alter our conclusions. In addition, future studies with formal mediation analysis are warranted to further elucidate the underlying mechanisms. Conclusions In summary, this study found that the risk of incident dementia begins to increase at least 10 years before diabetes diagnosis, peaking in the 2 years before the diagnosis, and a higher risk persists after the diagnosis. Our findings indicate that the 2-year period preceding diagnosis might represent a high-risk period, suggesting that closer cognitive monitoring could be considered for vulnerable individuals at this stage. Supplementary Information Supplementary Material 1. Acknowledgements We appreciate the original data creators, depositors, copyright holders, funders of the data collections, and their efforts for the use of the UK Biobank, approved project number 90492. We are also grateful to the participants for generously dedicating their time to participate in the UK Biobank study. Abbreviations Alzheimer’s disease American Diabetes Association Apolipoprotein E4 Body mass index The China Health and Retirement Longitudinal Study Confidence Interval Directed acyclic graph The English Longitudinal Study of Ageing Hazard ratio Interquartile range Low-density lipoprotein cholesterol Odds ratio Propensity score matching Standardized mean difference Townsend deprivation index Vascular dementia White matter hyperintensity Authors’ contributions YL.L and FF.Z conceived the idea. YL.L conducted the analysis and wrote the original draft. YW.D and Y.P contributed to the data cleaning. XQ.Y, MH.Z, XY.D, JY.M, and XH.H contributed to the study methodology. All authors provided critical revisions and approved the final version of the submitted manuscript. FF.Z revised the manuscript, had full access to the data in the study and take responsibility for the integrity of the data and the accuracy of the data analysis. Funding This work was supported by grants from the National Natural Science Foundation of China (82373665) and the Non-profit Central Research Institute Fund of the Chinese Academy of Medical Sciences (2021-RC330-001). The funding sources had no role in the study design, data collection, analysis, interpretation, writing, or publication decision of this study. Data availability The data underlying this study were provided by UK Biobank under a project application. Requests for access to the UK Biobank data can be made here: https://www.ukbiobank.ac.uk/enable-your-research/apply-for-access. Declarations Ethics approval and consent to participate The UK Biobank study was approved by the North West Multicenter Research Ethics Committee. All participants provided written consent before enrolment, which was conducted in accordance with the Declaration of Helsinki. Consent for publication Not applicable. Competing interests The authors declare no competing interests. Footnotes Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. References Associated Data Supplementary Materials Supplementary Material 1. Data Availability Statement The data underlying this study were provided by UK Biobank under a project application. Requests for access to the UK Biobank data can be made here: https://www.ukbiobank.ac.uk/enable-your-research/apply-for-access.