Contextual Embeddings for Ukrainian: A Large Language Model Approach to Word Sense Disambiguation
Paper · 2023 · Yurii Laba, Volodymyr Mudryi, Dmytro Chaplynskyi et al.
Summary
The Ukrainian word коса can refer to hair or to a scythe. A reader can typically tell which is intended from what the sentence says about it. The paper asks how to build a system that makes that judgment when Ukrainian has little training material in which individual uses are labeled by meaning. The authors organize the work around two resources. The SUM dictionary supplies definitions and examples with an established connection between them. The UberText corpus supplies periodical sentences in which the same word can be found in different settings. The dictionary makes it possible to check answers, while the corpus makes it possible to collect training comparisons in quantity. This is the task of word sense disambiguation.
The authors clean the dictionary material to obtain 42,000 samples, then construct a homonym evaluation with 2,882 samples. The homonym test treats the separate entries for hair and scythe as different answers. It puts closely related definitions of the hair reading under the same answer. To predict an entry, the system represents the target in its sentence as a numerical vector and compares it with vectors for the candidate groups. It adapts the pretrained multilingual SBERT encoder PMMBv2 using triplets from UberText. Each triplet has a reference sentence and two sentences containing the same target. A separate encoder ranks those sentences so the authors can assign one as a likely match in meaning and the other as a likely contrast. The training procedure uses those assignments to improve the contextual word embeddings through fine-tuning.
The best setting reaches 77.9% accuracy on SUM homonyms. Before adaptation, PMMBv2 scores 0.735 on that task. The authors report 0.526 for Babelfy, a graph-based comparison that they check manually on a random portion of the evaluation data. The winning setting uses the larger triplet collection with weak contrasts removed according to the automatic similarity scores. It improves on the pretrained encoder for lower-ranked as well as leading dictionary senses. Its strongest grammatical category is nouns and its weakest is adverbs. The choice of training data matters differently when the test asks for closely related meanings within an entry. Accuracy is lower on that finer task, where the unfiltered settings lead the filtered one.
The authors make U-WSD available to prepare dictionary datasets, vary how representations and predictions are produced, and report accuracy for groups such as parts of speech. The results show that automatically selected corpus examples can help on a dictionary-based test, even though a manual inspection finds that only 13.1% of the sampled training triplets qualify as relevant. The evaluation covers the available part of SUM and uses a small homonym collection that includes literary and folklore examples. The authors also identify possible bias in both source resources, whose compilation gives them limited grounds for assessing how such patterns affect the predictions.
Deep dive: Contextual Embeddings for Ukrainian: A Large Language Model Approach to Word Sense Disambiguation
The study adapts contextual embeddings to distinguish Ukrainian homonyms, training on automatically selected sentences and testing against a dictionary. · about 33 minutes to read
The problem and its context
A dictionary supplies the choices, and a sentence supplies the evidence
The choice in this study is attached to a specific occurrence. Consider the spelling замок, which the paper uses in its prediction diagram. One dictionary reading corresponds to a castle and another to a lock. The spelling gives the system access to both readings. Something about how the word is used has to settle which one fits. In the paper’s setup, the system has the sentence, the target, and its candidate meanings. Its job is to connect the occurrence in that sentence to the appropriate part of the inventory.
That step can matter to a task further downstream. A translation may require a different word when the intended object changes. A search system may need to distinguish documents that use the same spelling for different subjects. A system answering a question may need to determine what the question refers to before it can identify a relevant answer. The authors cite these as applications of sense disambiguation and study the lexical decision in isolation. Their experiment therefore scores the match with a dictionary meaning. A translation, a retrieved document, or an answer would introduce further decisions and a different measure of success. The application areas are machine translation, information retrieval, and question answering.
There can be a large difference between choosing the object meant by замок and deciding exactly which of several related dictionary definitions applies to a sentence about hair. SUM records a braided-hair reading and a long-hair reading under the hair entry for коса. Each addresses a different aspect of what the word describes. A use of коса can convey enough information to rule in the hair entry while leaving a more delicate choice between these adjacent definitions. Homonymy is the paper’s term for the case in which unrelated words have the same form, as with the hair and scythe entries. Polysemy concerns the distinctions among related meanings. Which choice is required depends on how the evaluation turns the dictionary into a set of answers.
For Ukrainian, the authors identify a shortage of corpora with senses attached to occurrences. A collection of texts gives examples of actual usage. To train directly on the dictionary choice, a researcher would also need to know which meaning each occurrence expresses. To evaluate a predictor, the researcher needs examples with answers that can be checked. A lexicographer’s decision to place a sentence under a definition provides that second kind of evidence in a particular form. The paper’s question is whether that resource can support evaluation while a much larger supply of ordinary text provides a different, cheaper kind of evidence for learning. The distinction concerns the role of linguistic annotation.
What a representation can preserve
The account of earlier work begins with static word vectors, including Word2Vec and GloVe. A vector represents a word as a list of numbers. With a static scheme of the kind the authors describe, the same list is associated with the word across occurrences. Such a representation can encode regularities in how a word is used across a collection. When the input has the same spelling in two sentences, however, the static vector for that spelling provides the same information in each case. Earlier work cited by the authors sought to enrich these vectors or represent multiple meanings explicitly. One of the static approaches they discuss is GloVe.
A contextual encoder can produce different vectors for appearances of the same word. It computes a token’s representation in the course of processing its surroundings, so the numerical output can reflect the difference between what happens in one sentence and what happens in another. The paper cites earlier work in which that property made it possible to use nearest neighbors for disambiguation. In such a procedure, an occurrence is represented in the same space as examples with known meanings. Proximity to those examples provides evidence about the likely sense. The potential advantage is that much of the task can be handled by the representation. When ordinary proximity in the space tracks differences of meaning, the final comparison can be straightforward.
A second approach puts the meaning description directly into a decision about the sentence. The paper describes a BERT system that reads a sentence containing the target alongside a proposed definition. A classification head, the component that makes the final decision, estimates whether the usage agrees with that definition. The same type of judgment can be made for each candidate definition. This approach gives the predictor an explicit description to examine alongside the occurrence and uses labeled pairs to train it to recognize a match.
The paper also discusses a method that brings decisions about nearby words into the prediction. Once another word in the context has been assigned a sense, the sense itself can supply evidence about the target. A representation of surrounding words can carry signals about this relationship. The earlier method gives the assigned meanings an explicit role. The improvement sought by that line of work depends on what evidence is already available about words in the surrounding text. The paper discusses it through ConSeC.
A lexical graph provides a further route to a decision. Its nodes and relations organize meanings and their connections so that an algorithm can use structure supplied by a lexical resource. The authors describe Babelfy as a method that draws on sense definitions and semantic relationships of this kind. They discuss it as an unsupervised alternative and point to earlier research reporting stronger results with supervised neural approaches. In Ukrainian, access to the training labels needed for those approaches is part of the research problem. The graph-based approach is represented by Babelfy.
SemCor and SemEval-2007 illustrate the kind of supervision the authors have in mind. With a sentence, a target and explicit sense information, a training procedure can learn from examples where the connection between an occurrence and a meaning has already been established. The Ukrainian approach seeks a weaker relationship that can be generated automatically. It asks whether one occurrence is more likely than another to share the reference occurrence’s meaning. That gives the training procedure a way to use an abundant corpus, while SUM still provides dictionary answers for evaluation. The paper associates SemCor with A Semantic Concordance.
The method, step by step
Recover meanings and examples from SUM
SUM gives the authors both a choice of lexical meanings and sentences associated with those choices. The paper explains the dictionary’s treatment of polysemy and homonymy in terms of componential analysis. The approach considers the semantic features that meanings have in common. Related meanings can be organized within an entry, while words that share a spelling but have unrelated meanings can be given separate entries. This matters to the experiment because the level at which an answer is defined can follow distinctions already made by dictionary editors.
The sentences are drawn from sources of different kinds. The authors mention literary writing, biblical translations into Ukrainian, folklore, journalism, scientific and popular scientific material, mass media, and the Internet. These kinds of material explain the range of examples that can occur in the dictionary. The portion available for the research stops at ПІДКУРЮВАЧ. An entry has to be present in that portion before any of the later selection rules can bring it into the test.
The extraction starts from a lemma, the dictionary headword under which uses of a word are grouped. The example may contain an inflected word form, as when the noun heading коса appears in a sentence in a form required by its grammatical role. The record connects the headword, a lexical meaning, and the examples attached to that meaning. This organization lets the authors inherit a label for an example from its place in the dictionary. The headword specifies what to disambiguate, while the association between example and definition specifies the intended answer.
Removing lemmas with only one sense leaves 78,000 samples. A one-sense entry would supply a correct candidate without requiring a contextual distinction. A further pass removes lemmas shorter than three characters, records missing meanings or usage examples, items from functional parts of speech, and entries whose meaning is given by a reference to another lemma. These filters favor records that offer a usable target, an identifiable meaning, and a sentence in which it can be judged. After cleaning, the collection has 42,000 samples. A sample at this stage associates a lemma with a particular lexical meaning and the examples under it. Stanza assigns grammatical categories, which the authors later use to break down accuracy. This is the role of part-of-speech tagging.
The homonym evaluation then retains only headwords with more than one separate entry. Within each entry, the authors combine definitions and their examples. This produces 2,882 homonym samples. The hair uses of коса illustrate how the label changes. SUM has an illustration involving dark braids around a face and another involving golden hair falling over the chest and shoulders. The dictionary associates them with different descriptions of hair. The homonym construction places both under the hair answer. A separate illustration about a grandson carrying a scythe remains under the tool answer. The example sentences continue to provide distinct contexts even when their labels are grouped.
The preparation procedure also supports a finer inventory in which lexical meanings are kept separate. Consider what changes for the two hair illustrations. On the homonym task, both call for the same answer. With the finer inventory, the dictionary’s particular definition for each illustration matters. A decision that identifies hair can be enough in the grouped version and incomplete in the fine-grained version. The two experiments therefore differ at the point where a sense decision is defined, before any choice of encoder or similarity calculation.
Specify the prediction
The authors describe the candidates for a headword with this set.
Gₗ = {gₗ₁, …, gₗₙ}
The subscript l identifies the target lemma, and Gₗ names the set of meaning groups associated with it. Each g with that lemma subscript names one candidate group. The final subscript distinguishes the first group, written gₗ₁, from the last, gₗₙ. Here n is the number of groups for the target. The ellipsis represents the intervening groups, the commas separate members, and the braces enclose the set. The equals sign defines Gₗ as that collection. Each candidate on the homonym task comprises the meanings associated with one separate dictionary entry.
On a prediction, the system has an example sentence and a target lemma. It uses the sentence to obtain a representation of the occurrence, retrieves the candidate groups for that lemma, and gives each group a score. The candidate with the highest score is the prediction. For замок, the diagram in the paper illustrates this with the castle and lock readings. The candidate list can be the same in different sentences, while the representation of the target changes with what those sentences say.
Computing those scores requires vectors for the occurrence and the meaning groups. The paper describes the occurrence vector as coming from the encoded sentence. It describes U-WSD as computing representations for lexical meanings as well as examples. The task definition specifies the comparison at the level of a group, after related definitions and their illustrations have been collected. The article’s description leaves the precise aggregation of text into a group vector open when an entry has several definitions.
From a SUM example to a predicted entry
The steps in order.
Cosine similarity measures alignment between vectors. For vectors with non-zero length, it compares their dot product with the scale set by their lengths. The direction of the representation therefore governs the ranking. An occurrence can receive different scores against different entries because its vector is better aligned with one candidate than with another. The choice is comparative. The system picks the best available candidate from the supplied inventory, and evaluation checks it against the label inherited from SUM. The linguistic property the comparison is intended to reflect is semantic similarity.
Decide which encoder outputs to use
An encoder returns numerical information for the units it processes, which the paper calls tokens. Each layer transforms a sequence of representations into a new sequence. The paper uses BERT to illustrate this structure, describing contextual output vectors available at each layer. Which output to take and how to assemble it are separate decisions. A prediction system needs an embedding it can pass to the comparison, and the encoder can provide several plausible sources of information for that embedding. The architecture discussed in the paper is based on the Transformer.
Pooling is the step that combines the selected outputs into a representation. The paper examines choices that operate over token outputs from the final layer and choices that combine information across layers. In mean pooling, the values in corresponding coordinates are averaged. Each coordinate of the result reflects the values contributed by the token outputs involved in the calculation. Max pooling uses the largest available value for each coordinate. The values in different coordinates of that result can come from different token outputs. Mean Max keeps the average and maximum vectors as separate stretches of one concatenated representation.
Pooling over layers poses a related question about where useful information lives. The concatenation option retains the outputs from the last four hidden states by placing them alongside one another. The sum-based options combine corresponding coordinates from the last four or the last two. A sum merges the layer contributions within each coordinate. Concatenation preserves their positions separately and increases the length of the resulting representation. The value of any of these operations depends on how well the final vector supports the comparison with dictionary meanings.
The authors screen pretrained multilingual encoders and pooling strategies before choosing a system to adapt. They select paraphrase-multilingual-mpnet-base-v2, abbreviated PMMBv2, and use the most successful pooling choice from that screening, the mean. PMMBv2 belongs to the SBERT family, which the paper introduces as a way to obtain better representations of sentences. In this study the sentence is the source of contextual evidence, and the output is a judgment about one word. The screening tests whether information learned for sentence representation carries over to that more local decision.
Find sentence triplets without dictionary labels
The authors need examples that tell the optimization how to change the geometry of the representation. A triplet provides a reference occurrence, an occurrence presumed to use the same meaning, and an occurrence presumed to use a different meaning. The reference is called the anchor, and the other positions are called positive and negative. The position names always refer back to the anchor. All three sentences are selected to contain the target lemma. Even a perfectly assigned triplet would supply a relationship among occurrences without specifying the dictionary entry to which each one belongs.
The sentences are drawn from the developers’ preview of UberText 2.0, which the paper describes as including Ukrainian periodical writing. The first selection retains sentences containing a lemma from the SUM homonym evaluation. The authors also screen sentences using such criteria as length and the occurrence of punctuation or digits. They apply langdetect to discard samples identified as non-Ukrainian. The result is a supply of corpus sentences that can be compared within the vocabulary targeted by the experiment. The corpus is documented in Introducing UberText 2.0.
The authors use ukr-roberta to embed these corpus sentences. With a sentence chosen as an anchor, the comparison is against other sentences that contain the required lemma. The ranking uses cosine similarity. The sentence highest in that ranking becomes the positive, and the sentence lowest becomes the negative. The two choices give the clearest contrast available under the ranking rule for that anchor. Their interpretation as same-sense and different-sense examples is a working assumption about what the sentence representations capture.
There are two encoders with separate roles in the procedure. Ukr-roberta assigns the training roles through its comparisons of corpus sentences. PMMBv2 receives the triplets during adaptation. The distinction matters because a comparison can offer evidence for learning even when the judging encoder and the encoder being trained have different outputs. It also shows where an error can arise. A close pair can share a subject or phrasing while using the target differently. A far-apart pair can use the target in the same sense while discussing different subjects. Requiring the target lemma in all three sentences narrows the comparison, while the similarity ranking still reflects the full input used to make the embeddings.
The authors describe collections of ~190,000 and ~1,200,000 triplets from UberText 2.0. For a filtered run, they start from the larger collection and examine the gap between the two similarities involving the anchor. A triplet is removed if the anchor’s similarity to the positive and its similarity to the negative differ by less than 0.3. The criterion is a score gap. A sentence can be the farthest available alternative in a pool and still be only weakly separated from the closest one. Filtering removes triplets for which the ranking assigns distinct roles with a small numerical separation.
The authors also examine roughly 100 triplets to see whether the automatically chosen sentences provide the intended lexical relations. They report 13.1% as relevant in that check. The inspection measures whether the assigned roles make linguistic sense, whereas the similarity ranking is the mechanism that made the assignments. This distinction is consequential for the training setup. Once a triplet is included, its assigned positive and negative determine the direction of its training signal. The margin objective has no dictionary label with which to revise those assignments.
Adapt PMMBv2 with a distance constraint
A triplet is useful to the optimizer when it can say something about the relative closeness of the three embeddings. The desired arrangement places the positive closer to the anchor and leaves a margin separating its distance from the distance to the negative. The authors use the objective called TripletMarginLoss to impose that arrangement.
max(‖a − p‖ − ‖a − n‖ + M, 0)
Here a is the embedding of the anchor sentence, p the embedding of the positive sentence, and n the embedding of the negative sentence. The symbol n in this expression denotes the negative embedding, while in the candidate set it counted the groups. Within the norm bars ‖ ‖, each minus sign denotes vector subtraction. Taking the Euclidean norm of the difference gives the distance between the vectors. The minus sign between the norm terms subtracts the anchor-to-negative distance from the anchor-to-positive distance. The plus sign adds M, the margin hyper-parameter, which is set to 1. The parentheses enclose the arguments to max, and the comma separates the margin-adjusted difference from the numerical floor 0. The function returns whichever of those arguments is greater.
When the positive is closer by at least the required margin, the first argument to max is zero or below and the objective assigns zero loss to that triplet. When both alternatives are equally far from the anchor, the margin leaves a positive penalty. A positive penalty also occurs whenever the positive is closer but the advantage falls short of the margin. Training can reduce the penalty by moving the positive nearer to the anchor, moving the negative farther away, or changing both distances. The loss cares about their ordering and the separation between them.
The paper uses Euclidean distance for the training objective. Cosine similarity has a role earlier in the workflow, when ukr-roberta supplies the triplet ranking, and later, when the predictor scores a target against candidate meanings. These comparisons answer distinct questions. The construction rule asks which corpus sentences should be put into each training position. The loss asks whether the adapted representations give those positions the intended relative distances. The inference rule asks which meaning group best matches a dictionary occurrence. The cutoff of 0.3 applies to the corpus ranking, and the margin of 1 applies to the loss.
The authors optimize with Adam at a learning rate of 2e-6 and a batch size of 32. The batch size specifies how many training items are processed together. The learning rate controls the scale of the parameter changes made in optimization. During the first 10% of training data, they gradually increase the learning rate at a constant pace. Of the triplet data, 99% is used for training and 1% is reserved to calculate training metrics.
They also check disambiguation accuracy during training on 20% of the SUM evaluation dataset. That accuracy is the basis for early stopping, so the process monitors how the embeddings serve the dictionary task as well as how training proceeds on the triplets. The two monitored collections have distinct purposes. The reserved corpus examples concern the type of comparison that shaped the objective. The SUM examples have labels based on lexical meanings and can reveal whether the adapted encoder is getting better at the downstream decision.
Prepare, predict, and report with U-WSD
U-WSD is the framework the authors make available for running this kind of experiment. Its preparation component can apply dictionary-cleaning criteria and restrict how many senses or usage examples are retained for a lemma. It can keep meanings separate or assemble homonym groups. That choice makes the test adaptable to the level of lexical distinction a researcher wants to investigate. The prediction component lets the researcher vary the encoder and pooling choices for embeddings of meanings and examples, as well as the way predictions are made.
The reporting component can examine accuracy by part of speech and by lemma frequency obtained from UberText. It also supports evaluation with different numbers of leading dictionary senses. These ways of sorting outcomes correspond to different questions. A corpus frequency concerns how often the lemma appears across its uses. A grammatical category concerns how the lemma is classified. A sense restriction concerns which answers are available or which uses are measured. Having these distinctions in the framework makes it possible to study an overall result in terms of the lexical decisions that contributed to it.
Experiments and results
What counts as a correct answer
The paper measures accuracy by comparing the predicted meaning with the one associated with the example in SUM. A match counts as correct. Overall accuracy is the proportion of scored predictions that match. In the homonym evaluation, the label is a group formed from a separate entry. In the fine-grained evaluation, the label identifies a lexical meaning at the level used by the test. The same measure can be applied in either setting, but its interpretation follows the choice the system is being asked to make.
The main comparison uses the SUM collection assembled into 2,882 homonym samples. The corpus triplets are the adaptation data, and the labels used for accuracy come from the dictionary examples. The manual check on Babelfy concerns a random 10% portion of the evaluation data. The 20% of SUM monitored during fine-tuning serves a different purpose, as the source of early-stopping accuracy. These two uses of SUM matter when reading the baseline comparison and the reported performance of the adapted settings.
The authors first evaluate pretrained encoders and pooling strategies. This screening establishes a starting point for the adaptation experiment. The next comparison holds the starting encoder at PMMBv2 while varying the triplet collection. Additional reports examine part of speech, sense usage rank, and the finer dictionary senses. These comparisons all use accuracy, with the scored examples or candidate inventory specified by the setting.
The strongest pretrained configuration
Mean pooling gives pretrained PMMBv2 an accuracy of 0.735 in the homonym screening. Max pooling gives 0.718, and Mean Max gives 0.716. Concatenating the last four hidden states gives 0.644. Summing the last four gives 0.636, and summing the last two gives 0.656. The last-layer mean is the highest-scoring PMMBv2 setting and the strongest reported encoder-and-pooling combination in the pretrained screening.
Other rows help explain the scope of that result. Multilingual BERT achieves 0.602 with the mean and 0.622 with Mean Max. In that row, the combined representation does better. The study therefore has evidence for choosing mean pooling with PMMBv2 on this evaluation and evidence that the ranking can differ with the encoder. The screening also includes multilingual and Ukrainian RoBERTa variants. Ukr-roberta has a separate role in the study as the encoder that ranks sentences for triplet creation. The choice of PMMBv2 for prediction follows the dictionary evaluation of the pretrained configurations.
The graph-based baseline, Babelfy, has a reported overall accuracy of 0.526 on the randomly sampled portion that the authors manually validate. This comparison places the embedding method alongside a system drawing on lexical graph structure. Pretrained PMMBv2 is the direct reference for what happens after fine-tuning, since each tuned setting starts from that encoder. The two baselines accordingly tell the reader different things about the result.
Adapting the encoder for SUM homonyms
Overall accuracy of the pretrained and adapted PMMBv2 settings on SUM homonyms
The larger filtered collection gives the highest reported overall accuracy.
The numbers
| System or setting | accuracy |
|---|---|
| Pretrained PMMBv2 | 0.735 |
| PMMBv2, smaller triplet collection | 0.77 |
| PMMBv2, larger unfiltered triplet collection | 0.778 |
| PMMBv2, larger filtered triplet collection (this paper) | 0.779 |
Each triplet-trained setting scores above pretrained PMMBv2 on the homonym evaluation. The smaller collection reaches 0.77, and the larger unfiltered collection reaches 0.778. The larger filtered collection produces the best overall result, 0.779. The conclusion reports that figure as 77.9% accuracy. The larger unfiltered collection comes close to the filtered one, so the evidence for substantial improvement over the pretrained baseline and the evidence for an additional benefit from filtering come from comparisons of different magnitudes.
The ranking is based on decisions among the grouped SUM entries. It indicates that the automatically constructed triplets provide a usable training signal for that task. The authors’ inspection of the triplets addresses a separate measurement. There, relevance depends on the assigned sentences expressing the intended semantic relations to the anchor. A setting can help with entry prediction while many individual triplets fail that check. The results give the downstream outcome of learning from the collection as assembled, and the inspection gives direct evidence of its imperfections as supervision.
Grammatical categories tell different stories
For the pretrained PMMBv2 baseline, accuracy on SUM homonyms is 0.767 for nouns, 0.668 for verbs, 0.752 for adjectives, and 0.593 for adverbs. In the larger filtered setting those figures are 0.824 for nouns, 0.693 for verbs, 0.759 for adjectives, and 0.607 for adverbs. All four exceed the corresponding pretrained results. Nouns account for the highest category score in that setting, and adverbs have the lowest score.
The larger unfiltered collection gives 0.825 on nouns, 0.698 on verbs, and 0.761 on adjectives, the highest reported accuracies for those three categories. Adverbs behave differently. Their accuracy after training on the larger unfiltered collection is 0.531. With the smaller triplet collection it is 0.562. Both scores are below the pretrained adverb result, and the larger filtered collection gives the highest reported adverb accuracy. The overall ordering thus cannot be used to recover the ordering within each part of speech.
The smaller collection also helps illustrate why the categories are worth reporting. It reaches 0.819 for nouns and 0.685 for verbs, while its adjective accuracy of 0.743 is below the pretrained adjective score. Its overall result improves even with lower accuracy in some categories. Overall accuracy reflects the collection as scored. The paper gives the category accuracies without reporting the information needed to attribute the overall change to particular categories or to judge their relative statistical precision.
Accuracy across dictionary sense ranks
The authors ask whether automatic triplets may mainly help a often encountered meaning. They examine accuracy by the frequency of usage to which they refer in SUM, comparing pretrained PMMBv2 with the larger filtered setting. The ranks in this comparison concern senses. UberText lemma frequency, which the reporting framework also supports, counts occurrences of a headword and is a different basis for grouping results.
Accuracy by SUM sense-usage rank for pretrained PMMBv2 and the larger filtered setting
The filtered setting improves accuracy at every reported sense rank.
The numbers
| System or setting | accuracy |
|---|---|
| First rank, pretrained PMMBv2 | 0.76 |
| First rank, filtered PMMBv2 (this paper) | 0.799 |
| Second rank, pretrained PMMBv2 | 0.703 |
| Second rank, filtered PMMBv2 | 0.754 |
| Third rank, pretrained PMMBv2 | 0.666 |
| Third rank, filtered PMMBv2 | 0.773 |
The leading rank has the highest score both before and after adaptation. The second- and third-ranked senses also improve, and the third rank moves above the second in the filtered setting. The authors interpret these results as evidence that the fine-tuned encoder can make useful contextual decisions for less common meanings. The comparison addresses that concern within the dictionary’s reported ranks. It provides no estimate of how often those senses appear in an arbitrary sample of periodical text or how many of the training triplets use them.
Performance when the answers are closer in meaning
The polysemy test evaluates the first 2 senses, the first 3 senses, and all senses. In that order, pretrained PMMBv2 scores 0.682, 0.637, and 0.608. The smaller triplet setting scores 0.702, 0.66, and 0.632. The larger unfiltered setting scores 0.7, 0.656, and 0.629. The larger filtered setting yields 0.689, 0.646, and 0.618. Within each configuration, the condition with all senses yields the lowest of the reported accuracies.
Accuracy of the PMMBv2 settings with all candidate senses on SUM polysemy
The smaller triplet collection leads when every available sense is considered.
The numbers
| System or setting | accuracy |
|---|---|
| Pretrained PMMBv2 | 0.608 |
| PMMBv2, smaller triplet collection (this paper) | 0.632 |
| PMMBv2, larger unfiltered triplet collection | 0.629 |
| PMMBv2, larger filtered triplet collection | 0.618 |
The smaller collection leads in each of the three polysemy columns. The setting that leads overall on homonyms, the larger filtered collection, falls behind both unfiltered tuned settings on each polysemy condition. Yet every fine-tuned setting scores above pretrained PMMBv2 in the corresponding polysemy condition. The authors’ observation of weaker performance on polysemy is about the change to a finer task, and their observation about filtering concerns the comparison among tuned settings on that task.
The hair definitions of коса illustrate why the choice can become harder. A sentence may give compelling evidence that the referent is hair. Its assignment to a definition about a braid or to one about length requires more specific evidence. Keeping such distinctions among possible answers changes what a correct prediction requires. In the restricted polysemy conditions, the task also asks about fewer leading senses. The results describe performance under each inventory rule, with the broadest inventory producing the lowest accuracy across the reported configurations.
What the ablations show
The encoder and pooling have to work together
The paper varies components of the prediction and training procedures, and it examines subsets of the evaluation after the predictions have been made. The pooling comparison is a change to the prediction procedure. It can hold the pretrained encoder fixed and ask what happens when the vectors entering the sense comparison are assembled differently. The grammatical and sense-rank breakdowns work differently. They record where the resulting predictor succeeds under different types of examples. They can reveal where to look for an explanation, while a change to a component tests the effect of that specific setting.
For PMMBv2, the average of the final-layer outputs outperforms both the maximum and the concatenation of the mean and maximum. Mean Max preserves both summaries in its vector, while the cosine comparison then operates on that combined representation. The result suggests that retaining the additional coordinates does not necessarily make the geometry more useful for selecting a dictionary entry. The same observation applies to the options that combine hidden states across layers. Several available layers can contribute information, and their particular combination can give a lower accuracy than the final-layer mean.
The multilingual BERT row shows why this finding belongs to a specific combination. The mixed pooling choice beats the mean for that encoder. The evidence supports evaluating pooling in conjunction with the encoder whose outputs it summarizes. It also supports the authors’ choice to start adaptation with an SBERT encoder, because a system designed to represent sentences produces the most successful vectors in their screening for lexical sense prediction. Differences between the encoders encompass their prior training and the representations available at each layer. The paper’s comparisons leave the contribution of those differences open.
More examples and stronger contrasts affect different decisions
Increasing the unfiltered triplet collection is associated with higher overall homonym accuracy. The authors suggest that the larger collection may improve the representation because it offers more examples and has greater average separation between positives and negatives. If both properties change, the comparison measures their combined effect. To establish what extra examples contribute at constant contrast strength would require a comparison organized around that control. The reported runs show which collection worked better when used as assembled.
Filtering the larger collection makes a more focused change. It removes examples for which cosine similarity gives the most and least similar sentences scores with a small gap. The overall homonym comparison favors keeping the better-separated triplets. The grammatical breakdown gives that result a more precise scope. Adverbs have markedly different reported outcomes under the larger training collection before and after filtering, while the filtered setting scores below the unfiltered one for nouns, verbs, and adjectives. Because the distribution of examples across categories is unspecified, those comparisons support a description of category-specific outcomes while leaving the source of the overall change uncertain.
The same filter has a different association on fine-grained meaning prediction. Each polysemy condition favors the larger unfiltered collection over the filtered version, and the smaller collection leads both. One possible explanation follows from what the training criterion can see. A wide separation between sentences can be useful evidence for senses as distinct as hair and a scythe. Closely related dictionary senses can occur in sentences that remain similar in other respects. The observed rankings are consistent with a training procedure that serves the broad contrast better. The paper offers the difficulty of separating related meanings as an interpretation and leaves the mechanism for the difference between filtered and unfiltered training open.
The inspection and sense ranks test different concerns
The manual inspection checks the training procedure upstream of optimization. To be relevant, the triplet needs to express a genuine same-sense relationship on the positive side and a meaningful contrast on the negative side. Being highly ranked by the encoder is the way a positive is selected. The inspection tests whether that rank corresponds to the linguistic relationship the designers intend. Its low relevance result shows that errors in making this correspondence are a practical issue for the collection.
The sense-rank comparison checks a potential consequence downstream. If automatically selected contrasts only helped a headword’s leading use, the lower-ranked meanings might show little improvement. The filtered setting improves accuracy for those ranks as well. This addresses the concern that the reported improvement can be explained completely by better performance on the leading sense. It leaves open how the rank of a sense relates to its representation in the training triplets, since the automatically selected examples come without dictionary sense labels.
Put together, the comparisons identify the stages at which experimenters have evidence for an effect. The pretrained screening shows that the construction of the vector matters to the similarity decision. The holding of PMMBv2 fixed as a starting point shows that triplet adaptation can improve grouped-entry accuracy across the reported training settings. The sense-rank and grammatical breakdowns show how unevenly the benefits can appear. The change of inventory shows that the best configuration depends on whether the answer is a distinct homonym or a finer lexical meaning.
Limitations
Limits the authors identify
The authors describe the homonym set as relatively small and question how well it represents Ukrainian as a whole. SUM includes examples from fiction and folklore, and its illustrations are chosen for dictionary purposes. Even an entry supported by clear examples can have uses outside the sorts of text that supplied those illustrations. Coverage is also bounded by the portion of SUM available to the authors. The reported accuracy is consequently a result for a particular set of headwords, meanings, and sentences. A claim about Ukrainian usage more broadly would require evaluation evidence from contexts sampled for that purpose.
The authors also identify the focus on homonymy as a constraint on practical scope. Text can require a choice between unrelated meanings of a spelling or between very close interpretations of a word. The main result concerns the first kind of choice. The polysemy experiment provides evidence on the second, with lower accuracies and a different ranking of the settings. What a system needs in practice depends on how specifically it must interpret the target. Identifying which object a noun denotes may suffice for some purposes, while others can depend on a distinction that the homonym benchmark groups together.
The source collections lack bias controls, a concern the authors raise for both SUM and UberText. They name possible biases involving gender, race, and socioeconomic status. Dictionary examples affect the evidence used to judge predictions. Periodical sentences affect which occurrences are available to form training contrasts. Associations in either source could therefore affect which decisions are easy to learn or to score. The authors identify this possibility, while their accuracy comparisons leave the presence, magnitude, and distribution of such effects undetermined. This concern belongs to bias, fairness and safety.
Recreating the adaptation requires a GPU with enough memory. The authors give an NVIDIA T4 with 16 GB as an example. They also describe the resources needed to use the procedure for another language. It would require a dictionary with headwords and meanings, a means of classifying parts of speech, and a sentence collection sufficiently large and varied to contain different uses of the words. The study demonstrates the arrangement using Ukrainian resources. Its requirements show where another language’s available data would determine how closely the experiment could be reproduced.
The authors propose removing almost identical anchor and positive sentences, excluding named entities mistaken for the target, sampling more evenly across lemmas, and improving target detection. Nearly identical sentences may satisfy the ranking rule while contributing little contrast. A target detection error can remove the shared lexical basis of a triplet altogether. Uneven sampling can concentrate training on some headwords and leave others with sparse evidence. These proposals specify problems the authors see in constructing the data. They also propose exploring comparison methods beyond cosine similarity, which would address a different stage of the system.
Limits that follow from the setup
The manual assessment establishes that the automatically constructed triplets frequently fail the relevance criterion in the sample checked. The paper leaves open how the errors are distributed among positives, negatives, and target identification. It also leaves open whether the filtered collection has a higher manually verified relevance rate. Filtering uses the same similarity evidence that produced the assignments. A larger gap gives more separation under that criterion. Establishing that the gap gives more reliable sense assignments would require direct evidence about the meanings in the retained sentences.
The vocabulary used for corpus collection comes from the homonym evaluation set. The training material and dictionary examples have distinct sources, but the experiment deliberately uses the evaluation headwords to guide corpus selection. That design is useful for learning about a known set of ambiguous words. Generalizing to new ambiguous headwords is a separate question. The reported comparisons leave open how much of the improvement transfers when none of the triplets are selected around the headwords used to test it.
Early stopping depends on SUM accuracy, and the paper specifies the portion monitored. The relationship between that monitored portion and every final result is left unspecified. The comparison with Babelfy has its own qualification because the graph system is manually checked on a random portion. These details make the design easiest to interpret as a comparison of reported configurations under the described evaluation procedures. The paper gives point scores, leaving the variation across data selections or repeated runs unknown. That uncertainty matters especially for the closely spaced results of the larger filtered and unfiltered settings.
The inference setup provides a list of meanings, asks for the best-scoring one, and scores agreement with the dictionary’s assigned answer. This is a clear way to test a predictor when a target and its inventory are given. In a broader setting, a use might fall outside the available entries or be compatible with several descriptions. The top-choice accuracy cannot establish how reliably the system recognizes such cases, how confident it should be, or whether a runner-up is linguistically defensible. The polysemy results make that gap particularly relevant because the distinctions in the inventory can be finer than the most evident distinction in a sentence.
Some questions about implementation and causation also remain. The description specifies several pooling operations and the comparison with meaning-group vectors, while giving limited detail on how all texts within a group are assembled into its vector. The triplet experiments vary collection size and filtering and measure the resulting accuracy, leaving the individual effects of coverage, label quality, and contrast strength unresolved. These boundaries preserve the strongest claim the setup supports. Adaptation with automatically assigned corpus triplets improves the reported PMMBv2 results for SUM homonyms, and the settings behave differently when evaluated on closer lexical meanings.
What came after
The connection through UberText
The work on UberText has a direct role in the study as well as a citation connection. The disambiguation paper uses the developers’ preview to find periodical sentences for the target headwords. Having enough candidate contexts makes the ranking procedure possible. The corpus supplies the sentences, and the disambiguation study develops the similarity rule that arranges them into anchor, positive, and negative positions. The corpus work in turn cites the disambiguation study, providing a documented connection between corpus construction and a specific use of its sentences. Introducing UberText 2.0
The citation trail also includes an entry titled UberText2. It connects the disambiguation study to another citing record about the corpus. The documented data use is the developers’ preview described in the study. The citing record leaves any additional use of the sense evaluation, triplet selection rule, or predictor unspecified. UberText2
Representation and robustness for Ukrainian
From Bytes to Borsch studies fine-tuning Gemma and Mistral for Ukrainian language representation. That brings the question of adaptation to a wider representation objective. Laba and colleagues give adaptation a particular operational test, the choice among dictionary meanings for a target occurrence. The citing paper’s title identifies a different set of systems and a broader aim. Its citation relates the two investigations at the level of adaptation for Ukrainian, while the transfer of a particular dataset or training procedure remains unspecified. From Bytes to Borsch
Precision vs. Perturbation examines robustness to synonym attacks in Ukrainian language processing. A lexical substitution raises a question about the meaning a word has in the sentence where it is used. That gives the study a point of contact with sense disambiguation, where the relation between an occurrence and its context is the main object of measurement. The robustness paper’s title identifies its concern as behavior under synonym perturbation. The citation records the connection to the earlier study, with the role of its actual predictor or datasets in the robustness experiments left open. Precision vs. Perturbation
Lexical relations and meaning over time
The Ukrainian WordNet paper addresses automated extraction of hypo-hypernym relations. These relate a narrower category to a broader one. The disambiguation study starts from a dictionary inventory whose distinctions have already been made and asks which meaning applies to a sentence. The WordNet paper’s title identifies a problem about constructing connections among lexical categories. The citation ties occurrence-level choice to research on the organization of a Ukrainian lexical resource. The details of any use of U-WSD or SUM examples in the extraction procedure remain unspecified. Hypo-Hypernym Relations for Ukrainian WordNet
The semantic-change work points to a setting in which the uses being compared may come from different periods. The disambiguation study judges an occurrence with respect to a fixed set of dictionary meanings. A question about semantic change puts the relationship between usages across time at issue. This is a connection in what must be represented about word meaning. The citation establishes the relation between the studies, with the semantic-change work’s use of the triplets, the similarity rule, and the dictionary evaluation unspecified. Semantic Change
Cite
Cite as Yurii Laba, Volodymyr Mudryi, Dmytro Chaplynskyi, Mariana Romanyshyn and Oles Dobosevych. 2023. Contextual Embeddings for Ukrainian: A Large Language Model Approach to Word Sense Disambiguation. Proceedings of the Second Ukrainian Natural Language Processing Workshop (UNLP).
@inproceedings{laba2023contextual,
title = {{Contextual Embeddings for Ukrainian: A Large Language Model Approach to Word Sense Disambiguation}},
author = {Yurii Laba, Volodymyr Mudryi, Dmytro Chaplynskyi, Mariana Romanyshyn and Oles Dobosevych},
booktitle = {Proceedings of the Second Ukrainian Natural Language Processing Workshop (UNLP)},
year = {2023},
doi = {10.18653/v1/2023.unlp-1.2},
url = {https://doi.org/10.18653/v1/2023.unlp-1.2}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/laba-2023-contextual-embeddings-ukrainian-large-language/