Rapid pyrolysis is a promising technique to convert biomass into fuel oil, where NOX emission remains a substantial environmental risk. NH3 and HCN are top precursors for NOX emission. In order to clarify their migration path and provide appropriate strategies for their controlling, six up-to-date machine learning (ML) models were established to predict the NH3 and HCN yield during rapid pyrolysis of 26 biomass feedstocks. Cross-validation and grid search methods were used to determine the optimal hyperparameters for these ML models. The support vector regression (SVR) model achieved optimal accuracy among them. The optimal root means square error (%), mean absolute error (%), and R2 of test set for NH3/HCN yield were 1.2901/1.1531, 1.0501/0.84712, and 0.98253/0.96152, respectively. In addition, based on the results of Pearson correlation analysis, the input variables with a weak linear correlation with the target product were eliminated, which was found capable of improving the prediction accuracy of almost all ML models except SVR. While after input variables elimination, the SVR model still showed the optimal NH3 and HCN yield prediction accuracy. It reflects SVR's great significance and potential for predicting the yield of NOX precursors during rapid biomass pyrolysis.