The optimum neural network combined with sliding mode control (ONNSMC) introduces the approach as a means of developing a strong controller for a robot system with two links. Sliding mode control is a strong control method that has found widespread use in a variety of disciplines and recognized for its efficiency and easy tuning to solve a wide variety of control issues using nonlinear dynamics. Nevertheless, the uncertainties in complex nonlinear systems are huge, the higher switching gain leads to an increase of the chattering amplitude. To mitigate this gain, a neural network (NN) is utilized to predict the uncertain sections of the system plant with on-line training using the backpropagation (BP) technique. The learning rate is a hyperparameter of BP algorithm which has an important effect on the results. This parameter controls how much the weights of the network are updated during each training iteration. Typically, the learning rate is set to a value ranging from 0.1 to 1. In this study, the Ant Colony Optimization (ACO) algorithm is employed with the objective of enhancing the network’s convergence speed. Specifically, the ACO algorithm is utilized to optimize this parameter and enable global search capabilities. In order to reduce the response time caused by the online training, the obtained output and input weights are updated using the adaptive laws derived from the Lyapunov stability approach, while simulations are conducted to evaluate its performance. The control action employed in the approach is observed to exhibit smooth and continuous behavior, without any signs of chattering.