Loss is decreasing but the predictions are not getting well

stuck: <p>Hi,</p>
<p>I am trying to implement a Dependency Parsing model using the transformer model in <a href="http://nlp.seas.harvard.edu/2018/04/03/attention.html" rel="noopener nofollow ugc">here</a> with a few changes.<br>
On the training, my loss has decreasing trend; but the predictions at the end of 20 epochs are not meaningful.</p>
<p>What could be the problems?</p>
<p>Thanks for any help in advance.</p>
<p><em>Outputs are below here:</em></p>
<p>The training:</p>
<blockquote>
<p>Epoch 0<br>
Epoch Step: 1 Loss: 12.520 Tokens per Sec: 156.228836<br>
Epoch Step: 51 Loss: 9.549 Tokens per Sec: 144.077591<br>
Epoch Step: 1 Loss: 2.845 Tokens per Sec: 139.670441<br>
Epoch Step: 51 Loss: 7.709 Tokens per Sec: 148.557648<br>
tensor(0.0452)<br>
Epoch 1<br>
Epoch Step: 1 Loss: 18.100 Tokens per Sec: 132.820221<br>
Epoch Step: 51 Loss: 10.469 Tokens per Sec: 151.330307<br>
Epoch Step: 1 Loss: 8.830 Tokens per Sec: 141.060349<br>
Epoch Step: 51 Loss: 9.055 Tokens per Sec: 146.867462<br>
tensor(0.0348)<br>
Epoch 2<br>
Epoch Step: 1 Loss: 11.577 Tokens per Sec: 143.026764<br>
Epoch Step: 51 Loss: 4.532 Tokens per Sec: 133.869629<br>
Epoch Step: 1 Loss: 1.540 Tokens per Sec: 166.832520<br>
Epoch Step: 51 Loss: 0.617 Tokens per Sec: 133.209915<br>
tensor(0.0191)<br>
Epoch 3<br>
Epoch Step: 1 Loss: 5.193 Tokens per Sec: 101.057816<br>
Epoch Step: 51 Loss: 3.458 Tokens per Sec: 125.874458<br>
Epoch Step: 1 Loss: 4.809 Tokens per Sec: 146.683258<br>
Epoch Step: 51 Loss: 8.953 Tokens per Sec: 132.177780<br>
tensor(0.0413)<br>
Epoch 4<br>
Epoch Step: 1 Loss: 11.321 Tokens per Sec: 115.404495<br>
Epoch Step: 51 Loss: 3.964 Tokens per Sec: 129.871109<br>
Epoch Step: 1 Loss: 5.374 Tokens per Sec: 153.859207<br>
Epoch Step: 51 Loss: 5.484 Tokens per Sec: 119.325813<br>
tensor(0.0279)<br>
Epoch 5<br>
Epoch Step: 1 Loss: 7.173 Tokens per Sec: 115.805588<br>
Epoch Step: 51 Loss: 1.819 Tokens per Sec: 123.073883<br>
Epoch Step: 1 Loss: 0.960 Tokens per Sec: 170.719009<br>
Epoch Step: 51 Loss: 1.785 Tokens per Sec: 125.758141<br>
tensor(0.0167)<br>
Epoch 6<br>
Epoch Step: 1 Loss: 0.949 Tokens per Sec: 143.089218<br>
Epoch Step: 51 Loss: 5.166 Tokens per Sec: 119.562157<br>
Epoch Step: 1 Loss: 1.305 Tokens per Sec: 145.756500<br>
Epoch Step: 51 Loss: 3.682 Tokens per Sec: 124.026428<br>
tensor(0.0146)<br>
Epoch 7<br>
Epoch Step: 1 Loss: 3.911 Tokens per Sec: 138.809906<br>
Epoch Step: 51 Loss: 5.827 Tokens per Sec: 122.372780<br>
Epoch Step: 1 Loss: 0.494 Tokens per Sec: 137.776642<br>
Epoch Step: 51 Loss: 2.666 Tokens per Sec: 131.723038<br>
tensor(0.0121)<br>
Epoch 8<br>
Epoch Step: 1 Loss: 2.576 Tokens per Sec: 136.597214<br>
Epoch Step: 51 Loss: 2.826 Tokens per Sec: 126.036842<br>
Epoch Step: 1 Loss: 2.027 Tokens per Sec: 126.010918<br>
Epoch Step: 51 Loss: 3.742 Tokens per Sec: 130.350937<br>
tensor(0.0090)<br>
Epoch 9<br>
Epoch Step: 1 Loss: 1.823 Tokens per Sec: 142.635910<br>
Epoch Step: 51 Loss: 2.043 Tokens per Sec: 125.544189<br>
Epoch Step: 1 Loss: 0.558 Tokens per Sec: 133.733505<br>
Epoch Step: 51 Loss: 1.802 Tokens per Sec: 129.989548<br>
tensor(0.0087)<br>
Epoch 10<br>
Epoch Step: 1 Loss: 1.817 Tokens per Sec: 128.555618<br>
Epoch Step: 51 Loss: 5.115 Tokens per Sec: 121.563423<br>
Epoch Step: 1 Loss: 0.555 Tokens per Sec: 145.560699<br>
Epoch Step: 51 Loss: 2.464 Tokens per Sec: 135.761688<br>
tensor(0.0088)<br>
Epoch 11<br>
Epoch Step: 1 Loss: 0.869 Tokens per Sec: 159.163788<br>
Epoch Step: 51 Loss: 2.623 Tokens per Sec: 124.412704<br>
Epoch Step: 1 Loss: 0.772 Tokens per Sec: 148.348251<br>
Epoch Step: 51 Loss: 0.438 Tokens per Sec: 127.859993<br>
tensor(0.0078)<br>
Epoch 12<br>
Epoch Step: 1 Loss: 2.377 Tokens per Sec: 123.196060<br>
Epoch Step: 51 Loss: 1.719 Tokens per Sec: 122.183594<br>
Epoch Step: 1 Loss: 1.415 Tokens per Sec: 124.849358<br>
Epoch Step: 51 Loss: 1.805 Tokens per Sec: 132.770676<br>
tensor(0.0080)<br>
Epoch 13<br>
Epoch Step: 1 Loss: 1.472 Tokens per Sec: 124.035645<br>
Epoch Step: 51 Loss: 0.777 Tokens per Sec: 127.847717<br>
Epoch Step: 1 Loss: 0.605 Tokens per Sec: 140.335785<br>
Epoch Step: 51 Loss: 0.380 Tokens per Sec: 133.239578<br>
tensor(0.0061)<br>
Epoch 14<br>
Epoch Step: 1 Loss: 1.652 Tokens per Sec: 116.933731<br>
Epoch Step: 51 Loss: 2.005 Tokens per Sec: 131.188080<br>
Epoch Step: 1 Loss: 0.057 Tokens per Sec: 162.092529<br>
Epoch Step: 51 Loss: 0.840 Tokens per Sec: 131.577316<br>
tensor(0.0066)<br>
Epoch 15<br>
Epoch Step: 1 Loss: 0.573 Tokens per Sec: 144.241257<br>
Epoch Step: 51 Loss: 1.395 Tokens per Sec: 133.703445<br>
Epoch Step: 1 Loss: 0.922 Tokens per Sec: 150.064331<br>
Epoch Step: 51 Loss: 1.862 Tokens per Sec: 133.412491<br>
tensor(0.0062)<br>
Epoch 16<br>
Epoch Step: 1 Loss: 1.002 Tokens per Sec: 141.052292<br>
Epoch Step: 51 Loss: 0.367 Tokens per Sec: 127.523247<br>
Epoch Step: 1 Loss: 0.792 Tokens per Sec: 137.230988<br>
Epoch Step: 51 Loss: 1.554 Tokens per Sec: 132.268616<br>
tensor(0.0057)<br>
Epoch 17<br>
Epoch Step: 1 Loss: 1.520 Tokens per Sec: 139.651688<br>
Epoch Step: 51 Loss: 0.979 Tokens per Sec: 121.396866<br>
Epoch Step: 1 Loss: 0.826 Tokens per Sec: 125.688881<br>
Epoch Step: 51 Loss: 1.198 Tokens per Sec: 138.106827<br>
tensor(0.0057)<br>
Epoch 18<br>
Epoch Step: 1 Loss: 0.738 Tokens per Sec: 142.477478<br>
Epoch Step: 51 Loss: 0.467 Tokens per Sec: 128.806183<br>
Epoch Step: 1 Loss: 0.153 Tokens per Sec: 155.590027<br>
Epoch Step: 51 Loss: 1.191 Tokens per Sec: 136.467148<br>
tensor(0.0050)<br>
Epoch 19<br>
Epoch Step: 1 Loss: 0.456 Tokens per Sec: 133.751083<br>
Epoch Step: 51 Loss: 0.315 Tokens per Sec: 128.097702<br>
Epoch Step: 1 Loss: 0.584 Tokens per Sec: 151.586060<br>
Epoch Step: 51 Loss: 0.524 Tokens per Sec: 129.905441<br>
tensor(0.0051)</p>
</blockquote>
<p>The predictions:</p>
<blockquote>
<p>the reality is that it stands for and operationalizes us power , in cooperation with america 's closest allies .<br>
Eisner Prediction:  root 's 's 's 's 's 's 's 's 's 's 's 's 's 's 's . 's 's the<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609<br>
Target:	reality is root stands stands is stands operationalizes stands power operationalizes stands cooperation stands allies allies america allies cooperation is</p>
</blockquote>
<hr>
<blockquote>
<p>there are parallel shortcomings in many other markets .<br>
Eisner Prediction:  root many many many many . many many there<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609 1609 1609<br>
Target:	are root shortcomings are markets markets markets are are</p>
</blockquote>
<hr>
<blockquote>
<p>the victorians produced his plays as lavish spectacles on a grand scale .<br>
Eisner Prediction:  root plays plays plays the . . . . . . . the<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609<br>
Target:	victorians produced root plays produced spectacles spectacles produced scale scale scale produced produced</p>
</blockquote>
<hr>
<blockquote>
<p>what is the minimum password strength ?<br>
Eisner Prediction:  root what strength strength strength what strength<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609<br>
Target:	root what strength strength strength what what</p>
</blockquote>
<hr>
<blockquote>
<p>license .<br>
Eisner Prediction:  root license<br>
Prediction:	1609 1609<br>
Target:	root license</p>
</blockquote>
<hr>
<blockquote>
<p>if you already have a facebook account , you can log in to your account from the same page .<br>
Eisner Prediction:  root the the the the the the the the the the the the the the the page the if if<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609<br>
Target:	have have have log account account have have log log root log account account log page page page log log</p>
</blockquote>
<hr>
<blockquote>
<p>there is no oppression of russian speakers in ukraine , and there never has been .<br>
Eisner Prediction:  root . . . . . . . . . . . . . . there<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609<br>
Target:	is root oppression is speakers speakers oppression ukraine is been been been been been is is</p>
</blockquote>
<hr>
<blockquote>
<p>( the house rose and observed a minute 's silence ) .<br>
Eisner Prediction:  root . . . . . . . . . . (<br>
Prediction:	1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609 1609<br>
Target:	rose house rose root observed rose minute silence minute observed rose rose</p>
</blockquote>