[a;b][\mathbf{a}; \mathbf{b}]

[a; b] — concatenation

Read "a joined with b". A semicolon between items in square brackets means: join them end to end into one longer vector, or stack them as rows into one longer sequence.

[head⁡1;… ;head⁡h][\operatorname{head}_1; \dots; \operatorname{head}_h] places hh vectors, each dvd_v wide, side by side into one vector h dvh\,d_v wide. That is why WOW^O has h dvh\,d_v rows: one for each number in the joined vector.

When the items are matrices whose rows are tokens, the semicolon stacks their rows: [Ximg;Xtext][\mathbf{X}_{\text{img}}; \mathbf{X}_{\text{text}}] is the image rows followed by the text rows, one sequence. The same notation adds a new row to the KV cache and inserts image patches among text tokens in a multimodal sequence. In PyTorch it is torch.cat.

Example

[[1,2]; [3,4,5]]=[1,2,3,4,5][[1, 2];\, [3, 4, 5]] = [1, 2, 3, 4, 5]

A length-2 and a length-3 vector join into a length-5 vector.

Where the course uses it

Related terms