| Algorithm 1 Pseudocode of Attention-Based Contrastive Loss Computation. |
| Input 1: ▹ M: number of |
| Input 2: ▹ N: count of Q |
| Output: |
| ▹⊙: Matrix Multiplication |
| for do |
| ▹ i-th row of |
| ▹ i-th row of |
| ▹ CL: Contrastive Loss; ×: element-wise multiplication |
| end for |
| return |