---
title: "How do different tokenizers perform on downstream tasks in"
description: "A Japanese BERT study compares morphological analyzers, Byte-Pair Encoding, WordPiece and Unigram across seven language tasks."
canonical: "https://research.elamur.ai/free/en/papers/fujii-2023-how-do-different-tokenizers-perform/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/fujii-2023-how-do-different-tokenizers-perform/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2023](https://md.research.elamur.ai/free/en/papers/2023/) / How do different tokenizers perform on downstream tasks in scriptio continua languages?: A case study in Japanese

# How do different tokenizers perform on downstream tasks in scriptio continua languages?: A case study in Japanese

Paper · 2023 · Takuro Fujii, Koki Shibata, Atsuki Yamaguchi et al.

**Authors:** Takuro Fujii, Koki Shibata, [Atsuki Yamaguchi](https://md.research.elamur.ai/free/en/authors/atsuki-yamaguchi/), [Terufumi Morishita](https://md.research.elamur.ai/free/en/authors/terufumi-morishita/) and [Yasuhiro Sogawa](https://md.research.elamur.ai/free/en/authors/yasuhiro-sogawa/) · **Year:** 2023 · **Venue:** Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop) · **Licence:** [CC BY 4.0 (ACL Anthology)](https://creativecommons.org/licenses/by/4.0/)

Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop) · [licence](https://creativecommons.org/licenses/by/4.0/)

- [Publisher's page](https://aclanthology.org/2023.acl-srw.5/)
- [PDF](https://aclanthology.org/2023.acl-srw.5.pdf)
- [DOI 10.18653/v1/2023.acl-srw.5](https://doi.org/10.18653/v1/2023.acl-srw.5)

## Summary

Japanese sentences generally lack spaces marking where one word ends and the next begins. A system that reads Japanese must still divide each sentence into units it can process. Fujii and colleagues ask how much those decisions matter for the work the system ultimately does, from judging whether two sentences mean similar things to finding a person’s name in a passage. They study [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/) as a sequence of decisions. A morphological analyzer first identifies word-like units. A [subword tokenizer](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/) can then divide each unit into smaller pieces. The authors compare this approach with applying sub-word tokenization directly to the text.

The experiments cross four Japanese morphological analyzers with three sub-word methods, Byte-Pair Encoding (BPE), WordPiece and Unigram. Each sub-word method also runs without an analyzer. Every configuration gets its own pretraining run with the same base architecture, [BERT](https://md.research.elamur.ai/free/en/papers/devlin-2019-bert-pre-training-deep-bidirectional/). The authors then adapt the resulting systems to seven Japanese tasks. This design lets them ask whether having a morphological stage helps, whether the choice of analyzer matters when the sub-word method is fixed, and whether the choice of sub-word method matters when the analyzer is fixed.

All three sub-word methods achieved their lowest reported average across tasks when used without an analyzer. The size of the penalty depended on the method and task. On the Japanese Wikipedia [named entity recognition](https://md.research.elamur.ai/free/en/concepts/named-entity-recognition/) evaluation, BPE scored 85.1 F1 with Juman++ and 62.9 when applied directly. WordPiece without an analyzer had a more basic problem. Its implementation could treat a long stretch of unspaced text as a single word and replace that entire unit with an unknown token when segmentation failed. Unknown tokens accounted for 99.8 ± 4.9% per sample during pretraining in that configuration, and its training loss was unstable.

Among the configurations with morphological analysis, the strongest analyzer depended on the task. Vaporetto stood out for sentence similarity, Juman++ for entity recognition, and Sudachi for [dependency parsing](https://md.research.elamur.ai/free/en/concepts/dependency-parsing/), which identifies grammatical links between words. BPE and Unigram both had significant advantages over WordPiece in some comparisons, while the authors detected no significant difference between BPE and Unigram on any of the tasks tested. The study supports using a morphological analyzer in this Japanese BERT setup and treating its choice as task-dependent. The authors released the code and pretrained BERT systems so that the tokenizer pairings can be examined and reused.

## Deep dive: How do different tokenizers perform on downstream tasks in scriptio continua languages?: A case study in Japanese

A Japanese BERT study compares morphological analyzers, Byte-Pair Encoding, WordPiece and Unigram across seven language tasks. · about 32 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### A sentence needs boundaries before it becomes a sequence of tokens

A reader can identify words in a Japanese sentence even when spaces do not mark them. A tokenizer needs a procedure for placing those boundaries. The paper uses *scriptio continua* for writing without explicit word separators, a setting it illustrates with Japanese and also associates with Chinese and Thai. The issue is how a computational system obtains a useful division of the text when the writing supplies few of the cues that a space-delimited pipeline expects.

The authors illustrate the difference with parallel sentences about doing research on morphological analyzers. In their [English](https://md.research.elamur.ai/free/en/topics/english/) example, spaces already isolate the word *analyzers*. A sub-word rule can work within that span and split off its ending. In the Japanese example, the tokenizer begins with a continuous string. The analyzer first proposes boundaries, separating such units as 私, は and 形態素. The sub-word algorithm then has the option of dividing 形態素 into pieces such as 形態 and 素. That second decision is made within a span supplied by the first.

The two stages serve different purposes. A [morphological](https://md.research.elamur.ai/free/en/concepts/morphology/) analyzer aims to recognize units with a linguistic role. The paper describes these units as comparable to words for the purposes of tokenization, although their exact extent depends on the analyzer. A sub-word system works with a vocabulary learned from text. It can preserve a whole unit when the vocabulary supports that choice or represent it with several entries. Several small entries can be reused across many expressions, so the system need not allocate a separate entry to every complete word form it encounters.

A boundary from the first stage also limits what the second stage can do. If two characters fall on opposite sides of an analyzer boundary, a sub-word algorithm that works separately within each analyzer unit has no opportunity to combine them. If the analyzer groups them together, several sub-word divisions may remain possible. The vocabulary learner sees the consequences of these decisions as well. A character sequence that lies inside analyzer units often has a different chance of becoming a vocabulary entry from one that is regularly split across them.

This matters because tokens form the input to a pretrained [language model](https://md.research.elamur.ai/free/en/concepts/language-model/). They affect what each position represents and how many positions a stretch of text occupies. Pretraining teaches the system to recover pieces represented in that initial encoding. When the system is later trained to solve a particular task, it still has to work with that vocabulary and those input boundaries. The question is therefore about a design choice made before either phase of BERT training.

#### Earlier work left the two stages difficult to disentangle

The paper describes earlier research as having established that tokenization can affect performance after pretraining. It cites investigations that approach the issue through multilingual coverage, the treatment of spaces, and the choice of sub-word algorithm. Much of the evidence it discusses comes from settings with explicit word boundaries. The authors point to studies on Japanese and Thai as precedents and argue that those studies leave room for a broader comparison of analyzer and sub-word pairings.

Existing systems also demonstrate that there is more than one workable way to organize the input pipeline. BERT is associated with WordPiece, while the paper gives GPT-3 as an example of a system using byte-level BPE. A system can also dispense with language-specific morphological analysis and apply sub-word tokenization directly, as the authors note for XLM-R. Those examples establish that the choices occur in practice. Their different training setups make them unsuitable as a controlled comparison of the choices themselves. [Language Models are Few-Shot Learners](https://md.research.elamur.ai/free/en/papers/brown-2020-language-models-few-shot-learners/), [Unsupervised Cross-lingual Representation Learning at Scale](https://md.research.elamur.ai/free/en/papers/conneau-2020-unsupervised-cross-lingual-representation-learning/).

The sub-word methods already had reasons to differ. BPE builds entries by merging often associated pieces. WordPiece also constructs a sub-word vocabulary, then applies a longest-match rule in the implementation examined here. Unigram fits probabilities to possible pieces and uses them to choose among complete segmentations. The paper cites earlier evidence that such algorithms can produce different boundaries and that vocabulary choice can affect performance in a given language. For Japanese, those differences can depend on what each algorithm receives from the morphological stage. [Neural Machine Translation of Rare Words with Subword Units](https://md.research.elamur.ai/free/en/papers/sennrich-2016-neural-machine-translation-rare-words/), [How Good is Your Tokenizer?](https://md.research.elamur.ai/free/en/papers/rust-2021-how-good-is-your-tokenizer/), [Byte Pair Encoding is Suboptimal for Language Model Pretraining](https://md.research.elamur.ai/free/en/papers/bostrom-2020-byte-pair-encoding-is-suboptimal/).

Comparing a single two-stage tokenizer with a single direct tokenizer would make the result depend on the particular algorithms picked for each side. Comparing different packages that change both stages at once would leave the source of a difference similarly uncertain. The authors instead organize their questions so that each has a corresponding comparison. For the first, they examine direct tokenization alongside morphological preprocessing within each sub-word family. For the second, they hold the sub-word family fixed and vary the analyzer. For the third, they hold the analyzer fixed and vary the sub-word family. Each question can then be examined across tasks with different demands on the representation.

### The method, step by step

#### Decide what the subword algorithm receives

The study uses MeCab, Juman++, Sudachi and Vaporetto as alternative front ends. A front end receives the Japanese sentence and returns a sequence of units to pass to the sub-word stage. The paper distinguishes two ways to obtain those units. Sequence prediction chooses a segmentation by evaluating possible paths through the sentence. Pointwise prediction decides at each character gap whether a boundary belongs there. Both produce an ordered sequence of spans, which makes them interchangeable at the interface needed for the experiment.

A sequence predictor can represent its options as a lattice. Think of each character boundary as a position along the sentence, with links spanning dictionary entries that could begin and end at those positions. One complete path selects a series of spans that together cover the sentence. Competing paths can include different spans at the same location. Selecting a path settles several boundary choices together. The cost or score comes from the particular analyzer, and the authors describe search procedures that avoid enumerating every possible complete path.

MeCab constructs the lattice from its dictionary and searches for the path with the lowest cumulative cost. Its sequence-labeling feature function supplies the costs, and Viterbi search finds the preferred combination. Juman++ starts from a dictionary lattice as well, then uses beam search to pursue promising paths. Juman++ combines a recurrent language score with a feature-based linear score and seeks the path with the highest combined score. The two tools thus use the same broad representation for candidate sequences while differing in how they score and search those sequences. [Applying Conditional Random Fields to Japanese Morphological Analysis](https://md.research.elamur.ai/free/en/papers/kudo-2004-applying-conditional-random-fields-japanese/).

Sudachi provides choices about the granularity of its units. The authors select its Middle setting, which the paper describes as close to an ordinary notion of a word. The Sudachi condition consequently represents one specific configuration of the analyzer. A different granularity would change the spans made available to the sub-word learner. Vaporetto uses features from a window of characters around the gap being considered. A linear classifier judges whether that gap should be a boundary, making its basic prediction local to the gap.

The direct conditions skip this first pass. The original text goes to the sub-word algorithm without the intervening sequence of analyzer units. The paper labels this option *Nothing*. This label describes the morphological stage only. Direct BPE, direct WordPiece and direct Unigram still learn vocabularies and segment text according to their respective rules. The direct treatment therefore needs to be interpreted within each sub-word family, especially when an algorithm has its own assumptions about blanks or word spans.

#### Learn a vocabulary and apply its segmentation rule

Vocabulary construction determines which strings are available as entries. Tokenization determines how to use those entries on a particular input. The authors distinguish these operations because differences between algorithms arise in either or both. With an analyzer in place, the sub-word learner works from text divided into the analyzer’s units. The rule it learns can later split those same kinds of units when encoding the material for BERT.

Byte-Pair Encoding, or BPE, builds larger entries from smaller ones. It scores adjacent pairs of current symbols using their frequencies, then merges the highest-scoring pair and adds the resulting entry. It repeats the operation until it reaches the vocabulary target. For segmentation, the paper describes starting with characters and repeatedly applying the eligible pair merges to form larger vocabulary pieces. Earlier merges affect which symbols are adjacent and therefore what can be merged next. The rule can retain a longer piece where the learned merge sequence permits it. [Neural Machine Translation of Rare Words with Subword Units](https://md.research.elamur.ai/free/en/papers/sennrich-2016-neural-machine-translation-rare-words/).

WordPiece also builds its vocabulary by favoring combinations of existing symbols. Its score takes account of both the frequency of the pair and the separate frequencies of its members. At application time, the study follows BERT’s longest-match-first procedure. Starting at the left edge of a unit, the tokenizer chooses the longest permitted entry that matches the text there. It advances by the length of that entry and repeats the procedure on the remaining text. The decision is greedy because it commits to a piece at the current position before working through the rest of the unit.

The fallback behavior of this implementation matters for the direct experiment. If WordPiece fails to segment a unit, the unknown marker `[UNK]` can stand in for that unit as a whole. In the paper’s Japanese illustration, the analyzer has already separated the text before WordPiece begins. A failure is then confined to the unit being processed. With a long unspaced sequence, the unit sent to WordPiece can cover much more text. Each successful or unsuccessful segmentation decision can consequently affect a span far longer than an ordinary word.

Unigram takes a pruning approach to vocabulary construction. It begins with a large set of plausible entries, which can be assembled from frequent substrings, and fits a unigram probability distribution for that set. A unigram distribution assigns probabilities to individual pieces. The learner examines how the likelihood of the training corpus changes when an entry is removed. It prunes entries whose removal has the smallest effect and continues reducing the candidate set. The paper describes the removal cost as a difference between log likelihoods. [Subword Regularization](https://md.research.elamur.ai/free/en/papers/kudo-2018-subword-regularization-improving-neural-network/).

```
C(u) = ℓ(Corpus; V) − ℓ(Corpus; V ∖ {u})
```

Here `u` is the candidate entry and `C(u)` is its removal cost. `Corpus` denotes the text used to learn the vocabulary, and `V` is the current vocabulary. The function `ℓ` gives the log likelihood of that text under the corresponding unigram distribution. The expression `V ∖ {u}` means the vocabulary with just `u` removed, with braces identifying the set containing that entry. The minus sign gives the change from the current likelihood to the likelihood after removal. The entry with the smallest degradation is the least costly one to discard at that point.

For segmentation, Unigram compares complete candidate divisions using the learned piece probabilities. Viterbi inference identifies the highest-likelihood path through the available pieces. A long piece at the beginning can be passed over if several shorter pieces lead to a more probable segmentation overall. The search criterion differs from BPE’s sequence of pair merges and WordPiece’s choice of the longest matching entry at each position. The learned vocabulary constrains each search, so algorithms can produce different boundaries even when applied to units produced by the same analyzer.

#### Build comparable BERT systems

Crossing the four analyzers with the three sub-word algorithms gives the 12 paired tokenizers reported by the authors. They also train three direct tokenizers, one for each sub-word algorithm. Vocabulary size is fixed at 30k in every condition. The vocabularies are learned from 10M randomly selected sentences from Japanese Wikipedia. That fixes the nominal inventory size and the source and scale of the vocabulary-training material while allowing the inventory itself to differ across configurations.

The Wikipedia preprocessing described in the implementation appendix excludes sentences shorter than 30 characters, as well as sentences containing the marker “Category” or table symbols. Vocabulary learning over Wikipedia is distinct from BERT pretraining, which uses Japanese Wikipedia and CC-100. The authors report 2.2 and 1.1M samples, respectively, for those two pretraining sources. The pretraining sequence length is capped at 512. Because the cap is on the encoded sequence, a change in segmentation can alter how much original text fits within it.

The authors initialize a separate base BERT system for every tokenizer. Each uses the architecture reported as having 12 hidden layers and 12 attention heads, a hidden dimension of 768, an intermediate dimension of 3072, and 125M parameters. Pretraining uses masked language modeling. Some input tokens are obscured, and the system learns to recover them from the surrounding text. A tokenizer therefore changes the units that supply the context and the units that can serve as prediction targets. The experiments carry that change through pretraining and subsequent task adaptation.

The pretraining schedule is fixed at 500,000 steps, with a batch size of 128. The initial learning-rate settings include a rate of 1e-4 and linear warmup over 10,000 steps. The AdamW settings use an epsilon of 1e-8, momentum coefficients of 0.9 and 0.999, and weight decay of 0.01. Both the attention dropout and the other dropout setting are 0.1. These shared settings make it possible to compare the tokenizer pipelines under the same nominal training schedule. [Decoupled Weight Decay Regularization](https://md.research.elamur.ai/free/en/papers/loshchilov-2017-decoupled-weight-decay-regularization/).

From Japanese text to downstream evaluation The steps in order.

#### Adapt each system to the task

[Fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/) starts from the representations obtained during pretraining and adjusts the system using examples of the target task. The procedure changes according to what the task asks for. A product review goes to a classifier, a pair of captions goes to a similarity predictor, and a question with a passage calls for an answer span. All continue to use the tokenizer associated with their own pretraining run.

The fine-tuning batch size is 32. The paper gives a schedule of 5 epochs for JGLUE and named entity recognition and 10 for Universal Dependencies. Sequence lengths vary by task. The cap is 512 for MARC-ja and the dependency task, 348 for JSQuAD, and 128 for JSTS, JNLI and entity recognition. JCommonsenseQA uses 64. The rate for JGLUE and entity recognition is 3e-5. For dependency parsing, the BERT component and the parser have separate rates of 5e-5 and 1e-3. Fine-tuning warmup occupies 10% of the steps.

The dependency task has a separate component that predicts links between words. The authors average the representations for each token over the top four BERT layers and feed the result to a deep biaffine attention parser. This parser scores candidate dependency arcs and their grammatical relationship labels. Its arc features have dimension 500 and its relation features dimension 100. The implementation uses SuPar with its default parser settings as described by the authors. The parsing scores consequently reflect the full pipeline from tokenizer to BERT representations to the trained parser. [Deep Biaffine Attention for Neural Dependency Parsing](https://md.research.elamur.ai/free/en/papers/dozat-2016-deep-biaffine-attention-neural-dependency/).

The tokenizer implementation uses the Tokenizers library. The BERT experiments use PyTorch and Transformers, with automatic mixed precision in FP16. The authors report running pretraining on four NVIDIA V100 GPUs with 32GB of memory and fine-tuning on one GPU. They made the implementation available in the `compare-ja-tokenizer` repository and the trained checkpoints through Hitachi’s Hugging Face account. [PyTorch](https://md.research.elamur.ai/free/en/papers/paszke-2019-pytorch-imperative-style-high-performance/), [Transformers](https://md.research.elamur.ai/free/en/papers/wolf-2020-transformers-state-art-natural-language/).

#### Define the vocabulary and score comparisons

The authors also compare vocabulary contents directly. They ask what fraction of the fixed vocabulary size the two tokenizers share. This analysis considers pairs drawn from different sub-word families. It puts overlap on one axis of a plot and a difference in downstream scores on the other.

```
Overlap(T₁, T₂) = |V₁ ∩ V₂| / |V|
```

`T₁` and `T₂` are the tokenizers being compared, and `V₁` and `V₂` are their respective vocabulary sets. The intersection sign `∩` selects entries present in both. The bars around the intersection count those shared entries. `|V|` is the vocabulary size used as the denominator, which is the same for the tokenizers in this study. The slash denotes division. A higher value indicates that a larger fraction of the vocabulary entries is shared.

The score difference is computed separately for each task. The authors aggregate the observed scores for each tokenizer, then take the magnitude of the gap between those averages.

```
Gap(T₁, T₂) = (1/5) × |Σᵢ s₁ᵢ − Σⱼ s₂ⱼ|
```

`Gap(T₁, T₂)` is the score difference for the two tokenizers on the task being considered. `s₁ᵢ` is the observed score for tokenizer `T₁` indexed by `i`, and `s₂ⱼ` is the observed score for tokenizer `T₂` indexed by `j`. Each `Σ` adds the observations indexed beneath it. The minus sign subtracts the totals, and the bars take the absolute value so that the gap has no direction. The factor `1/5` scales the gap between totals to the gap between the five-run averages, and `×` denotes multiplication. The size of the plotted gap and the direction of the performance comparison therefore answer different questions.

### Experiments and results

#### The tasks measure different kinds of performance

Five tasks come from JGLUE, the Japanese general language understanding benchmark. The authors use training data in five-fold cross-validation and report performance on the development sets because the benchmark’s test sets were unavailable publicly. The dataset counts in the paper distinguish the training and development material. The scores for these tasks belong to that development evaluation.

MARC-ja asks whether a Japanese product review is positive or negative. It is based on the Japanese portion of the multilingual Amazon reviews corpus and has 187,528 training examples and 5,654 development examples. The evaluation uses accuracy, the share of examples receiving the correct class. This task asks for a single judgment about a review. Its score shows whether the representation carries the evidence needed for that judgment, with no separate credit for locating the words that convey the review’s [sentiment](https://md.research.elamur.ai/free/en/topics/sentiment-emotion/). [The Multilingual Amazon Reviews Corpus](https://md.research.elamur.ai/free/en/papers/keung-2020-multilingual-amazon-reviews-corpus/).

JSTS measures [semantic similarity](https://md.research.elamur.ai/free/en/concepts/semantic-similarity/) between two sentences. It uses captions from Japanese versions of the MS COCO caption data and the YJ Captions Dataset. The target ranges from 0 for the least similar pair to 5 for the most similar. There are 12,451 training pairs and 1,457 development pairs. The paper reports Spearman correlation, which checks whether the predicted ordering of pairs by similarity agrees with the annotated ordering. A system can perform well on this metric if it correctly ranks pairs whose absolute predicted scores differ from the annotated values. [Microsoft COCO Captions](https://md.research.elamur.ai/free/en/papers/chen-2015-microsoft-coco-captions-data-collection/).

JNLI also presents two sentences, sourced from the same caption data as JSTS. Its target is a categorical inference relationship. The second sentence can follow from the first, contradict it, or be neutral with respect to it. The data include 20,073 training pairs and 2,434 development pairs. Accuracy measures correct choices among the inference labels. Sharing a source of sentences with JSTS makes the difference in the objective particularly clear. One task asks how similar the two sentences are, while the other asks what one allows a reader to infer about the other. [SNLI](https://md.research.elamur.ai/free/en/papers/bowman-2015-large-annotated-corpus-learning-natural/).

The two [question answering](https://md.research.elamur.ai/free/en/concepts/question-answering/) tasks also demand different outputs. JSQuAD presents a question and a passage from Japanese Wikipedia. The system locates the answer span in that passage. The benchmark follows the construction of SQuAD v1.1 and supplies 62,859 training examples and 4,442 development examples. The score reported here is F1, which gives credit for overlap between the prediction and reference. A system can select a passage with some of the right answer content and still lose credit for including too much or too little. [SQuAD](https://md.research.elamur.ai/free/en/papers/rajpurkar-2016-squad-100-000-questions-machine/).

JCommonsenseQA asks the system to choose the most appropriate of five answers. It follows the design of CommonsenseQA, whose questions were seeded using ConceptNet. The Japanese dataset has 8,939 training examples and 1,119 development examples. It is scored by accuracy. Here the answer is a choice among alternatives, so the tokenizer can affect how the input question and choices are represented without setting the endpoints of an extracted span. [CommonsenseQA](https://md.research.elamur.ai/free/en/papers/talmor-2019-commonsenseqa-question-answering-challenge-targeting/).

The entity recognition task uses Japanese Wikipedia sentences annotated by Stockmark. Its targets include both where a name occurs and what category of entity it denotes. The dataset contains 5,343 examples in its supplied training collection and has no separate official development or test data. The authors split the collection 9:1, use five-fold cross-validation within the larger portion for fine-tuning, and measure F1 on the smaller portion. F1 balances the ability to find annotated entities with the ability to avoid predicting entities incorrectly. Results on this split show how well the sub-word representations support the annotation scheme used by this dataset.

The dependency parsing benchmark is Japanese-GSD from [Universal Dependencies](https://md.research.elamur.ai/free/en/concepts/universal-dependencies/). It supplies 7,050 training sentences, 507 development sentences and 543 test sentences. The task represents a sentence as a directed tree with labeled relations between words. Performance is measured with labeled attachment score, or LAS. A correct attachment requires the predicted head and the grammatical relation label to agree with the annotation. The task therefore depends on the structural predictions of the parser as well as the representations it receives from BERT.

#### The baseline and the score table serve different purposes

The paper reports `bert-base-japanese` as a reference outside the configurations it trains for the comparison. That checkpoint uses MeCab and WordPiece. Its reported scores include 95.5 ±0.1 for MARC-ja accuracy, 85.3 ±0.3 for JSTS Spearman correlation and 86.4 ±0.2 for JSQuAD F1, all on the JGLUE development evaluation. On the held-out Stockmark evaluation it scores 85.6 ±0.2 entity F1. Its role is to show how the experimental systems compare with an existing Japanese BERT checkpoint using a familiar tokenizer combination.

The paper also reports its own MeCab and WordPiece run. It gives 95.5 ±0.1 MARC-ja accuracy, 82.4 ±0.5 JSTS Spearman correlation and 89.2 ±0.3 JSQuAD F1 on the development evaluation. The existing checkpoint and the experimental condition thus share the names of their tokenizer components and can still yield different results. The main evidence for the research questions comes from comparisons within the common experimental setup. The published checkpoint supplies a reference for the scale and task dependence of the scores.

Each row in the main results table contains task scores and a reported average across tasks. The task scores are accompanied by standard deviations over five runs. An expression such as 85.1 ±0.6 describes the reported central score and its variability across runs. The average provides a compact way to survey each condition. Since its inputs include correlation, classification accuracy, F1 and LAS, it should be read as a descriptive aggregate of different assessments. The task columns show which of those assessments accounts for a change.

#### Morphological preprocessing helps most where direct segmentation struggles

For every sub-word family, the direct condition has the lowest reported task average within that family. With BPE the direct average is 83.3, compared with 87.2 for Juman++ and 87.1 for Sudachi. With Unigram the direct condition averages 85.9, and the Juman++, Sudachi and Vaporetto versions each average 87.1. WordPiece’s direct average is 33.5. Its versions with Juman++ and Vaporetto reach 86.5. These averages show both the common direction of the change and the much larger failure of the particular direct WordPiece setup.

The effect is uneven even within BPE. On MARC-ja, direct BPE gives 95.4 ±0.2 development accuracy, while Vaporetto with BPE gives 95.6 ±0.1. On JSQuAD, direct BPE yields 88.7 ±0.3 development F1 and Sudachi with BPE yields 90.2 ±0.2. The named entity evaluation has a much larger separation. The authors report a maximum difference of 22.2 there, between Juman++ with BPE and direct BPE. All the paired BPE settings score in a much narrower range on that task than the range created by including direct BPE.

BPE with and without morphological analysis on Stockmark Japanese Wikipedia entity F1 Every analyzer improves on direct BPE, with Juman++ giving the highest entity score.

**The numbers**

| System or setting | F1 |
| --- | --- |
| BPE without an analyzer | 62.9 |
| MeCab + BPE | 83.7 |
| Sudachi + BPE | 83.5 |
| Vaporetto + BPE | 84.1 |
| Juman++ + BPE (this paper) | 85.1 |

Direct Unigram is more resilient on the same entity evaluation. It scores 76.9 ±1.0 F1, compared with 84.1 ±0.4 using either Juman++ or Vaporetto. The relative advantage of a morphological front end becomes much smaller on some sentence-level tasks. For instance, direct Unigram reaches 74.6 ±0.4 JCommonsenseQA development accuracy, against 74.9 ±1.2 for the Unigram condition with Juman++. Its score also exceeds some of the other mean scores for Unigram on that task. The broad average favors adding an analyzer while the task-level results show where the recommendation carries more or less weight.

Direct WordPiece performs poorly across the benchmarks with reported numeric scores. It reaches 85.5 ±0.0 on MARC-ja development accuracy, 55.3 ±0.0 on JNLI development accuracy, and 20.0 ±0.8 on JCommonsenseQA development accuracy. Its JSQuAD development F1 is 10.1 ±0.1, and its held-out entity F1 is 0.0 ±0.0. The JSTS entry is marked N/A. These results belong to a configuration in which the tokenizer’s handling of an unsegmentable span regularly strips away the input content that the downstream tasks depend on.

Direct subword methods on JSQuAD development F1 Direct Unigram leads direct BPE, while direct WordPiece performs far worse than either.

**The numbers**

| System or setting | F1 |
| --- | --- |
| WordPiece without an analyzer | 10.1 |
| BPE without an analyzer | 88.7 |
| Unigram without an analyzer (this paper) | 89.3 |

#### The leading pairs change with the task

MARC-ja is closely grouped once a morphological front end is present. Vaporetto with BPE reports 95.6 ±0.1 development accuracy, and Sudachi with Unigram reports 95.6 ±0.2. For JNLI, the highest experimental mean is Sudachi with Unigram at 88.4 ±0.3 development accuracy. MeCab with Unigram reaches 88.3 ±0.4. Sudachi with BPE reaches 88.2 ±0.3. Those small separations put the raw rankings in context before the statistical tests are considered.

On JSTS, Vaporetto with BPE and Sudachi with Unigram both report 84.8 in development Spearman correlation, with standard deviations of ±0.2 and ±0.5, respectively. Within BPE, Juman++ reaches 84.6 ±0.4 and MeCab 84.2 ±0.1. The authors’ account highlights Vaporetto for sentence similarity based on controlled comparisons. The equal means for Vaporetto and Sudachi across different sub-word families illustrate why that finding is more informative when stated with its comparison conditions.

Morphological analyzers paired with BPE on JSTS development Spearman correlation Vaporetto has the highest mean among the BPE pairings.

**The numbers**

| System or setting | Spearman |
| --- | --- |
| MeCab + BPE | 84.2 |
| Sudachi + BPE | 84.2 |
| Juman++ + BPE | 84.6 |
| Vaporetto + BPE (this paper) | 84.8 |

On the reading comprehension benchmark, Sudachi with BPE gives the highest experimental JSQuAD development F1 at 90.2 ±0.2. MeCab and Juman++ with BPE both give 90.1, with standard deviations of ±0.3 and ±0.2. On JCommonsenseQA, Juman++ with Unigram has the highest experimental mean, 74.9 ±1.2 development accuracy. Juman++ with WordPiece achieves 71.1 ±0.6 on the same evaluation, which shows how changing the sub-word method can matter even with an effective analyzer held fixed.

Japanese-GSD offers an especially clear example of task dependence. Sudachi with WordPiece achieves 94.0 ±0.1 LAS, the highest mean in the parsing column. Sudachi with BPE yields 93.8 ±0.1, and Sudachi with Unigram yields 93.7 ±0.1. WordPiece’s generally weaker performance across tasks thus coexists with a strong individual result. Its parsing score with Sudachi also contrasts with the direct WordPiece result of 63.8 ±0.9 LAS on Japanese-GSD. That contrast bears on how the two stages interact in this implementation.

### What the ablations show

#### Removing the analyzer changes how much text reaches BERT

Skipping morphological analysis is the closest experiment to removing a component. Each sub-word method is trained and used in both the paired and direct settings. Retraining matters here because a vocabulary learned from analyzer output is adapted to those boundaries. The direct variant learns its own entries from the unsegmented input. The comparison therefore measures the practical effect of taking the analyzer out of the pipeline, including its effects on the learned vocabulary and how that vocabulary is applied.

The entity recognition results give the authors a reason to examine the alignment between linguistic segmentation and task annotation. The paper observes that the entity annotations are at the word level and tend to correspond well to morpheme boundaries. An analyzer puts breaks in linguistically motivated places before the sub-word algorithm works within those regions. This may give the trained system a more convenient representation for deciding where entities start and end. The large gain from an analyzer for BPE, together with the gain for Unigram, is consistent with that explanation across different sub-word rules.

The entity scores measure downstream performance rather than boundary agreement itself. The authors’ explanation involves an intermediate quantity that the experiments do not directly score. An analyzer can also affect the entries that are learned and the contexts in which their pieces appear during pretraining. The entity results distinguish plausible conditions for useful segmentation while leaving room for several mechanisms to contribute to the effect. The direct Unigram result shows that an analyzer-free algorithm can preserve considerably more entity performance than another direct algorithm under the same benchmark.

For WordPiece the paper supplies a more immediate diagnostic. Its implementation treats a stretch without a blank as one word. If that stretch cannot be segmented under the rule, it may be replaced wholesale by `[UNK]`. In the direct WordPiece pretraining data, the average sequence length is 1.15 ± 3.28 and the unknown-token ratio per sample is 99.8 ± 4.9%. Together these observations explain what is unusual about those encoded sequences. They are short because much of the original input has been collapsed into an unknown marker. Length alone could otherwise be mistaken for efficient segmentation.

The pretraining-loss curves provide a second observation about the same condition. The appendix shows unstable loss for direct WordPiece. The downstream results fit what happens earlier in the pipeline. BERT learns from inputs in which most of the original content has already been lost, and downstream inputs are subject to the same tokenizer. The paired WordPiece runs have morphological boundaries available before the fallback rule operates. The evidence here identifies a failure of this particular use of WordPiece on unspaced text and helps separate that failure from the smaller differences among functioning tokenizer pairs.

#### Holding the subword method fixed reveals task-specific analyzer effects

For the analyzer comparison, the authors omit the direct conditions. Each group contains the four analyzer variants of a given sub-word method. They apply a Kruskal–Wallis test, which compares ranks across groups of observed scores. The threshold used for statistical significance is .05. A significant result indicates a difference somewhere among the analyzers in the group. The authors then use Steel–Dwass comparisons to determine which pairs are significantly separated.

The broad test gives different patterns for different tasks. On JSTS, analyzer differences are significant within the BPE and WordPiece groups, while the Unigram group has no significant analyzer difference. The same pattern holds for the Stockmark entity task. The parsing task shows significant analyzer differences in all three sub-word groups. On MARC-ja, the analyzer comparison is nonsignificant within each sub-word group. The analyzer choice is thus easier to distinguish statistically on some tasks and under some sub-word algorithms than on others.

The pairwise results lead the authors to highlight Vaporetto for JSTS, Juman++ for entity recognition, and Sudachi for Japanese-GSD parsing. Those are preferences within the conditions that yielded evidence of separation. For example, Vaporetto’s JSTS development Spearman score with BPE is 84.8 ±0.2, whereas its Unigram version scores 84.6 ±0.2. In the Unigram group, Sudachi’s 84.8 ±0.5 is the highest mean, with no significant analyzer difference for that group. Thus the statement that Vaporetto performs well on JSTS has clearer support when tied to the configurations that the statistical analysis distinguishes.

On entity recognition, Juman++ with BPE scores 85.1 ±0.6 and Sudachi with BPE scores 83.5 ±0.6 on the held-out split. The authors identify Juman++ as effective overall for this task. With Unigram, Juman++ and Vaporetto happen to share an F1 of 84.1 ±0.4, and the omnibus comparison within Unigram finds no significant analyzer effect. The usefulness of comparing all pairings is that a preference emerging in one sub-word group can be examined in each of the others.

The parsing results likewise give a reason to consider the downstream output when picking an analyzer. Sudachi has the strongest parsing mean with both BPE and WordPiece, and it shares the leading mean with Vaporetto among the Unigram pairings. Its selected Middle configuration defines the unit passed to sub-word tokenization. The experiment compares that analyzer configuration as a whole, including its dictionary, boundary decisions and granularity. The study associates it with stronger parsing under several conditions without attributing the gain to one of those properties individually.

#### Holding the analyzer fixed distinguishes the subword families

The complementary analysis groups configurations by morphological analyzer and compares BPE, WordPiece and Unigram within each group. This excludes the direct WordPiece collapse from the statistical comparison of the sub-word methods. Every tokenizer in it has a morphological stage. The question is whether the way those analyzer units are converted to sub-words still matters once suitably bounded input reaches the sub-word algorithm.

For JSTS and JCommonsenseQA, the omnibus sub-word comparisons are significant with every analyzer. The pairwise results show that WordPiece is significantly worse than BPE, Unigram or both on some tasks. The paper reports no significant pairwise difference between BPE and Unigram across the tasks it studies. On MARC-ja and entity recognition, the omnibus sub-word comparison finds no significant difference with any analyzer. For entity recognition in particular, the strongest signal in this study is associated with supplying an analyzer, plus some analyzer-specific differences, while contrasts among the sub-word families under the same analyzer are less clear.

Consider JCommonsenseQA with MeCab held fixed. The development accuracies are 74.1 ±0.7 for BPE, 69.8 ±0.7 for WordPiece, and 74.5 ±0.8 for Unigram. With Sudachi on the same task, the corresponding scores are 74.2 ±0.6, 70.0 ±0.9, and 74.5 ±0.6. These are functioning WordPiece systems, unlike the direct condition, so a substantial share of the text is available for downstream use. The pattern shows why replacing WordPiece with either of the other algorithms can still make a difference even after supplying morphological boundaries.

The parsing column provides a counterweight to a universal ranking. Sudachi and WordPiece produce that column’s highest mean. The statistical and average comparisons across the study favor BPE and Unigram as choices across tasks, while the parsing result illustrates the value of evaluating configurations on the specific outcome of interest. The tests also distinguish a lack of detected separation from the expectation that two methods will behave identically on every example.

#### Vocabulary differences accompany the changes in score

The vocabulary analysis examines whether tokenizers with similar entries also obtain more similar downstream scores. Each point in the paper’s plot describes a comparison between two different sub-word methods. The authors report that comparisons involving WordPiece tend to cluster at lower vocabulary overlap and larger performance gaps. Comparisons between BPE and Unigram occur more frequently in the region of higher overlap and smaller score gaps. The vocabulary picture thus agrees with the broad pattern of the downstream comparisons.

The overlap formula counts entries. It gives the same weight to an entry used often and one rarely selected by the segmentation rule. The performance formula measures the magnitude of a gap and loses its direction by design. The plot can show that a pair of methods both differs in its inventory and tends to differ in its scores. The individual task results and pairwise tests supply the evidence about which method scores higher. This makes the overlap diagnostic useful for comparison without treating it as a model of how any individual vocabulary entry changes a prediction.

Vocabulary composition and the segmentation rule change together in these experiments. WordPiece commits to the longest available match at the current position. BPE builds pieces through its merge ordering. Unigram chooses a path using the likelihood of a full segmentation. The authors suggest that these algorithmic differences may contribute to downstream performance alongside vocabulary composition. They do not swap the same vocabulary among all the rules or hold the segmentation rule fixed while systematically replacing the vocabulary. The observed association therefore supports these mechanisms as possible explanations and leaves their individual contributions unresolved.

### Limitations

#### Limits the authors state

The authors fix vocabulary size at 30k. This is an important control because the comparison holds the number of available entries constant. It also restricts the conclusion to that operating point. A different vocabulary budget can change how frequently a recurring expression gets its own entry and how heavily an algorithm has to rely on smaller pieces. The paper cites prior work suggesting that differences due to vocabulary size can be small at sufficiently large sizes, giving over 16k as an example. It leaves the effect of varying size in this Japanese setup open.

The study uses the BERT base architecture and its masked prediction objective. The authors identify other architectures, including T5 and GPT-3, as future directions. The division of the input into tokens is common to those examples, but the comparisons here pertain to the architecture, pretraining procedure and task adaptation used in the experiments. When the paper finds that a particular combination is effective, that finding is about how the combination works within this shared setup. [Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer](https://md.research.elamur.ai/free/en/papers/raffel-2019-exploring-limits-transfer-learning-unified/).

The paper also limits its language claim to a Japanese case study. The motivation extends to other writing systems without routine spaces between words. The dictionaries, analyzer decisions and gold task annotations used for the evidence are Japanese. Another language can share the need to infer boundaries while offering different cues for placing them or different resources for building an analyzer. The authors leave experiments on other scriptio continua languages to future work.

The authors also identify automatic selection of a tokenizer pair for a particular task as future work. Their comparisons provide observed preferences after training and evaluation. The study does not furnish a selection procedure that can look at a new task and identify its most effective analyzer and sub-word combination in advance. In the ethics discussion, the authors say they used public data and note that the released systems may behave unfairly in some circumstances. The downstream suite assesses the task capabilities reported here. It contains no fairness evaluation of those systems. [Bias, fairness & safety](https://md.research.elamur.ai/free/en/topics/bias-fairness-safety/).

#### Limits that follow from the design

The analyzer comparison changes a package of decisions. MeCab and Juman++ both work with dictionary lattices and differ in their scoring and search. Sudachi uses a particular granularity setting, and Vaporetto makes gap-level predictions. The comparison establishes how these configured tools perform as front ends. It leaves questions such as whether the gains arise from dictionary coverage, preferred boundary sizes or the prediction strategy itself to experiments that control those properties more directly.

The study also standardizes training in steps and maximum sequence lengths. Identical settings make the comparisons easier to read. They can still give different tokenizers different effective exposures to the underlying text. A representation that uses more tokens for a sentence fills a fixed length with less original text. For masked prediction, a long piece can also hide more source characters than a short one. In this experiment those are consequences of changing tokenizers under a common schedule. The design does not quantify their separate effects or attempt to equalize them.

The findings on WordPiece have two scopes. The collapse in the direct condition is linked to the behavior of the tested implementation on long unspaced spans. It applies to that route through the pipeline, with its longest-match procedure and whole-unit unknown fallback. The significant disadvantages that remain in several paired comparisons have a different evidentiary basis, since those runs did receive analyzer output. Together the results support a preference for BPE or Unigram under the tested conditions, with the strongest failure reserved for direct WordPiece.

The evaluation splits also matter for quoting the numbers. JGLUE scores are development results because public test sets were unavailable. The Stockmark entity results come from a held-out slice of the original training collection. Japanese-GSD has its own development and test sets. These scores describe performance on the reported evaluation material, and the variation over runs describes uncertainty under those procedures. Close mean scores and nonsignificant differences leave uncertainty about the ordering that would be seen under another split or new training runs.

Finally, the reported task average combines metrics with different meanings. A change in a similarity ranking, a change in entity F1, and a change in the number of correct review labels need different interpretations. The average is a quick view of overall behavior and exposes the weakness of particular configurations. The individual scores and tests are the evidence for selecting a tokenizer in a given task. This is especially important when a small advantage on a sentence-level metric appears beside a much larger change on an annotation task that relies on locating boundaries.

### What came after

Later citations place the Japanese comparison in the broader literature on [language models and pretraining](https://md.research.elamur.ai/free/en/topics/language-models/). Two citing works survey a field, and two address changes to tokenization or to the representation of sub-words. That distinction matters for understanding how they relate to this experiment. A survey can situate a result among many design choices, while a method paper can pose a new question in which those design choices are part of the setup. The citation connections establish where the study was taken up at that level. They do not identify a reused Japanese tokenizer pairing or a replicated score.

*Challenges and Applications of Large Language Models* cites the study in a general treatment of the difficulties and uses of [large language models](https://md.research.elamur.ai/free/en/concepts/large-language-models/). The connection is to the role of choices made before pretraining and task adaptation. In Fujii and colleagues’ experiment, changing the input vocabulary and segmentation rules while keeping the base BERT configuration fixed leads to different downstream results. The later survey places that tokenizer study in a discussion whose scope extends beyond the Japanese benchmark suite. [Challenges and Applications of Large Language Models](https://md.research.elamur.ai/free/en/papers/kaddour-2023-challenges-applications-large-language-models/).

*Multilingual Large Language Model: A Survey of Resources, Taxonomy and Frontiers* cites the study from a survey of resources and approaches for multilingual systems. The Japanese comparison supplies a case in which a language’s writing conventions change what a conventional sub-word pipeline receives. It also examines a language-specific preprocessing option alongside direct sub-word tokenization, which the authors discuss in connection with a cross-lingual system. The survey’s subject places the case within [multilingual and cross-lingual NLP](https://md.research.elamur.ai/free/en/topics/multilingual-nlp/), where input conventions and the resources available for handling them can differ across languages. [Multilingual Large Language Model: A Survey of Resources, Taxonomy and Frontiers](https://md.research.elamur.ai/free/en/papers/qin-2024-multilingual-large-language-model-survey/).

*Retrofitting Large Language Models with Dynamic Tokenization* takes up tokenization as something that can be changed in a system that already exists. Fujii and colleagues trained a fresh BERT system for each fixed tokenizer so that any change could carry through the full pretraining procedure. Retrofitting starts from a different point in that process. It makes the question how to change tokenization after a system has already learned to work with particular input units. The later work cites the Japanese comparison while addressing that later intervention point. [Retrofitting Large Language Models with Dynamic Tokenization](https://md.research.elamur.ai/free/en/papers/feher-2025-retrofitting-large-language-models-dynamic/).

*LGSE* addresses the initialization of [subword embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/) for adaptation to [low-resource languages](https://md.research.elamur.ai/free/en/topics/low-resource-languages/). Its topic connects segmentation to the next operation in the input pipeline. Once a tokenizer identifies a sub-word, the system needs a numerical representation for that entry. Fujii and colleagues change the inventory and segmentation before learning the representations through pretraining. LGSE’s stated focus is on giving sub-word entries lexically grounded initial representations in an adaptation setting. Its citation connects these neighboring choices without establishing that it adopts the Japanese analyzer experiment. [LGSE: Lexically Grounded Subword Embedding Initialization for Low-Resource Language Adaptation](https://md.research.elamur.ai/free/en/papers/teklehaymanot-2026-lgse-lexically-grounded-subword-embedding/).

## Cite

Cite as Takuro Fujii, Koki Shibata, Atsuki Yamaguchi, Terufumi Morishita and Yasuhiro Sogawa. 2023. How do different tokenizers perform on downstream tasks in scriptio continua languages?: A case study in Japanese. Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop).

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.18653/v1/2023.acl-srw.5](https://doi.org/10.18653/v1/2023.acl-srw.5)

```bibtex
@inproceedings{fujii2023how,
  title = {{How do different tokenizers perform on downstream tasks in scriptio continua languages?: A case study in Japanese}},
  author = {Takuro Fujii, Koki Shibata, Atsuki Yamaguchi, Terufumi Morishita and Yasuhiro Sogawa},
  booktitle = {Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 4: Student Research Workshop)},
  year = {2023},
  doi = {10.18653/v1/2023.acl-srw.5},
  url = {https://doi.org/10.18653/v1/2023.acl-srw.5}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
