SourceWhen Do Prompting and Prefix-Tuning Work? A Theory of Capabilities and Limitations
The paper validates its theoretical prediction on Llama-7B by applying a prefix of length one to the first layer and measuring the resulting attention and activations. Figure 5 shows that the attention distribution over content (non-prefix) positions is identical with and without the prefix, up to a uniform scaling factor, confirming that the prefix cannot change what the head attends to. Figure 6 shows that the prefix-tuned activations match the theoretical formula: the pretrained activations scaled by (1 minus attention on prefix) plus a constant bias vector wv*s1. Additionally, the authors note that Llama-7B produces 24,426 unique completions when prompted with each of its 32,000 tokens, but 46,812 unique 10-token sequences when controlling a single virtual token, illustrating the greater capacity of the embedding space.