BPE-knockout: Pruning Pre-existing BPE Tokenisers with Backwards-compatible Morphological Semi-supervision
Paper · 2024 · Thomas Bauwens and Pieter Delobelle
Summary
A tokenizer turns text into units that a language system can process. Byte-pair encoding, or BPE, learns those units by joining pieces that frequently occur next to each other. A frequent pair can straddle the boundary between meaningful parts of a word. Once those pieces have been joined, later rules can build an even larger token around the join, hiding a pattern that recurs in other words. BPE-knockout uses a lexicon of analyzed words to find the rules that repeatedly erase such boundaries. It brings evidence about word structure into an existing system for subword tokenization.
Removing a rule poses a practical problem. Other rules may need the piece it produces, and removing all of them could discard useful vocabulary. BPE-knockout rewrites those dependent rules so they can join the removed piece’s ingredients directly. A surviving token still has its original spelling and can still use its learned representation. The resulting tokenizer can therefore be used with a system that was trained on the original vocabulary, although the system will encounter new segmentations and may need further training to handle them well.
In English, German and Dutch, the edited tokenizers recovered more derivational and compound boundaries from the CELEX lexicon. For Dutch words counted equally, morpheme-boundary F1 rose from 53.9 with ordinary BPE to 68.9 when the same lexicon supplied the edits and the evaluation. It reached 67.5 when the authors used a random holdout and scored entries that had been withheld from the edit selection. The improvement on held-out entries shows that some changes transfer across words. Holding entries out had a larger effect when the evaluation emphasized the commonest words.
The Dutch RoBERTa experiments give a more mixed picture. Starting with the edited tokenizer improved named entity recognition at the matched pretraining budget, while ordinary BPE performed better on several other measures. Switching an already trained system to BPE-knockout initially caused a sharp rise in pseudo-perplexity, a measure of how well it scores text under a masking procedure. Continued pretraining brought that score back down and yielded stronger token-level results than continued training with ordinary BPE. The paper shows how an existing tokenizer can be revised without discarding prior training, and where better alignment with morphology made a measurable difference.
Deep dive: BPE-knockout: Pruning Pre-existing BPE Tokenisers with Backwards-compatible Morphological Semi-supervision
BPE-knockout prunes harmful merge rules from an existing tokenizer so it can better preserve meaningful word parts and reuse prior training. · about 37 minutes to read
The problem and its context
Why frequent pairs can make poor word pieces
A tokenizer has to represent words it has never seen using a vocabulary of manageable size. Giving every possible word its own entry makes that vocabulary difficult to maintain. Giving every character its own entry has the opposite effect. It makes a wide range of words representable, but a familiar stem or ending arrives as a sequence of small units. A sub-word vocabulary puts some longer pieces into the inventory so they can each carry a learned representation while leaving smaller pieces available for unfamiliar words. The design question in this paper is which longer pieces earn their place in the vocabulary.
The paper traces BPE from a compression procedure to a way of learning and applying a vocabulary. In the compression procedure, a frequent pair of neighboring bytes is replaced by a new symbol. The process repeats with the updated sequence, and the recorded operations can be reversed to recover the input. The adaptation for translation learned an ordered list of joins over text and then reused the list on new inputs. As the paper describes it, the original text adaptation worked with characters and disallowed merges across spaces. Later variants returned to bytes. The important change was to use a set of joins learned from one corpus to segment other text, an approach introduced for rare words in neural machine translation.
BPE has an economical answer to the question of what to join next. It counts adjacent pairs in the current representation of the training corpus and takes the most frequent one. Each join changes the pairs available for the next round. A piece that turns up inside many longer words can therefore become a token before any of those words has a dedicated entry. The training corpus needs no linguistic labels. Its counts, however, say how often two pieces occur together. They supply no direct evidence about whether the pieces belong to the same stem, suffix or compound constituent.
That distinction matters because the system downstream sees token identities. The starting material for a token is visible to the tokenizer, while the downstream system receives the resulting unit as an item with its own learned representation. If an ending appears as a separate token in some words and is swallowed into several unrelated tokens in others, occurrences of the ending contribute through different inputs. The issue is especially clear when a merge takes part of a stem and part of an ending. It can prevent either from surfacing as a complete piece, even if the vocabulary already contains the pieces that would otherwise make a good segmentation.
The paper illustrates the consequences with earlier work on Turkish translation. A passive marker had its letters distributed across surrounding tokens, and the translation lost the passive reading in the example discussed by the authors. An English example shows the same representational issue without the translation step. The spellings of danced and dancing can share danc as a token, while danced and entered can share ed. Segmentations that break each word differently give the downstream system fewer explicit repetitions to learn from. The point concerns recurring surface material. Even a boundary that is linguistically well placed need not expose a stem in its dictionary spelling.
Preserving a boundary is also only part of the objective. Character segmentation would retain every ordinary gap inside the word, including every morpheme boundary, while introducing a split at all the other gaps as well. The paper wants longer units that let repeated occurrences of a meaningful piece inform the same representation. The useful comparison therefore asks how frequently a tokenizer finds meaningful gaps and how frequently its chosen gaps are meaningful. Both questions matter when deciding whether a tokenizer has improved or has simply become more granular.
Why an existing vocabulary is hard to change
BPE constructs a large piece through a sequence of pairwise joins. A piece learned early can spend the rest of training mainly as an ingredient for a larger one. Once the larger token exists, the intermediate piece can become rare in the tokenizer’s final output. Work discussed by the authors found a sharp drop in usage near the low-frequency end of BPE vocabularies, including pieces that hardly ever appeared. Such entries still occupy space for learned representations. The paper connects this issue to the observations in Byte Pair Encoding Is Suboptimal for Language Model Pretraining.
An intermediate piece can be rare as an output and still indispensable to the original derivation of another token. Removing its rule from the list would make every rule that takes it as an input impossible to apply. A valuable word piece could disappear because it happens to have been built through an undesirable intermediate form. The training procedure created this dependency by requiring each join to combine a pair. An edit that removes the intermediate piece needs to preserve enough of that derivation to keep the larger piece within reach.
The problem becomes more consequential after downstream pretraining. The learned representations belong to particular vocabulary entries, and the system has seen those entries in particular patterns. Starting over with a vocabulary induced under different rules could change both which entries exist and how text is broken into them. Editing the old vocabulary offers a route to preserve the representations for surviving entries. This leaves a separate question about behavior. Even when an entry carries over directly, changing the contexts in which it appears can change how well prior training prepares the system to use it.
Earlier ways of bringing structure into segmentation
The paper places BPE-knockout alongside approaches that intervene at different stages. Early work on discovering morphemes sought a vocabulary whose pieces follow recurring word structure. Later members of the Morfessor family could use both raw text and examples of preferred splits. The labeled words help guide the learner, while unannotated text still supplies evidence about usage. BPE-knockout also combines these sources of evidence, but its corpus-based stage can already have happened by the time the morphological examples are introduced. The authors trace this line of work back to Unsupervised Discovery of Morphemes.
Another option is to split the input at known boundaries before it reaches BPE. The authors discuss work that found lower perplexity for causal language prediction when a morphological analyzer supplied those breaks. They also discuss targeted work in which protecting certain derivational affixes improved topic and sentiment classification. These studies provide reasons to test the causal role of segmentation, since changing a boundary can change how a stem or ending is presented to a downstream task. The presegmentation result comes from Morphology Matters.
A separate line of work exposes a system to several segmentations of the same spelling. In BPE-dropout, individual applications of merge rules can be skipped at random. The same input can then appear in more than one form across training, giving the system opportunities to see substrings that an ordinary deterministic pass consistently hides. That variation can also help when identical spellings have different analyses. BPE-knockout takes a fixed rule list and changes it deterministically, so the comparison with BPE-Dropout helps distinguish the effect of selecting specific rules from the effect of withholding joins more generally.
The closest vocabulary-reduction comparison in the paper is trimmed BPE. Trimming runs the original merge procedure, then opens up any final token marked for removal. It repeats that reversal if a newly exposed piece is also marked. In that design, a piece can still operate as an intermediate during segmentation even when it is forbidden in the final output. BPE-knockout intervenes in the rules used to reach that output. This distinction becomes important when an intermediate piece captures material that another large token could have used.
The method, step by step
Learn the starting vocabulary
The method begins with a trained BPE tokenizer. During ordinary BPE training, each word initially consists of alphabet items. The trainer finds the most frequent adjacent pair, creates a rule for joining it, and applies the rule across the training material. This adds a new vocabulary item and changes which pairs the next round will count. At application time, the tokenizer uses the learned priorities to decide which available join to perform. It continues until no eligible rule can join any of the remaining pieces.
For the English, German and Dutch baselines in the paper, the authors built word-count dictionaries from the corresponding parts of OSCAR, a collection of web text organized by language. They limited each language input to the first 30 million entries and put spaces around punctuation other than hyphens. They then split on whitespace and counted strings. They removed strings with a frequency below 10, strings longer than 60 characters, and strings that contained characters from a foreign alphabet. The remaining strings were encoded in UTF-8, prefixed with a word-start marker, and split at hyphens. BPE operated on the resulting byte-based word counts.
The initial vocabulary size was 40,000 for each language. The authors took the byte-based setup from RoBERTa and the vocabulary size from RobBERT. The word-start marker, written as Ġ in examples below, distinguishes a piece at the beginning of an input word from an otherwise identical sequence that occurs inside it. This is part of the representation on which the rules work. Punctuation handling, byte encoding and the marker shape the inventory before any morphological evidence is consulted.
Map the reference analyses to surface words
The authors obtained annotated lemmas from CELEX. A lemma is a dictionary form, so the entries offer information about the structure of headwords. CELEX supplies this information as a tree. Its leaves specify the morphological material, its groupings indicate which pieces combine first, and its tags distinguish categories and the roles of affixes. The rule-selection step ultimately needs a much simpler object, a set of internal positions in the written word where a boundary should survive.
The authors show how to obtain these positions with the Dutch compound reanimatietechniek, meaning resuscitation technique. The reference breaks the word into a branch for reanimatie and a branch for techniek. At a deeper level, its analysis includes forms such as animeer and technisch. Concatenating those forms with the other material in the tree would give a different spelling from the actual headword. A Viterbi alignment links the underlying pieces to substrings in the observed form. In this example, animeer is realized as anim, and technisch as techn.
The surface sequence is re | anim | atie | techn | iek. The vertical bars indicate the boundaries used for judging merges. In a later evaluation, the tree also lets the authors ask where the constituent words of the compound meet. For that purpose, they attach affixes to the material they modify and recover reanimatie | techniek. The full and reduced analyses come from the same word. The first gives the target boundaries for blame. The second gives a separate view of how well the tokenizer keeps the constituent words recognizable.
This conversion makes the procedure applicable to annotations of different forms. The paper’s selection rule needs the positions in a flat segmentation once they have been mapped to the spelling used for tokenization. The richer CELEX annotation is useful for obtaining those positions and distinguishing which of them belong to the compound evaluation. A rule may therefore be selected because it crosses an affix boundary even when the intended downstream comparison concerns complete constituent words.
Editing a BPE tokenizer with morphological boundaries
The steps in order.
Represent rules and dependencies explicitly
A BPE rule takes pieces in a particular order. Its output has the spelling of those pieces concatenated in that order. The paper writes a binary rule as follows.
x + y → xy
Here x and y are neighboring pieces from the vocabulary. The plus sign places x before y as the input to the rule. The arrow indicates that the pair is replaced by the single piece xy, whose surface form is the concatenation of the inputs. The vocabulary V starts with the alphabet Σ. The alphabet consists of nonempty strings, and the vocabulary grows as the rules construct new strings.
For editing, it is useful to represent the merge list with priority and argument order intact.
M = {(i, (xᵢ, yᵢ))}ᵢ₌₁⁽|ᴹ|⁾
M denotes the collection of merge records. The index i is the place in the learned ordering and runs from 1 through |M|, the number of records. The ordered pair (xᵢ, yᵢ) contains the left and right inputs at that index. The output is implicit in the pair. This representation keeps a rule’s identity distinct from the spelling it constructs.
A drawing with a vertex for each vocabulary item and arrows from smaller pieces to larger ones conveys some dependencies. It loses the priority of each operation, which input comes first, and how to group the inputs if several rules are ever allowed to construct the same string. Using a vertex for every merge instead would preserve the rule identity. It could also duplicate information about which subsequent rules consume the same output. The authors use both kinds of vertices. Edges run from the input types to the rule that consumes them and from that rule to the type it produces.
For a vocabulary type t, the incoming rule set Mᵢ(t) identifies the operations that construct t. The outgoing rule set Mₒ(t) identifies the operations that take t as an input. Here the subscripts on Mᵢ and Mₒ distinguish incoming and outgoing sets. The graph makes the difference between producing and consuming a type explicit, so an edit can act on both sides of the same dependency.
∀(i, m) ∈ M: |m| = 2
The symbol ∀ means that the condition holds for every record (i, m) in M. The symbol ∈ means membership, i is the rule’s priority, and m is its ordered tuple of inputs. The notation |m| gives the length of that tuple. This is the pairwise property of the starting merge list. After a knockout, a rewritten rule can have more inputs.
∀t ∈ V ∖ Σ: |Mᵢ(t)| = 1
Here t ranges over the vocabulary V excluding its starting alphabet Σ, with ∖ denoting set difference. The notation |Mᵢ(t)| counts the rules that produce t. The equality expresses the unique producer property for types created by merges. Alphabet entries are available initially, so they have no producer to remove. The knockout procedure explicitly checks for this case.
The proof in the paper explains why the producer is unique for an ordinary trained BPE vocabulary. Consider a string that is about to receive a learned rule. Some occurrences of that string may already have merged with neighboring material across one of its edges. Those occurrences cannot later form the isolated string, because a BPE operation only joins existing pieces. The occurrences that remain intact follow the same internal merge history as one another up to the new rule. Applying the new rule throughout the corpus turns those occurrences into the same token wherever the rule is available. As a result, the corpus offers no remaining sequence of separate pieces that can later be counted as another way of learning that same type.
Attribute each lost boundary to a rule
A finished segmentation tells the authors which boundaries survived. To decide what to edit, they need to know which operation first removed each missing boundary. They run the original tokenizer over the reference words and record its merge history. A boundary is lost at the first operation that places material from both sides inside one token. Later joins may carry that token into a larger piece, but the earlier operation is the one that made the two sides inseparable. The responsible operation can therefore be identified even if its output is absent from the final segmentation.
A join can be blameworthy before either morpheme has formed a complete token. It only needs to take material from both sides of a reference gap. This is what makes tracing the full history important. Looking exclusively at final tokens would identify pieces that cross a boundary, but it could lead to removing the rule that built a large token when an earlier rule is responsible for the missing gap.
R(m) = B(m) / N(m)
m is a merge rule in the original list M. N(m) is the count of its applications when the reference entries are tokenized. B(m) is the count of times it is blamed for deleting a reference boundary. The slash denotes division, and R(m) is the resulting blame ratio. The criterion concerns observed applications. A rule unused in the reference entries supplies no applications from which to estimate blame.
R(m) ≥ 1/2
The symbol ≥ includes equality. The threshold 1/2 selects a rule when the reference analysis assigns blame in at least half of its observed applications. Selection is for the rule as a whole, so acceptable uses of a high-blame rule can be affected too. The threshold turns repeated boundary-crossing behavior into a definite edit without requiring a linguistic judgment at runtime.
The default selection scores written word types. Each lexicon entry contributes its merge events without a multiplier for corpus frequency. An entry’s contribution still depends on the merges actually performed in it. The aim is to keep errors on rare word forms visible during selection. The authors separately test what happens when occurrences in common words receive more influence.
The Dutch words bruidsjurk, beleidsmaker and gids illustrate this distinction. The join id + s runs in all of them in the example. The reference identifies the join as harmful in bruidsjurk and beleidsmaker and permits it in gids. The paper’s constructed lexicon accordingly gives B(m) as 2 and N(m) as 3. In the separate frequency example, gids occurs 30 times while the other words occur 10 times each. Weighted blame has B(m) of 20 and N(m) of 50, putting the rule below the selection threshold. The same linguistic analyses can lead to different edits depending on how the examples are weighted.
Remove a token without losing every token built from it
Suppose the selected rule produces ids from id and s. Deleting that rule would normally prevent any later rule that needs ids from running. BPE-knockout opens the intermediate piece back up inside each dependent rule. A join that once combined Ġbru and ids is now expressed as a join of Ġbru, id and s. It still yields Ġbruids at the original rule’s priority if those inputs are adjacent and available. ids itself is removed from the vocabulary and can no longer appear as a token under its original rule.
The paper calls the generalization byte-tuple encoding. A tuple is an ordered list of inputs. The application procedure can use a rule with several inputs as long as the specified pieces occur next to each other in that order. The method obtains those rules by rewriting existing joins. Searching for arbitrary tuples during initial training would pose a different problem. The number of possible candidates grows with the vocabulary and the tuple length.
|V|ᴺ
V is the vocabulary, |V| is its size, and N here is the number of positions in a candidate tuple. The superscript denotes exponentiation. The paper uses this expression to describe the search space for ordered tuples and argues that long candidates would also yield sparse counts. This N refers to tuple length, while N(m) in the blame calculation counts applications of an individual rule.
The graph edit starts by retrieving the unique rule that produced the selected piece. It removes that rule from the outgoing sets of its parents. For every rule that used the selected piece, it substitutes the parent tuple in place of the selected input. The new rule is recorded as the producer of the same output and retains the old priority. The parents now participate in these rewritten rules. Finally, the selected piece leaves the vocabulary and its graph links are cleared. If an input has already been expanded during a previous knockout, its current tuple supplies the replacement. The authors state that the ordering of knockouts does not affect the result for a fixed selection.
A surviving token’s spelling and learned representation can therefore be carried over to a pretrained RoBERTa system. Its derivation can change in the process. The replacement rule might run in the new segmentation, or another join can use one of its ingredients before it has the opportunity. Compatibility concerns the retained entries and prior training. The sequence that reaches the system is precisely what the edit is meant to change.
Why undoing a final token produces a different edit
When a type has no outgoing rules, it is a leaf in the merge graph. For that type, withholding its join and undoing the join in the final segmentation have the same effect in the comparison the paper describes. There is no later rule that needs the leaf as an intermediate. This can be expressed in terms of the graph.
|Mₒ(t)| = 0
t is the type being considered, and Mₒ(t) is the set of rules that consume it. The bars give the size of that set. A value of 0 means the type has no dependent rules.
For an internal piece, trimming can leave the original intermediate join inside a larger final token. Knockout changes which derivation is available while the tokenizer is deciding what to join. The Dutch compound standaardtarief gives a concrete example. Ordinary BPE applies d + t across the place where standaard meets tarief. Removing that join lets the d and the t participate in building their own constituent tokens. Undoing only a final piece would preserve any decisions already taken on the original merge tree. The paper uses the example to show that rule editing can change the shape of the tree, including which other joins are able to run.
Experiments and results
What counts as a correct boundary
The intrinsic evaluation treats each internal gap in a word as a decision. A positive is a gap marked in CELEX. A prediction is a gap left between tokens. Precision gives the share of predicted gaps that agree with the reference. Recall gives the share of reference gaps that the tokenizer preserves. F1 combines precision and recall so that a strong result requires both to be reasonably high. The counts are pooled across the lexicon before the scores are computed. This is micro-averaging, which gives each gap a contribution to the overall tally.
n − 1
n is the number of characters in an entry, and the minus sign subtracts 1 to give the number of gaps between adjacent characters. The edges of the word are outside this count. In reanimatietechniek, the full morphological analysis contributes 4 positive positions and 13 negative positions. A tokenizer that leaves breaks between the correct pieces adds to both precision and recall. A break inside a reference piece adds to the predicted count without recovering a reference boundary.
The CELEX data contained 38,108 entries with distinct morphological decompositions for English, 44,437 for German and 96,540 for Dutch. The reported mean morpheme counts per word, called the index of synthesis in the paper, are 1.94 for English, 2.31 for German and 2.48 for Dutch in these data. Those are properties of the analyzed entries. They bear on the chances of hitting a reference position and on the range of boundary types represented in the evaluation.
The authors ran the evaluation with and without frequency weights. In the unweighted version, an entry appears once in the tally. In the weighted version, every gap contribution for a word is multiplied by that word’s OSCAR count. An entry absent from OSCAR receives weight 1. The weighted scores therefore emphasize how common the reference words are in running text, while continuing to use the set of analyzed forms available in CELEX. In the paper’s example, reanimatietechniek occurs 26 times in OSCAR and contributes 104 positives and 338 negatives to the weighted reference counts.
The same four conditions were evaluated per language. Ordinary BPE was the starting baseline. BPE-dropout was applied at a rate of 5%, with scores averaged over 10 repetitions. For the main BPE-knockout condition, the authors selected edits using the whole lexicon and evaluated on that lexicon. A random 50-50 holdout supplied a separate comparison in which the entries used to select rules were disjoint from the entries used to score them. The full-lexicon run measures how much of the available annotation can be reflected in the rules. The holdout run measures transfer to entries whose annotations did not guide those edits.
Morpheme boundaries in English, German and Dutch
On the unweighted English evaluation, ordinary BPE achieved precision of 43.0, recall of 49.6 and F1 of 46.1. Full-lexicon knockout reached 53.2 precision, 75.1 recall and 62.3 F1. The German baseline was at 45.0 precision, 54.0 recall and 49.1 F1. Knockout reached 55.3, 79.8 and 65.3 on those metrics. The Dutch comparison follows the same pattern, with precision rising from 52.6 to 61.7 and recall from 55.3 to 78.2. All of these boundary scores are percentages.
Dutch CELEX morpheme-boundary F1 on unweighted word types
Knockout leads the comparison even when evaluated on held-out entries.
The numbers
| System or setting | F1 % |
|---|---|
| BPE | 53.9 |
| BPE-dropout | 53.4 |
| BPE-knockout, full lexicon (this paper) | 68.9 |
| BPE-knockout, 50-50 holdout | 67.5 |
Under frequency weighting, the original BPE tokenizers had much lower morpheme recall. The baseline recalls were 4.0 for English, 8.4 for German and 11.0 for Dutch. With full-lexicon knockout they reached 59.2, 69.2 and 64.1, respectively. The corresponding weighted F1 scores went from 7.3 to 69.6 in English, from 14.5 to 64.0 in German, and from 18.4 to 71.8 in Dutch. Giving common headwords more influence reveals a substantial concentration of missing boundaries in the baseline. The effect is particularly clear for English, where an unweighted recall of 49.6 accompanies that weighted recall of 4.0.
On held-out English and German word types, morpheme F1 reached 57.5 and 61.7, respectively. The Dutch holdout score is shown in the chart. On the frequency-weighted holdout evaluation, morpheme F1 was 40.3 for English, 34.4 for German and 47.4 for Dutch. All exceed their language’s ordinary BPE scores. They are also below the full-lexicon scores, so the transfer demonstrated by the holdout does not account for the entire improvement in the fit to the annotated dictionary. Weighted German precision illustrates a specific exception to the general precision gains. It was 54.3 for ordinary BPE and 51.4 for holdout knockout, even as recall rose from 8.4 to 25.9.
The edits reduced the inventory while improving boundary recovery. Starting from 40,000 entries, the full-lexicon edited vocabularies contained 36,814 in English, 35,919 in German and 35,525 in Dutch. The dropout baseline retained the original inventory because its decisions apply to merge instances during a pass. In English, weighted morpheme precision under dropout was 9.7 compared with 40.7 for ordinary BPE, while weighted recall went from 4.0 to 5.9. The main dropout comparison therefore shows how a small increase in boundary coverage can come with a considerable loss in the accuracy of individual breaks.
Boundaries between parts of compounds
To evaluate whole-word boundaries, the authors collapse affixes into their host material in the CELEX analyses, leaving the splits between compound constituents. Preserving one of those splits means the resulting sequence gives both constituent strings a chance to be recognized. An early join across it forecloses that outcome. The paper gives horseshoe as an English example. In isolation, the tokenizer recognizes horse and shoe. In the compound, e + s runs early, yielding Ġhorses | hoe. The altered pieces obscure the identity of both constituents. The leading marker itself also depends on whether a piece begins the input word, so recovering the gap is a necessary test of separability, with exact token identities still dependent on context.
For unweighted compound boundaries, recall in English rose from 80.2 with BPE to 89.0 with full-lexicon knockout. German went from 67.5 to 81.1 and Dutch from 69.7 to 82.5. There was more headroom in the frequency-weighted comparison. English went from 9.5 to 76.5 and German from 14.7 to 76.0. The Dutch results show the same broad improvement and the smaller gain with held-out entries.
Dutch CELEX compound-boundary recall weighted by OSCAR frequency
Full-lexicon knockout recovers the most compound boundaries, with a smaller gain on held-out entries.
The numbers
| System or setting | Recall % |
|---|---|
| BPE | 29.5 |
| BPE-dropout | 31.4 |
| BPE-knockout, full lexicon (this paper) | 81.2 |
| BPE-knockout, 50-50 holdout | 48.8 |
Whole-word precision must be interpreted against the smaller set of target gaps. The tokenizer is being edited to preserve derivational boundaries as well as compound boundaries, so some desirable breaks count against precision under this narrower definition. In Dutch, frequency-weighted whole-word precision fell from 36.2 to 25.8 with full-lexicon knockout. Whole-word F1 still rose from 32.5 to 39.1. The direction of F1 depended on the language and weighting. For English word types, full-lexicon knockout raised whole-word recall while F1 moved from 22.8 to 21.2. The most consistent finding for compounds is the recovery of boundaries, particularly on common words whose annotations were available when selecting edits.
Starting with knockout or switching to it later
Dutch had the largest CELEX inventory in the study, and the authors used it for the downstream experiments. They pretrained RoBERTa on Dutch OSCAR using a shared budget of 30k batches for the comparison from scratch. One run used ordinary BPE and the other began with the edited vocabulary. They also took the original BPE run at the same checkpoint and continued it under two conditions. One retained its tokenizer. The other switched to BPE-knockout. Both continuation conditions were allotted an added 30% of the original budget, allowing the effect of switching to be compared with the effect of extra training alone.
During pretraining, the sequence length was capped at 128 tokens and the batch size was 4096. The masked objective asks the system to recover hidden text units from the surrounding input. Validation loss measured performance on that training objective over a held-out set of 10k examples. The paper also reports pseudo-perplexity, or PPPL, on test text. This uses a masking-based scoring procedure to assess how well the system accounts for observed tokens. The validation curve and pseudo-perplexity give views of prediction during and after pretraining. They need not rank systems the same way as a particular supervised task.
The downstream suite included sentiment analysis accuracy on DBRD and natural-language inference accuracy on SICK-NL. These assess decisions about a whole input sequence. The token-level tests were named entity recognition F1 on CoNLL-2002 and part-of-speech tagging accuracy on LassyUD. They assess whether the system identifies entity spans and word categories, respectively. For downstream fine-tuning, the authors searched batch size, learning rate and weight decay over 10 random initializations, picked the best on held-out validation data, and reported its test performance.
At the 30k checkpoint, BPE-knockout from scratch had 4.67 test PPPL against 3.88 for ordinary BPE. The training curves still showed loss falling faster with knockout. On DBRD, the respective test accuracies were 82.01 and 82.10. On SICK-NL they were 82.98 and 83.16. On LassyUD, the run with knockout from scratch scored 91.19, while ordinary BPE scored 93.50. Named entity recognition was the exception to this pattern. Knockout from scratch gave 86.21 on CoNLL-2002, compared with 80.04 for ordinary BPE at that checkpoint.
Switching tokenizers after 30k batches immediately raised pseudo-perplexity to 200.37. At 35k, after 5k additional batches, the switched run reached 4.62. This is below the 4.67 reported for the run that used knockout throughout its 30k budget, with the difference in training duration relevant to that comparison. At 39k, test pseudo-perplexity was 4.35 for the switched run and 3.66 for the continuation with ordinary BPE. The retained vocabulary could be used immediately, but the masked objective showed how much work the new segmentation presented to the pretrained system.
Dutch CoNLL-2002 named entity recognition F1 after 39k pretraining batches
Switching to knockout and continuing pretraining gives higher named entity recognition F1 than continuing with ordinary BPE.
The numbers
| System or setting | F1 |
|---|---|
| Continued BPE | 83.98 |
| Continued after switching to BPE-knockout (this paper) | 87.51 |
The switched run also scored 96.01 on LassyUD at 39k, compared with 93.78 for the continuation with ordinary BPE. The sequence-level results were closer and pointed in different directions. On DBRD, the switched and unchanged continuations scored 81.74 and 81.43. On SICK-NL, they scored 83.14 and 83.53. Immediately after the switch, before further pretraining, fine-tuning already gave the switched run 94.82 on LassyUD compared with 93.50 at the ordinary BPE checkpoint. That immediate gain coexisted with the spike in pseudo-perplexity. The paper makes the implementation available as BPE-knockout and releases the final Dutch checkpoints under the same collection name.
What the ablations show
The choice of removed rules matters
Removing merges tends to leave more opportunities for a reference gap to survive. The authors tested whether the observed improvement would follow from deletion alone or from the tuple rewrite itself. On Dutch CELEX, they ran the same knockout procedure with randomly chosen merges and with the latest merges in the learned ordering. The evaluation was unweighted and used the full set of entries. For random selection, the results were averaged across 10 repetitions. The comparison lets the selection criterion vary while preserving the basic editing operation.
As the proportion of deleted merges grew, both random deletion and deletion from the end of the list recovered more morpheme boundaries. Both also showed a consistent loss of precision. Blame-guided deletion increased both measures in the main intrinsic experiment. Restricting the latest-merge strategy to leaves gave a similar result to pruning the latest rules without that restriction. In the Dutch graph, 90% of the rules in the last 50% produced leaves. Many late removals therefore affect similar parts of the inventory regardless of whether the strategy explicitly checks for leaves.
The selected rule priorities show why shrinking the original vocabulary would produce a different intervention. Across English, German and Dutch, high-blame rules occur throughout the order. Adjacent quartiles of the selected positions were separated by between 9000 and 11,000 vocabulary items in lists of size 40,000. This distribution supports the authors’ reading that harmful joins can enter early as well as late. A vocabulary cap removes a contiguous tail. Blame selection can remove an early rule that repeatedly crosses a boundary while retaining later rules that produce useful pieces.
The threshold balances boundary coverage and precision
The Dutch threshold sweep varied the blame cutoff from 1% to 99%. The number of removals fell as the cutoff rose. With a permissive cutoff for removal, recall was highest at a very low threshold, where many joins could be disabled. Precision peaked at 50%. F1 peaked between the recall and precision maxima. The chosen threshold thus has direct support for the goal of keeping proposed splits reliable in this evaluation, while the best cutoff depends on which of the metrics is valued.
The tradeoff follows from the task. Preventing an operation may expose a marked split but may also expose other gaps inside pieces. A very strict rule for keeping boundaries can push output towards smaller tokens and recover more positives at the expense of more false positives. The threshold sweep shows that the rule’s fraction of harmful uses is useful for managing that tradeoff in Dutch. It does not establish a shared optimum for every corpus, reference lexicon or downstream task.
The dropout comparison addresses a related question with a different intervention. The authors estimated how many of the original tokenizer’s observed merge applications involved a rule later removed by knockout. They give this estimate as a retrospective effective dropout rate.
pₑբբ,ᵣₑₜ = (Σₘ∈M† N(m)) / (Σₘ∈M N(m))
Here pₑբբ,ᵣₑₜ denotes the retrospective effective dropout rate. The symbol Σ immediately before the summands means to add over the indicated rules. M is the original rule set, M† is the subset selected by the blame threshold, and N(m) counts applications of a rule m in the original segmentation histories. The numerator counts applications of selected rules and the denominator counts applications of all rules. The estimate is retrospective because the edited tokenizer can follow different merge histories. The authors separately track the fraction of rules removed.
|M†| / |M|
The bars in this expression count rule types in the selected set M† and in the original set M. The slash divides the former count by the latter. This fraction measures pruning of the rule inventory. The retrospective rate instead weights a rule by how frequently it ran on the original reference words.
The retrospective rates were 4.681% in English, 5.174% in German and 5.025% in Dutch. The corresponding pruning rates were 8.017%, 10.270% and 11.261%. The application rates motivated the 5% setting used for the main BPE-dropout comparison, below the 10% setting recommended in prior translation experiments. This matches the rough frequency of disabled applications more closely than matching the share of distinct rules removed. The two procedures still distribute those disabled events differently.
An appendix varies BPE-dropout explicitly on Dutch CELEX. At 0%, weighted morpheme precision was 54.3 and recall was 11.0. At 1%, precision was 50.4 and recall was 11.3. At 10%, precision was 26.4 and recall was 14.7. F1 responds less uniformly. Weighted morpheme F1 was 18.4 at 0% and 18.8 at 10%, while weighted compound F1 moved from 32.5 to 21.6. The rate sweep shows small gains in the fraction of boundaries found and a sharp decline in how frequently a predicted boundary was correct. That gives context to the authors’ conclusion about using dropout for regularization and selecting rules by blame when the goal is morphological alignment.
A smaller vocabulary can occasionally yield a shorter sequence
The Dutch compound masterthesis explains why the number of tokens need not move in step with the size of the vocabulary. Ordinary BPE produces Ġmast | ert | hes | is. The rule that creates ert runs before the one that could finish Ġmaster, taking the er that the latter rule requires. Removing ert gives Ġmaster | the | sis. In the paper’s example, a removed piece leaves enough material available for other rules to make larger units, so the sequence goes from 4 tokens to 3.
This outcome was uncommon in the Dutch CELEX analysis. Fewer than 1% of lemmas received fewer tokens after knockout, while more than 25% received more. The most common result was an unchanged token count, reported for 72.88% of lemmas. That last figure concerns the number of tokens and permits changes in the positions of the breaks. The analysis separates a local possibility created by rule competition from the overall tendency towards finer segmentation.
Frequency and held-out entries change the question
The authors recomputed blame with frequency weights for Dutch and evaluated the result under both scoring schemes. With ordinary, unweighted blame, full-lexicon morpheme F1 was 68.9 for word types and 71.8 with token-frequency weights. With weighted blame, it was 67.9 for word types and 73.4 with frequency weights. Weighted morpheme recall was 64.1 under both selection schemes, while weighted precision rose from 81.6 to 85.9 with weighted blame. In this evaluation, some of the benefit of tracking common applications shows up in the reliability of predicted breaks, while the unweighted measurements favor giving all entries an equal role in selection.
The holdout analysis asks why hiding annotations causes such a large drop in weighted recall. If the main issue were the total number of annotated entries available, putting more of the lexicon into selection should recover much of the gap. If the issue were that certain edits depended on seeing particular words, an evaluation on disjoint words would continue to miss those opportunities even with a larger selection set. The paper compares splits from 50-50 to 90-10 in Dutch. The appendix’s frequency-weighted morpheme F1 was 47.4 for 50-50 and 48.2 for 90-10, compared with 71.8 when both stages used the full lexicon. The scores across the intermediate splits were similarly close.
Each split changes which words enter the evaluation as well as how many are available for blame. The authors read the stability across these splits as evidence that withholding particular entries matters more than the sheer fraction available. A rule used in only one word might be easy to score and edit when that word is included, yet impossible to evaluate on that very word after training on its annotation in a disjoint split. Other rules affect numerous words and can transfer, consistent with the gains on held-out types. The two effects can coexist in the same edited vocabulary.
Perfect morpheme recovery has a compound-scoring cost
The authors ran the evaluation on the CELEX morpheme splits themselves to show how the compound metric behaves under ideal morpheme segmentation. The ideal segmentation reaches 100 for whole-word recall, since every constituent boundary is among the full set of morpheme boundaries. Its predictions also include affix breaks. In the frequency-weighted Dutch evaluation, this ideal segmentation has a whole-word precision of 25.0 and whole-word F1 of 39.9. Full-lexicon Dutch knockout has whole-word F1 of 39.1 under the same weighting. The proximity of those F1 scores does not imply equivalent segmentation. The ideal reference recovers every compound break, while the edited tokenizer has 81.2 recall.
The comparison establishes a ceiling for an output that matches the full morphological analysis under the narrower compound metric. A tokenizer designed only to identify compound boundaries would have a different target. Low compound precision can reflect correct affix segmentation, incorrect internal splitting, or a mixture. Evaluating both sets of boundaries makes the source of this apparent tension visible.
Limitations
Limits the authors identify
CELEX supplies analyses of headwords. The experiment therefore gives the algorithm strong evidence about derivation and compounding, with limited coverage of inflection as used in running text. The authors emphasize that the reference omits the ordinary range of plural and conjugated forms and, for German, the forms in cases other than the nominative. An average morpheme count per word cannot show how many boundaries relate to grammatical variation. A corpus can contain many forms whose relevant joins have no opportunity to receive blame in the lexicon evaluation.
This matters differently for the paper’s two kinds of result. The intrinsic test uses the same kind of headword analysis for its reference, so it can ask a coherent question about the boundaries represented there. Downstream training encounters inflected forms as part of ordinary text. A successful edit on CELEX may leave harmful joins across those forms untouched. The authors therefore expect the coverage gap to limit the improvement available downstream, even if the headword benchmark gives an accurate account of its own targets.
The lexicon also gives morphological structure without marking when a word’s meaning has become conventionalized as a whole. The Dutch verb muggenziften literally evokes sifting mosquitoes and means to nitpick. An analysis of the parts supplies evidence to split it even though the meaning used in context is attached to the whole expression. A rule specialized to that expression can be especially vulnerable. If it is applied only in the lexicalized word and crosses a marked gap every time, every observed use adds blame. The procedure has no separate evidence that preserving the whole could support the intended interpretation.
Another limitation is that the edit creates no new vocabulary types. It can free an existing piece so another existing rule can make a more appropriate token. In twintiger, removing ig + er lets ig help form Ġtwintig, yielding Ġtwintig | er in place of Ġtwint | iger. In subtropisch, the original Ġsubt | rop | isch becomes Ġsub | t | rop | isch. The split after the prefix is recovered, but the desirable piece trop still has no rule to form it in this setup. A boundary score can reward the recovered gap while leaving the resulting stem in several parts.
The reported procedure also computes blame only before the edit. When the ids piece is removed, a rewritten rule for Ġbruids can still join id and s inside the result. The original general rule has been replaced by more specific contexts in which the join can occur. The authors propose that a second pass could score those rewritten contexts and remove a tuple join in bruids- while retaining a good one in gids. They also describe how inserting a suitable intermediate could expose Ġbruid as a clearer token. The paper leaves repeated blame estimation and such additions for future work.
The vocabulary-size problem is only partly addressed by morphological blame. Some intermediate types exist mainly to build a larger word and cross no marked boundary. The paper illustrates this with bibliotheken, whose derivation includes several dedicated stepping stones. A rewrite could in principle bypass an intermediate item, but the blame score supplies no reason to select one that stays inside the annotated pieces. The results establish that the vocabulary can be reduced by removing harmful joins. They leave open how to identify redundant entries that cause no visible boundary error.
Limits of what the comparisons establish
Full-lexicon fitting and held-out evaluation answer different questions. The full-lexicon scores show what can be recovered when annotations are available for the very entries whose breaks are measured. The random holdout shows transfer between CELEX entries. The held-out words can still share stems, affixes and patterns with the selection entries, and the original BPE vocabulary can already have seen their spellings in OSCAR. As a result, holdout performance supports transfer of the learned edits within this setup. It does not measure recovery on a corpus whose words or word families were all absent from both stages of tokenizer construction.
The weighted results also inherit the limits of the reference. The OSCAR frequencies give more influence to common CELEX headwords, while the evaluation still has no annotations for many forms that occur in OSCAR. The large weighted gains therefore describe the evaluated entries under that corpus weighting. Moving from those figures to an estimate of all morphological boundaries in running text would require annotations with broader coverage. The differences in CELEX sizes and boundary densities also make cross-language scores depend in part on the reference inventories.
The downstream comparison covers Dutch with one RoBERTa setup. The equal training budget from scratch and the matched continuation give relevant controls for that setup. Equal batch counts under a fixed token cap, however, need not mean exposure to the same amount of underlying text if segmentation changes the sequence length. Shared hyper-parameters make the training runs comparable under common settings and can suit one tokenizer better than another. The authors also observe that the validation curve for the knockout run from scratch was still falling more steeply at the cutoff. The available checkpoints cannot settle what either approach would achieve under a longer budget or separately optimized settings.
Finally, switching to knockout changes the surviving vocabulary, the input breaks and the masked prediction problem together. The downstream gains are evidence about that intervention as a whole. They do not identify how much of the improvement comes from recovered linguistic units, changed training exposure or the reuse of representations from the starting run. The authors suggest that the less consistent initial BPE segmentation might have a regularizing effect before the switch. Their experiments make that explanation plausible enough to test, while the curve and task scores establish the narrower result that adapting an existing system can work well under the tested conditions.
What came after
Looking beyond compression and vocabulary counts
Tokenization Is More Than Compression cites BPE-knockout in work that asks how to evaluate tokenization beyond its ability to shorten text. BPE-knockout supplies a specific reason to distinguish the questions. It removes vocabulary entries while usually increasing the number of pieces in a word, and it measures benefits through both boundary agreement and downstream tasks. The connection concerns the criteria by which a tokenizer can be judged. Vocabulary size, sequence length and recovery of word structure can move differently under the same edit.
The issue of language complexity appears in Why Do Language Models Perform Worse for Morphologically Complex Languages?. The scope shifts from repairing a particular set of joins to asking how morphological complexity relates to performance across languages. BPE-knockout gives that question a concrete intervention to consider. It shows how to change the visibility of certain morphological patterns while retaining vocabulary entries and prior training. Its own downstream results come from Dutch, while its comparison across languages concerns boundary recovery.
Confounding Factors in Relating Model Performance to Morphology takes up the problem of interpreting such relationships when other properties of the evaluation can also vary. In BPE-knockout, the chance of drawing a correct split partly depends on the density of reference boundaries, and frequency weighting changes how much influence individual words have. Editing the tokenizer also changes several properties of the input at once. These are specific points of contact between a rule-level intervention and a later study framed around interpreting performance differences.
Adapting a vocabulary to a new use
Evaluation of LLMs in Medical Text Summarization addresses vocabulary adaptation in medical text with many out-of-vocabulary items. Its stated setting is domain-specific summarization. BPE-knockout’s setting is the treatment of existing sub-word joins that conceal word structure. The shared problem is how to judge a vocabulary after choosing which recurring material it should present as reusable units. The intended endpoint differs as well, with medical summarization on one side and reference boundaries and Dutch downstream tasks on the other.
Teaching Old Tokenizers New Words addresses efficient adaptation after pretraining, the setting made practical by BPE-knockout’s reuse of surviving entries. Its framing is about teaching an existing tokenizer new words. This puts the focus on vocabulary coverage, alongside the earlier paper’s focus on removing harmful joins. Both lines of work address a decision faced after substantial training has already occurred. The tokenizer can be changed, and the usefulness of the change depends on how much the existing system can carry over to the altered input.
AdaptBPE frames BPE adaptation as a move from general-purpose to specialized tokenizers. BPE-knockout specializes the behavior of a general merge procedure using a lexicon of word structure. The later work’s title indicates a broader specialization problem. Vocab Diet addresses vocabulary reshaping through vector arithmetic, placing the modification at the level of learned representations in its stated approach. BPE-knockout acts on the dependency rules that compose token strings and carries surviving entries forward. These works put different parts of a pretrained system in view when asking how much of its vocabulary can be changed.
Putting morphology into subword construction
MoVoC takes up morphology-aware sub-word construction for Geez script languages. Its stated emphasis on construction locates the morphological intervention at a different point from the original paper’s post-training pruning. BPE-knockout begins with what corpus counts have already built, then uses annotated boundaries to choose which rules to rewrite. The later work brings attention to the construction of the sub-words themselves in a different linguistic and writing-system setting.
These are citing works with identifiable research aims. The citations establish a connection to BPE-knockout, while their stated scopes leave open which papers reused the blame threshold, implemented the dependency rewrite or used BPE-knockout as an experimental baseline. Those distinctions matter here because citing a way to revise an existing tokenizer and adopting its specific rule edit are different contributions.
Cite
Cite as Thomas Bauwens and Pieter Delobelle. 2024. BPE-knockout: Pruning Pre-existing BPE Tokenisers with Backwards-compatible Morphological Semi-supervision. Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers).
@inproceedings{bauwens2024bpe,
title = {{BPE-knockout: Pruning Pre-existing BPE Tokenisers with Backwards-compatible Morphological Semi-supervision}},
author = {Thomas Bauwens and Pieter Delobelle},
booktitle = {Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers)},
year = {2024},
doi = {10.18653/v1/2024.naacl-long.324},
url = {https://doi.org/10.18653/v1/2024.naacl-long.324}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bauwens-2024-bpe-knockout-pruning-pre-existing/