<p>20k training instances is extremally small training data for neural machine translation. If you want to train anything on this data, you should use as little parameters as possible and strong regularization (dropout, L2, something as <a href="https://arxiv.org/abs/1808.07512" rel="nofollow noreferrer">SwitchOut</a>).</p>

<p>If I understand your code correctly, you are doing the vanilla encoder-decoder architecture by <a href="https://papers.nips.cc/paper/5346-sequence-to-sequence-learning-with-neural-networks.pdf" rel="nofollow noreferrer">Sutkever at al</a>. Although it is a simple model, it has relatively weak modeling capabilities. On such a small dataset, the attention model might be more suitable.</p>
RNN encoder-decoder model keeps overfitting
<p>i've trainning a machine translation model (from english to vietnamese) with RNN, LSTM with 25000 example pairs (for training set -> 20000, test set -> 5000) the model i used like below but val_acc always reach to ~0,37 and does not increment althought i used some other models and epoch is about 100:</p>

<pre><code>model = Sequential()
model.add(Embedding(src_vocab, n_units, input_length=src_timesteps, mask_zero=True))
model.add(Bidirectional(LSTM(n_units)))
model.add(Dropout(0.2))
model.add(RepeatVector(tar_timesteps))
model.add(Bidirectional(LSTM(n_units, return_sequences=True)))
model.add(Dropout(0.2))
model.add(TimeDistributed(Dense(512, activation='relu')))
model.add(Dropout(0.2))
model.add(TimeDistributed(Dense(tar_vocab, activation='softmax')))
return model
</code></pre>

<p>i want the model prevents overfitting,hope you guys help me solve the problem</p>