The World Health Organization has urged countries to prioritize dementia in their public health policies. Dementia poses a tremendous socioeconomic burden, and the accurate prediction of the annual increase in prevalence is essential for establishing strategies to cope with its effects. The present study established a model based on the architecture of the long short-term memory (LSTM) neural network for predicting the number of dementia cases in Taiwan, which considers the effects of age and sex on the prevalence of dementia. The LSTM network is a variant of recurrent neural networks (RNNs), which possesses a special gate structure and avoids the problems in RNNs of gradient explosion, gradient vanishing, and long-term memory failure. A number of patients diagnosed as having dementia from 1997 to 2017 was collected in annual units from a data set extracted from the Health Insurance Database of the Ministry of Health and Welfare in Taiwan. To further verify the validity of the proposed model, the LSTM network was compared with three types of models: statistical models (exponential smoothing (ETS), autoregressive integrated moving average model (ARIMA), trigonometric seasonality, Box–Cox transformation, autoregressive moving average errors, and trend seasonal components model (TBATS)), hybrid models (support vector regression (SVR), particle swarm optimization–based support vector regression (PSOSVR)), and deep learning model (artificial neural networks (ANN)). The mean absolute percentage error (MAPE), root-mean-square error (RMSE), mean absolute error (MAE), and R-squared (R2) were used to evaluate the model performances. The results indicated that the LSTM network has higher prediction accuracy than the three types of models for forecasting the prevalence of dementia in Taiwan.