A stack of one-dimensional convolutional layers, each with kernel width and stride one, pads its input so that every layer returns a row of the same length.
(a) Show that one output of the stack can see input positions. Check the counts that section 21.1 gives for two and three layers of width three.
(b) How many layers of width three does a row of 1000 values need before one output can see the whole row? Repeat for width five.
(c) Section 21.6 says a convolution has a path length that grows like the logarithm of the sequence length. Explain why that statement describes a stack whose layers shrink the sequence, not the stride-one stack of section 21.1. This exercise connects the two sections.
This tier asks for a derivation, so there is no automatic checker. Write your answer, then open the worked solution and compare.
Worked solution
(a) For the stack is one kernel of width , so . Suppose the first layers produce outputs whose receptive field holds values. Layer reads consecutive outputs of that stack. The first of those outputs reaches positions, and each further output shifts the window by one position, so the union covers positions. Therefore For , and , which matches the counts in section 21.1.
(b) For width three, . The condition gives , so 500 layers. For width five, , and gives , so 250 layers. Check the boundary: 499 layers of width three see values, one short, while 500 layers see 1001. For width five, 249 layers see 997 and 250 layers see 1001.
(c) In the stride-one stack the length stays the same at every layer, and one layer moves information by at most positions. Crossing a row of items therefore takes about layers, which is linear in : 500 layers for 1000 items at width three. The logarithm appears when each layer also divides the length by , as a stride- layer does. After such layers the length is , so the stack reaches a single position when , which is layers. Section 21.1's stack keeps its length and has linear path length; section 21.6's logarithmic entry describes a shrinking stack. The two statements are consistent once the stride is named, and the comparison with attention's single step depends on which convolutional stack the reader has in mind.