CLS and Mean: Special position does not automatically equal the best sentence vector

CLS is often used as a summary position for input throughout the paragraph, but its direct use as a generic vector depends on pre-training and fine-tuning objectives.

• Step by stepCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives 2 first fixes

Try to do it after reading

  • Distinguishing the sequence header from the generic similitude
  • Check for consistency of coding objectives and pool patterns

Suggested first

  • Inner vectors & Parameters
  • Classified loss and gradient

A special token function comes from training

CLS is often used as a summary position for input throughout the paragraph, but its direct use as a generic vector depends on pre-training and fine-tuning objectives. The serial classification task monitors this location through the head of the classification, and does not mean that it naturally has the best cosine geometry without the corresponding training.

Set hidden status CLS = [10], two elements token [0,2] and [0,4], respectively. Take CLS for [1.0] content worth [0,3]. The two directions are completely different and cannot be said to be merely a harmless compression of the same information. The distribution of information on the network requires a task validation and cannot be determined by a name of the location alone.

Mean is not without assumptions. It gives each valid position, etc., the repeated words, templates and special symbols in the long text influence the result. CLS allows the network to learn through attention that is not evenly aggregated, but whether this capacity is activated by the target or migrated to a new task is not guaranteed by the interface itself.

Accuracy of classification is not a substitute for a search assessment

A vector can be accurately separated by a non-linear classification header and may not be suitable for direct use of cosine to find immediate neighbours. The classification header may compensate for the scale and direction of the original space, whereas the search is conducted using only fixed measures. If the goal is semantic, the list should be compared to the list of candidates and correlations, instead of just looking at classification loss.

Changes in the length of the context are also checked. After the cut, CLS still exists, indicating that it no longer contains the cut; The denominator of mean will change. The cut-off length, special symbols and mask policies should be recorded, and the two options should not be compared under different input overlays.

A small collection of the same content but different templates, length and sequences can be constructed, checking for non-variability and then assessing it with an independent mission. Individual recent neighbours appear to be reasonably capable of diagnosis and not of evidence of overall superiority.

This section refers to the original papers BERT and Sentence-BERT, where vectors are synthetic reverses. Specific models sometimes provide a dedicated pooler or recommended vector interface, and priority should be given to checking model cards with training targets to avoid treating all Transformer in the same way.

The model has CLS, does it make sure it is suitable for direct cosine search?

No assurance that location use and representation geometry are determined by the training target and require search evaluation.

Mean No parameters, no design assumptions?

No, it assumes that the selected effective position, etc., is a summary, with special symbols, templates and length strategies influencing the outcome.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks
  2. BERT: Pre-training of Deep Bidirectional Transformers

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.