Architectural Mechanism: Prefix Injection in Attention Layers

To achieve deeper adaptation, techniques like P-tuning v2 implement layer-wise prefix injection by prepending learnable continuous vectors directly to the key and value tensors within the self-attention mechanism of each transformer layer. This method allows the prefixes to influence the model's contextual understanding at multiple processing stages.

Sources

Open the full topic