ReTok: Replacing Tokenizer to Enhance Representation Efficiency in Large Language Model

Shuhao Gu, Mengdi Zhao, Bowen Zhang, Liangdong Wang, Jijie Li +1 more
10/6/2024
cs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Tokenizer is an essential component for large language models (LLMs), and a tokenizer with a high compression rate can improve the model's representation and processing efficiency. However, the tokenizer cannot ensure high compression rate in all scenarios, and an increase in the average input and output lengths will increases the training and inference costs of the model. Therefore, it is crucial to find ways to improve the model's efficiency with minimal cost while maintaining the model's performance. In this work, we propose a method to improve model representation and processing efficiency by replacing the tokenizers of LLMs. We propose replacing and reinitializing the parameters of the model's input and output layers with the parameters of the original model, and training these parameters while keeping other parameters fixed. We conducted experiments on different LLMs, and the results show that our method can maintain the performance of the model after replacing the tokenizer, while significantly improving the decoding speed for long texts.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gu2024retok,
  title  = {ReTok: Replacing Tokenizer to Enhance Representation Efficiency in Large Language Model},
  author = {Shuhao Gu and Mengdi Zhao and Bowen Zhang and Liangdong Wang and Jijie Li and Guang Liu},
  year   = {2024},
  eprint = {2410.04335},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2410.04335v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2410.04335.svg)](https://codeofpaper.com/paper/2410.04335)

Discussion