Why do we need padding in seq2seq network
To handle sequences of different, I would like to know. 


Why do we need padding the sequence the word to the same length? 
If the answer is "Yes, you need padding.". Can I set the padding in other indexes? For example, if I have an index word like this:

{0:"&lt;s&gt;,1:"&lt;e&gt;",2:"AAA",3:"BBB",.......,500:"zzz"}


Where &lt;s&gt; is starting word of the sentence and  is the ending word of the sentence.

Can I set the padding flag to the last index?   

{0:"&lt;s&gt;,1:"&lt;e&gt;",2:"AAA",3:"BBB",.......,500:"zzz",501:"&lt;pad&gt;"} 



  Why do we need padding the sequence the word to the same length?


Because basically all layers with parameters perform some way of matrix multiplication (actually: tensor multiplication) at some point in their logic. Now, try it yourself. Multiply matrices where not all rows or columns have the same length. E.g. what is this supposed to be?

| 1 2 3 |     | 1 | 
| 4 5   |  *  | 2 |  =  ???
              | 3 |


It is simply not possible to do this, unless you put some value in the gap. Some people may even argue that this thing on the left hand side is not even a matrix.


  Can I set the padding in other indexes? Can I set the padding flag to the last index? 


Sure. You can take whatever value you want for padding. Ideally, you should use a value that has otherwise no other meaning in the context of you problem and thus cannot be confused with any "real" value.
