Multilayer perceptron (MLP) has been demonstrated to implement feedforward control of the piezoelectric actuator (PEA). To further improve the control accuracy of the neural network, reduce the training time, and explore the possibility of online model updating, a novel recurrent neural network named PEA-RNN is established in this paper. PEA-RNN is a three-input, one-output neural network, including one gated recurrent unit (GRU) layer, seven linear layers, and one residual connection in the linear layers. The experimental results show that the displacement linearity error of piezoelectric ceramics reaches 8.96 μm in the open-loop condition. After using PEA-RNN compensation, the maximum displacement error of piezoelectric ceramics is reduced to 0.465 μm at the operating frequency of 10 Hz, which proves that PEA-RNN can accurately compensate piezoelectric ceramics’ dynamic hysteresis nonlinearity. At the same time, the training epochs of PEA-RNN are only 5% of the MLP, and fewer training epochs provide the possibility to realize online updates of the model in the future.