How to exchange arguments, sequence length and rare word overlays for the size of the table

A larger vocabulary can press a common segment into a smaller number of token, while increasing input embedding and output projection.

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

Try to do it after reading

  • Mechanisms and premises to explain how the size of the vocabulary is exchanged for parameters, sequence length and rare word overlaying
  • Positioning the mechanism ' s fault limits with fixed examples

Suggested first

  • Token with embedded matrix

Issues and mechanisms

A larger vocabulary can press a common segment into a smaller number of token, while increasing input embedding and output projection. A smaller list makes it easier for individual segments to overwrite new words, but with longer sequences, attention and cache costs may increase. The size of the phrase sheet is therefore not the larger the better or the smaller the smaller, but rather a joint choice between data languages, document types and model resources.

Sets the size of the vocabulary V, hides the dimensions d, and a noncompressed embedded table has V multiplied by d parameters. Another approximate size matrix is required when the output weight is not shared; Sharing reduces storage without eliminating the cost of calculating the fractions of the word table for each location. The wordbox should be assessed by looking at the average length, long-tail length, character coverage and domain-specific terminology at the same time, and not just at the compression rate of ordinary news.

A concrete example

Synthetic model takes a thousand dimensions hidden. Thirty million embedded parameters are needed for the 30 grand and 60 million for the 60 grand. Assuming that the same documents receive 200 and 160 token, respectively, a larger list reduces the sequence by two points, but doubles the embedded parameters. If the median of the full attention increases by length squarely, the two lengths correspond to 40,000 and 25,600 positions paired; This is only the account book, not the total time taken to reduce the whole model by 36 per cent.

Budget of the glossary of embedded parametersSynthetic hidden dimensions of 10, 30,000 and 60,000 words correspond to 30 million and 60 million embedded parameters, respectively.30,000 words30 Million ArgumentsSixty thousand words60 Million Parameters
Synthetic hidden dimensions of 10, 30,000 and 60,000 words correspond to 30 million and 60 million embedded parameters, respectively.

Borders and checks

Changes in different languages are not necessarily uniform. The large amount of English acronyms for the glossary may add to the size of Chinese and minority languages. Training and reasoning must be repeated in the same table and special symbol numbers; Directly replaces the list of words that change the meaning of each embedded line. The addition of token also requires clarity about initialization, training and the return of old capabilities, and it cannot be assumed that the new vocabulary has been learned because the matrix size can be expanded.

A method of verification

The phrase sheet experiment can fix the same Chinese-English mixed test text, counting the total token, the maximum sample, the numerical string and the cut of the name of a rare person. If the average length is improved and a few professional samples grow, the tail changes should be listed separately. Parameter logbooks check whether to share the output header: both tabs are added when not shared and only one is added when shared. This would allow the word-compression, parameters and actual mission quality to be placed in the same auditable comparison, rather than simply selecting the optimal configuration of the average.

Check understanding

Double the vocabulary. Do you have to double the whole model parameter?

No, it's not. The changes occurred mainly in the matrix associated with the vocabulary, and the Transformer subject may not change; Embedded, output header and main parameters should be listed separately to avoid local scales being applied to the whole.

The sequence's reduced by 20%. Must it be 20%?

Can't. Prefixing, decoding by token, projection of words, RAM bandwidth and batch ratio. Length is only part of the cost and is ultimately measured on fixed documents and hardware.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Hugging Face LLM Course — Byte-Pair Encoding
  2. Stanford CS336 — Language Modeling from Scratch, Spring 2025

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.