This paper takes 2020-2022 Shanghai main board listed companies as the research object, and empirically examines the relationship between factors such as the establishment of internal audit department and the quality of internal audit empowered by new quality productivity, with the effectiveness of the quality of internal control as the explanatory variable, the degree of separation of two powers and so on as the explanatory variable, and the corporate governance structure as the control variable to carry out a via gradient descent Logistic regression analysis optimized by gradient descent algorithm. On this basis, to address the problem that internal audit is prone to bias or falsehood due to management’s self-interest, the fsQCA method is combined to analyze the influencing factors of the choice of auditing policy (capital item or expense item) for general R&D expenditures. It is found that there is a significant positive relationship between companies with an internal audit department and a higher hierarchical level of affiliation and obtaining a standard audit opinion, and the regression relationship holds at the 0.05 level of significance, with a positive correlation with a regression coefficient of 3.745, and an OR value of 40.099. However, the effect of the company’s twofold separation of powers governance structure on the quality of the audit fails the significance test. Firms with lower profitability levels, higher R&D intensity, higher debt levels, lower tax benefits for R&D additions and deductions and lower external audit quality are more likely to capitalize R&D expenditures. The study uses cutting-edge algorithms to accurately analyze new quality productivity-enabling internal audit quality factors and innovate corporate compliance internal control paths.