Why do the BPE merger rules have to be kept in order

The BPE training began with a smaller grouping of segments, which was gradually consolidated according to the adjacent segment statistics in the language.

Thematic shorts • IntroductionCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives . 1 first fix

Try to do it after reading

  • Explain the mechanism and premise that the BPE merger rule must keep the order
  • Positioning the mechanism ' s fault limits with fixed examples

Suggested first

  • String and frequency count

Issues and mechanisms

The BPE training began with a smaller grouping of segments, which was gradually consolidated according to the adjacent segment statistics in the language. Each step will change the subsequent observable adjacent pairs, so the consolidated form is an orderly procedure. Only the final list and no order of consolidation are usually insufficient to accurately reproduce the original severing; Recounting the frequency of the text to be coded would better confuse training and reasoning.

Frequency numbers need to include the number of words or segments that appear, and cannot be counted only for different types of strings. (c) The use of defined rules for the maximum frequency to be listed; Normativeization, pre-several boundaries and endpoints also affect candidates. The byte-level scheme can start with a fixed byte overlay, while the character-level scenario takes into account non-seen characters. Arithmetical description here cannot replace a specific tokenizer complete file.

A concrete example

Take synthetic terms ab three times and abc once. The initial frequency of a and b is four, b and c are one, and ab is merged first. Then the words become three ab and one ab, c, which can be merged with ab and c. For new strings abab, the encoding should be done in accordance with the trained merger rules, and should not create a new merger on a temporary basis because of the occurrence of b and a in this new string. Prints the sequence of the fragments per round, more than just looking at the last token number, to detect boundary errors.

Borders and checks

High frequency is not a guarantee of semantic boundaries, and a segment can cross the word of the natural language; Changes in areas may also lead to the loss of the compressed advantage. Test training sets and new areas for splitting differences should be counted as identifiers, web sites, numbers and codes, respectively. The effect cannot be attributed to the consolidated table itself if the case, space rules are modified together and the token number changes are observed.

A method of verification

An effective regression case should contain both training common words, unattended combinations and strings with space boundaries. (b) The consolidation table is fixed and the initial segments of each input record and each legally merged; Change the frequency of words in the input to confirm that the rules of reasoning are not retrained with a single request. If a new space is added to allow adjacent parties to cross the pre-several boundary, the possibility of such integration being permitted by the realization is checked. Only words with the same size and different tracks should be treated as separate, divided assets.

Check understanding

Why are the same phrase sheets and the two verbs still able to produce different segments?

Because merger priorities, regularization and boundary rules are different. The glossary describes which segments exist, the consolidation procedure describes how to choose in the event of a conflict, and the two need to be preserved together.

The highest frequency is tied to each other. Can you pick one at random?

Arithmeticals can define random rules, but randomity and end product must be recorded. If there is a desire for a stable return, a sequence of treatment should be established; It is not possible to declare the same phrases after every training has been randomly changed.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Hugging Face LLM Course — Byte-Pair Encoding
  2. SentencePiece

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.