Previous studies have hinted at the benefits of following an anti-inflammatory diet for potentially reducing breast cancer prevalence. However, the combined influence of diet and inflammation on breast cancer remains unclear. The advanced lung cancer inflammation index (ALI) was used to assess inflammation and nutritional status. Statistical methods, such as multivariable logistic regression, eXtreme Gradient Boosting (XGBoost) model, and subgroup analysis, were employed to analyze the impact of ALI on prevalence of BC. Additionally, a two-piece-wise logistic regression model with smoothing was used to determine the ALI threshold for BC prevalence. The study aimed to understand the mechanistic association between ALI levels and BC development. The mean (SD) age of the study population was 50.0 (17.7) years, with 40.0% of individuals classified as obese. Comparing ALI tertiles to the lowest tertile, the odds ratios (95% CI) for breast cancer (BC) were 0.78 (0.62, 0.98) and 0.68 (0.52, 0.87) for T2-T3. The XGBoost machine learning model was employed to assess the importance of selected factors, revealing ALI as one of the top five variables influencing BC. Subgroup analysis identified a correlation between ALI, alcohol consumption, and menopausal status. Additionally, ALI levels were associated with decreased estradiol (E2) levels, increased total testosterone (TT)/E2 ratio, and TT/sex hormone-binding globulin (SHBG) ratio. This study indicates a potential protective effect of ALI levels against breast cancer, possibly related to sex hormone disruption. The findings support the use of optimal therapeutic strategies for preventing breast cancer.