Multilevel inverters (MLI) are becoming more common in different power applications, such as active filters, elective vehicle drives, and dc power sources. The Multi-Group Marine Predator Algorithm (MGMPA) is introduced in this study for resolving transcendental nonlinear equations utilizing an MLI in a selective harmonic elimination (SHE) approach. Its applicability and superiority over various SHE approaches utilized in recent research may be attributed to its high accuracy, high likelihood of convergence, and improved output voltage quality. For the entire modulation index, the optimum switching angles (SA) from Marine Predator Algorithm (MPA) is utilized to control a three-phase 11-level MLI employing cascaded H-bridge (CHB) architecture to regulate the vital element and eliminate the harmonics. The limitation of SHE is that it is difficult to find solutions for nonlinear equations. As a result, specific optimization approaches must be used. Artificial Intelligence (AI) algorithms can handle such a nonlinear transcendental equation successfully, although their time consumption as well as convergence abilities vary. Here, recurrent neural network (RNN) is considered where the hidden neurons are tuned by MGMPA with the intention of harmonic distortion parameter (HDP) minimization, thus called as enhanced recurrent neural network (ERNN). The method’s resilience and consistency are demonstrated by simulation and analytical findings. The MGMPA method is more effective and appropriate than various algorithms including the MPA, Harris Hawks optimization (HHO), and Whale optimization algorithm (WOA), according to simulation data.