Calculate the probability of a given sequence for a seq2seq model
Given a seq2seq paraphrase modelpp_model, a tokenizerpp_tokenizer, a piece oftextand a few pre-determined paraphrasespp_1, pp_2, pp_3pp_model = AutoModelForSeq2SeqLM.from_pretrained("tuner007/pegasus_paraphrase")
pp_tokenizer = AutoTokenizer.from_pretrained("tuner007/pegasus_paraphrase")

text  = "I like to go to the beach."
pp_1  = "I really enjoy going to the beach."
pp_2  = "The beach is somewhere I like to go."
pp_3  = "I like driving to the beach and watching the waves flow."how can I calculate the generation probability ofpp_modelgenerating each paraphrase?For context, I need this to work out the KL-divergence between a model and a reference model, using the formulaKL = E_{x \sim p_{model}} [\log p_{model}(x) - \log p_{refmodel}(x)](e.g. as donehere).