Scaffold-BPE: Enhancing Byte Pair Encoding for Large Language Models with Simple and Effective Scaffold Token Removal

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Lian, Haoran, Xiong, Yizhe, Niu, Jianwei, Mo, Shasha, Su, Zhenpeng, Lin, Zijia, Chen, Hui, Liu, Peng, Han, Jungong, Ding, Guiguang
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866909387373674496
author Lian, Haoran
Xiong, Yizhe
Niu, Jianwei
Mo, Shasha
Su, Zhenpeng
Lin, Zijia
Chen, Hui
Liu, Peng
Han, Jungong
Ding, Guiguang
author_facet Lian, Haoran
Xiong, Yizhe
Niu, Jianwei
Mo, Shasha
Su, Zhenpeng
Lin, Zijia
Chen, Hui
Liu, Peng
Han, Jungong
Ding, Guiguang
contents Byte Pair Encoding (BPE) serves as a foundation method for text tokenization in the Natural Language Processing (NLP) field. Despite its wide adoption, the original BPE algorithm harbors an inherent flaw: it inadvertently introduces a frequency imbalance for tokens in the text corpus. Since BPE iteratively merges the most frequent token pair in the text corpus to generate a new token and keeps all generated tokens in the vocabulary, it unavoidably holds tokens that primarily act as components of a longer token and appear infrequently on their own. We term such tokens as Scaffold Tokens. Due to their infrequent occurrences in the text corpus, Scaffold Tokens pose a learning imbalance issue. To address that issue, we propose Scaffold-BPE, which incorporates a dynamic scaffold token removal mechanism by parameter-free, computation-light, and easy-to-implement modifications to the original BPE method. This novel approach ensures the exclusion of low-frequency Scaffold Tokens from the token representations for given texts, thereby mitigating the issue of frequency imbalance and facilitating model training. On extensive experiments across language modeling and even machine translation, Scaffold-BPE consistently outperforms the original BPE, well demonstrating its effectiveness.
format Preprint
id arxiv_https___arxiv_org_abs_2404_17808
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Scaffold-BPE: Enhancing Byte Pair Encoding for Large Language Models with Simple and Effective Scaffold Token Removal
Lian, Haoran
Xiong, Yizhe
Niu, Jianwei
Mo, Shasha
Su, Zhenpeng
Lin, Zijia
Chen, Hui
Liu, Peng
Han, Jungong
Ding, Guiguang
Computation and Language
Byte Pair Encoding (BPE) serves as a foundation method for text tokenization in the Natural Language Processing (NLP) field. Despite its wide adoption, the original BPE algorithm harbors an inherent flaw: it inadvertently introduces a frequency imbalance for tokens in the text corpus. Since BPE iteratively merges the most frequent token pair in the text corpus to generate a new token and keeps all generated tokens in the vocabulary, it unavoidably holds tokens that primarily act as components of a longer token and appear infrequently on their own. We term such tokens as Scaffold Tokens. Due to their infrequent occurrences in the text corpus, Scaffold Tokens pose a learning imbalance issue. To address that issue, we propose Scaffold-BPE, which incorporates a dynamic scaffold token removal mechanism by parameter-free, computation-light, and easy-to-implement modifications to the original BPE method. This novel approach ensures the exclusion of low-frequency Scaffold Tokens from the token representations for given texts, thereby mitigating the issue of frequency imbalance and facilitating model training. On extensive experiments across language modeling and even machine translation, Scaffold-BPE consistently outperforms the original BPE, well demonstrating its effectiveness.
title Scaffold-BPE: Enhancing Byte Pair Encoding for Large Language Models with Simple and Effective Scaffold Token Removal
topic Computation and Language
url https://arxiv.org/abs/2404.17808