Six Reviews, Two Batches

Sequential DataMedium+20 XP+20

Six Reviews, Two Batches

A sequence model reads reviews in batches, and every sequence inside a batch must be the same length, so the shorter ones are padded with blanks.

Six tokenized reviews are waiting:

reviewtokens
r112
r25
r340
r47
r514
r68

The hardware processes three sequences at a time, so these six go through as two batches of three. You are free to choose which reviews share a batch.

Padding is decided batch by batch: inside a batch, every sequence is padded up to the length of the longest review in that batch, so a batch of three occupies

3×(length of its longest review)3 \times (\text{length of its longest review})3×(length of its longest review)

positions. The model pays for every position it processes, blank or not. The model can read sequences of up to 646464 tokens, so nothing here needs truncating.

Grouped in the way that wastes the least, how many of the processed positions hold padding rather than a real token?

Hints

Solve it to unlock the solution

Once you get it right, the reasoning behind the answer shows up here.

Select all that apply.