(2) text encodings \(\stackrel{PQ}{\Longrightarrow }\)  discrete codes. Next, we consider mapping the text encoding \({x}_i\)  to a vector of discrete codes for item \(i\) , based on product quantization (PQ) [1]}. PQ defines \(D\)  sets of vectors, each of which corresponds to \(M\)  centroid embeddings with dimension \(d_W/D\) . Formally, we denote \({a}_{k,j}\in \mathbb {R}^{{d_W}/{D}}\)  as the \(j\) -th centroid embedding for the \(k\) -th vector set. Given the text encoding \({x}_i\) , PQ first splits it into \(D\)  sub-vectors \({x}_i = \left[{x}_{i,1};\ldots ;{x}_{i,D}\right]\) .
Then for each sub-vector, PQ selects the index of the nearest centroid embedding from the corresponding set to compose its discrete code (i.e., a vector of indices). For the \(k\) -th sub-vector of item \(i\) , formally we have the selected index as:
\(c_{i,k} = \arg \min _{j} \Vert {x}_{i,k}-{a}_{k,j}\Vert ^2 \in \lbrace 1,2,\ldots ,M\rbrace ,\) 
