Hybrid active power filter (HAPF) has been widely used to suppress harmonics in the electric power system. However, selecting HAPF parameters accurately remains a primary challenge faced by researchers. To optimize HAPF parameters and reduce the harmonic pollution, this paper proposes an improved teaching-learning-based optimization algorithm, namely HTLBO. In HTLBO, a self-study strategy based on Lévy-Flight is developed to avoid the population falling into local optima. Furthermore, in the teaching phase, all learners are divided into three hierarchies according to their learning ability, and learners at different hierarchies learn from different teachers respectively. While in the learning phase, each learner learns not only from a better individual but also from a worse individual. The above hierarchical teaching strategy and improved learning strategy effectively balance the exploration tendency and exploitation tendency of the algorithm. In addition, a competitive mechanism based on dynamic clustering is proposed to ensure the vitality of the entire population. The performance of HTLBO is verified by identifying the parameters of two classical HAPF topologies. Experimental results present that compared with the other nine well-established meta-heuristics algorithms, HTLBO achieves outstanding performance, especially in terms of accuracy and reliability. INDEX TERMS Hybrid active power filter (HAPF), harmonic pollution (HP), hierarchical learning, metaheuristics, teaching-learning-based optimization (TLBO).