In the field of power systems, the optimization challenge of combined heat and power units economic dispatch (CHPUED) holds immense importance. This study presents an improved Aquila optimization technique (IAQT) that effectively tackles the CHPUED. The primary objective of the enhanced IAQT model is to minimize the overall cost of power generation in CHP systems while satisfying demand and operational constraints. However, to achieve more accurate cost estimations and avoid suboptimal solutions, it is crucial to consider transmission losses in the optimization model. By incorporating transmission losses, the IAQT algorithm can allocate power generation resources more effectively, leading to improved system efficiency and reduced operational costs. The proposed IAQT algorithm addresses the limitations of the standard AQT and introduces novel features to enhance its search capabilities. One key limitation of the standard AQT is its heavy reliance on the best solution found during optimization. To overcome this drawback, the enhanced IAQT model eliminates the dependency on the best solution and enables a more thorough exploration of the search space. Moreover, the algorithm incorporates specific limitations and constraints for each dimension of the newly generated solutions, ensuring their feasibility and validity. The standard AQT and proposed IAQT are tested on CEC 20 benchmark functions. Moreover, the proposed approach is extensively evaluated through experimentation and testing on various scenarios, including 7–48-unit and large 96-unit systems with/without losses. Furthermore, the overall costs for the 7 unit-system are considered including the reserve constraint. The results exhibit the remarkable performance and efficiency of the enhanced IAQT model, outperforming the standard version and several previously reported results. This validation underscores the significant contribution of the study in addressing the CHPUED and highlights its potential for real-world applications.