[KongchangAI]
Concept

SentencePiece

A language-agnostic subword tokenization tool supporting multiple algorithms including BPE and Unigram. It is widely used as a tokenizer for large language models and can learn tokenization models directly from raw text.

Core Facts

Timeline (last 90 days)

Nov 3

WordPiece and SentencePiece are different implementations of the same line of thinking in subword tokenization, among which SentencePiece supports training directly from raw text without pre-splitting words by spaces, making it friendlier to languages without spaces such as Chinese.

Unverified50%
Oct 23

llama.cpp's tokenizer implementation follows the two mainstream schemes of SentencePiece and BPE, and provides a unified abstraction for the vocabulary embedded in GGUF, covering details such as special tokens, byte fallback and normalization rules.

Unverified50%
Oct 20

TinyLlama's UNK rate is 0.0% on all tested scripts, because SentencePiece's byte fallback mechanism never produces UNK tokens.

Unverified50%
Oct 20

When encountering a character that does not exist in the vocabulary, SentencePiece's byte fallback mechanism decomposes the character into a sequence of raw UTF-8 bytes, mapping each byte to a token, thereby avoiding UNK tokens.

Unverified50%
Oct 20

Across 9,000 greedy-decoding questions covering all three splits, token ID 3582 (corresponding to the bare word 'yes') and 1217 (corresponding to the bare word 'no') were never once generated by LLaVA-1.5-7B; what the model actually outputs is ' Yes' (token 3869) and ' No' (token 1939).

Unverified50%
Oct 20

The researchers conducted a four-reading audit on another four VLMs covering three tokenizer families, concluding that the Yes/No reading confusion is a protocol-level rather than model-level issue.

Unverified50%
Oct 20

Porting LLaVA-1.5's token IDs as-is to two models with disjoint vocabularies drops F1 straight to 0.00, whereas using tokenizer-derived readings keeps F1 stable between 0.80 and 0.92.

Unverified50%
Oct 20

SentencePiece treats spaces as ordinary characters (denoted by ▁), and when the prompt ends with 'ASSISTANT:' it retains the space byte after the colon, so the next token the model predicts is actually the space-prefixed form ' Yes'/' No'.

Unverified50%
Oct 16

ArcLM provides both a word-level tokenizer and SentencePiece support.

Unverified50%
Oct 16

The ArcLM core installation automatically pulls in dependencies such as NumPy and SentencePiece, but does not pull PyTorch.

Unverified50%

9 more timeline events

All Facts (20)

Verified

SentencePiece is a language-agnostic tokenization framework proposed by Google that models directly on raw text and is suitable for multilingual use and languages without clear word boundaries.

75%
Verified

Subword tokenization cuts words into smaller segments, common algorithms include BPE, WordPiece and Unigram, and SentencePiece is one language-agnostic engineering implementation among them.

70%
Verified

Different models use different tokenization schemes (such as BPE, SentencePiece, etc.), and the same piece of text may be counted as a different number of tokens across different models.

65%
Verified

Tokens are generated by the BPE (Byte Pair Encoding) algorithm; in English text, each token corresponds on average to approximately 4 characters (about 0.75 words).

65%
Unverified

A Tokenizer is responsible for splitting raw text into token sequences that the model can process; mainstream approaches include BPE, WordPiece, and SentencePiece.

60%
Unverified

OpenAI uses the BPE (Byte Pair Encoding) algorithm for tokenization, while Google's SentencePiece adopts a language-agnostic tokenization method trained directly on raw text.

60%
Unverified

LLM tokenizers (such as BPE) are designed for natural language and decompose numerical values into multiple unrelated tokens, destroying the continuity and magnitude semantics of numbers.

60%
Unverified

OpenAI uses the tiktoken tokenization algorithm, and Google uses the SentencePiece tokenization algorithm.

60%
Unverified

WordPiece and SentencePiece are different implementations of the same line of thinking in subword tokenization, among which SentencePiece supports training directly from raw text without pre-splitting words by spaces, making it friendlier to languages without spaces such as Chinese.

50%
Unverified

llama.cpp's tokenizer implementation follows the two mainstream schemes of SentencePiece and BPE, and provides a unified abstraction for the vocabulary embedded in GGUF, covering details such as special tokens, byte fallback and normalization rules.

50%
Unverified

TinyLlama's UNK rate is 0.0% on all tested scripts, because SentencePiece's byte fallback mechanism never produces UNK tokens.

50%
Unverified

When encountering a character that does not exist in the vocabulary, SentencePiece's byte fallback mechanism decomposes the character into a sequence of raw UTF-8 bytes, mapping each byte to a token, thereby avoiding UNK tokens.

50%
Unverified

Across 9,000 greedy-decoding questions covering all three splits, token ID 3582 (corresponding to the bare word 'yes') and 1217 (corresponding to the bare word 'no') were never once generated by LLaVA-1.5-7B; what the model actually outputs is ' Yes' (token 3869) and ' No' (token 1939).

50%
Unverified

Porting LLaVA-1.5's token IDs as-is to two models with disjoint vocabularies drops F1 straight to 0.00, whereas using tokenizer-derived readings keeps F1 stable between 0.80 and 0.92.

50%
Unverified

The researchers conducted a four-reading audit on another four VLMs covering three tokenizer families, concluding that the Yes/No reading confusion is a protocol-level rather than model-level issue.

50%
Unverified

SentencePiece treats spaces as ordinary characters (denoted by ▁), and when the prompt ends with 'ASSISTANT:' it retains the space byte after the colon, so the next token the model predicts is actually the space-prefixed form ' Yes'/' No'.

50%
Unverified

ArcLM provides both a word-level tokenizer and SentencePiece support.

50%
Unverified

The ArcLM core installation automatically pulls in dependencies such as NumPy and SentencePiece, but does not pull PyTorch.

50%
Unverified

Metaspace is a special pre-tokenization processing technique common in the SentencePiece tokenization system, which replaces spaces between words with a special underscore character (▁).

50%
Unverified

The byte fallback mechanism decomposes characters not found in the vocabulary into their corresponding UTF-8 byte sequences when the tokenizer encounters them, mapping each byte to a special token in the form of <0xE4>.

50%

Source Articles