Scenario parameters of aerogel glazing systems are with uncertainties in the real operation, whereas current literature fails to characterise the thermal and energy responses regarding stochastic scenario uncertainties. Furthermore, multi-level uncertainty-based optimisation has been rarely studied for the robustness improvement. In this study, a general method for stochastic uncertainties-based optimisation is proposed. A machine-learning based surrogate model is developed for uncertainty analysis. Furthermore, a multi-level uncertainty-based optimisation function is characterized and integrated with the heuristic teaching-learning-based algorithm to search for the optimal design. Research results indicated that, in the multi-level uncertainty-based optimal scenario, average values of RoC, thickness of aerogel layer, extinction coefficient and thermal conductivity are 306253.4 J/(K m3), 24.5 mm, 0.092, and 0.0214 W/(m K). Compared to the deterministic case, the stochastic uncertainty case can decrease the heat flux from 237.16 to 190 kWh/m2.a by 19.9%, and total heat gain from 267.18 to 222.04 kWh/m2.a by 16.9%. Furthermore, by adopting the multi-level uncertainty-based optimisation, the heat flux can be further reduced to 162.54 kWh/m2.a by 31.5%, and the total heat gain to 191.56 kWh/m2.a by 28.3%. The proposed technique can improve the reliability of aerogel glazing systems in green buildings.