Abstract In this paper, ant colony algorithm and genetic algorithm are combined and applied to the teaching mode of English for Special Purposes (ESP) in colleges and universities, and the optimization of the teaching mode is realized through the PDCA model. The iteration speed of ant colony algorithm is better than that of genetic algorithm in the early stage. In comparison, the iteration speed of genetic algorithm is better in the later stage. By fusing these two algorithms, their respective advantages can be maximized. The study takes two computer science classes as an example, first conducts a needs analysis of the ESP course, and finds that the ratings in English foundation, learning materials, learning mode, and quiz mode are all higher than 5.5. By comparing the final exam scores of the experimental and control classes, it was found that the average score of the practical class was 3.5 points higher than that of the control class, which indicated that the ESP teaching of the PDCA cycle effectively improved the students’ academic performance. The average score of students’ recognition of the ESP teaching model of PDCA cycle was 4.252, while the ratings in satisfaction, participation in classroom interactions, and learning effect were all over 4.1. The analysis of learning motivation shows that “for better employment”, “for promotion”, and “to pass the exam” are the top three motivations for students to choose to learn English for computer science majors, with scores of 175, 174, and 170, respectively. This study effectively demonstrates the potential of combining ACO and Genetic Algorithm in education.