FaBERT: Pre-training BERT on Persian Blogs
Paper · 2025 · Mostafa Masumi, Seyed Soroush Majd, Mehrnoush Shamsfard et al.
Summary
A Persian product review, a question on a discussion forum, and a news report can use the same language in markedly different ways. A system trained to read one kind of writing may struggle when the same information appears in another. FaBERT asks whether Persian blogs can supply enough variety to train a general-purpose reader for these different settings. The authors train a BERT-base encoder from scratch on HmBlogs, a collection of 20 million posts covering 15 years. The corpus includes formal prose as well as colloquial writing, so the experiment tests a source with a broader range of styles than the word blog might suggest.
The authors filter the corpus and standardize inconsistent characters before training. They adapt tokenization to Persian half spaces and use a vocabulary of 50,000 tokens. To learn from posts without task labels, FaBERT practices recovering words hidden from passages. The hidden words change as passages are encountered again, and all the pieces of a selected word are masked together. The resulting encoder has 124 million parameters and is publicly available. It is then adapted separately to each benchmark, using task examples to learn outputs such as a sentiment label or the location of an answer in a paragraph. Fine-tuning
The evaluation covers 12 datasets. FaBERT leads the compared systems on nine, using the paper’s overall comparison for each dataset. It reaches 82.62 test F1 on ParsiNLU question paraphrasing, where some questions use informal wording, and 55.87 test F1 on ParsiNLU reading comprehension, where it must find an answer in a passage. It also leads on both sentiment datasets and on the conversational PCoQA benchmark. The remaining comparisons reveal different strengths. ParsBERT leads on the aggregate MultiCoNER v2 entity score, and XLM-R leads on irony accuracy and overall PQuAD F1. On PQuAD’s answerable questions, FaBERT has the strongest F1 among the automated systems.
The tokenizer typically produces longer inputs than ParsBERT’s and shorter inputs than the multilingual alternatives in the paper’s length comparison. This matters because an encoder can read only a fixed number of tokens at once. Compact segmentation lets more of the original passage fit into that space, although FaBERT still has a 512-token limit. Taken together, the experiments show that Persian blogs can support an effective, relatively compact encoder for several kinds of reading. The comparison concerns FaBERT as a complete system. It leaves open how much of its performance comes from the source of its training text, the tokenizer, or the other training choices.
Deep dive: FaBERT: Pre-training BERT on Persian Blogs
FaBERT pre-trains BERT on formal and informal Persian blogs, then tests how well it handles Persian text across language understanding tasks. · about 36 minutes to read
The problem and its context
The kinds of Persian a reader encounters
The paper starts from a mismatch between learning a language from available text and using it wherever people write. The sources it describes for earlier Persian systems include encyclopedic pages, news, academic writing, and social media. Each source exposes a reader to particular sorts of expressions. An encyclopedia supplies explanations written for a broad audience. A social post may use a more conversational vocabulary. In a practical application, the input can come from either end of that range, and the language of a labeled dataset may differ from the language that supplied most of the earlier training.
The authors highlight features that make everyday Persian worth representing directly. Writers can use idioms, slang, flexible sentence structures, and vocabulary whose meaning depends on cultural context. A system can encounter a familiar subject in a sentence built very differently from the examples it learned from. The issue also arises when words are familiar but their use is unfamiliar. A piece of wording that works as straightforward praise in one context may function differently in an ironic post. The paper's interest in informal Persian concerns these choices of vocabulary and expression as well as spelling variation.
Blogs offer a way to bring some of those styles together in a single corpus. The reasoning depends on what HmBlogs contains. The authors describe its posts as coming from users across different demographics and covering a long period, with varied subjects and genres. Some posts contain conversational writing, while others use more formal language. The authors identify Persian blogs as a source that earlier Persian pretraining had yet to use. Their proposal is to make this source the entirety of the pretraining text and see how well the resulting encoder adapts to datasets collected elsewhere.
Earlier experiments cited by the paper had already made a case for exposing an encoder to informal writing. The authors point to work on English tweets and to pre-training BERT on Arabic tweets. They cite these projects for the value of colloquial and social-media text. FaBERT pursues a related question through a corpus that includes both colloquial and formal passages. Its target is a Persian encoder that can move across applications after task-specific training, including applications whose inputs bear little resemblance to a blog post.
The diversity in the raw collection also creates a preparation problem. Persian script is an imperfect guide to the language of a post, and two characters that look the same to a person can be represented differently in the underlying text. Large amounts of raw text are useful only insofar as the system can draw sensible training examples from them. The authors therefore treat selection and normalization as part of building the pretraining corpus. This introduces an important distinction within informal writing itself. The project aims to retain colloquial Persian, while its filters also remove some posts that the authors consider too noisy for training.
Why the authors chose an encoder
The underlying task is to learn representations that can be adapted to natural language understanding problems. An encoder takes a sequence of input tokens and builds a representation of each token in relation to the others. In BERT, a token can draw information from the context on both sides. If a word is missing near the middle of a passage, the words after the gap can offer evidence as well as the words before it. The authors contrast this property in their discussion of earlier work with systems that process language in a single direction.
The original BERT recipe described by the authors includes masked language modeling and next sentence prediction. Masked language modeling gives the system a passage with some material hidden and asks it to recover what was there. The text itself supplies the answers, which allows training without a human assigning a category to every passage. Next sentence prediction asks whether a second sentence follows a first one. Both are ways of obtaining a training signal before introducing a specific output such as an entity type or a sentiment label. FaBERT keeps the recovery task and follows earlier work cited in the paper in dropping the sentence-order objective.
The introduction also explains the authors’ interest in keeping the encoder compact. They discuss larger language systems as capable across many applications and describe the continuing role of fine-tuned encoders in classifying, retrieving, and processing text. They identify response time, hardware demands, and the need to send inputs to an online service as practical considerations in choosing a system. Applications such as document retrieval or content filtering may need to make a narrow decision many times. The authors present an encoder as a way to handle those decisions with a dedicated system.
In FaBERT, the smaller system has a specific job at evaluation time. For a review, it assigns a label. For an entity task, it supplies labels at positions in the text. For a reading question, it locates an answer in the supplied context or, on datasets that provide that option, leaves the question unanswered. This makes it possible to ask how well the representation learned from blogs transfers to tasks with explicit answer formats. The paper’s comparisons therefore concern readers adapted to those formats, within the benchmark setup the authors describe.
Persian specialization and multilingual coverage
ParsBERT and AriaBERT are the main Persian-specific predecessors discussed in the paper. ParsBERT learned from material collected from 8 sources and used both of the original BERT objectives. The authors describe it as widely used for Persian language processing. AriaBERT follows changes associated with RoBERTa and segments text with byte-pair encoding. Its pretraining collection exceeds 32 gigabytes and includes conversational and formal material as well as mixed-style text. These predecessors already offer ways to train specifically for Persian. The distinctive choice in FaBERT is to draw the full pretraining corpus from blogs.
The other line of work involves training a single encoder for many languages. The paper describes multilingual BERT, or mBERT, as learning from Wikipedia in 104 languages with a shared vocabulary. It uses both masked language modeling and next sentence prediction. The authors discuss its ability to transfer across languages, for instance when task annotations are available in one language and evaluation occurs in another. They also describe XLM-R, which they identify as a multilingual relative of RoBERTa trained to recover hidden text from more than 2 terabytes across 100 languages. These systems give the evaluation alternatives that learned from resources far beyond Persian alone. Multilingual and cross-lingual NLP
A shared vocabulary has to serve many languages. For FaBERT, the designers can spend the entire vocabulary on the text they intend to read. The difference becomes important because an input budget counts pieces emitted by the tokenizer. If a Persian expression is represented by a short sequence of pieces, more of the preceding and following passage can fit in the same budget. If the expression has to be broken down further, the input spends more positions representing it. The relevant question is how a vocabulary behaves on Persian text, since its total size gives little direct information about how many of its entries are useful for a particular document.
Vocabulary size also affects the number of parameters associated with storing token representations. Adding entries can make it possible to encode more expressions with dedicated pieces, but each additional entry needs to have its representation learned during training. At the other extreme, small inventories can leave the encoder reading sequences with many pieces for common forms. The earlier systems give the authors several points of comparison for this tradeoff. They can compare the size of the resulting encoders and, separately, observe how much text their tokenizers can express in a given space.
The method, step by step
From blog posts to training passages
The authors start with HmBlogs. The collection contains more than 6.8 billion tokens by the corpus count reported in the paper and spans a range of styles. The count describes the collection as introduced by the authors. It gives the scale of the source before their account of filtering, without giving a new count for the material retained by those filters. The pretraining data come from this collection alone. Training the encoder from scratch means learning its parameters from this preparation process and the word prediction task, without beginning with the weights of one of the comparison systems.
The first preparation step is to decide which posts belong in the training material. According to the authors, looking at the alphabet can lead to mistakes because Persian script resembles the scripts used for Arabic and Kurdish. A post can therefore look plausible at the character level and still be in another language. Within Persian, the authors also encounter posts with typographical errors, very rare words, or heavy use of local dialect. They use a post discriminator to filter material they consider unsuitable or excessively noisy. The unit they describe filtering is the post. Their account identifies the kinds of input that motivated it and leaves its decision rules unspecified.
The next step is to standardize how characters are written. The paper describes forms that are visually indistinguishable from ordinary Persian characters yet have different underlying codes. To a reader, a word containing one of these substitutions may look unchanged. To the tokenizer, the character sequence is different. Treating these cases consistently reduces the chance that two visually identical words are learned as unrelated strings merely because a writer used a different character form. The authors also normalize decorative characters and correct words in which characters have been repeated.
These steps address different sources of variation. Filtering decides which documents contribute text. Normalization changes the representation of characters in the text that is kept. Both take place before the text becomes a sequence of pieces for the encoder. Their role is particularly important in a corpus selected for stylistic range. The objective requires keeping enough of the variation that makes blogs useful while preventing inconsistencies in the written representation from overwhelming useful patterns. The paper describes this as a preparation choice for the corpus rather than as a separate learning task.
During pretraining, the input is a contiguous passage drawn from a single document. A passage can have one sentence or extend across neighboring sentences. This lets a training example preserve the surrounding text where the author actually wrote it. The examples vary in length. The paper explains that this variation is intended to help the encoder learn positional encodings, the part of the input representation that supplies information about where tokens occur. The objective remains recovery of masked material even when the passage crosses a sentence boundary.
How a passage becomes an input
FaBERT uses WordPiece for subword tokenization. A word can correspond to an entry in the vocabulary or be represented by several smaller entries. The encoder works with the resulting sequence of entries. A person may count the word as a single item while the encoder assigns it several positions. This difference is relevant throughout the paper. It affects how the authors hide training material and how they count the space a passage takes up during the length analysis.
The authors choose WordPiece over byte-pair encoding, referring to prior evidence that switching to the latter did not improve performance in the work they considered. They set the vocabulary size to 50,000 tokens as a compromise between coverage and computational cost. The vocabulary has to cover much more than a list of common words. Its pieces must combine effectively when the reader sees a less common form or an expression absent as a whole. A larger inventory could dedicate entries to more forms. The authors’ choice puts more emphasis on obtaining useful combinations within a smaller inventory.
Persian half spaces receive particular attention. The tokenizer is adapted to preserve appropriate treatment of this feature in Persian text. That decision applies both while the representation is learned and when it is used for a labeled task. A word boundary matters here in two ways. It helps determine what the tokenizer treats as a unit when processing the text, and it supplies the grouping needed to hide a whole word in training. The paper identifies half-space support as a property of FaBERT’s tokenizer and gives its effect on overall token counts as part of a broader comparison of tokenizers.
The encoder follows the original BERT-base Transformer design, with 12 hidden layers and 12 self-attention heads in each layer. A layer updates the representation of each input position. An attention head provides a way for a position to draw on information from other positions. In a masked passage, that mechanism can connect the gap to clues elsewhere in the text. The vocabulary and encoder together give FaBERT its 124 million parameters, the learned values that are adjusted during training.
The paper’s size comparison puts the scale of this design in context. In the table’s parameter-count unit of millions, ParsBERT is listed at 162 and AriaBERT at 132. Their vocabularies are listed at 100 and 60, respectively, in thousands of entries. The corresponding vocabulary entries for mBERT and XLM-R are 105 and 250 in that unit, and their parameter counts are 167 and 278 in millions. The table presents English BERT as a reference point as well, with 30 in the vocabulary column and 109 in the parameter column. The authors’ compactness claim concerns the Persian and multilingual alternatives used in the downstream experiments.
How the hidden-word exercise works
The encoder learns by recovering masked text. It receives a version of the passage from which selected material has been hidden. Its training target is the original material in those positions. The surrounding text can suggest the answer through the subject of the passage, through grammatical cues, or through the particular combination of words that occurs on either side. This gives the encoder a reason to learn relationships between tokens. Later tasks use the representations produced by that practice for different decisions.
The paper specifies a masking rate of 15%. Masking is dynamic, so the locations selected for hiding can change when an input is encountered again. A given passage can provide different exercises across training. A word that is available as context on one encounter can become part of the target on another. This is the change associated with the paper’s use of dynamic masking. Varying the sentence lengths, by comparison, changes the span of text the encoder sees and the positions it has an opportunity to learn about.
Whole-word masking determines what disappears once a word is chosen. A word that has been split into pieces can otherwise leave much of its written form visible if only one of those pieces is hidden. Under FaBERT’s procedure, the pieces belonging to the chosen word are hidden together. The encoder still reads a sequence of tokens. It is the choice of positions to hide that follows the boundaries of the word. The intended effect is to make the surrounding context carry more of the evidence needed for recovery.
The authors dispense with next sentence prediction, drawing on earlier work that found no discernible benefit from it. As a result, a training passage with neighboring sentences supplies context for recovering hidden text. There is no additional training exercise asking the encoder to decide whether the sentences are actual neighbors. Keeping those decisions distinct makes the recipe easier to understand. Sampling contiguous passages defines what context is available, dynamic masking determines how the exercise varies, and whole-word masking defines the unit of concealment.
From Persian blog posts to a fine-tuned FaBERT encoder
The steps in order.
Training settings and transfer to labeled tasks
The pretraining configuration lists a batch size of 32, which sets how many examples are handled together in a training batch. The optimizer is Adam, the procedure that uses the training error to update the parameters. The listed learning rate is 6e-5, which sets the scale for those updates. Weight decay, used to restrain the growth of the learned weights, is 0.01. The authors give a dropout setting of 0.1. Dropout removes some activations during training so that the system learns under varying patterns of available information.
The training schedule comprises 18 Million total steps, with 1.8 Million warmup steps. Warmup is the initial phase in which the learning rate rises toward its training setting. The precision format is TF32, the numerical format named in the authors’ settings. They train on a single Nvidia A100 40GB GPU for 400 hours. The pretraining split assigns 99% of the data to training and 1% to validation. The validation portion provides a way to track recovery of masked material on text withheld from the parameter updates.
The paper follows the masked language modeling loss on both portions as pretraining progresses. The loss indicates how well the encoder predicts the hidden material, while validation perplexity expresses the uncertainty of those predictions on the reserved data. The final validation perplexity reported for FaBERT is 7.76. This value belongs to the pretraining exercise and its particular text and segmentation. The downstream measurements concern different exercises for which the encoder receives separately labeled examples.
Once pretraining is complete, the authors fine-tune FaBERT for each dataset. The shape of the input and the expected output depend on the task. A premise and hypothesis call for a label describing their relationship. A text containing named entities calls for labels that locate and categorize those entities. A reading question comes with a passage and calls for a span, a consecutive portion of that passage that supplies the answer. The pretraining exercise teaches a shared way to read text. Fine-tuning attaches that representation to the decisions defined by the dataset.
There is one explicit label-set expression in the paper. It describes how the DeepSentiPers source data represented sentiment before the authors simplified the task.
E = {−2, −1, 0, +1, +2}
E names the original set of sentiment labels. The equals sign identifies its contents, the braces delimit the set, and commas separate the labels. The minus signs in −2 and −1 identify negative ratings, with −2 more negative. The label 0 is neutral. The plus signs in +1 and +2 identify positive ratings, with +2 more positive. The authors found it difficult to distinguish consistently between the adjacent negative categories and between the adjacent positive categories. They combine the negative ratings and combine the positive ratings, retaining neutral as its own category. The evaluation therefore asks for the direction of the sentiment and drops the original distinctions in intensity.
Experiments and results
How the comparisons were set up
The authors compare FaBERT against ParsBERT, AriaBERT, mBERT, and XLM-R. They fine-tune the systems with common training, validation, and test splits for each dataset. Training examples are used to adapt the encoder to the task. Validation examples are used to choose the tuning configuration, and the reported performance comes from the test examples. They perform a grid search for each system and dataset pair, meaning that they consider combinations of candidate settings and select the one with the best validation score. This gives different systems a chance to use settings appropriate to them under the same dataset partition.
The appendix describes the candidates for learning rate, batch size, number of epochs, and warmup. An epoch is a pass through the training examples. The range of choices varies across datasets. FarsTail, for example, lists learning rates of 2e-5, 3e-5, and 5e-5, batch sizes of 8 and 16, and epoch choices of 3 and 7. In the ParsiNLU experiments the authors follow the hyper-parameter settings defined in the ParsiNLU code. Its reading comprehension row lists a batch size of 4 and learning rate candidates of 3e-5 and 5e-5. The corresponding question paraphrasing row uses the same learning rate choices and lists batch sizes of 8 and 16.
The scores measure success differently according to the task. Accuracy measures how often the system gives the correct label. F1 balances precision and recall. Precision concerns how often a predicted item is correct, while recall concerns how much of the expected output the system recovers. A micro average pools decisions before calculating the score. A macro average gives each class or entity type equal weight when combining the scores. In reading comprehension, overlap F1 gives credit for a partly correct answer. Exact match requires the selected answer to match the reference. The meaning of F1 in these experiments therefore depends on what the system is asked to predict and how the predictions are combined.
Most of the headline comparisons concern one test score per dataset. Reading comprehension and conversational answering have additional measures that separate different ways of succeeding. Named entity recognition has a further breakdown by category. These details matter when two encoders have similar aggregate scores. They can arrive at the same level through different strengths, and the benchmark’s main metric determines which of those strengths has the most influence on the final ranking. Evaluation and benchmarks
Inference and question paraphrasing
Natural language inference asks how two sentences are related. In the datasets used here, the categories are entailment, contradiction, and neutral. Entailment means that the first sentence supports the conclusion expressed by the second. Contradiction means that their claims conflict. A neutral pair leaves the conclusion unresolved. The input can contain words associated with the same topic in any of these cases. The task is to decide what the sentences imply about each other. The authors include datasets built in different ways so that this ability is tested on more than one source of sentence pairs. Reasoning
FarsTail starts with multiple-choice questions taken from Iranian university exams in a variety of subjects. These questions supply the basis for constructing examples of the inference relationships. The experiment uses 7266 training examples, 1564 validation examples, and 1537 test examples. FaBERT achieves 84.45 test micro F1. XLM-R reaches 83.50, and mBERT reaches 83.42 on the same metric. ParsBERT scores 82.52, while AriaBERT scores 76.39. FaBERT’s lead is visible here on a dataset with roots in exam material, alongside the results the authors obtain on more conversational text.
SBU-NLI draws on several sources to make a balanced collection of the same relationship labels. Its split contains 3248 training examples, 361 validation examples, and 401 test examples. FaBERT’s test micro F1 is 66.65, with mBERT at 66.38. The paper describes their performance as comparable. XLM-R records 58.85, ParsBERT 58.41, and AriaBERT 52.81. The much lower absolute scores in this dataset compared with FarsTail reflect results from a different collection of examples. They give a second view of inference, with a different nearest competitor and a narrower lead for FaBERT.
ParsiNLU question paraphrasing asks whether two questions express the same request. The data come in part from questions found through Google autocomplete and Persian forums, and partly from translating QQP with the Google Translate API. The resulting questions include informal wording. The classification can require recognizing a shared request even when the phrasing changes. This is a different relationship from the ones labeled in the inference datasets. The split lists 1830 training examples, 898 validation examples, and 1916 test examples.
ParsiNLU question paraphrasing test micro F1 by encoder
FaBERT leads the comparison on question pairs that include informal wording.
The numbers
| System or setting | micro F1 |
|---|---|
| ParsBERT | 77.60 |
| AriaBERT | 78.86 |
| mBERT | 79.48 |
| XLM-R | 79.74 |
| FaBERT (this paper) | 82.62 |
On this test, the strongest baseline is XLM-R and FaBERT is ahead of it. The authors report the improvement as +2.88% in F1. The result is consistent with their motivation for including informal language in pretraining. The dataset combines translated and mined examples, though, and the reported score is for the combined test set. It measures whether the encoder works across the particular mixture it receives. A result broken out by how the questions were obtained would answer a more specific question about which part of the mixture contributes to the lead.
Named entities in tweets, news, and difficult short contexts
In named entity recognition, the reader finds expressions that name things and assigns each one a category, such as person, location, or organization. This is a task about the location and type of an expression within a text. A sentence can contain several entities, each requiring its own prediction. The authors evaluate with collections that differ in both their writing and their definition of an entity. They use micro F1 for PEYMA and ParsTwiNER and macro F1 for MultiCoNER v2, as stated in the results discussion and reflected by the detailed averages.
ParsTwiNER supplies the informal comparison. The source contains 7632 tweets with 24,061 annotated entities. Its categories include events and groups as well as familiar categories such as people and locations. For the experiment, the paper lists 6418 training examples, 447 validation examples, and 304 test examples. FaBERT leads with 82.22 test micro F1. ParsBERT is the nearest competitor at 81.13, and the authors describe FaBERT’s improvement as +1.09%. XLM-R scores 79.50, AriaBERT 78.53, and mBERT 75.60. This is a transfer from blog pretraining to a distinct source of informal Persian.
PEYMA is drawn from formal texts published by ten news websites. It includes labels such as time and date in addition to the usual named categories. The test split has 1027 examples, after fine-tuning on 8029 training examples and selecting settings with 926 validation examples. FaBERT records 91.39 test micro F1, narrowly ahead of ParsBERT at 91.24. XLM-R has 90.91, AriaBERT 89.76, and mBERT 87.84. The authors describe performance on PEYMA as broadly comparable. This is a useful counterpart to the tweet test because the same FaBERT pretraining also supports a leading result when the target text comes from news.
MultiCoNER v2 presents finer categories, relatively little context for some entities, and noise inserted into inputs. Names can also have complex internal structure, as with titles of creative works. The source draws on Wikidata and Wikipedia and spans 12 languages. The authors evaluate on Persian, with 16,321 training examples, 855 validation examples, and 219,168 test examples. FaBERT scores 57.92 test macro F1, close to ParsBERT at 58.09. AriaBERT reaches 54.00, XLM-R 51.47, and mBERT 51.04. This dataset’s overall result favors ParsBERT, and the category-level results show where FaBERT is strong within that comparison.
These datasets differ in more than formality. They also specify different categories and present different amounts of context. The separation between the tweet and news datasets helps show that FaBERT transfers to both. The MultiCoNER v2 result shows why describing all entity recognition with a single ranking would be misleading. On this collection, the scores depend on how well a reader identifies many distinct types under difficult conditions. Averaging across those types gives a different comparison from pooling the entity decisions in the tweet or news benchmarks.
Sentiment and irony
Sentiment analysis asks for the attitude expressed in a text. The paper evaluates review sentiment with DeepSentiPers and MirasOpinion. Both come from Digikala, described as an Iranian e-commerce platform. They differ in how the labels were obtained and how those labels are used here. DeepSentiPers begins with ratings that distinguish intensity, and the authors merge adjacent labels as described in the method. MirasOpinion already uses positive, neutral, and negative labels assigned through crowdsourcing. Macro F1 gives each sentiment category a share of the final score regardless of how often it occurs.
DeepSentiPers is described as a collection of 9,000 reviews. The experiment lists 6320 training examples, 703 validation examples, and 1854 test examples. On the simplified sentiment labels, FaBERT reaches 79.85 test macro F1. XLM-R is closest at 79.00. AriaBERT reaches 75.09, ParsBERT 74.94, and mBERT 72.95. The distinction between the original label set and the evaluated label set matters here. These results measure how well the encoders distinguish negative, neutral, and positive text after the authors remove the finer judgments of intensity.
MirasOpinion contains 93,000 reviews according to the paper’s dataset description, and the evaluation uses it as part of SPARROW, a benchmark for sociopragmatic understanding. The split table lists 75,094 training examples and 9387 each for validation and test. FaBERT scores 87.51 test macro F1. ParsBERT has 86.73, AriaBERT 85.56, XLM-R 84.92, and mBERT 84.40. The nearest competitor changes from the DeepSentiPers comparison even though both experiments concern product reviews from the same platform. Across these separate setups, FaBERT has the highest reported sentiment score.
MirasIrony tests for a mismatch between what a tweet says literally and the sentiment it conveys. The source comprises 4,339 manually labeled Persian tweets. In the dataset’s terminology a positive label marks irony, while a negative label marks its absence. These are labels for the phenomenon, distinct from the positive and negative ratings of a review. The authors again use the SPARROW evaluation. The split table lists 2352 training examples, 295 validation examples, and 294 test examples for their experiment.
The main score for MirasIrony is accuracy. XLM-R leads at 75.51% test accuracy, and FaBERT is next at 74.82% accuracy. mBERT is at 74.48 in the table’s accuracy column, with AriaBERT at 73.80 and ParsBERT at 71.08. The outcome qualifies a simple explanation in which exposure to informal language is enough to give FaBERT the lead on tweet data. FaBERT places first when locating entities in ParsTwiNER and second when deciding whether a tweet is ironic. That distinction separates understanding what kinds of things are named in a text from recognizing how the intended sentiment relates to its literal wording.
Finding answers in a supplied passage
The question answering experiments involve reading a passage and identifying an answer in it. Even when a system finds the relevant information, it can select a span that extends too far or falls short. Overlap F1 can register that partial success, while exact match is sensitive to the span boundary. The datasets present different demands on top of this shared format. The reading comprehension benchmark draws on questions people might search for. PQuAD includes questions that the supplied passage cannot answer. PCoQA asks a series of related questions, so an individual question belongs to an unfolding exchange about the document.
In ParsiNLU reading comprehension, the dataset creators use Google autocomplete to find questions starting from a seed set. Repeated queries broaden that set. After invalid questions are removed, native annotators choose answer spans in relevant paragraphs. The experiment has 600 training examples, 125 validation examples, and 575 test examples. FaBERT has the highest test exact match at 33.33. It also leads with 55.87 test F1. mBERT is the closest baseline on both measures, with 26.31 exact match and 49.63 F1. The authors report a +6.24% improvement in F1 for FaBERT over the next system.
The remaining ParsiNLU reading scores show a change in ranking between the two measures. ParsBERT gets 22.10 test exact match and 44.89 F1. XLM-R reaches 21.92 exact match and 42.55 F1, while AriaBERT has 16.49 and 37.98, respectively. The exact match and F1 columns tell complementary parts of the story for each system. FaBERT improves the amount of reference text recovered and the chance of reproducing the reference answer exactly. The two scores also show that obtaining the precise reference span remains difficult in this setup.
PQuAD contains 80,000 questions written by crowdworkers using passages from Persian Wikipedia. The dataset reserves 25% of its questions as unanswerable. A reader must learn when a passage supports an answer and when selecting a plausible phrase would be a mistake. The authors list 63,994 training examples, 7976 validation examples, and 8002 test examples. They report overall answer scores, scores restricted to answerable questions, and a separate NoAns column for unanswerable questions. The dataset also provides human estimates based on crowdworkers’ answers to a subset.
XLM-R has the strongest automated overall PQuAD scores, with 75.16 test exact match and 87.60 test F1. FaBERT is close, with 75.04 exact match and 87.34 F1. ParsBERT reaches 74.41 exact match and 86.89 F1. The human estimates are 80.3 exact match and 88.3 F1. The gap between the exact match and overlap columns is relevant to what readers can infer about these systems. An encoder can approach the reference under the overlap measure while still missing the exact answer string more frequently than the crowdworkers in the human estimate.
The PQuAD ordering changes when the evaluation is restricted to the answerable questions. FaBERT has 70.33 HasAns exact match and 86.50 HasAns F1. XLM-R posts 69.79 exact match and 86.13 F1 on that subset. The separate NoAns scores tell a different story. FaBERT records 90.02, XLM-R 92.26, and mBERT 93.26, the highest automated score in that column. The human NoAns estimate is 96.80. The subset figures reveal why an overall PQuAD result on its own obscures useful information. FaBERT extracts answers strongly when the passage contains them, while other systems do better at recognizing when there is no answer.
Answering successive questions
PCoQA comprises 870 dialogs and over 9,000 question-answer pairs based on Wikipedia articles. The document provides the evidence for the answers, and the questions in a dialog are connected to one another. This changes what it means to read a question. Its subject or the intended level of detail can depend on the exchange it belongs to. The reported split consists of 6319 training examples and 1354 each for validation and test. The authors evaluate both span recovery and the handling of unanswerable questions.
PCoQA conversational question answering test F1 by encoder
FaBERT leads the automated systems, while the human estimate remains well ahead.
The numbers
| System or setting | answer-overlap F1 |
|---|---|
| AriaBERT | 41.37 |
| mBERT | 46.11 |
| ParsBERT | 50.96 |
| XLM-R | 51.12 |
| FaBERT (this paper) | 53.51 |
| Human estimate | 86.97 |
FaBERT’s PCoQA test exact match is 35.85, with XLM-R at 34.52 and ParsBERT at 31.17. The human estimate is 85.5. The authors report a +2.39% test F1 advantage for FaBERT over the next automated system. FaBERT also leads the separate NoAns column at 61.39, compared with 54.88 for XLM-R and 48.83 for ParsBERT. Here, the relative strength of FaBERT on unanswerable questions differs from what the authors observe on PQuAD. The two datasets put the decision to abstain in different question settings, and a ranking on one does not settle the ranking on the other.
PCoQA also reports human equivalence measures. HEQ-Q measures the percentage of questions on which the system matches or exceeds the human F1 reference. HEQ-M assesses equivalence at the level of an entire dialog. FaBERT records 45.36 HEQ-Q and 2.45 HEQ-M. XLM-R records 44.81 HEQ-Q and 0.81 HEQ-M. A system can be competitive on particular questions while still falling short on the dialog it must answer as a whole. The dialog-level scores make this difference visible alongside the large gap in overall F1 between the automated systems and the human estimate.
The paper’s count of nine leading datasets treats PQuAD as an overall comparison. FaBERT’s strong answerable-question result there does not add another dataset to the total. Likewise, the two entity benchmarks on which FaBERT leads and the one on which ParsBERT leads each count once. This way of reading the conclusion keeps the overall result consistent with the finer comparisons. It also preserves the individual outcomes that matter for a particular application, such as whether an encoder must retrieve a span accurately or decide that a passage is missing the information requested.
What the ablations show
The paper reports no component ablation of FaBERT’s pretraining recipe and instead offers tokenizer comparisons, results by entity type, and separate scores for answerable and unanswerable questions.
How much room the tokenizers leave for text
The authors apply different tokenizers to the same benchmark material and compare the lengths of their outputs. This is a direct comparison of segmentation. A longer sequence spends more of the encoder’s input budget on the same text. If a passage is near the limit, the more compact representation can preserve more of the original wording in the portion the encoder sees. The quantity measured in these experiments is the token count before that constraint comes into play. The paper reports medians and presents boxplots of the token count distributions.
PQuAD median input token count by tokenizer
ParsBERT produces the shortest median input, followed by FaBERT.
The numbers
| System or setting | median tokens |
|---|---|
| ParsBERT | 160 |
| FaBERT (this paper) | 189 |
| AriaBERT | 207 |
| XLM-R | 210 |
| mBERT | 235 |
PQuAD gives the clearest separation between FaBERT and ParsBERT in the authors’ discussion. The paper suggests a corpus-based explanation. PQuAD passages come from Wikipedia, which was an important source in ParsBERT’s training. A vocabulary learned with exposure to that kind of text could have useful entries for its recurring expressions. The observed length ranking is a property of the trained tokenizers on PQuAD. The explanation about Wikipedia is the authors’ interpretation of the pattern. They do not compare ParsBERT tokenizers trained with and without that source.
For MirasOpinion, the median token count is 27 with ParsBERT and 28 with either FaBERT or AriaBERT. The corresponding medians are 34 for XLM-R and 44 for mBERT. In FarsTail, the median is 58 with ParsBERT and 62 with FaBERT, followed by 66 with AriaBERT, 74 with XLM-R, and 85 with mBERT. The differences are relevant even in the shorter collections because they show that the compactness ranking recurs across very different kinds of input, from product reviews to material derived from exam questions.
In ParsiNLU reading comprehension, the tokenizer medians are 113.5 for ParsBERT and 119.5 for FaBERT. AriaBERT produces a median of 130, XLM-R 142.5, and mBERT 165. This task makes the length question especially concrete. A reading system needs room for the context that contains the answer as well as for the question it is trying to answer. The tokenizer comparison shows how quickly the same text consumes input positions. Its median alone does not reveal how often an answer-bearing portion lies beyond the supported length.
The comparison shows that a smaller vocabulary can still give nearly the same median length as a larger one on some datasets. The authors highlight FaBERT’s compression given that its vocabulary is half the size of ParsBERT’s. The multilingual tokenizers produce longer medians on every dataset in this comparison. The authors attribute that tendency to their more limited inventory of Persian pieces within their shared vocabularies. The medians support the observation about segmentation. Linking that observation to a particular accuracy loss would require tracking which material was lost and how the same reader performed with that material available.
The boxplots complement the medians by showing variation across examples. A typical input length is useful for comparing tokenizers, while the long inputs are the ones most likely to challenge a hard sequence limit. A tokenizer can therefore look similar to another at the median and still behave differently on the passages that are hardest to fit. The paper presents these distributions for the same datasets used in the median comparison. The figures serve as a description of length behavior, with no direct experiment on the accuracy effects of truncating those examples.
Which entities account for the aggregate results
The entity analysis holds the benchmark fixed and separates scores by the type of name the reader must find. In the ParsTwiNER test results, FaBERT has F1 of 0.9344 on people and 0.9 on nations. The corresponding ParsBERT scores are 0.8893 and 0.7385. For locations, ParsBERT scores 0.8414 and FaBERT scores 0.8281. XLM-R obtains 0.8 on political groups, where FaBERT is at 0.6364. The micro average favors FaBERT even though some individual categories favor other systems.
The support column gives the number of reference instances behind a category’s figures. It lists 244 for people and 221 for locations on ParsTwiNER, alongside 30 for nations and 22 for political groups. This matters when reading the table. The overall micro score gives categories with more instances more opportunity to affect the result. The score for a category with few examples may be informative about a particular kind of error, while the ranking for that category rests on less test evidence. A reader interested in a specific type can use the category figures to see what the aggregate leaves out.
PEYMA shows similar variation within a close overall comparison. FaBERT records F1 of 89.16 for dates, while ParsBERT has 85.65. For organizations, the ordering reverses. ParsBERT has 89.37 and FaBERT has 88.24. XLM-R leads on currency with 96.15 against 94.34 for FaBERT and ParsBERT. The support figures in the same table include 667 organizations and 26 currency entities. This makes it easier to distinguish a strength on a particular class from a difference likely to dominate a pooled measure.
The contrast is especially useful on MultiCoNER v2. The authors identify medical entities as a FaBERT strength and creative works as a ParsBERT strength. For medication or vaccine names, FaBERT has F1 of 0.7067, compared with 0.6837 for ParsBERT. FaBERT also has 0.6307 on medical procedures, against 0.5965 for ParsBERT. For written works, ParsBERT records 0.7463 and FaBERT 0.7447, with XLM-R higher at 0.7523. For software, ParsBERT scores 0.6586 and FaBERT scores 0.6448. These results give the authors’ broad description a more specific meaning. The medical categories give examples of FaBERT’s advantage, while individual categories among creative works favor different competitors.
Where the answer comes from
The split between answerable and unanswerable questions serves a similar purpose for reading tasks. Answerable cases test whether the reader can locate a useful span. Unanswerable cases test whether it recognizes that selecting text would give a spurious answer. On PQuAD, FaBERT’s lead among automated systems on answerable questions accompanies a lower NoAns score than the leading multilingual systems. On PCoQA, FaBERT leads the NoAns comparison and also leads on overall F1. The split exposes how much the meaning of a gain depends on which cases the application cares about.
These analyses answer questions about the behavior of the finished system. The tokenizer study shows how many positions a passage needs. The entity breakdown identifies types on which an aggregate leader can still trail. The question subsets distinguish span extraction from abstention. Each narrows the interpretation of the main benchmark results. Explaining why FaBERT learned these strengths would require varying components during training and then measuring the resulting systems on these same slices.
Limitations
Limits the authors identify
The authors flag possible demographic and sociolinguistic biases in using Persian blogs as the sole source of pretraining. The people who write these posts and the conventions of their online communities shape the variety of Persian the encoder sees. A collection can encompass many styles and still give some groups or ways of writing more representation than others. The paper raises this concern as a consequence of the source. Its benchmark findings establish performance on the datasets evaluated, without measuring how evenly the benefits extend across groups of writers.
The length limit is also explicit. FaBERT’s BERT architecture supports up to 512 tokens in an input sequence. Compact tokenization can fit more writing into that limit, but documents can still contain more material than the encoder can read together. This affects applications in which the evidence for an answer or interpretation is spread over a long document. The authors point to research on longer-context architectures as a possible direction for Persian. Their own tokenizer analysis concerns the use of the available space, with the architecture’s limit still in force.
The authors identify a further gap in Persian resources for sentence embeddings, representations meant to let whole pieces of text be compared. They describe a shortage of parallel texts and labeled examples for semantic similarity. These resources would support the development and assessment of embeddings for functions such as semantic search and dense retrieval, which match queries and documents using their learned representations. The downstream tasks in the paper show what an encoder can do when adapted to their labeled decisions. They leave the authors’ broader question about Persian sentence embeddings open. Information retrieval
Limits suggested by the design and reporting
The central evidence is comparative. FaBERT learns from HmBlogs using its own preparation, segmentation, and pretraining recipe. The alternative encoders have different training sources, vocabularies, and objectives. The common fine-tuning setup makes the test results useful for comparing these finished systems. It leaves the causes of the differences entangled. Even on an informal dataset, a lead could reflect the training material, the decision to specialize in Persian, the choice of token boundaries, the masking procedure, or interactions among these factors. A comparison with matched training settings and a deliberately varied corpus would be needed to estimate the effect of the blog source itself.
The pretraining preparation also limits what can be said about how much of the corpus’s variety reaches FaBERT. The authors give the size of HmBlogs and explain that they filter posts and normalize text. They do not quantify how much material survives each decision or how formal, colloquial, and regional varieties are distributed afterwards. Heavy local dialect is among the characteristics they associate with some of the noisy posts. The demonstrated ability to handle the evaluated informal writing therefore cannot establish coverage of local varieties in general. The benchmarks provide evidence about particular texts such as tweets, product reviews, and questions gathered through forums or search suggestions.
Formality is an interpretation of the sources of several datasets, rather than the sole variable varied in a test. A formal news entity dataset and an informal tweet entity dataset differ in categories as well as register. ParsiNLU paraphrasing brings together questions with different origins, and its aggregate score gives no separate estimate for each origin. MirasIrony adds a judgment about intended sentiment that does not arise in the same form in the entity task. These distinctions make it possible for FaBERT to perform differently across the settings for reasons other than formality. The case for stylistic breadth rests on the range of successful transfers, with the effect of register itself still unmeasured.
Several leads are close, including SBU-NLI and PEYMA. The paper reports the test results selected through validation and gives detailed category scores in some tasks. It does not accompany the main comparisons with variation across repeated runs or uncertainty estimates. A reader can determine the ordering observed under this procedure, while confidence in small differences across different training runs remains undetermined. The broad pattern of strong performance across datasets and the narrower question of whether a lead on any one dataset would recur are distinct conclusions.
There is also an inconsistency in the reported averaging labels for the entity benchmarks. The score descriptions in the results section identify PEYMA as micro F1 and MultiCoNER v2 as macro F1, whereas the corresponding rows in the fine-tuning appendix label them the other way around. The reported main scores align with the results section’s description in the detailed entity tables. FaBERT’s PEYMA value of 91.39 is in the micro average row, and its MultiCoNER v2 value of 0.5792 is in the macro average row. The detailed rows clarify which averages produced the reported aggregate scores. The reporting still leaves a reader to reconcile the appendix’s metric labels when reconstructing the tuning setup.
The tokenizer analysis gives an indirect measure of one aspect of efficiency. It shows that FaBERT often needs fewer tokens than the multilingual systems for an input and has fewer parameters than the Persian and multilingual baselines. The experiments supply a training duration and hardware configuration, while practical efficiency claims in the introduction and conclusion go beyond what is timed in the evaluation. Inference latency, memory use during fine-tuning, and performance on mobile hardware are left unmeasured. Likewise, the PCoQA results establish what the systems achieved on the conversational benchmark, with the details of how much earlier dialog is included in each input left unspecified.
Finally, the human comparisons answer specific questions about the datasets that include them. PQuAD’s human values are estimates made using answers to a subset, and PCoQA has separate question- and dialog-level measures against human performance. FaBERT can lead the automated encoders and still trail the human estimates substantially on the conversational task. The results support a claim about relative performance among the systems tested. Human performance across Persian reading tasks would require a broader comparison, with comparable judgments collected for the different tasks.
What came after
Exploring Subjective Tasks in Farsi cites FaBERT in a survey and evaluation concerned with subjective tasks in Farsi. This brings FaBERT into a narrower topical discussion than the scope of its original evaluation. FaBERT treats sentiment and irony as part of a broader test of Persian language understanding, alongside tasks such as entity recognition and reading comprehension. The later work’s stated subject puts tasks involving subjective judgments at the center.
The citation establishes that FaBERT is part of that later discussion. The specific use of FaBERT in the survey or evaluation is unclear. In particular, the citation does not establish whether the later authors ran the released encoder, drew on its published sentiment and irony results, or considered its blog pretraining as an approach to representing informal Farsi. The documented connection is between FaBERT’s evaluation of Persian sentiment and irony and the later survey’s broader focus on subjective tasks in the language.
Cite
Cite as Mostafa Masumi, Seyed Soroush Majd, Mehrnoush Shamsfard and Hamid Beigy. 2025. FaBERT: Pre-training BERT on Persian Blogs. Proceedings of the Tenth Workshop on Noisy and User-generated Text.
@inproceedings{masumi2025fabert,
title = {{FaBERT: Pre-training BERT on Persian Blogs}},
author = {Mostafa Masumi, Seyed Soroush Majd, Mehrnoush Shamsfard and Hamid Beigy},
booktitle = {Proceedings of the Tenth Workshop on Noisy and User-generated Text},
year = {2025},
doi = {10.18653/v1/2025.wnut-1.10},
url = {https://doi.org/10.18653/v1/2025.wnut-1.10}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/masumi-2025-fabert-pre-training-bert-persian/