This study presents a novel investigation and comparison of the mechanical properties, specifically compressive strength (CS) and flexural strength (FS), of autoclaved aerated concrete (AAC) blocks using machine learning (ML) models: linear regression (LR), artificial neural network (ANN), and Gaussian process regression (GPR). The novelty lies in the utilization of ML techniques to predict the mechanical strength of AAC blocks, which have been prepared through a unique combination of materials including flyash (FA), construction and demolition waste (CDW), lime (L), cement (OPC 53), gypsum powder (GP), alkaline solution (AS), and free water (FW). Notably, various proportions of CDW are substituted for FA, and AS is employed as a substitute for aluminum powder (AP). Moreover, the curing process is innovatively conducted in an accelerated curing tank (ACT), deviating from conventional autoclaves. The experimental evaluation of CS and FS serves as the foundation for the development of the ML models, employing days strength, FA, CDW, L, OPC 53, GP, AS, and FW as input parameters. The performance evaluation metrics, including mean square error (MSE), root mean square error (RMSE), and coefficient of determination (R2), demonstrate the superiority of the GPR model in predicting CS and FS. To augment the comprehensive understanding of AAC block performance, additional experimental tests are conducted to analyze block density (BD), water absorption (WA), and drying shrinkage (DS) of AAC specimens. Furthermore, the study encompasses an optimization process to derive an optimal AAC formulation by considering the diverse range of data sets, primarily focusing on maximizing CDW content, CS, and FS, while minimizing FA content and BD. Overall, this research contributes novel insights by showcasing the proposed ML models' applicability for CS and FS prediction in CDW-based AAC blocks. The experimental investigations conducted on the AAC specimens enhance the current understanding of material performance, further emphasizing the originality and significance of this study.