Formula

Composition of Hidden States in a Prefix-Tuned Layer

In a prefix-tuned model, the complete hidden state for layer l+1l+1, denoted as Hl+1\mathbf{H}^{l+1}, is formed by concatenating the prefix vectors with the processed hidden states of the original input sequence. This composition is represented by the formula: Hl+1=p0l+1p1l+1pnl+1Hl+1\mathbf{H}^{l+1} = \mathbf{p}_0^{l+1} \mathbf{p}_1^{l+1} \dots \mathbf{p}_n^{l+1} \overline{\mathbf{H}}^{l+1} where Hl+1\overline{\mathbf{H}}^{l+1} is the sequence of output hidden states corresponding to the original input, which can be further expanded as: Hl+1=p0l+1p1l+1pnl+1h0l+1h1l+1hml+1\mathbf{H}^{l+1} = \mathbf{p}_0^{l+1} \mathbf{p}_1^{l+1} \dots \mathbf{p}_n^{l+1} \mathbf{h}_0^{l+1} \mathbf{h}_1^{l+1} \dots \mathbf{h}_m^{l+1}

Image 0

0

1

Updated 2025-10-08

Contributors are:

Who are from:

Tags

Ch.3 Prompting - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences