Could you check the .grad attribute of data_words after the backward call?
Also, Variables are deprecated since PyTorch 0.4.0, so you can use tensors directly now.
The usual approach would be to pass the parameters as a list to the initialization of your optimizer, but your approach seems to work for data_phrases.