---
title: "Nepali Encoder Transformers — paper by Maskey et al. (2022)"
description: "How Nepali encoder transformers handle Devanagari text and how DeBERTa and DistilBERT compare on Nepali news classification."
canonical: "https://research.elamur.ai/free/en/papers/maskey-2022-nepali-encoder-transformers-analysis-auto/"
---
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/maskey-2022-nepali-encoder-transformers-analysis-auto/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2022](https://md.research.elamur.ai/free/en/papers/2022/) / Nepali Encoder Transformers: An Analysis of Auto Encoding Transformer Language Models for Nepali Text Classification

# Nepali Encoder Transformers: An Analysis of Auto Encoding Transformer Language Models for Nepali Text Classification

Paper · 2022 · Utsav Maskey, Manish Bhatta, Shiva Bhatt et al.

**Authors:** [Utsav Maskey](https://md.research.elamur.ai/free/en/authors/utsav-maskey/), Manish Bhatta, Shiva Bhatt, Sanket Dhungel and [Bal Krishna Bal](https://md.research.elamur.ai/free/en/authors/bal-krishna-bal/) · **Year:** 2022 · **Venue:** Proceedings of the 1st Annual Meeting of the ELRA/ISCA Special Interest Group on Under-Resourced Languages · **Licence:** [CC BY-NC 4.0 (ELRA, LREC proceedings)](https://creativecommons.org/licenses/by-nc/4.0/)

[Cited by **6** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/maskey-2022-nepali-encoder-transformers-analysis-auto/cited-by/) · Proceedings of the 1st Annual Meeting of the ELRA/ISCA Special Interest Group on Under-Resourced Languages · [licence](https://creativecommons.org/licenses/by-nc/4.0/)

- [Publisher's page](https://aclanthology.org/2022.sigul-1.14/)
- [PDF](https://aclanthology.org/2022.sigul-1.14.pdf)

## Summary

A system that sorts Nepali news articles by subject has to begin by reading the text faithfully. That first step matters in Devanagari, where a mark attached to a consonant can change how a word is read. The authors show a case in which a tokenizer drops such marks and turns the form for *flu* into the form for *fruit*. They investigate how to prepare Nepali text for an encoder, a system that builds a representation of an input sequence, and how to train it when suitable text and computing resources are limited. Their downstream test asks how well the resulting encoders classify articles from the “16 Nepali News” dataset. This is a task in [text classification](https://md.research.elamur.ai/free/en/concepts/text-classification/).

The authors combine publicly available Nepali text from OSCAR, cc100 and iNLTK, remove duplicates, and obtain 13 million sequences. They fit a SentencePiece tokenizer to that collection, with a vocabulary of 24,576 tokens. The tokenizer converts text into pieces that the encoders can process. The authors then hide some of those pieces and train the encoders to recover them from the surrounding text. A short feasibility test compares DistilBERT, DeBERTa and XLM-R under the available computing budget. DeBERTa reaches the target training loss in the shortest time. XLM-R reaches it after seeing the fewest samples, but takes the longest and has a noisy training run. The authors continue full Nepali pretraining with DeBERTa and DistilBERT. Both stages use a [Transformer](https://md.research.elamur.ai/free/en/concepts/transformer/).

DeBERTa leads on both reported measures from the full pretraining comparison, with an evaluation perplexity of 6.4237 against 12.3802 for DistilBERT. Perplexity measures how much uncertainty a predictor assigns to the answers it is meant to recover, with lower values preferred. On Nepali news classification, DeBERTa reaches a peak accuracy of 88.93% and DistilBERT reaches 88.31%. Both exceed the reported peaks of the existing Nepali BERT implementations and the multilingual XLM-R baseline. DistilBERT reaches its peak with the fewest reported classification training steps, which matters when selecting a candidate for a resource-constrained setting.

The comparison gives practical evidence for the authors’ Nepali pretraining pipeline and suggests a tradeoff between the highest reported accuracy and a smaller encoder that comes close on the same task. The news results measure the complete training setups together. The tokenizer examples show a concrete input problem, while the classification experiment leaves the separate contributions of tokenization, data preparation, masking and encoder architecture unresolved.

## Deep dive: Nepali Encoder Transformers: An Analysis of Auto Encoding Transformer Language Models for Nepali Text Classification

How Nepali encoder transformers handle Devanagari text and how DeBERTa and DistilBERT compare on Nepali news classification. · about 30 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

#### Why start with unlabeled text?

The paper takes up a resource problem with two sides. An encoder can benefit from reading a large collection before it is adapted to a particular task, yet assembling such a collection is harder for languages with fewer readily available digital resources. The authors place Nepali in that situation. Their objective is to find a workable way to train a Nepali encoder and then compare it with existing alternatives on a task for which labeled documents are available. The question is how to make the most of the text and computing budget at hand in work on [low-resource languages](https://md.research.elamur.ai/free/en/topics/low-resource-languages/).

Unlabeled text and labeled text have different jobs in this setup. A news article can contribute ordinary Nepali sentences to pretraining without anyone assigning it a category. Later, a collection of articles with category labels can teach an encoder to make a particular decision about a whole document. That separation is why the authors can draw the initial text from general-purpose sources while reserving a news collection for the classification experiment. The first collection supplies examples of how pieces of language occur together. The second supplies examples of how the labels in the benchmark are used.

In the authors’ account, the Transformer made this approach attractive because much of its computation can run in parallel and its performance can improve as the supply of parameters, data and computation grows. They cite work on how those quantities are related. For their own project, the scaling argument poses a practical question. An architecture’s capacity is valuable only to the extent that the project can train it under the available conditions. The paper therefore treats the cost of reaching a usable training state as a decision in its own right. The cited earlier work is [Scaling Laws for Neural Language Models](https://md.research.elamur.ai/free/en/papers/kaplan-2020-scaling-laws-neural-language-models/).

The authors trace the idea of transferring learned representations back to work on [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/). A word embedding represents a word with numerical features learned from text, so the representation can then serve as input to another task. In the paper’s account, recurrent systems built on learned representations offered a way to process sequences, including with long short-term memory and gated recurrent units. The broader connection to the Nepali experiment is the reuse of language information. The computation spent learning from ordinary text can support more than the task used to learn it. An early example in the paper is [Efficient Estimation of Word Representations in Vector Space](https://md.research.elamur.ai/free/en/papers/mikolov-2013-efficient-estimation-word-representations-vector/).

ULMFiT represents a later step in that account. It uses a predictive language task to train a network before adapting the network to another purpose. The target during initial training can come from the text itself. This is important for settings where a researcher has more sentences than annotated task examples. Subsequent encoder approaches change the prediction problem so that the system can learn from the text on both sides of a missing piece. The procedure of adapting a pretrained system to a labeled task is [fine-tuning](https://md.research.elamur.ai/free/en/concepts/fine-tuning/).

The paper situates its experiment among BERT-style encoders evaluated on language-understanding tasks. It also refers to Indic-Transformers as an example of bringing this line of work to Hindi, Bengali and Telugu. The earlier Indic study helped establish a precedent for comparing pretrained systems across practical tasks. The Nepali authors narrow their own downstream comparison to document categories. That choice gives them a common benchmark for existing Nepali systems, a multilingual system and the encoders they train themselves.

Nepali computational work already included studies of grammar and projects on generating headlines and identifying names. The authors also identify two existing Nepali BERT implementations, `nepaliBERT` and `NepaliBERT`. They are distinct systems, distinguished in the paper partly by the capitalization of their names. Their availability gives the study something more informative to compare against than a single multilingual baseline. A new Nepali encoder has to be assessed alongside earlier attempts to train directly for the language.

#### Why the script affects the experiment

Nepali is an Indo-Aryan language written in Devanagari. The paper describes a script with independent letters and dependent signs that combine with them. It also notes that Nepali writing has no upper-case and lower-case distinction. Those characteristics matter because a step designed to simplify text for another writing system can change what the Nepali text says. The authors therefore examine how input is converted into tokens before asking what an encoder can learn from it. This is the job of [tokenization](https://md.research.elamur.ai/free/en/concepts/tokenization/).

A consonant and a dependent vowel sign can form what the reader sees as a single unit even though the input encodes the elements separately. A routine that keeps the consonant and discards its mark is making a linguistic change. The paper also discusses the halanta, which suppresses a consonant’s inherent vowel and is used in forming combinations of consonants. A routine that removes it can change the relation between adjoining letters. These are separate ways a tokenizer’s handling of Devanagari can alter the form received by an encoder.

This creates an issue earlier than representation learning. An encoder can use context to decide how to interpret a token sequence, yet that sequence can already have lost information available in the original writing. A preprocessing choice determines what the encoder sees throughout pretraining and, when the same tokenizer is reused, throughout downstream adaptation. The authors’ examination of several tokenizers is therefore part of the investigation into what would make an encoder suitable for Nepali.

The paper also gives context for why a shared tokenization method is worth considering. Building a different hand-designed front end for every language requires knowledge of how each writing system behaves. SentencePiece offers a way to learn units directly from text while treating whitespace as part of the input. The authors cite its use in XLM-R as precedent and pursue the question at a smaller, Nepali-specific scale. That choice leaves architecture, training cost and downstream usefulness as questions to be tested after the text has been represented.

### The method, step by step

#### Assemble the text before choosing what to predict

The authors start with text collected for general language learning. They combine the Nepali portions of OSCAR and cc100 with material from iNLTK, then remove duplicate entries. The resulting corpus contains 13 million text sequences. A sequence here may be a phrase or a paragraph. The count describes entries in the collection after combination and deduplication. It does not describe a word count, a count of news articles or a count of the tokens that the tokenizer will eventually produce.

This stage supplies the material for two later operations. The tokenizer learns which pieces of Nepali text to represent in its vocabulary, and the encoders learn to predict hidden pieces in the resulting sequences. Neither job needs the document categories used in the news experiment. For the first, the repeated forms in the corpus are the evidence for defining the units. For the second, the original, visible text supplies the targets that can be hidden during training.

Deduplication changes the input before either form of learning takes place. Public collections can contain repeated sequences, and a repeated entry gives the same phrasing repeated representation in the pooled corpus. The procedure reported in the paper operates on the combined collection. The authors describe removing duplicates as beneficial in the limited-data setting. The result of pooling and deduplication is the common text resource for the encoders they train.

From collected Nepali text to news classification The steps in order.

#### Decide how the input will be divided

The authors evaluate two approaches to breaking text into pieces. A sub-word tokenizer can represent a whole word as one unit when the vocabulary supports it, or build its representation from smaller units. This means words that share a written form in part can share some of their tokens. It also means the placement of the boundary between pieces matters. The encoder receives the pieces, in order, and uses those as the units of its prediction task. This is [subword tokenization](https://md.research.elamur.ai/free/en/concepts/subword-tokenization/).

WordPiece, used by the two existing Nepali BERT implementations, indicates when a piece continues a word. The familiar `##` prefix marks a continuation in the examples. The tokenizer can therefore distinguish a piece beginning a word from a piece that follows another piece within it. The authors’ concern is with the handling of characters before or during this division. A continuation marker can tell an encoder where a retained fragment occurs, but it cannot carry a vowel sign that has already been deleted.

The paper illustrates the problem using `लु`. The displayed form combines `ल` with the dependent sign `◌ु`. In the behavior the authors flag, the tokenizer drops the dependent sign and leaves `ल`. The visible result now represents a different written form. This example is small enough to locate the change exactly. It happens in the input representation, before the encoder has had an opportunity to interpret a sentence or make a prediction.

The example with `फ्लु` shows a consequence at word level. The consonants in the form for *flu* are accompanied by a halanta and a vowel sign. If those dependent marks disappear, the result is `फल`, the form for *fruit* in the paper’s example. The issue is a collision between forms. The same retained characters can stand for the spelling that was already present in one input and the spelling produced by simplifying a different input. An encoder that sees only the simplified form has to rely on whatever other clues are available.

The authors show the two WordPiece implementations and their own tokenizer processing the same Nepali passage. In the displayed results, `nepaliBERT` changes the initial form in a way that yields `फल` among its pieces and loses signs in other parts of the passage. `NepaliBERT` retains the consequential marks in the initial form. The authors’ tokenizer also keeps them. This comparison matters for interpreting the experiment. The input loss is a behavior of the implementation being demonstrated, and the better-preserved WordPiece output shows that a WordPiece vocabulary and preprocessing pipeline can make a different choice.

#### Learn a vocabulary for the pooled corpus

SentencePiece treats the input as a Unicode character sequence and handles spaces within that representation. A boundary is represented with `▁`, identified in the paper by the Unicode value `U+2581`. In the examples, this marker lets a piece carry information about the space before it. It plays a different role from WordPiece’s continuation prefix. A piece can be associated with a preceding boundary, while a neighboring piece can be attached without one. The approach comes from [SentencePiece](https://md.research.elamur.ai/free/en/papers/kudo-2018-sentencepiece-simple-language-independent-subword/).

The authors fit their SentencePiece tokenizer on the combined Nepali corpus and set its vocabulary size to 24,576 tokens. This number is the size of the inventory learned for segmentation. A corpus sequence can use some of those units and reuse them wherever the same written material recurs. The inventory covers units of different lengths, as the examples show. The method therefore has room to keep recognizable spans together or break a form into several pieces while retaining the marks that distinguish it.

There are two reasons for preferring this tokenizer in the paper. The authors want an input representation that works for the Nepali text in front of them. They also value a tokenizer that can be used flexibly when generating text with a system that predicts successive tokens. The examples establish why the first criterion receives attention. The latter is a design consideration for choosing the tokenizer. The final evaluation in the paper asks encoders to predict a document category.

The tokenizer is shared by the encoders the authors train. That choice matters when reading the feasibility comparison. If two training runs start from the same Nepali characters, the common tokenizer gives those characters the same segmentation for the authors’ runs. Separately trained baselines can come with their own input representations. It is useful to distinguish the shared preprocessing inside the new pipeline from the comparison of complete systems on news classification.

#### Turn the visible text into its own training target

An encoder reads a sequence and builds numerical representations informed by the rest of the input. The paper describes the Transformer in terms of encoder and decoder components. For this study the encoder is useful because a variable amount of text can inform a fixed set of output choices in the downstream task. Each document eventually has to receive a category. During pretraining, however, the prediction targets sit at selected positions inside the text.

The authors use masked language modeling, abbreviated MLM. Start with a token sequence, conceal selected tokens, and ask the encoder to recover them. The unaltered sequence supplies the targets. The visible input on both sides can contribute evidence for a hidden token. The authors contrast that objective with causal prediction, where the system uses the preceding sequence to predict what comes next. The distinction matters because a category decision can depend on information scattered across an article. The initial objective encourages the encoder to build representations that can draw on context in both directions.

The paper first denotes the original text sequence as follows.

```
X = {xᵢ}
```

`X` is the original sequence given to the training procedure before any tokens are hidden. `xᵢ` is the token occupying position `i`, and `i` indexes the positions in that sequence. The braces collect the indexed tokens. The paper calls `X` a sequence, so the identity of each position is part of the representation.

The corrupted input can be shown by the following transformation.

```
X → X̃
```

`X` again denotes the original token sequence. `X̃`, read as “X tilde,” denotes the version with selected positions masked. The arrow means that the masking operation produces the second sequence from the first. The training target at a masked position comes from the original sequence at that position. Reconstruction in this experiment is the recovery of those hidden tokens.

The masking probability determines how much of the input the encoder is asked to recover. Raising it changes the number of training targets and reduces the amount of visible context around them. The authors mention 15% as the original BERT setting. They also cite earlier work suggesting 20% for small Transformers and rates as high as 40% for much larger ones. Those numbers describe the cited masking choices or findings. The Nepali paper does not present a sweep across that range. It uses different masking settings for different runs in the feasibility stage, and reports a shared masking setting in its longer comparison.

The authors also discuss progressive masking as a way of reusing a limited collection. Across repeated passes through the corpus, the procedure increases the number of masked tokens, making later passes harder. The training signal can vary even when the underlying text is the same, since the visible and target pieces can change. The appendix explicitly identifies a DistilBERT run using progressive masking. The longer pretraining table gives 20% as the masking probability for the comparison. The paper does not map that table’s value to a complete schedule of rates for the individual epochs. An epoch is a pass through the training data.

#### Screen the architectures under a computing constraint

The authors choose the candidate families for different reasons. DistilBERT is the smaller option, motivated by efficiency and the possibility of on-device use. DeBERTa is the candidate chosen for its ability to represent relationships between nearby token pairs. XLM-R brings a multilingual architecture into the comparison. The project gives each candidate the same overall task of learning to recover Nepali tokens while allowing the training configurations to differ.

Before committing to longer training, the authors set a cutoff of 54.598 in perplexity, corresponding to a training loss of 4.0. Training loss summarizes the prediction error according to the learning objective. Perplexity expresses the same kind of prediction uncertainty on a different scale, where lower values indicate that the targets receive more support from the predictor. In the feasibility test the cutoff is a stopping criterion for comparing progress. It gives the authors a point at which they can inspect elapsed time and samples processed.

They vary settings that affect the work done in each update. A batch is the collection of examples processed together for a training update. In the feasibility test the batch sizes are 28 for DistilBERT, 6 for DeBERTa and 1 for XLM-R. The masking probability is 15% for DistilBERT and XLM-R and 20% for DeBERTa. Those settings define the runs whose costs are compared. Each system is evaluated by how its configured run reaches the cutoff, rather than through a test that matches every setting across architectures.

Elapsed time and sample count give different views of the training effort. The sample count shows how much text a run used before reaching the target. Time shows the wall-clock cost in the authors’ setup. When the batch contains only a single sample, processing another batch can involve an update after each sample. With a larger batch, more samples contribute to an update together. A system can therefore use fewer samples overall and still take longer to reach the cutoff. The feasibility test is designed to notice such a tradeoff before committing to longer runs.

#### Continue pretraining and adapt to news labels

The authors carry DeBERTa and DistilBERT forward and train them for 5 epochs on the collected text. The longer-run table reports the same batch sizes used for these systems in the feasibility test, 6 for DeBERTa and 28 for DistilBERT. It gives 20% as the masking probability and records both end-of-training loss and evaluation perplexity. This part of the pipeline compares the systems after a fuller pass through the learning procedure, using the same Nepali corpus and tokenizer.

The next stage replaces the masked-token problem with the labeled classification problem. The encoder processes Nepali news text, and the training signal now comes from each article’s reference category. The immediate purpose is to adapt what the encoder learned about token sequences so it can support a choice among news topics. Accordingly, the downstream metric is expressed in correctly categorized documents. The pretraining targets and the news labels answer different questions about the same trained system.

The authors vary the fine-tuning settings and run the systems for a number of epochs while monitoring for overfitting. Overfitting is the tendency for continued adaptation to the training examples to cease improving performance on evaluation examples. The paper identifies `2e-5` and `3e-5` as learning rates that worked well for the authors’ systems with a linear scheduler. The learning rate governs the size of parameter updates, and the scheduler changes that rate as training progresses. The paper ultimately compares the highest accuracy recorded for each system under the configurations it tried.

### Experiments and results

#### How quickly did each run reach the cutoff?

The feasibility experiment uses the authors’ collected Nepali text and newly fitted tokenizer. The comparison ends when each run reaches the target perplexity of 54.598, corresponding to a training loss of 4.0. There are two outcomes in the feasibility table. One is elapsed training time to the cutoff. The other is the number of samples seen by that point. Reading the two together explains the authors’ decision about which runs to extend.

DeBERTa reaches the cutoff in 1:39, using 546,000 training samples. DistilBERT reaches it in 3:59, using 406,000 samples. XLM-R reaches it in 9:16, using 154,000 samples. The times are reported in hours and minutes. The ordering therefore depends on what counts as cost. DeBERTa leads on elapsed time even though the count of training samples is highest for its run. XLM-R sees the smallest number of samples while requiring the longest training time.

DeBERTa also runs with 20% masking in this comparison, while DistilBERT and XLM-R use 15%. The authors interpret its progress as encouraging because it reaches the threshold promptly despite the higher proportion of hidden material. The threshold describes how well each run is doing at the masked prediction task it was given. DeBERTa’s result says that its particular training configuration reaches the authors’ chosen criterion quickly under their constraints.

The XLM-R run uses a batch size of 1. The authors describe it as stochastic, with the most training steps of the three feasibility runs, and report a noisy loss trajectory. The low count of samples gives XLM-R an advantage on one resource axis. The amount of computation and the behavior of the run lead the authors to drop it from longer pretraining on their newly collected corpus. Its later appearance in the classification experiment is as an existing multilingual baseline.

The feasibility table also helps interpret what the authors mean by a lightweight option. DistilBERT is not the quickest run to this particular cutoff. It stays in the study because its smaller architecture serves a different practical goal from DeBERTa’s. The paper wants to know whether a system chosen for modest computational requirements can retain enough downstream accuracy to be useful. The short training screen decides which candidates are worth taking forward. The news task supplies the evidence about how close the smaller candidate comes.

#### What longer pretraining achieved

After the 5-epoch run, DeBERTa has a training loss of 1.9375 and an evaluation perplexity of 6.4237. DistilBERT has a training loss of 2.6412 and an evaluation perplexity of 12.3802. The figures come from the longer Nepali masked prediction experiment reported with 20% masking. The loss values belong to training. The perplexity values are designated as evaluation results, with the paper leaving the makeup of that evaluation portion unspecified.

Evaluation perplexity after pretraining on the combined Nepali corpus DeBERTa has lower evaluation perplexity than DistilBERT.

**The numbers**

| System or setting | perplexity |
| --- | --- |
| DistilBERT | 12.3802 |
| DeBERTa (this paper) | 6.4237 |

Both measurements favor DeBERTa within this comparison. The evaluation perplexity gives a direct indication that its advantage extends to the text used to evaluate recovery of hidden tokens. This is evidence about masked prediction after the longer run. The paper separately evaluates whether the new encoders can be adapted to document labels, because the categories in news classification are absent from the pretraining task.

The table also puts the feasibility result in perspective. DistilBERT makes enough progress to justify carrying it through the entire evaluation, and its purpose is to offer a smaller alternative. The study can therefore ask how the practical ordering changes when the output is a category rather than a missing token. A reader selecting between the two encoders needs the result from the task they intend to use, along with the training evidence relevant to their constraints.

#### Which encoder classifies Nepali news best?

The downstream dataset is “16 Nepali News,” described as containing approximately 14,364 Nepali news documents divided unevenly among 16 categories. The topics range across areas such as banking, literature, technology and sport. When presented with a news document, a system predicts one of the dataset’s classes. Some classes are represented by more documents than others, so the collection gives different amounts of training and evaluation evidence for different categories.

The comparison includes the Nepali-pretrained DeBERTa and DistilBERT, both earlier Nepali BERT implementations, and the multilingual XLM-R. These alternatives make several comparisons possible. The new encoders can be measured against earlier monolingual work, as well as against a system pretrained for multiple languages. The two new encoders can also be compared with each other after learning from a common corpus and tokenizer.

The reported metric is the highest accuracy reached in the evaluation runs. Accuracy is the share of evaluated articles assigned their reference category. The paper gives an 80% baseline level and reports that all the systems exceed it. It does not identify that level with a separately trained reference classifier. The model comparison itself comes from the individual peak accuracies, and the paper does not designate the split used for these peaks as a separate untouched test split.

Highest classification accuracy on 16 Nepali News The Nepali-pretrained DeBERTa leads, followed by the Nepali-pretrained DistilBERT.

**The numbers**

| System or setting | accuracy % |
| --- | --- |
| NepaliBERT | 81.05 |
| Multilingual XLM-R | 84.02 |
| nepaliBERT | 85.96 |
| Nepali-pretrained DistilBERT | 88.31 |
| Nepali-pretrained DeBERTa (this paper) | 88.93 |

DeBERTa records the highest accuracy at 88.93%. Its reported peak comes at epoch 3, with 4845 training steps in the table. DistilBERT follows at 88.31%, also with epoch 3 listed, and with 1212 training steps. The result gives the authors a practical distinction between their encoders. DeBERTa offers the highest reported figure. DistilBERT comes close on the news task and reaches its recorded peak with fewer updates.

Among the existing Nepali systems, `nepaliBERT` reaches 85.96%. The corresponding entries are epoch 4 and 3231 training steps. `NepaliBERT` reaches 81.05%, with epoch 6 and 3230 training steps. The upper-case distinction makes a material difference when reading the results, since the two systems have different tokenization examples and different evaluation outcomes. In particular, `NepaliBERT` preserves the initial Devanagari form in the passage shown earlier, while `nepaliBERT` scores higher on the news benchmark.

The multilingual XLM-R baseline reaches 84.02%. Its row lists epoch 5 and 8075 training steps. Its accuracy lies between those of the two existing Nepali BERT implementations. There is thus a difference between saying the best configurations in the study were pretrained for Nepali and saying that all Nepali-specific systems beat the multilingual option. The reported order supports the first observation. The relative position of XLM-R and the existing Nepali systems shows why the choice of comparison matters.

The paper plots evaluation as training proceeds, with the horizontal progression representing epochs. It discusses an overall tendency for Nepali-adapted systems to reach strong performance earlier. The peak table gives a narrower view. Both systems trained in the study have their peak entries at epoch 3, and XLM-R’s entry is later. One existing Nepali system has its peak entry later than XLM-R’s. The tendency is most directly illustrated by the new DeBERTa and DistilBERT runs.

The authors interpret DistilBERT’s low step count and close accuracy as favorable for a production environment with limited computation. The step count is directly observed in the classification comparison. It counts updates under the reported settings, so a timing inference also depends on how expensive an update is. The crisp result is that DistilBERT reaches its best reported accuracy with the fewest classification training steps among the systems evaluated.

### What the ablations show

The paper does not report controlled ablations that remove one component at a time. It offers a qualitative comparison of tokenizers, a feasibility comparison of training configurations, and comparisons of longer pretraining and downstream fine-tuning. These forms of evidence address different questions. The tokenizer output can expose the character change directly. The training runs can rank complete setups under a common decision criterion. The news results can show whether those setups transfer to a labeled task.

#### What can be seen directly in the token sequences

The single-passage comparison gives the most direct explanation of a mechanism in the study. The input begins with the form containing the consonant combination and dependent vowel mark discussed earlier. When these signs disappear in one output, the resulting pieces preserve a different written form. The example makes the authors’ motivation inspectable at the character level. The reader can trace which part of the original spelling is unavailable to the encoder after tokenization.

The other WordPiece implementation retains the initial form. SentencePiece preserves it too, while expressing spaces through a different set of pieces. As a result, the examples support an observation about particular preprocessing choices. They illustrate why it is useful to inspect the output of a tokenizer on Nepali passages. A tokenizer’s family name alone leaves open how the underlying implementation will handle the signs in those passages.

The comparison also draws attention to two separate qualities of a token sequence. One is fidelity to the written input, including its marks and boundaries. The other is the usefulness of the sequence for prediction. Preserving letters and their signs is necessary for giving the encoder access to those distinctions. A well-preserved example alone cannot determine how well the piece inventory will support all articles and categories. The higher news accuracy of `nepaliBERT` than `NepaliBERT`, in spite of their behavior on the displayed form, illustrates how much else can affect a complete system’s score.

A controlled tokenizer experiment would hold the corpus, encoder and training procedure fixed while changing how the text is prepared. The paper’s qualitative evidence establishes the possibility of meaningful input loss, and its classifier comparison measures the systems as available or trained. The two experiments together give a reason for the tokenizer choice and a measure of the resulting system, leaving the tokenizer’s independent effect on accuracy unresolved.

#### What the common cutoff controls

The feasibility test fixes a criterion for the end of each run, which makes the time and sample results interpretable. A comparison at an arbitrary stopping time might show that one system had read more text while another was further along in its predictions. Here each run is measured at the point where its loss reaches the same selected level. The authors can use this comparison to decide whether an architecture offers acceptable progress within their computing constraints.

The mask and batch settings remain part of that result. A higher masking rate presents a different balance of context and targets. A smaller batch presents a different balance of samples and updates. Architecture, batch size and masking probability therefore all contribute to the observed path to the threshold. DeBERTa’s lead in time answers a question about the configurations that were actually available to the project. Assigning that lead to a particular architectural feature would require keeping the other variables aligned.

The test gives a concrete example of how the resource measure can change an interpretation. With the samples processed as the criterion, XLM-R has the most favorable recorded count. With elapsed time as the criterion, its run is the most costly of those compared. That divergence is directly relevant to a project facing limited compute. It does not depend on interpreting which encoder learns the best eventual representation, because the feasibility decision precedes the full pretraining and classification stages.

#### Where the longer comparison is more informative

The longer comparison gives DeBERTa and DistilBERT the same corpus, the same fitted tokenizer and the same reported number of epochs. It also lists the same masking probability in the table that reports both systems. Sharing those conditions makes the lower DeBERTa perplexity easier to interpret than a comparison of unrelated pretrained encoders. The two still run with different batches, and the paper’s discussion of progressive masking leaves details of the per-epoch schedule open. The conclusion is about the trained versions the authors report.

DeBERTa also leads in downstream accuracy, whereas the smaller DistilBERT requires fewer reported downstream updates to reach its peak. These observations support distinct selection criteria. Masked prediction quality favors DeBERTa under the longer pretraining setup. Both systems remain competitive when judged by news accuracy, and the peak step counts distinguish them in another way. The table on pretraining captures how well they recover token targets. The table on news categories captures how successfully each adapts to a whole-document decision.

The evidence for adaptation to Nepali also has a precise scope. Both new systems lead the multilingual baseline, and one existing Nepali system does as well. The other existing Nepali system trails it. Comparing complete systems is an appropriate way to see whether the proposed pipeline provides a stronger candidate on the benchmark. It leaves open which ingredients would have to be retained to reproduce the benefit with a different encoder, corpus or task.

#### What remains unmeasured for masking and data preparation

The authors motivate progressively raising the masking difficulty as a way to get varied training problems from a limited text collection. This rationale describes what changes in the input as training proceeds. The appendix identifies a run that uses progressive masking. There is no reported comparison that assigns otherwise equivalent runs to fixed and rising masking schedules and then measures both outcomes. The independent effect of the schedule therefore remains unquantified in the paper’s main results.

The authors similarly credit deduplication with improving the training procedure. They build it into the corpus used for the study. A separate result for an equivalent run on the collection before removing duplicates would be needed to measure how much that operation contributed. The reported outcomes instead describe what can be achieved by the deduplicated corpus, the shared tokenizer and the selected training setup together. That is the level at which the strongest conclusions about the pipeline apply.

### Limitations

#### Limits acknowledged by the authors

Computing capacity shapes the study from the feasibility test onward. The authors state that XLM-R’s training behavior and cost make it unsuitable for the longer run under their constraints. This means the final pretraining comparison covers the candidates that passed the project’s practical screen. It leaves open how a Nepali-trained version of XLM-R would compare after fuller training, including how it would perform on the downstream task. The multilingual XLM-R row reports a different training history.

The authors also frame their masking and corpus preparation around limited text availability. Reusing corpus entries across epochs with more demanding masking is their way of getting additional training variation from the collection. That choice is tied to the data budget that motivated the study. The paper’s findings show what the authors were able to obtain under their setup. Choosing an appropriate schedule for a different text budget would require evidence about how the training responds when the supply of text changes.

Scope is another explicit feature of the work. The objective is to train Nepali encoders and compare them on a downstream classification task. The conclusion emphasizes Nepali pretraining and the different motivations for DeBERTa and DistilBERT. Accurate categorization on the news benchmark is the practical outcome the authors demonstrate. Their proposed on-device use for the smaller system motivates the architecture choice. They report no device-specific measurements to establish how it behaves in that setting.

The suitability of SentencePiece for aspects of text generation also enters the authors’ design reasoning. Their experiments exercise it in masked prediction and news classification. Those uses give evidence that the tokenizer supports the pipeline they built. Its performance for autoregressive generation with these data and choices remains a separate empirical question.

#### Limits of the benchmark and reporting

The news evaluation uses an unevenly distributed set of categories and reports one overall accuracy figure per peak run. A frequently represented class can contribute more to that figure than a sparsely represented class. As a result, two similar headline accuracies can hide different behavior across the labels. The paper provides no per-class scores or confusion counts for deciding whether an increase is spread across categories or concentrated where there are more evaluation examples.

The highest reported accuracy is also sensitive to the way runs are selected. The authors vary hyper-parameters and observe performance over epochs. Their table gives the best observed value for each system. A reader would need the composition of the evaluation split and details of how the selected configuration was assessed to know how independently those peaks were measured from the choices made during fine-tuning. The paper does not specify that protocol in enough detail to treat the figures as estimates from a separately defined final test.

The same peak-reporting approach limits what can be said about the size of the gap between DeBERTa and DistilBERT. Their reported order is clear. There are no repeated-run distributions or uncertainty estimates in the comparison, so the stability of that order across reruns is unknown. The authors call the difference marginal, and the table shows how close the observed peaks are. The available measurements leave open how consistently another run under the same settings would reproduce the ranking.

The relationship between the pooled text and the news benchmark is another open detail. Deduplication among the collected pretraining sequences is described. The paper does not report how the authors checked for overlapping material between the news collection and the pooled pretraining text. Internal deduplication and separation across corpora address different issues. The first reduces repeated entries in a collection. The second would help establish how independent the classification evaluation is from material available at pretraining time. The absence of a reported overlap check leaves that independence unverified.

Several setup details are given at the level of broad choices. There is a corpus size, a tokenizer vocabulary size, batch and mask settings, a pretraining duration, and a report of learning rates that worked well. Other details needed for a closely matched reproduction are left open, including per-source contributions to the corpus, the exact schedule for progressive masking and the precise evaluation partitions. These omissions limit comparisons with later runs that reuse the same encoder family or dataset name but prepare the materials differently.

#### Limits of the causal and practical conclusions

The paper’s best systems are both trained for Nepali, which supports the authors’ argument for investing in language-specific pretraining. In this study, that choice comes as part of a bundle. The systems differ in architecture, previous exposure to languages, training corpora, and how text is converted to tokens. They are also fine-tuned under varying settings. A comparison designed to isolate the influence of Nepali adaptation would need otherwise comparable runs differing in that factor. Here the result is strongest as a ranking of the complete configurations used on this benchmark.

The authors describe their systems as domain-adapted, with the relevant adaptation in this argument being to Nepali. The downstream collection then brings in a narrower domain, news. The pooled corpus is described as monolingual unlabeled text, with phrases and paragraphs from several sources. The experiment consequently supplies evidence for using Nepali pretraining in Nepali news categorization. It leaves the additional effect of pretraining specifically on news, as distinct from general Nepali text, unmeasured.

The same distinction between a measured quantity and an application claim matters for efficiency. There are wall-clock measurements for reaching the feasibility cutoff and update counts for the fine-tuning comparison. The paper does not report classification latency, inference memory or on-device throughput. Such measurements would be needed to characterize the use the authors envisage for DistilBERT. The evidence available is the choice of a smaller architecture, its close accuracy on news, and the observed cost measures at specific stages of training.

Finally, perplexity is tied to what the system is asked to predict. The study uses it to track the recovery of token pieces defined by its own tokenizer and masking procedure. The classification benchmark provides a second kind of evidence, about category choices after fine-tuning. Neither measure covers the full set of Nepali language tasks discussed in the paper’s background. Claims about tagging, question answering or performance across other kinds of Nepali writing would require evaluation with their own targets and data.

### What came after

Later work that cites the paper addresses several different questions about language resources and evaluation. The link established across these works is the citation, and their stated subjects indicate where each takes the discussion. Their titles do not establish that any of them used Maskey and colleagues’ tokenizer, pretrained weights or news benchmark.

The study by Subedi and colleagues investigates large pretrained systems on two Nepali tasks with more local outputs than news classification. Named entity recognition identifies mentions such as names in text, and part-of-speech tagging assigns grammatical labels to tokens. The move from an article category to labels within a sentence changes what successful adaptation must demonstrate. The work extends the evaluation question to these two tasks in [Exploring the Potential of Large Language Models for Nepali NER and POS Tagging](https://md.research.elamur.ai/free/en/papers/subedi-2024-exploring-potential-large-language-models/).

Thapa and colleagues investigate politico-economic bias in systems for Nepali. That takes the evaluation question beyond correctness against assigned news categories. It asks what tendencies appear in outputs that concern political or economic viewpoints. The subject is a different property of Nepali language technology from the capability measured by Maskey and colleagues, and it is the focus of [Which Side Are You On?](https://md.research.elamur.ai/free/en/papers/thapa-2024-which-side-are-you-investigating/).

MaiBERT takes up the resource-building problem for Maithili. Its stated contributions pair a pretraining corpus with a system trained for that language. The connection to the Nepali study is the decision to address the text resource and the pretrained system together. The language and resulting resource are the subject of [MaiBERT](https://md.research.elamur.ai/free/en/papers/yadav-2026-maibert-pre-training-corpus-language/).

NepKANUN applies Nepali language technology in a legal assistant. The title specifies retrieval-augmented generation, in which retrieved material informs the text an assistant generates. This makes the application different from assigning news categories using a pretrained encoder. Its domain and retrieval-based approach are the stated focus of [NepKANUN](https://md.research.elamur.ai/free/en/papers/thapa-2026-nepkanun-rag-based-nepali-legal/).

## Cite

Cite as Utsav Maskey, Manish Bhatta, Shiva Bhatt, Sanket Dhungel and Bal Krishna Bal. 2022. Nepali Encoder Transformers: An Analysis of Auto Encoding Transformer Language Models for Nepali Text Classification. Proceedings of the 1st Annual Meeting of the ELRA/ISCA Special Interest Group on Under-Resourced Languages.

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{maskey2022nepali,
  title = {{Nepali Encoder Transformers: An Analysis of Auto Encoding Transformer Language Models for Nepali Text Classification}},
  author = {Utsav Maskey, Manish Bhatta, Shiva Bhatt, Sanket Dhungel and Bal Krishna Bal},
  booktitle = {Proceedings of the 1st Annual Meeting of the ELRA/ISCA Special Interest Group on Under-Resourced Languages},
  year = {2022},
  url = {https://aclanthology.org/2022.sigul-1.14/}
}
```

> 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)
