In the field of machining different grades of alloys using wire electrical discharge machining (WEDM), developing efficient techniques has been a challenge. Typically, specific supervised learning and optimization (SLO) methods are created for individual alloys, resulting in a time-consuming process. To address this issue, a unified SLO approach capable of handling various grades of alloys with different compositions and physical characteristics is proposed. In this study, three stochastic optimization tools are combined with a multi-layer neural network to determine the optimal SLO strategy. Five different alloy grades are considered, with inputs consisting of six variables, including chemical composition, and physical properties. The neural network architecture used is 19-500-500-4, and it is combined with a gray wolf stochastic algorithm, proving to be the most effective SLO methodology. The results indicate that regardless of the alloy grade, the pulse on time significantly affects the material removal rate, kerf width, and thickness of the recast layer (RL). Surface roughness is primarily influenced by alloy properties such as density, specific heat, and elements like Cr, Mo, and Ni. Additionally, the recast layer is dependent on factors such as V, Ti, thermal conductivity, and thermal diffusivity of the materials. Validation experiments demonstrate that the mean squared error of all responses for each alloy remains within 5.0%. This unified SLO approach provides a promising solution for optimizing the machining process of different alloy grades, reducing the need for separate techniques for each material.