atlas

Research map / Large language models / Instruction and fine-tuning

Getting the most out of your tokenizer for pre-training and domain adaptation

ICML 2024 · Large language models › Instruction and fine-tuning · approach: Efficient LLM fine-tuning systems · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies how BPE tokenizer size, pre-tokenization regex, and training data affect code LLM compression and downstream code generation, and tests switching tokenizers during fine-tuning of pre-trained LLMs.

Problem

Tokenizer design (vocabulary size, pre-tokenization regex, training data) is usually fixed by borrowing and rarely optimized, and pre-trained LLMs keep their original tokenizer during domain fine-tuning even when it is sub-optimal for the domain, hurting inference efficiency and effective context le

Approach

Systematically ablates BPE tokenizer hyper-parameters for code, derives inference- and memory-optimal vocabulary size formulas, and shows that a pre-trained code LLM can switch to a more compressive tokenizer during fine-tuning (with FVT embedding initialization) given enough tokens (>=50B) without losing downstream performance.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Switch a Llama 2 7B model to the GPT-4 80k tokenizerLlama 2 7B · HumanEvalPass@1: 32.05792683 -> 30.82317073Hurt
Switch a Llama 2 7B model to the GPT-4 80k tokenizerLlama 2 7B · MBPPPass@1: 41.926 -> 42.594Helped
Change tokenizer vocabulary size from 32k to 64k (ablation)GPT-4 tokenizer on model 1.5B · HumanEvalPass@1: 20.54268293 -> 20.625No clear effect
Change tokenizer vocabulary size from 32k to 128k (ablation)GPT-4 tokenizer on model 1.5B · MBPPPass@1: 27.245 -> 27.459No clear effect
Remove FVT initialization (ablation)GPT-4 tokenizer on model 1.5B · HumanEvalPass@1: 20.54268293 -> 18.40548780487805Hurt
Remove FVT initialization (ablation)GPT-4 tokenizer on model 1.5B · MBPPPass@1: 27.245 -> 25.001Hurt
Replace a distinct tokenizer with an extended Llama tokenizermodel 1.5B fine-tuned for code · HumanEvalPass@1: 20.54268293 -> 20.84451219512195No clear effect
Freeze non-vocabulary weights for 100B tokens (ablation)Punct tokenizer model 1.5B · HumanEvalPass@1: 22.22560976 -> 21.33231707Hurt
Freeze non-vocabulary weights for 500B tokens (ablation)Punct tokenizer model 1.5B · HumanEvalPass@1: 22.22560976 -> 17.80792683Hurt
Use the GPT-4 tokenizer instead of the Llama tokenizer after 50B or more fine-tuning tokensPre-trained model fine-tuned for code · HumanEvalPass@1No clear effect
Use the Punct tokenizer instead of the Llama tokenizer after 50B or more fine-tuning tokensPre-trained model fine-tuned for code · HumanEvalPass@1No clear effect
Remove token healing (ablation)Identity tokenizer model fine-tuned from Code Llama · HumanEvalPass@1: 18.77439024 -> 0.1341463415Hurt

Surprising findings

Limitations

Experimental setup

Datasets: CCnet Wikipedia The Stack HumanEval MBPP

Benchmarks: HumanEval MBPP

Metrics: Pass@1 Pass@100 Compile@1 Normalized Sequence Length Bytes per Token Renyi entropy

Baselines: Llama tokenizer Code Llama 7B GPT-2 tokenizer Identity tokenizer InCoder tokenizer

Builds on: Byte-Pair Encoding Fast Vocabulary Transfer Code Llama GPT-4 pre-tokenization regex

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy