Back Translation Using T5

Hey guys,

I actually want to implement a back-translation method using T5, which means that I first use T5 to generate a sentence Y’ from X, then use T5 again to generate sentence Y (which ideally should be as similar as possible to the initial sentence X), and compute the corresponding Loss(X, Y). I think I need to find a way to make the Y’ differentiable.
Does anybody have any idea about it?