Similar Items: Cross-Attention and Encoder-Decoder Transformers: A Logical Characterization