BPE Tokenizers are the standard for modern LLMs. By default, most add_prefix_space , so that John went away is pretokenized to [_John][_went][_away] . To preserve reversibility, on roundtrip, the leading space is removed. This allows the tokenizer to map a word in the beginning of the sentence to the same word anywhere. But what about cases where there is no leading space in natural language? Examples include poetry ( John went away\nJohn will...
Originally asked by SRobertJames on Stack Exchange (ai) (CC BY-SA 4.0).