A causal attention layer with no positional encoding at all (NoPE) still sees word order, because the causal mask lets token attend only to tokens . Show it: compute such a layer, read token positions back from its output, and write the layer schedule used by models that skip RoPE in every -th layer.
causal_attention(q, k, v) -> np.ndarray
q, k: (T, d); v: (T, d_v). No position information is added anywhere.(T, d_v) = weights @ v.recover_positions(outputs, feature) -> list[int]
outputs: (T, d_v). Column feature holds, at row , the value (up to floating-point error). Return the positions as a list of Python ints, one per row.rope_layers(n_layers, k) -> list[int]
n_layers. Every -th layer skips RoPE: layer skips it when . Return the numbers of the layers that apply RoPE, in increasing order. .