From RNNs to Transformers