While identifying the drivers of global CO2 emission is crucial for climate change mitigation, the heterogeneous technology-related drivers (e.g., technological change and efficiency of energy and CO2 emission) were ignored to a large extent at a global scale, hindering to formulate heterogenous climate policies. Moreover, the projection of CO2 emission was also not well compared for countries. Here, the study investigated the heterogeneous technology-related drivers of CO2 emissions in time and space simultaneously in 42 major emitter countries over 1998–2020 by extending the spatiotemporal production-theoretical decomposition models, and compared the different performances for forecasting CO2 emission by traditional time-series models and several machine learning models. Key findings as follows: first, drivers of CO2 emissions exhibit significant heterogeneity across countries where the effects of energy usage technology gap and CO2 emission technology gap were negative drivers for USA, South Korea, and the Czech Republic and potential energy intensity effect was the negative driver in countries like China, Russia, Japan, and India. Second, the effects of within-GDP per capita and within- population size were the important drivers affecting global CO2 emission difference. Third, general regression neural network achieved the best forecasting performance on average compared with other models in the study. The study highlights the importance of formulating climate policies based on heterogeneous technology and emission forecast modeling.