where \(\mathtt {sg}\)  denotes the stop-gradient operator. The first term optimizes the codebook \(Z\)  and the second term is a commitment loss to make sure \(\hat{z}\)  commits to codebook and does not grow arbitrarily[1]}. \(\beta \)  is a weight parameter to balance the two terms.
<FIGURE>