Short Answer

Calculating the Output Slice in Prefix-Tuning

A Transformer layer is configured for a fine-tuning method where a set of trainable vectors is prepended to the main input sequence. In a specific case, 32 trainable vectors are prepended to an original sequence of 512 hidden state vectors. The layer processes this combined sequence and produces a full output tensor, which we will call H_full_output.

  1. Write the specific Python-style slicing expression needed to select the correct portion of H_full_output to be passed to the next layer.
  2. Briefly explain the purpose of this selection process.

0

1

Updated 2025-10-03

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

Application in Bloom's Taxonomy

Cognitive Psychology

Psychology

Social Science

Empirical Science

Science