Automatic sentence generation is an important problem in natural language processing that has many applications, including language translation, summarization, and chatbots. Deep learning techniques, such as recurrent neural networks (RNNs) and transformer models, have been shown to be effective in generating coherent and diverse sentences. Recurrent neural networks (RNNs) have been widely used in natural language processing tasks, including automatic text generation. However, the traditional RNN suffers from the vanishing gradient problem, which hinders the learning of long-term dependencies. To address this issue, long short-term memory (LSTM) and gated recurrent unit (GRU) models have been introduced that can selectively forget or update certain information in the hidden state. These models have been shown to improve the quality of automatically generated text by better capturing the long-term dependencies in the input data.