Higher-order cognitive computational modeling focuses on the large amount of data generated by learners during their educational activities in order to make predictions and inferences and obtain their cognitive characteristics. In this paper, the original ant colony system algorithm is improved. Considering learners as ants, through state transfer probability calculation, pheromone updating, and continuous iteration of multiple ants with the same cognitive characteristics, the optimal teaching path suitable for the learner can be derived. After analyzing, it can be seen that comparing with the data of other GA and ACO algorithms, the improved ACO algorithm in this paper achieves the optimal training effect. By setting up the experimental group and the control group, it can be found that the teaching paths of the five students who did not use the method of this paper were all longer. Therefore, a concise and precise teaching path can be designed from the complicated learning resources and activities. Compared to the control group, the students in the experimental group presented more significant grammar scores and grammar learning attitudes (p<0.001).