## 2 Related Work
### Domain-Adapted Tokenizers and Tokenization Efficiency Metrics  
The legal domain has a distinct characteristic unique to its field. As stated by the authors of [41] \"LLMs struggle to fully capture the complexities of legal language\" and \"may fumble with the specialized terminology and citation formats or outright hallucinate domain-specific knowledge, losing the rigor and precision essential in legal contexts\". Moreover, the authors of [42] state that models trained on generic domain corpora \"should not be directly applied to a specific domain corpus, as the distributional representation (embeddings) of their lexical units may significantly shift from the nuances and peculiarities expressed in domain-specific texts\". The authors further say that this statement \"certainly holds for the legal domain as well, where language understanding is particularly challenging\". The authors of [43] also conclude that domain adaptation is crucial for task-specific models to learn to capture the nuances of legal language and context. The legal language is distinct in vocabulary, semantics, and reasoning [44; 45; 46]. Like in other languages, Serbian legal and legislation texts contain a number of specifics unique to its field and a large number of rare, domain-specific terms. A significant effort has been put into finding ways to use task data and specialized corpora to improve the pre-training of language models for particular domains, in addition to the substantial amount of work that goes into creating models. Multilingual models are often considered as a means to transfer both domain and syntactic knowledge [47], but their capabilities should be further investigated due to peculiar aspects of languages such as gender agreement, relative clauses, and passive transformations. As a domain capable of exposing these aspects, legal domain stands out. Therefore, significant effort has been put into building model from the ground up for various legal domain tasks [43]. One advantage of building the model from the ground up with in-domain data rather than employing continuous pretraining has been noted by [PERSON] et al. [48]. Their results show that domain-specific language is successfully included in the tokenizer's vocabulary. The meanings of these specialized terms can therefore be directly transferred through their fixed embeddings, negating the need for the language model to represent them through contextual embeddings of their subwords. In [49], a different technique for domain adaptation of language models was used. Authors have shown notable performance improvements on three IT-related tasks: extractive reading comprehension, document ranking, and duplicate question detection. Their approach is based on adding complete words that are common in the target domain but absent from a language model tokenizer. It was deployed gradually to a Roberta Large language model architecture that had already been trained. Eight classification tasks and four domains (news, reviews, and articles in computer science and biomedicine) are included in the research presented by [PERSON] et al. [50]. Domain-adaptive pretraining, a second iteration of in-domain pretraining, has been demonstrated to enhance performance in both high- and low-resource circumstances. Additionally, research has shown that using basic data selection strategies together with task corpus adaptation is a helpful backup, especially when domain-adaptive pretraining resources are unavailable. Furthermore, by altering their tokenizers, [PERSON] et al. [49] propose an alternative approach for integrating pre-trained language models into new domains. They claim that by examining the conditional token distributions of the base and domain-specific datasets, domain-specific sub-word sequences can be successfully identified. Tokenizers have been evaluated using a variety of measures and techniques. The average number of tokens generated for each word is measured by a metric called subword fertility [51].