What are cls tokens?
- User
What are cls tokens?
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
What are cls tokens?
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
In transformer-based models (such as BERT and Vision Transformers), CLS tokens (short for "classification tokens") are special tokens that are added to an input sequence to serve as a summary or aggregate representation of the entire sequence. Here’s a more detailed explanation:
Purpose in NLP (e.g., BERT):
[CLS] is inserted at the very beginning of every input sequence.[CLS] token is treated as a representation of the entire sequence.[CLS] output is fed into a classifier. It may also be used in other tasks that require a holistic understanding of the input.Purpose in Vision Transformers (ViT):
[CLS] or simply "cls token") is appended to the resulting sequence of patch embeddings.Why Use a CLS Token?
In summary, CLS tokens are a design choice in transformer architectures that provide a straightforward way to extract a fixed-size representation of variable-length input sequences, particularly for tasks where a global understanding of the input is required.