Elamur Research

Masked Latent Semantic Modeling: an Efficient Pre-training Alternative to Masked Language Modeling

Paper · 2023 · Gábor Berend

Summary

A sentence can give away much about a missing word while leaving its exact identity open. In a sentence about someone eating, the surrounding words can suggest food while leaving room for several plausible completions. Ordinary masked language modeling asks a learner to recover the particular token that appeared in the original sentence. Gábor Berend asks whether each training example would teach more if the target described properties of the missing token in context. The paper calls this approach masked latent semantic modeling, or MLSM. It tests whether changing the target improves what a pretrained system can learn for later tasks.

MLSM gets its targets from an already pretrained BERT. The teacher represents each token with a vector that depends on the surrounding text. The paper learns a dictionary of reusable directions in those vectors, then expresses each token representation as a mixture that uses relatively few dictionary entries. Normalizing the mixture gives a distribution over latent properties. A smaller BERT sees the masked text and learns to predict that distribution. The dictionary entries come from patterns in the teacher’s representations, so their construction requires no assignment of word senses or human-written categories to the training tokens.

On the development sets, the medium BERT pretrained with MLSM averaged 0.7815 across the reported fine-tuning measures. The same-size system trained to recover token identities averaged 0.7675. A system trained to imitate the same teacher’s output probabilities over tokens averaged 0.7709. The advantages varied by task. MLSM led the medium-size comparison on both MultiNLI splits, for instance, while teacher distillation retained the highest average accuracy on Word-in-Context. Keeping the full distribution over latent properties also gave a higher overall score than training on the most prominent property alone.

The checkpoint comparison shows where the efficiency claim comes from. After 75K pretraining updates, the MLSM student had a higher average downstream score than the main alternatives achieved at 300K updates. At the end of training, its overall average was also close to the 0.7818 of a larger BERT trained with the ordinary masked-token objective. These findings concern the learner’s update budget and its performance after task-specific training. The method starts with an existing teacher, and the experiments cover English and medium-size students.

Deep dive: Masked Latent Semantic Modeling: an Efficient Pre-training Alternative to Masked Language Modeling

Masked latent semantic modeling trains BERT to predict contextual meaning and tests whether that helps smaller systems learn from fewer updates. · about 33 minutes to read

The problem and its context

The evidence a missing word leaves behind

Masked pretraining creates a learning exercise from text that already exists. A token, which can be a word or part of one, is selected in a sequence, and the learner receives a version of the sequence in which that position has been masked. The original text supplies the answer automatically. This is self-supervision. The text contains both the material from which the exercise is made and the answer used to evaluate it. In the approach used for BERT and discussed alongside systems such as RoBERTa, the answer normally identifies the original token in the vocabulary.

The paper’s example starts with a sentence about Alice eating a cake. With the last content word hidden, a reader can infer something about what belongs in that position even before settling on a particular food. A pear or a croissant could fit the sentence as well. The actual text resolves the question of what was written, while the visible context leaves the choice open. This difference matters when the original token becomes the only answer credited by the training objective. On that individual example, the loss falls as probability moves to the observed token, including when it moves away from a plausible substitute.

Berend distinguishes what happens on an individual update from what can happen after a learner has seen a large and varied collection of text. Different passages reward different completions. Across enough examples, a system trained to recover the observed token can assign substantial probabilities to several plausible alternatives in a new context. The paper asks whether training can make better use of an individual observed occurrence. If the occurrence supplies information about a group of properties, several contexts can give the learner overlapping supervision even when their hidden tokens differ.

An ideal target for filling the blank might assign probabilities to all the tokens that could reasonably appear there. A corpus gives the particular choice a writer made. It gives no direct probability for alternatives that the writer might have used. Obtaining a good distribution over such alternatives would largely reproduce the prediction problem that pretraining is intended to solve. Berend therefore moves the target to a different space. The learner predicts what the missing occurrence is like according to a representation derived from another system.

This shift leaves the exercise recognizable. There is still a sequence, a selected position, and a prediction based on what the student sees. What changes is the item against which the prediction is scored. In the ordinary exercise, successful prediction means assigning probability to a particular vocabulary entry. In the proposed exercise, it means recovering a pattern of weights over properties that can recur across occurrences. The distinction matters for interpreting the experiments. A downstream gain would show that the new exercise prepares the learner better for particular later tasks. The pretraining problem itself has changed, so raw losses from the two exercises would answer different questions.

Explicit semantic information and the coverage problem

The paper considers a direct way of supplying properties. A lexical resource or a knowledge graph can store information in triples linking a word or concept to a property or another concept. One of the paper’s examples connects cake with sweetness in ConceptNet. Given an association like that, an objective can ask for a semantic label at the masked position. This gives the researcher a human-readable category and a way to state what additional information is entering the training procedure.

Coverage is an obstacle. A resource needs entries for the words and uses that matter in the training corpus. The resource also needs to support choosing which information applies in an actual passage. The paper illustrates this with book. ConceptNet associates it with a university in one entry and with reserving in another. The first fits a use of book as a noun and the second a use as a verb. A lookup of the spelling can return both. Choosing a property appropriate to the sentence then requires a decision about the occurrence, beyond finding associations for the word type.

Sense-annotated text would give a way to supervise that decision. The paper identifies SEMCOR as a resource for English and notes the gap in scale between annotated collections of this kind and corpora used for pretraining. It also describes SenseBERT as an earlier effort to teach semantic information through WordNet. The reliance on WordNet makes the availability of an appropriate lexical resource part of deciding where that approach can be used. Berend’s experiment asks whether a context-sensitive pretraining target can be obtained without requiring that form of lexical coverage or a sense label for each training occurrence.

The survey of earlier work points out that semantic information can enter a system in several places. It can be supplied as part of the input, incorporated in the architecture, or requested in the output. These are different interventions. Adding information to the input changes what the learner can see. A training target changes the feedback the learner receives about its predictions. The formulation in this paper belongs to the latter family. In the explicit comparisons it also uses output targets, which helps make the experimental question about the source and form of that supervision.

Why use a teacher’s internal representations?

A pretrained encoder can represent an occurrence in light of the sentence containing it. The paper’s proposal takes that representation as a source of candidate semantic information. An internal vector has coordinates learned during the teacher’s original training. The paper looks for a new way to describe the vector using a dictionary in which each occurrence draws on relatively few entries. The name latent reflects how the entries are obtained. The training procedure discovers them in the teacher’s representations, and a human need not supply a category name when an entry is learned or used.

The paper grounds this choice in earlier studies of sparse representations. It cites work connecting such representations with interpretable properties, and earlier experiments that used sparse contextual vectors for word-sense disambiguation. It also describes work using them to visualize the contents of contextual representations, along with cross-lingual work on word senses. These are reasons to test sparse coding as a source of training targets. The step taken in this paper is to use the code as the answer to a masked prediction exercise for a new student.

Using an existing teacher also creates a close comparison with distillation. In the paper’s ordinary distillation baseline, the teacher provides probabilities over vocabulary entries at a masked position. Several candidates can receive probability, which addresses part of the concern about the exact-token target. In MLSM, the teacher provides the internal representation from which a distribution over latent properties is constructed. Both routes can give the student a distribution richer than a single label. They differ in what its entries describe. That makes distillation particularly relevant to the paper’s question about the value of the semantic representation.

The method, step by step

From a token in context to a training target

The method has a preparation stage and a training stage. In preparation, the researcher runs a fixed teacher on text, collects its hidden vectors, and learns a dictionary for reconstructing them. A hidden vector is the teacher’s internal numerical representation of a token at a particular layer. At the start of student training, the dictionary already exists. For a token selected for masking, its teacher representation is coded using that dictionary. The resulting weights are normalized to make the target that the student is asked to predict.

From teacher representations to masked student predictions

The steps in order.

From teacher representations to masked student predictionsStep 1: Collect contextual token vectors from the teacher1. Collect contextual token vectors from the teacherStep 2: Learn a dictionary of sparse reconstruction directions2. Learn a dictionary of sparse reconstruction directionsStep 3: Select token positions for masking3. Select token positions for maskingStep 4: Code their teacher vectors using the fixed dictionary4. Code their teacher vectors using the fixed dictionaryStep 5: Normalize each code into a target distribution5. Normalize each code into a target distributionStep 6: Predict dictionary entry probabilities from masked text6. Predict dictionary entry probabilities from masked textStep 7: Update the student using the distribution loss7. Update the student using the distribution loss

The sequence notation in the paper identifies the unit being described. Each position has its own token and its own semantic profile.

I = [t₁, t₂, …, tᵢ, …, t₍│I│₎]

I denotes the input sequence and the square brackets enclose its ordered entries. The letter t denotes a token, with the subscripts identifying positions. The first and second tokens are t₁ and t₂, and tᵢ is the token at the position of interest, indexed by i. The vertical bars in │I│ give the sequence length, so t₍│I│₎ is its final token. The ellipses stand for the entries between the positions shown.

The paper writes the profile at position i as s(tᵢ), with s standing for the procedure that assigns semantic information to the occurrence. The argument identifies a position within I. That position matters because its vector is computed in context. Occurrences of the same vocabulary item can produce different vectors and, through the later coding step, different target distributions. The dictionary is shared across occurrences, so an entry used to describe one token can also appear in the target for another.

The teacher in the main experiment is the official bert-base-cased. The learners trained for the main comparisons use its tokenizer, the component that divides input text into the units the system processes. This keeps the input units common when the pretraining objectives change. The compact student has 8 transformer blocks and a hidden width of 512 dimensions. The dictionary itself is learned in the teacher’s hidden space. The student’s internal vector size therefore does not have to match the teacher’s for their target and output to be comparable. What must match is the set of dictionary entries that the teacher-derived target and the student prediction refer to.

Learn a dictionary for the teacher’s hidden space

Sparse coding starts with the idea of reconstructing a vector as a weighted combination of other vectors. Each of those reusable vectors is a column of the dictionary and is called an atom. The dictionary may contain many atoms. A code for a particular occurrence is sparse when relatively few of the available entries receive non-zero weights. A collection of teacher vectors supplies the examples from which the dictionary is learned. The optimization seeks atoms that can be reused across those examples, along with a separate set of weights for each example.

min over D and αⱼ ∈ ℝᵏ₊   ∑ from j = 1 to N [½‖hⱼ⁽ˡ⁾ − Dαⱼ‖₂² + λ‖αⱼ‖₁]

The instruction min means to find the dictionary and codes that make the expression as small as possible. D is the dictionary matrix, with d rows and k columns. Here d is the number of coordinates in a teacher vector, and k is the number of dictionary atoms. The column norm is constrained to be at most 1. The index j runs from the first collected vector to the last, and N is the number of collected vectors. The summation sign adds a reconstruction and sparsity cost for every vector. The notation αⱼ denotes the k coefficients for example j. The set ℝᵏ₊ contains real vectors with k non-negative coordinates, including zeros.

The vector hⱼ⁽ˡ⁾ is the teacher’s hidden representation of occurrence j from layer l. The product Dαⱼ adds the dictionary columns in the amounts specified by αⱼ. Subtracting that product from hⱼ⁽ˡ⁾ leaves the reconstruction error. The norm marked with a subscript ₂ measures its Euclidean length, and the superscript ² squares that length. The factor ½ scales the squared error term. The norm marked with a subscript ₁ adds the absolute values of the coefficients. The symbol λ is the regularization coefficient. It sets how much the objective charges for that total alongside the reconstruction error.

The two terms reward different aspects of a code. A good reconstruction captures the structure of the original vector. The penalty makes a reconstruction using many substantial weights expensive, creating pressure for a compact code. The bound on the dictionary columns also matters. If their scale were free to grow, smaller coefficients could reconstruct the same vector simply because every unit of a coefficient bought a larger contribution. The norm bound makes the size of the coefficients meaningful for the penalty.

For the main teacher, the paper collects last-layer representations over SEMCOR and learns a dictionary with k set to 3000 and λ set to 0.05. The use of SEMCOR here is easy to confuse with the use of a sense-annotated corpus to assign target labels. The inputs to this optimization are the teacher’s hidden vectors obtained by processing the text. A teacher vector supplies the object to reconstruct. Its contextual code comes from the optimization, so SEMCOR’s sense annotations are unnecessary for this step. The much larger text collection used to train the student is Wikipedia.

A dictionary entry is a vector in the teacher’s hidden space. Its meaning in the experiment is initially operational. It identifies a direction that helps reconstruct some occurrences under the sparsity constraint. The paper motivates a semantic reading of these directions by discussing prior work and by examining examples in which particular entries recur for related words. The optimization itself asks for good sparse reconstructions. It has no term asking for an entry with a specified English definition, and it makes no assignment of labels such as animal, food, or action during dictionary learning.

Find the sparse code for a new occurrence

Once D has been learned, the researcher can express a new teacher vector in the same dictionary. The token under consideration may come from the Wikipedia training stream. The procedure solves another reconstruction problem to get that token’s coefficients. The matrix is held fixed, so a coordinate in the resulting code refers to the same atom regardless of which occurrence is being coded.

min over αᵢ ∈ ℝᵏ₊   ½‖hᵢ⁽ˡ⁾ − Dαᵢ‖₂² + λ‖αᵢ‖₁

Here min again means to minimize the displayed cost. The index i identifies the occurrence being coded. Its k non-negative real coefficients are αᵢ, and ℝᵏ₊ is the space of vectors satisfying those conditions. The vector hᵢ⁽ˡ⁾ comes from layer l of the teacher. The matrix D is the previously learned dictionary, and Dαᵢ is the reconstruction. The subtraction gives the residual, whose Euclidean norm is squared by ‖ · ‖₂² and scaled by ½. The expression ‖αᵢ‖₁ is the sum of the coefficient magnitudes, and λ weights this penalty. The plus sign joins the reconstruction and penalty terms into the total cost.

The paper describes this fixed-dictionary optimization as LASSO on a hidden vector. In this setting it is a least-squares reconstruction with an absolute-value penalty and a nonnegativity constraint. The nonnegativity is useful for what comes next. A non-negative weight can be read as an amount of contribution from an atom, and several such contributions can be turned into shares of a common total. The fixed dictionary supplies the vocabulary for those shares. Relearning a separate dictionary for each occurrence would remove that common basis.

To produce the target, the procedure divides each coefficient by the code’s ℓ₁ norm. The notation ℓ₁ refers to the sum of coefficient magnitudes, which is also the sum of the coefficients here because they are non-negative. For a code with positive total weight, normalization leaves zero entries at zero and preserves the ordering of the other entries. The result has unit total mass. A high weight now means that an atom takes a large share of that occurrence’s code. It is a weight within the target for this particular occurrence, with the other atoms supplying the context for how large that share is.

There are two levels of context in this operation. The teacher builds the vector using the occurrence and its surroundings. The sparse coding then describes that vector using entries learned from a collection of occurrences. An atom can therefore be common to examples with different vocabulary items, while the whole distribution can change across uses of the same item. The target carries that combination of contextual variation and shared coordinates. The student is asked to predict it when part of the evidence that produced it is hidden from the student’s input.

Score the student on the latent properties

MLSM adds k special symbols to the output vocabulary. Each symbol corresponds to one of the dictionary atoms. At a masked position, the prediction that matters for this objective is the student’s distribution over these symbols. The teacher supplies the hidden representation, the fixed dictionary maps it to coefficients, and the normalized coefficients state how the target’s mass is allocated. The output symbols give the student a way to express a prediction in the same space.

The main loss uses Kullback–Leibler divergence, abbreviated KL divergence. It measures how the predicted probabilities agree with a reference distribution. In MLSM, the reference is the normalized sparse code and the prediction comes from the student. The target weights determine how strongly the disagreement on each entry enters the comparison. When several entries carry mass, the student receives supervision about all of them, including which entries should receive greater weight. The procedure uses the loss to change the student’s parameters while keeping the teacher as the source of targets.

This is how the paper turns contextual similarity into a possible advantage during training. If the teacher-derived codes for two food words give weight to some of the same dictionary entries, the corresponding training examples offer overlapping feedback through the student’s output. Each occurrence can still supply a different distribution. The scheme can preserve a recurring property alongside details of the occurrence, depending on the structure of the teacher’s hidden space and the dictionary’s fit to it. That is the mechanism the downstream experiments put to the test.

The training interface also explains the distinction from ordinary distillation. Distillation in this paper compares the teacher’s and student’s probability distributions over tokens for the masked position, using KL divergence. Its entries answer which vocabulary items the two systems favor. The entries in MLSM answer which hidden-space directions contribute to a description of the target token in context. Both comparisons use soft targets, which means the supervision is distributed among possible outputs. The choice of output space determines what is being transferred.

Construct explicit semantic targets for comparison

The paper also implements masked explicit semantic modeling, or MESM, using WordNet and ConceptNet. These variants put special symbols for known semantic categories into the output vocabulary. When a masked item has viable semantic targets in the resource, the procedure chooses uniformly among the possibilities. This means that candidates available to the lookup have equal chances of selection when a choice is needed. The paper’s book example shows the consequence of lexical ambiguity for this procedure. An association valid for one sense may be selected on another occurrence.

MESM-WN introduces 45 symbols, one per WordNet lexname. A lexname identifies a broad lexical category, and the masked prediction exercise asks for the corresponding supersense. MESM-CN introduces symbols for ConceptNet’s 3000 most frequent relations, with IsA_food as one example of an output label. The number 3000 also serves as the dictionary size for MLSM. Thus ConceptNet and MLSM are compared with equally numerous sets of added symbols, while the contents of the sets and the way a target is selected remain different.

These explicit variants put a practical proposal under test. A training target can come from a pre-existing store of human-readable associations, or from a code computed over a contextual vector. The explicit comparisons show what happens with the particular resources and target selection rule implemented here. Reading their results requires keeping those choices together. A curated category, a token-level lookup, and a random choice among associations are all part of the baseline the paper actually trained.

Train on a common stream of Wikipedia text

The student training corpus comes from a Wikipedia dump prepared using the WikiBERT preprocessing pipeline. It contains approximately 125 million sentences and 2.7 billion whitespace-delimited tokens. That last count describes the corpus at the level of whitespace-separated items. The teacher’s tokenizer determines the units the student experiments use for prediction. The paper shuffles the processed sequences to give batches a more varied mix of text.

The batch size is 1024, implemented with gradient accumulation over 32 batches. Gradient accumulation lets several batches contribute to a parameter update. The experiment runs for 300,000 updates and processes roughly 300 million input sequences in all. The maximum sequence length is 128 for 90% of pretraining, then 512 for the remaining steps. This follows the paper’s account of the original BERT procedure and keeps most of training at the shorter length while allowing longer inputs later.

The optimizer is AdamW. The learning rate is 1e−4 with a linear schedule and a warm-up of 3,000 steps. Warm-up introduces the learning-rate schedule gradually at the start of training. The common optimization procedure is part of the comparison. The same sequences appear across pretraining runs, in the same batch order and with the same positions marked for masking. The systems consequently encounter the same training material on the same schedule, with their objectives supplying different feedback about those positions.

The implementation uses the Transformers library for the BERT experiments. The paper reports using 3 NVIDIA A6000 GPUs and gives approximate costs of 2 GPU weeks per pretraining run and 1 GPU day for the repeated fine-tuning experiments for one checkpoint. It also reports releasing the MLSM implementation and pretrained weights. The implementation is called MLSM, and the medium checkpoint is released as bert-medium-mlsm.

Experiments and results

Compare objectives before comparing sizes

The main comparison is between medium BERT systems trained on the common Wikipedia stream. The ordinary MLM baseline predicts the identity of the original token. MESM-WN uses WordNet labels and MESM-CN uses ConceptNet labels. These comparisons ask whether the proposed training target offers an advantage over conventional token prediction and over the particular explicit semantic objectives the paper constructs.

The final main baseline, MLM-D, is ordinary masked-token distillation. It uses the same bert-base-cased teacher as MLSM in the main experiment. The teacher predicts a probability distribution over vocabulary items at the mask, and the student is trained against that distribution. Since this baseline has access to the teacher and uses distributional feedback, it tests whether simply using that teacher is enough to account for the result. Comparisons with basic MLM and with MLM-D consequently answer related but distinct questions. The first changes both the source and the form of the target. The second lets both systems obtain probabilistic supervision from the same teacher, in different output spaces.

After pretraining, the experiment attaches a prediction head appropriate for each downstream task. A head maps the pretrained representations to the required output, such as a class, a token label, or a similarity score. The entire system is fine-tuned on that task. Each evaluation therefore measures what the pretrained student can become under a common supervised procedure. The numbers are downstream scores obtained after this adaptation, even though the underlying comparison is between pretraining objectives.

Set up the downstream measurements

The paper describes 10 downstream tasks and reports separate entries for the matched and mismatched splits of MultiNLI. Some tasks also supply more than one metric. CoLA measures linguistic acceptability and uses Matthews correlation, a score that summarizes agreement between predicted and recorded classes using the classification outcomes together. CoNLL2003 evaluates named entity recognition at the token level and reports F1, which balances precision and recall. These tasks supply evidence about different levels of prediction, from identifying words that form named entities to judging whether a sentence is acceptable. CoNLL-2003 shared task

The matched and mismatched versions of MultiNLI ask about the relation between a premise and a hypothesis. The mismatched evaluation changes the genre relationship between the training and evaluation material. Each split is scored by accuracy, the fraction of decisions that match the benchmark labels. RTE is another textual entailment benchmark and also uses accuracy. QNLI likewise reports accuracy on its sentence-pair decisions. It comes from a question-answering setting, but the evaluated output in this paper is a classification, so its accuracy belongs to that task formulation. MultiNLI · SQuAD

MRPC and QQP evaluate whether two inputs express the same meaning or question. Each reports accuracy and F1. The pair of metrics is useful because a change in predictions may affect overall correctness and the balance of precision and recall differently. Paper results for these tasks should therefore be read with the metric attached. A reported F1 score and a reported accuracy score describe different summaries of the same classification exercise. Microsoft Research Paraphrase Corpus

SST2 addresses sentiment classification and uses accuracy. STSB evaluates semantic similarity using graded scores and reports Pearson and Spearman correlations. Pearson summarizes the linear association between scores and reference judgments. Spearman does the comparison in terms of ranks. WiC asks whether a word is used with the same sense in two contexts and reports accuracy. This task has a particularly direct connection to the motivation for using contextual representations, so its individual result is important alongside the overall average. Stanford Sentiment Treebank · Semantic Textual Similarity benchmark · Word-in-Context

The reported evaluations use development sets. Many of the benchmarks come from GLUE or SuperGLUE, for which the paper says the test labels are unavailable. The paper uses a common recipe across tasks and says it did not choose the settings to optimize results on these development sets. The fine-tuning learning rate is 2e−5 with a linear schedule, the batch size is 32, and each run lasts 3 epochs. The reported score is taken at the end of the last epoch. This makes the choice of when to score a run part of the common procedure. GLUE · SuperGLUE

The experiment repeats fine-tuning 10 times for each task and pretraining variant. Runs with the same task and seed start with identical head parameters across the systems being compared. The batches also contain the same examples in the same order. There are therefore natural pairs of scores for comparing objectives. Each pair reflects teams of parameters that came from different pretraining runs, followed by a fine-tuning exercise with the corresponding initialization and supervised examples held in common. The repeats address variation introduced at this downstream stage.

Read the overall scores alongside the individual tasks

The main results table averages the repeated runs for each reported measure and also gives an overall average across its rows. The overall value is a summary over heterogeneous quantities. It combines accuracy scores with F1 and correlations, and a benchmark that contributes multiple rows has more representation in that summary than a benchmark with one row. The table’s average gives a compact view of the learning curves and final comparisons. The individual rows show which abilities contribute to it.

Medium BERT objectives and average development-set fine-tuning score across the benchmarks

The latent objective leads the overall comparison, with vocabulary distillation the closest baseline.

Medium BERT objectives and average development-set fine-tuning score across the benchmarksMLM: 0.7675MLM0.7675MESM-WN: 0.6596MESM-WN0.6596MESM-CN: 0.6590MESM-CN0.6590MLM-D: 0.7709MLM-D0.7709MLSM (this paper): 0.7815MLSM (this paper)0.7815
The numbers
System or settingaverage benchmark metric score
MLM0.7675
MESM-WN0.6596
MESM-CN0.6590
MLM-D0.7709
MLSM (this paper)0.7815

The MultiNLI results show the comparison against both ordinary MLM and distillation clearly. On the matched development split, MLSM reaches 0.798 accuracy, compared with 0.771 for MLM-D and 0.768 for MLM. On the mismatched split, the corresponding accuracies are 0.808, 0.782, and 0.771. The same ordering appears on both splits. Since the paper reports the splits separately, a reader can see that the advantage in this experiment occurs on both the matched and mismatched examples.

Medium BERT objectives on MultiNLI mismatched development accuracy

The latent objective achieves the highest accuracy on the mismatched split.

Medium BERT objectives on MultiNLI mismatched development accuracyMLM: 0.771MLM0.771MESM-WN: 0.731MESM-WN0.731MESM-CN: 0.749MESM-CN0.749MLM-D: 0.782MLM-D0.782MLSM (this paper): 0.808MLSM (this paper)0.808
The numbers
System or settingaccuracy
MLM0.771
MESM-WN0.731
MESM-CN0.749
MLM-D0.782
MLSM (this paper)0.808

For CoNLL2003, MLSM reaches 0.926 development F1, while MLM-D reaches 0.920 and ordinary MLM reaches 0.919. On CoLA, MLSM scores 0.403 in development Matthews correlation, versus 0.390 for MLM-D and 0.391 for MLM. The ordering of the token-based baselines changes across these two tasks. The MLSM comparisons thus include a token-labeling task and a sentence-level judgment task where the reference systems themselves show slightly different rankings.

The paraphrase and question-pair results offer a view across multiple metrics. On MRPC, MLSM reaches 0.786 development accuracy and 0.851 F1. MLM-D records 0.775 accuracy and 0.846 F1. On QQP, MLSM records 0.892 accuracy and 0.855 F1, against 0.888 accuracy and 0.849 F1 for MLM-D. The absolute scores are tied to their respective datasets and metrics. Within each pair of comparisons, both measures favor the same objective.

On QNLI, MLSM reaches 0.870 development accuracy, with MLM-D at 0.852 and MLM at 0.850. On SST2, the MLSM accuracy is 0.905, while ordinary MLM reaches 0.892 and MLM-D reaches 0.890. In the STSB evaluations, MLSM reaches 0.818 Pearson correlation and 0.820 Spearman correlation. Ordinary MLM records 0.809 on each. The two explicit semantic variants have particularly low values on this benchmark. MESM-WN scores 0.277 Pearson and 0.264 Spearman, and MESM-CN scores 0.243 Pearson and 0.226 Spearman. Those values form part of their low averages across the table, alongside their results on the classification tasks.

RTE and WiC show where the overall ordering changes. RTE development accuracy is 0.578 with MLM-D and 0.571 with MLSM. Ordinary MLM also records 0.571 on RTE. On WiC, MLM-D reaches 0.644 development accuracy, MLSM reaches 0.639, and MLM reaches 0.629. The WiC result is informative given the method’s motivation. A target derived from contextual lexical representations improves on standard MLM in this comparison, while token-distribution distillation from the same teacher gives the highest downstream score for the direct sense-comparison task.

What the paired results establish

The paper plots comparable fine-tuning scores for MLSM and MLM-D. Each point matches trials under the same downstream task and seed settings. Points on one side of the diagonal favor MLSM, and the figure shows that most fall on that side. The scatter is useful because the overall average alone gives no view of how frequently the advantage appears across individual trials. The paired figure exposes that structure while the task means identify benchmarks whose average scores favor distillation.

The paper applies a Wilcoxon signed-rank test to the paired results. This test uses the directions and ranks of the paired score differences. It reports p < 2e−12 for the MLSM versus MLM-D comparison and p < 3e−17 for MLSM versus ordinary MLM. These are significance results for the paired comparisons considered together. The sizes of the differences on specific tasks come from the development-set scores. In particular, a small aggregate p-value can coexist with the RTE and WiC outcomes, since the test summarizes the pattern across the pairs it receives.

The strongest comparison against MLM-D therefore goes beyond a favorable average. Both pretraining procedures have the same main teacher, and the downstream comparison is repeated under matched conditions. The direction of the effect appears in most of those paired trials. This makes the choice of what to transfer from the teacher a credible part of the explanation, with the contrasts in the next section narrowing that interpretation further.

What the ablations show

Preserve the distribution or keep its largest entry

The closest ablation keeps the teacher and its latent categories and changes how much of the target is used. In the main MLSM objective, the distribution includes all the sparse code’s normalized weights and is trained with KL divergence. In the alternative, the paper takes the index of the atom with the greatest target weight. The student is then trained with cross-entropy to predict that index as the target class. The paper calls this variant MLSM-CE.

The overall development-set score reported in this comparison is 0.781 for MLSM and 0.762 for MLSM-CE. These are the paper’s reported values for the distribution experiment. The setting tests whether it is sufficient to associate the masked token with its strongest latent property. The result favors retaining the weights across entries. An example in which several properties are active can supply feedback about more than its largest one, and that extra information is available every time such a target is used.

Full and top-category latent targets on average development-set fine-tuning score

Keeping the distribution over latent categories gives a higher overall downstream score.

Full and top-category latent targets on average development-set fine-tuning scoreMLSM-CE: 0.762MLSM-CE0.762MLSM (this paper): 0.781MLSM (this paper)0.781
The numbers
System or settingaverage benchmark metric score
MLSM-CE0.762
MLSM (this paper)0.781

The paper changes the target and its stated loss together in this comparison. The result therefore supports the complete choice of a soft latent target with its distribution loss over the implemented choice of a top category with a classification loss. It supplies no comparison among several loss functions applied to an identical full target. Its particular value is that it keeps the latent categories themselves available in both settings. Merely offering the student those categories does less well than also offering their relative weights under the tested training procedure.

Read alongside ordinary distillation, this suggests two separate lessons from the controls. The distillation comparison shows that a soft target over vocabulary items does not recover the full downstream benefit seen with the main MLSM configuration. The top-category comparison shows that a target in the latent space can lose much of its usefulness when compressed to a single label. In this experiment, the favorable result comes from the combination of the representation space and how much of its target structure reaches the student.

Evaluate comparable checkpoints along the training run

The checkpoint comparison fine-tunes students after 10% (30K), 25% (75K), 50% (150K), and 100% (300K) of the pretraining updates. At each checkpoint, the reported curve summarizes downstream performance. This is a comparison of how readily students can be adapted after different amounts of exposure to the pretraining exercise. It does not depend on treating a masked-token loss and a latent-distribution loss as though they were in the same units.

The MLSM curve is above the alternatives at the sampled points in the main comparison. The most consequential comparison looks across training times. At the 25% checkpoint, or 75K updates, the average downstream score of MLSM is already higher than the final average of the main alternatives at 300K updates. Sequence contents, masking positions, and batch order were fixed across the runs, which gives an update count a clear comparison here. At a common checkpoint, the objectives have had access to the same part of the student training stream.

The finding supports sample efficiency in the sense that motivates the paper. Under this schedule and these downstream evaluations, the latent objective reaches a benchmark performance level after fewer student updates. The plotted points are particular checkpoints, so the result pins the comparison to observed stops in training. The teacher and dictionary are prior inputs to that curve, and how their costs affect an end-to-end comparison is a separate question.

Compare a compact student with a larger standard BERT

The paper trains an additional BERT with ordinary MLM under the same pretraining procedure, using the base architecture instead of the medium one. The base configuration has 12 transformer blocks and hidden vectors of 768 dimensions. The medium configuration has 8 blocks and a hidden width of 512. The paper reports approximately 110M parameters for the base configuration and approximately 42M for the medium one. Each is fine-tuned 10 times on each downstream task for the relevant comparison.

The overall development-set average is 0.7818 for base BERT with ordinary MLM and 0.7815 for medium BERT with MLSM. The paper expresses the medium result as 99.96% of the larger system’s average. Medium BERT with ordinary MLM reaches 0.7675, which the paper expresses as approximately 98.17% of the base MLM average. Taken together, these results locate the size comparison within the experiments. Holding the medium architecture fixed, changing the pretraining objective improves the average. The resulting medium system is close to the larger standard baseline on the same summary measure.

Individual results give a different picture from the near tie in the average. Base MLM records 0.940 development F1 on CoNLL2003, compared with 0.926 for medium MLSM. On MRPC, medium MLSM reaches 0.786 development accuracy and 0.851 F1, while base MLM reaches 0.763 accuracy and 0.837 F1. When the paper reports how much of the larger system’s performance the medium system preserves, the quantity being preserved is the numerical aggregate. The task rows show that which system is preferable can depend on the intended task.

The comparison changes both architecture and objective. It addresses a practical question about what a smaller system can achieve after MLSM alongside what an otherwise comparably trained larger system achieves with ordinary MLM. An experiment applying MLSM at both sizes would answer a different question about how the advantage varies with student capacity. The paper’s fixed-medium comparison and its cross-size comparison give evidence at their respective settings.

Change the teacher and hold student capacity fixed

The paper tries bert-large-cased and roberta-large as teachers alongside bert-base-cased. For latent supervision from the larger teachers, the contextual representations come from layer 21. The BERT-base setup uses the final layer. These experiments retain the medium student and compare the latent objective with ordinary vocabulary distillation for each teacher. The question is whether transferring from a larger teacher improves the downstream performance that the student reaches.

When the teacher is BERT base, the average development-set score is 0.7815 for MLSM and 0.7709 for MLM-D. With BERT large, MLSM reaches 0.7696 and MLM-D reaches 0.7698. The paper treats those two scores as being on par. With RoBERTa large, MLSM reaches 0.7783 and MLM-D reaches 0.7563. For this student, the largest MLSM average in the comparison comes from the BERT-base teacher. Changing to a larger teacher gives different results depending on the teacher and the supervision used.

Berend suggests that the capacity gap between teacher and student may contribute to these outcomes. The gap is offered as an explanation, with student capacity held fixed in the teacher comparison. The comparison also includes different choices of teacher representation layer. It shows that teacher size alone does not rank the resulting students under these settings. Testing the capacity explanation would require following the same teacher choices across students of different sizes.

Inspect the geometry and properties of some targets

The paper also looks closely at the codes for cake, soup, cat, and fox in short example sentences. Each word is considered in context, and the examples form two intuitive groups, food and animals. The analysis first compares cosine similarities for pairs of occurrences. Cosine similarity reflects the alignment of vector directions. The original dense BERT representations give similarities that are relatively homogeneous across these examples. The paper connects this to anisotropy, the tendency for representations to favor certain common directions. An analysis of contextual representation geometry

In the sparse space, the pairwise similarities correspond more closely to those intuitive groups. The paper then plots the top 10 categories for each occurrence and shows how much weight the other occurrences give to those same categories. The food examples share some prominent entries. Category 2782 takes the most mass for both cake and soup. The predominant food categories have little overlap with the strongest categories of the animal examples, and the animal examples also show overlap with each other.

This analysis makes the distinction between a token target and a latent target concrete. Two tokens have different identities, yet the target distributions for them can share a prominent index. The index stands for a direction in a learned dictionary, which becomes intelligible here through the examples that use it. The plots illustrate the type of structure the pretraining objective can transmit. They examine a small set of occurrences, while the benchmark comparisons measure the outcome of using such targets throughout training.

Limitations

Limits identified in the paper

The paper evaluates English and explicitly points out the risk of reinforcing the field’s emphasis on English. The method could in principle be attempted where an appropriate teacher and a corpus of raw text are available. Its unsupervised dictionary learning avoids a requirement for a manually assigned sense at each masked position. That property makes it possible to describe how the procedure would transfer across languages. The reported experiments establish how it performs in the English setting.

Availability of a teacher is a separate constraint the paper identifies. MLSM takes the teacher’s contextual representations as an input to construction of its targets. In a language with raw text but without a suitable pretrained system, the teacher would have to be obtained first. This raises the startup cost. Berend distinguishes that dependency from the cost of downstream training once an MLSM student exists. After pretraining, the paper says that fine-tuning has the same cost as for a student trained with ordinary MLM under the corresponding setup.

The paper also limits the architectural claim to the autoencoder-style masked systems it studies. The student in the experiment receives context from a sequence with selected positions hidden. An autoregressive system poses a different prediction problem in which a prediction is made from the available prefix. Extending the semantic objective to such a setting is identified as future work. The benchmark evidence here concerns masked encoders and their downstream use.

Finally, the paper says that its compute budget limited the MLSM students to the medium size. Bigger teachers were feasible because they did not require back-propagation, the calculation used to update training parameters. The base-size MLM comparison then provided a reference for what a larger standard BERT could achieve. Applying the proposed objective to larger students remains outside the reported tests.

Limits of the comparisons and measurements

The early-checkpoint result is a measurement of student sample efficiency under a shared stream of examples. An accounting of total compute would also include teacher preparation, obtaining its hidden states, constructing the dictionary, and supplying targets. The paper reports approximate experimental costs, while its main efficiency comparison uses the count of student updates needed to reach a downstream score. Reusing an existing teacher makes that a relevant comparison. Starting with only a raw corpus would make the upfront work part of the cost of choosing MLSM.

The downstream findings are development-set measurements under a fixed fine-tuning procedure. The shared hyper-parameters make the comparison easier to interpret, and the 10 runs expose variability due to fine-tuning choices such as head initialization. Those repeats are about adaptation from the pretrained systems. They do not establish how variable the result would be across fresh pretraining runs with different seeds or data orders. The Wilcoxon results should likewise be read at the level at which trials were paired. They support the overall pattern among the comparisons in the paper, with individual tasks showing their own results.

A common fine-tuning procedure has the advantage of applying the same conditions to each objective. It also fixes the question being asked to performance after the specified recipe. Different tasks or initializations could respond differently to further optimization. The aggregate gives a view of the particular mix of development outcomes in the paper, with different types of metric and more than one reported row for some tasks. The near tie between medium MLSM and base MLM therefore supports similarity on the reported average. A task-specific comparison can still favor either system.

The semantic demonstration and the benchmark evaluation provide different kinds of evidence. Looking at cake and soup gives an interpretable example of shared weights. The reconstruction objective defines categories by how they help describe teacher vectors. The paper does not annotate the learned dictionary with human definitions or measure the semantic coverage of its full set of atoms. The examples suggest how some entries behave, and the benchmark results establish the usefulness of those training targets for the evaluated tasks.

The explicit baselines also reflect particular design choices. Their targets are based on the listed categories from WordNet and ConceptNet and the paper’s handling of ambiguous associations. Better downstream performance from MLSM provides evidence against those implemented targets as substitutes for it in this setup. A semantic method that resolved resource entries using sentence context or injected the information elsewhere would pose a different comparison. The paper’s own survey gives reasons to distinguish those possible designs when interpreting the low averages of MESM-WN and MESM-CN.

The ablations identify a useful combination of choices, with a narrower reach than a complete causal account. The soft-versus-hard comparison isolates the value of using more of the same latent target under the losses the paper couples to those settings. The main method uses one dictionary size and regularization strength for its primary experiment. The larger-teacher comparison changes the teacher and specifies a different representation layer from the base setup. These results explain why the tested configuration is preferable to its direct alternatives. They leave the dependence on dictionary settings, representation layers, and student capacity open.

What came after

The first follow-up takes up the relationship between the conventional token objective and the latent objective. In the original experiment, the main student is trained to predict latent properties in place of token identities. The follow-up investigates joint use of masked latent semantic modeling and masked language modeling for sample-efficient pretraining. This brings two kinds of supervision into the same research question. Token prediction rewards recovery of what was written, and the latent task supplies information about the contextual properties of the hidden occurrence. The joint formulation asks whether exact lexical supervision can contribute alongside the signal that made MLSM effective on its own. Better Together

A subsequent paper investigates bringing quasi-symbolic conceptual knowledge into pretraining. That direction picks up the original paper’s distinction between explicit knowledge stored in a resource and latent properties obtained from an encoder. Berend’s original work made these alternative sources of targets in its comparison of MESM and MLSM. The later work’s focus is conceptual knowledge in quasi-symbolic form. Its relationship to the earlier paper is at the level of what semantic structure can be made available during pretraining. Its title establishes that focus, while details such as reuse of the original sparse dictionary or effects on the original benchmarks remain unspecified here. Integrating Quasi-symbolic Conceptual Knowledge

Cite

Cite as Gábor Berend. 2023. Masked Latent Semantic Modeling: an Efficient Pre-training Alternative to Masked Language Modeling. Findings of the Association for Computational Linguistics: ACL 2023.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.findings-acl.876

@inproceedings{gabor2023masked,
  title = {{Masked Latent Semantic Modeling: an Efficient Pre-training Alternative to Masked Language Modeling}},
  author = {Gábor Berend},
  booktitle = {Findings of the Association for Computational Linguistics: ACL 2023},
  year = {2023},
  doi = {10.18653/v1/2023.findings-acl.876},
  url = {https://doi.org/10.18653/v1/2023.findings-acl.876}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/berend-2023-masked-latent-semantic-modeling-efficient/