Activity (Process)

Sequence Classification Pipeline using the [CLS] Token Output

For sequence-level classification tasks, a standard pipeline is often employed. An input sequence, prepared with a special [CLS][\mathrm{CLS}] token at the beginning, is first processed by a Transformer encoder. This yields a sequence of hidden state vectors, {h0,,hm}\{\mathbf{h}_0, \dots, \mathbf{h}_m\}. The hidden state corresponding to the [CLS][\mathrm{CLS}] token, h0\mathbf{h}_0, is then isolated, as it serves as an aggregate representation of the entire sequence's meaning. Finally, this single vector h0\mathbf{h}_0 is passed through a classification layer, such as Softmax, to produce the final output, for instance, in a binary classification system.

Image 0

0

1

Updated 2026-07-03

Contributors are:

Who are from:

Tags

Ch.1 Pre-training - Foundations of Large Language Models

Foundations of Large Language Models

Foundations of Large Language Models Course

Computing Sciences