Groth-Sahai Proof of multi-exponentiation

I want to create a NIZK proof of a multi-exponentiation via Groth-Sahai proofs. In the lectures of Jens Groth in a winter school of Bar-Ilan University, he shows a way to transform multi-exponentiations to paring product equations.

My problem is as follows. Let me take a pairing in the first form ($$e(A_j,h^{y_j})$$) I need to commit to $$h^{y_j}$$ as I understand. But I don't know how to prove that I commit the right exponentiation. I think that I just have another exponentiation to prove, since $$y_j$$ is also a variable -not a constant. Is there a different way to create proofs for multi-exponentiation equations or am I missing something?