Enhancing Natural Language Representation with Large-Scale Out-of-Domain Commonsense
Paper · 2022 · Wanyun Cui and Xingran Chen
Summary
Understanding a sentence can depend on events it leaves unstated. If Jim comforted Kevin, for example, something that happened to Kevin may explain the comforting. Yet when the reason is left blank, BERT proposes similar completions whether the sentence names Jim or Kevin as the person in distress. Cui and Chen study whether a system can make better use of such distinctions when it receives relevant commonsense statements alongside the sentence. They draw those statements from ATOMIC2020, a collection of everyday event descriptions and their possible causes and consequences. The collection gives them a broad source of knowledge, but its recurring sentence patterns and focus on event relations make it quite different from the texts the system is asked to understand.
The authors’ method, OK-Transformer, retrieves descriptions that match pieces of the input and encodes each description as a sequence of words. A special knowledge token in the input provides a place to gather evidence from these descriptions. Its state guides attention over the candidate set, and the resulting information enters the representation through the same token. Ordinary words can then attend to that token as the representation develops. This design lets the system handle a variable number of candidates, including a null option for inputs with little relevant evidence. The authors initialize the text and description encoders from existing pretrained weights and learn the connections between them during fine-tuning.
The adapted systems generally improve on their corresponding baselines across commonsense reasoning and the development sets of the general text tasks studied. With WinoGrande preparation, the RoBERTa system goes from 90.1 to 91.6 accuracy on WSC273 and from 87.5 to 91.7 on PDP. On the GLUE development split, BERT’s RTE score rises from 71.43 to 73.65, while its CoLA score falls from 59.50 to 58.29. The comparison with continued pretraining directly on ATOMIC2020 favors supplying the descriptions as inputs under the tested conditions. An SST-2 experiment also finds gains when training uses very few labeled examples and evaluation is restricted to examples whose retrieved knowledge overlaps with that training set.
The analysis gives some indication of why the separate knowledge token helps. Among the integration methods that converged in the reported comparison, OK-Transformer changes selected pretrained weight matrices less during fine-tuning. The authors also remove descriptions individually and measure how much the predictions move. Some influential statements make sense as evidence to a reader, but the case studies show only limited agreement between what moves the system’s prediction and what a person would regard as a good explanation.
Deep dive: Enhancing Natural Language Representation with Large-Scale Out-of-Domain Commonsense
OK-Transformer uses retrieved commonsense statements to enrich text representations without another round of large-scale pretraining. · about 34 minutes to read
The problem and its context
The knowledge a sentence leaves implicit
The paper begins with an example about comforting because the words in the sentence provide an incomplete account of the event. A reader can connect the act of comforting someone to a possible cause involving the person who receives the comfort. The missing information is an ordinary expectation about situations, and it can apply across many sentences that name different people or describe the situation in different language. A system that responds mainly to what commonly follows particular phrases can produce a plausible word without resolving which person that word should describe.
The authors illustrate the difference with masked-word prediction. In this task, an input contains a position whose original content is hidden. The system proposes words that could occupy that position. In the comforting example, the paper reports similar proposals involving illness, distress or dying for versions in which different people are named before the blank. The proposed words are understandable in the vicinity of comforted. Their recurrence across the versions motivates a different question about understanding. Can the system connect a plausible reason for an event to the person whose circumstances would make it plausible?
The example sets up the authors’ concern with knowledge that occurs infrequently in training text. Broad pretraining gives a system many opportunities to learn how language is used. Still, a relationship can be useful for understanding a sentence while being stated explicitly in relatively few of the sentences a system encounters. The authors interpret the comforting example through that possibility. They propose giving the system external descriptions that express these relationships directly, then asking whether those descriptions improve how it handles the original input.
Their source is ATOMIC2020. The descriptions used in the paper express if–then knowledge about events. A description can connect an action to a reason, a consequence, a prerequisite or a judgment about someone involved. Such expressions can carry information in their wording. If a description concerns what somebody wants to do following a promise, its usefulness depends on the event, the relation and which participant the consequence concerns. Encoding the full description gives the system access to these distinctions when it constructs a representation.
Where the mismatch comes from
The authors identify differences in both form and subject matter between the external descriptions and the downstream tasks. In form, the knowledge descriptions use recurring verbal patterns to make a relation explicit. A sentence supplied to a classification or reasoning task can take a much wider range of forms. The wording used to mark a consequence in the knowledge collection may never appear in a sentence whose interpretation depends on that consequence. An input may also consist of a pair of sentences, where the relation to be predicted is between the sentences as a whole.
The other difference concerns what the data is about. ATOMIC2020 concentrates on connections among events. A downstream task can ask for a decision about sentiment, grammatical acceptability or the relationship between sentences. Those decisions may draw on ordinary event knowledge, depending on the example. They also depend on signals that the knowledge collection was assembled for a different purpose than to exemplify. The authors refer to these differences in distribution as domain discrepancy.
This matters because one route to adding textual knowledge is to continue pretraining on a corpus that contains it. The system’s learned parameters change as it trains on the new text. The approach is attractive when the new corpus resembles the data the system will eventually handle. The paper cites work on domain and task adaptation and on fine-tuning BERT for text classification in its account of that practice. Cui and Chen take the similarity between the additional corpus and the target task as important to whether the practice will help.
For an event-centered knowledge source, the authors are concerned about catastrophic forgetting. In their argument, training on the new corpus can damage capabilities that were useful on the target task. The issue is especially consequential when the knowledge is supposed to support many downstream tasks. Preparing a system on a narrow type of sentence may alter a general text representation in ways that affect every input. An explicit source of evidence offers a different point of entry. The system can encounter a distinct set of statements for each example, and the downstream objective can teach it when using those statements helps.
Earlier ways of providing knowledge
In the usual setup described by the authors, a text encoder receives the target text and the task trains a predictor on the resulting representation. Extra information can also be supplied directly. The closest precedent in the paper is ExpBERT, which accepts additional text in the form of manually designed explanations. Those explanations are embedded and their representations concatenated. The number of explanations is fixed, making the approach a natural fit for a small collection of templates prepared in advance.
A knowledge base used across tasks changes the nature of that input. A passage may match many descriptions, or it may match very few. A string of words can retrieve statements about an event even when those statements offer little help with the label at issue. A fixed collection arranged by a designer has already had some relevance decisions made for it. In this setting, the retrieval stage produces a pool that still needs to be interpreted. The authors therefore treat the ability to handle a variable collection and the ability to distinguish its useful contents as parts of the same design problem.
The paper also distinguishes structured knowledge from plain-text and semi-structured sources. In its account of structured knowledge, an entry can be represented as an individual embedding, a vector associated with that entry. The authors cite Knowledge Enhanced Contextual Word Representations in this group. A vector produced by reading a complete commonsense description, by comparison, can reflect how its words work together. Two statements about the same event can convey different information because one describes what happened beforehand and the other refers to a consequence. The OK-Transformer design gives the sequence of words a direct role in forming the vectors that the system compares.
REALM appears in the paper’s discussion of methods involving plain text. The authors also borrow from it the idea of including a null candidate. Their aim is to handle the particular combination presented by ATOMIC2020. Its descriptions come in recurrent relational forms, can be read as sentences, and often need to be considered alongside a target text written for another purpose. A suitable representation has to preserve information within each description, compare descriptions against the input, and carry the selected evidence into an ordinary text-understanding task.
The method, step by step
From the target text to a pool of candidates
The task begins with an input text and, during training, a label. The input may be an individual sentence or a pair of sentences, depending on what the task asks the system to judge. In ordinary supervised classification, the label tells the system what decision it should learn to make from the text. In the authors’ setup, each input is accompanied by candidate descriptions retrieved from the knowledge base. The label still concerns the original task. A sentiment example, for example, provides supervision about its sentiment. There is no separate requirement in the training objective for a human to identify which retrieved statement supports that label.
To gather candidates, the authors examine word segments of the input with a window size of 5. They collect the ATOMIC2020 descriptions that match any of those segments. The descriptions used for retrieval cover 173k distinct verb phrases. This provides a way to connect sentences from varied tasks to statements about familiar actions. The retrieval rule uses the words that appear in the input. Judging whether a match supplies useful information is work for the architecture that follows.
It helps to consider what a match can yield. A sentence that mentions a promise can bring in descriptions of possible motives and prerequisites, as well as predictions of what the person making the promise may do next. Any of them could share the triggering phrase. The fact that they are retrieved together says very little about which one bears on the decision. For a question about who subsequently carried out an action, a statement about fulfilling the promise has a different bearing from a statement about what conversation came beforehand. The knowledge pool gives the system access to both kinds of information.
The authors also insert a null commonsense candidate for every input. They denote it by c₀. This gives the attention mechanism an option associated with a lack of useful external evidence. It matters for inputs where retrieval yields few matches, and also for inputs that happen to match many statements without finding a good explanation for the decision. A large candidate pool and a strong reason to draw on it are separate properties of an example.
The way supervision enters the procedure can be expressed by the paper’s training objective.
arg min over θ E₍ₓ,ᵧ₎∈train [ℒ(f(x, cs(x) | θ), y)]
Here x is the input text and y is its reference label. The pair (x, y) belongs to train, the training data, as indicated by ∈. The candidate set for the input is cs(x). In the paper’s notation, its ordinary candidate descriptions are c₁ through cₙ, where n counts the candidates and an indexed c denotes an individual description. The function f produces a prediction using the text, the candidate set and the parameters θ. The vertical bar marks that the function is parameterized by θ. The loss ℒ evaluates the prediction against y. The expectation E averages that loss over the training examples, and arg min over θ asks for the parameter values that minimize the resulting objective.
This formulation places the task loss at the end of the sequence of operations. The architecture learns how to use the retrieved information to make its prediction. The retrieval procedure supplies the candidate pool by matching input segments. Text may carry enough evidence by itself, so the task objective also allows the network to learn decisions that depend little on the supplementary input.
How information travels between the encoders
The system is built from the Transformer and attention architecture. In attention, a query is a representation used to determine what information a position seeks. A set of keys provides representations against which the query is compared, while the paired values carry the information that can be collected. The comparison determines how much the values contribute to the output. Multi-head attention performs several such operations in parallel, giving the system several ways to relate a query to the same collection of inputs.
OK-Transformer uses this machinery in distinct roles. The target-text Transformer represents the input text and a special knowledge token. A separate Transformer reads the text of each candidate commonsense description. An integration Transformer uses the state of the knowledge token to query the descriptions. It sends a combined vector back to the target-text stream. The paper groups the target-text stream under knowledge enhancement and the description encoder and integration attention under knowledge integration.
The distinction between two kinds of attention is central to following the architecture. Within the target sequence, ordinary positions and the knowledge position participate in self-attention. They are all part of the same sequence, so their representations can reflect one another. In the integration operation, the query comes from the target-side knowledge state and the keys and values come from another collection, the encoded candidate descriptions. That operation is cross-attention in the sense that it connects distinct sequences of representations. The destination for the combined information is the single knowledge position in the target sequence.
How OK-Transformer brings retrieved commonsense into text representations
The steps in order.
The dedicated position gives the architecture somewhere to put newly retrieved information while retaining the ordinary text positions. Each textual description has already been encoded before it contributes through this route. The target stream therefore receives a vector assembled from description representations rather than a sequence made by extending the source sentence with all the retrieved words. The interaction can recur as the text representation develops. Different layer queries can draw differently on the same candidate pool, and the candidate representations available at those layers can also differ.
What changes in a target-text layer
The paper first describes the target stream with the special token [k] placed before the input word pieces. Subword tokenization represents the input as a sequence of pieces that may be smaller than whole words. The architecture assigns a vector to each position. The vectors after a layer are hidden states, meaning intermediate representations on the way to the system’s output. The special token has a hidden state of the same width as the per-position text states. Its position and update rule distinguish it from the ordinary text.
At the start of a target layer, the knowledge state from the preceding layer is put into a sequence with the preceding text states. This sequence is the source of the queries, keys and values for self-attention. An additive connection then carries the preceding states forward alongside the attention output. This is a residual connection. Layer normalization acts on the result, giving the authors an intermediate knowledge state and intermediate text states.
k′ᵢ, H′ᵢ = LayerNorm([kᵢ₋₁, Hᵢ₋₁] + MultiHeadAttn([kᵢ₋₁, Hᵢ₋₁], [kᵢ₋₁, Hᵢ₋₁], [kᵢ₋₁, Hᵢ₋₁]))
The index i denotes the current layer, and i−1 denotes the preceding one. The vector kᵢ₋₁ is the preceding knowledge state, and Hᵢ₋₁ is the matrix of preceding text states. Brackets put the knowledge vector and the rows of the text matrix into a single sequence, with the knowledge vector at the front in this abstract description. MultiHeadAttn takes a query sequence, a key sequence and a value sequence in that order. The shared input for all its arguments makes this self-attention. The plus sign denotes addition of the attention output to the incoming sequence. LayerNorm is the layer normalization operation. The prime marks the intermediate outputs k′ᵢ and H′ᵢ, where k′ᵢ is for the knowledge position and H′ᵢ contains the text positions.
If d is the hidden width and n the number of input text pieces in this part of the paper, each row has d components and the text-state matrix has n rows. The bracketed sequence has an additional row for the knowledge state. The paper also uses n when counting the retrieved descriptions. These are local uses of the same letter. A long word-piece sequence and a large candidate set describe different dimensions of the computation.
The layer then passes the intermediate states through a feed-forward network, which the paper calls an MLP, or multilayer perceptron. For ordinary text states, the update follows the usual residual and normalization pattern. The knowledge state follows a related update that also receives the vector assembled from the retrieved descriptions.
kᵢ = LayerNorm(k′ᵢ + MLP(k′ᵢ) + csₑₘᵦ)
The output kᵢ is the knowledge state after layer i. The input k′ᵢ is the intermediate knowledge state from self-attention and normalization. MLP transforms that intermediate state. The symbol csₑₘᵦ denotes the integrated commonsense vector supplied at that layer. The plus signs add the intermediate state, its transformed version and the external vector, and LayerNorm normalizes the combined result.
Hᵢ = LayerNorm(H′ᵢ + MLP(H′ᵢ))
The output Hᵢ collects the text states after layer i. Its intermediate input is H′ᵢ. The function MLP supplies the feed-forward transformation of those states, the plus sign adds the intermediate states back, and LayerNorm normalizes the result. The ordinary positions interact with the incoming knowledge state during the layer’s self-attention. The fresh external vector enters through the knowledge state at the subsequent update. It can influence the ordinary positions through their interaction with the updated state in following layers.
How each description is encoded and compared
The description encoder processes every candidate separately. Its purpose is to make the description available in a form that reflects its wording and can serve as one member of a set of evidence. A single candidate may contain language about several participants, the order of events, or the relation between an action and what follows. The Transformer can represent the words in relation to one another before the system makes any decision about how much the statement should contribute to the target input.
embⱼ = Transformer⁽²⁾(cⱼ)
The index j picks a candidate. The input cⱼ is that candidate’s textual description, and embⱼ is its vector representation. The superscript label (2) identifies the description-encoding Transformer in the authors’ architecture. Parentheses after that Transformer denote applying it to the description. In the BERT adaptation, the vector for a particular layer is taken from the candidate’s classification token at that layer.
For integration, the system presents the encoded candidates together as keys and values. The previous knowledge state on the target side is the query. A candidate’s contribution can therefore depend on how its representation relates to the current query, with multiple heads able to capture different ways of relating them. The resulting attention output is added to the previous knowledge state and normalized to yield the vector that will enter the target layer.
csₑₘᵦ = LayerNorm(kᵢ₋₁ + MultiHeadAttn(kᵢ₋₁, emb, emb))
In this expression csₑₘᵦ is the integrated vector for the current target layer, and kᵢ₋₁ is the target knowledge state carried into that layer from the preceding one. The symbol emb denotes the collection of candidate vectors, each of the form embⱼ. In MultiHeadAttn, the first argument is the query, the second is the collection of keys, and the third is the collection of values. The plus sign adds the attention output to kᵢ₋₁ in a residual connection. LayerNorm normalizes that result. The query in this equation is the preceding layer’s knowledge state. The intermediate state denoted by k′ᵢ belongs to the target layer’s own self-attention equation.
The authors describe this operation as selecting relevant knowledge. The equation implements a weighted integration of candidate representations. It can give some candidates greater influence and distribute weight among several when their information is complementary. There is no prescribed step in the equation that returns a statement as the explanation for a decision. The null candidate is available within the candidate pool, so it can also receive weight. This gives the architecture a way to express the possibility that the retrieved evidence has little to add.
Adapting the architecture to pretrained encoders
The paper uses BERT to explain the adaptation. OK-BERT contains independent copies that the authors call BERT1 and BERT2. Both start from BERT’s pretrained parameters. BERT1 handles the target text and BERT2 handles the commonsense descriptions. The independence matters because fine-tuning can change each stream to suit its own role. One stream represents the examples on which the task makes decisions, and the other reads short statements retrieved from a different domain.
In BERT1 the knowledge token is inserted immediately after [CLS], the position used to obtain a representation for classification. This is the concrete BERT arrangement of the abstract update. For a single sentence, [SEP] follows the sentence’s word pieces. For a sentence pair, [SEP] marks the separation between the sentences and the end of the pair. Both input forms get the additional [k] position next to [CLS]. The text can thus retain its standard classification position while adding a dedicated place for knowledge.
BERT2 retains the ordinary Transformer structure. Its candidate representation is the hidden state of [CLS] in the corresponding layer. The choice of corresponding layer is important. The paper’s architecture does not produce solely a final vector for the description and supply that same finished vector everywhere. At each connection, the target-side layer receives integrated information constructed from the description representations at that depth. As the encoders progress, the description vectors and the query state develop together.
An integration layer connects each corresponding pair of encoder layers. In the BERT-base adaptation, the target encoder has 12 layers and the description encoder has 12 layers, with 12 integration layers connecting them. These are layer counts for this adaptation. The integration layers start with random parameters. The paper’s initialization claim applies to the two encoder copies, whose pretrained weights can be carried into the design directly. The downstream training then updates all the parameters end to end.
The authors also apply the design to RoBERTa to obtain OK-RoBERTa. Their experiments use BERT-base and RoBERTa-large from the Hugging Face Transformers library. The paper distinguishes reusing those pretrained weights from undertaking a new large-scale unsupervised training run to make the architecture usable. It also describes task-specific preparation for some reasoning comparisons. These stages serve different purposes. Initializing the encoders supplies their general text representations. Preparation on reasoning data follows the baseline protocols. Fine-tuning allows the task loss to shape the text encoder, description encoder and new connections together. The authors release an implementation under the OK-Transformer name.
Experiments and results
Reasoning tasks and their comparison protocols
The authors test the architecture in commonsense reasoning, general text classification and a restricted training setting for infrequent commonsense descriptions. They report conducting the experiments on 4 Nvidia Tesla V100 GPUs. The reasoning evaluation includes benchmarks concerned with identifying what a pronoun refers to, as well as tasks in which a system chooses answers that depend on ordinary knowledge. This breadth gives the architecture several kinds of decisions to support, while the comparisons within an encoder family show what happens when the knowledge mechanism is added to that particular setup.
The reference-resolution benchmarks include WSC273 and PDP. A case presents a sentence in which several people or things can be considered as the referent, and understanding the event can determine which one fits. This is a form of coreference resolution because it asks which expressions refer to the same entity. The authors also use Winogender and WinoGrande. Their other benchmarks are CommonsenseQA and PhysicalQA. The inclusion of these tasks lets the authors examine commonsense question answering as well as decisions about the referents of pronouns.
For disambiguation, the authors follow different earlier protocols for BERT and RoBERTa. With OK-BERT they use a masked language modeling formulation, where the task is expressed through a blank and handled by the system’s masked prediction machinery. With OK-RoBERTa they turn the cloze problem into multiple-choice classification. For each possible referent, they make a version of the sentence with that referent in place of the pronoun. They score each completed version using a linear prediction layer on its [CLS] representation. A softmax turns those scores into probabilities across the choices. The version with the highest probability determines the selected referent.
The reasoning setup reports preparatory training for 30 epochs over WSCR in the BERT protocol and 3 epochs over WinoGrande in the RoBERTa protocol, followed by task-specific fine-tuning. An epoch is a pass through the training data. The authors specify AdamW as the optimizer, which determines how to update the parameters in response to the loss. They use a learning rate of 5e-6, selected from the reported candidates 2e − 5, 1e − 5 and 5e − 6, and a batch size of 8. The batch size is the number of examples grouped for an update. These details matter because the matched comparison concerns the addition of the OK architecture within a protocol. The BERT and RoBERTa rows also differ in their backbone sizes, preparatory data and way of formulating disambiguation.
Reference resolution and commonsense questions
On the WSC273 and PDP benchmarks, the version with external descriptions improves over the corresponding original encoder in each matched comparison. On WSC273, BERT prepared on WSCR has an accuracy of 66.3 and OK-BERT prepared on WSCR reaches 67.4. The RoBERTa pair prepared on WinoGrande has accuracies of 90.1 and 91.6 on WSC273. These figures come from the paper’s main reasoning table. The comparison of knowledge introduction methods later gives WSC273 accuracies with a different displayed precision.
Accuracy on the PDP commonsense reasoning benchmark
The knowledge-enhanced version improves on its matching baseline in both encoder families.
The numbers
| System or setting | accuracy % |
|---|---|
| BERT with WSCR preparation | 85.0 |
| OK-BERT with WSCR preparation | 86.7 |
| RoBERTa with WinoGrande preparation | 87.5 |
| OK-RoBERTa with WinoGrande preparation (this paper) | 91.7 |
The reasoning table also includes earlier systems and a human comparison. This puts the matched gains in perspective. On the WSC benchmark, HNN has an accuracy of 75.1 and the human row gives 96.5. On PDP the same rows give 90.0 and 92.5. OK-BERT improves on the BERT run that uses the same preparatory data while earlier systems can still have stronger absolute results. OK-RoBERTa has the highest system accuracy in the reported comparison on these benchmarks, with the human figures providing a higher reference point in each case.
On Winogender, BERT with WSCR preparation scores 68.2 accuracy and the corresponding OK-BERT scores 72.4. The RoBERTa accuracy with WinoGrande preparation is 94.6, and OK-RoBERTa reaches 96.2. The table also includes a WikiCREM row with 82.1 on Winogender. On WinoGrande, the BERT pair moves from 51.4 to 53.4 accuracy, and the RoBERTa pair moves from 79.3 to 79.6. A prior WinoGrande result listed alongside these comparisons is 79.3 on that benchmark. The gain from adding descriptions is visible in both encoder families, with quite different sizes across benchmarks and starting points.
The other question-answering tasks give additional within-family comparisons. On PhysicalQA, the reported accuracy for BERT is 68.71, and OK-BERT records 69.09. RoBERTa has 79.76, and its knowledge-enhanced counterpart has 80.09. These are relatively close scores within each pair. The direction agrees with the CommonsenseQA comparison, where the RoBERTa pair shows more separation.
Accuracy on the CommonsenseQA benchmark
Each encoder family scores higher with the knowledge integration architecture.
The numbers
| System or setting | accuracy % |
|---|---|
| BERT | 55.86 |
| OK-BERT | 56.27 |
| RoBERTa | 73.55 |
| OK-RoBERTa (this paper) | 75.92 |
These paired results support the limited claim that the architecture is compatible with both encoders and can improve their downstream accuracy. The levels achieved by different families are informative for choosing a system in the paper’s setup. The evidence about the effect of OK-Transformer comes most directly from comparisons within each family, where the starting encoder and preparation protocol are held in common.
General classification and sentence comparison
The general text evaluation uses the GLUE development splits. The selected tasks cover several kinds of output. CoLA asks for a judgment about sentence acceptability, and SST-2 concerns sentiment. MRPC involves recognizing paraphrases, while STS-B measures how similar sentences are in meaning. RTE and QNLI ask for decisions based on the relationship between texts. The authors use this collection to examine whether an event-centered knowledge source can contribute beyond benchmarks that explicitly call for everyday reasoning.
The paper’s table gives paired scores for MRPC and STS-B and single scores for the other tasks. It presents the paired values in a fixed order without naming their component metrics in the table. Keeping that order preserves the reported comparison. For MRPC, the BERT development scores are 86.27/90.21 and the OK-BERT scores are 87.25/90.84. For the RoBERTa pair, the corresponding values are 90.44/93.15 and 91.91/94.24. Each reported component rises in each pair. On STS-B the BERT-family development scores are 89.35/88.93 and 89.82/89.46, while the RoBERTa-family scores are 91.83/91.95 and 92.41/92.20. Both components again rise for the knowledge-enhanced version in each family.
For RTE, the reported development score goes from 71.43 with BERT to 73.65 with OK-BERT, and from 84.11 with RoBERTa to 86.28 with OK-RoBERTa. On QNLI, the BERT pair gives 91.20 and 91.58, while the RoBERTa pair gives 94.00 and 94.41. SST-2 shows improvements in both families as well. BERT and OK-BERT score 91.97 and 93.69 on that development split. RoBERTa and OK-RoBERTa score 95.70 and 96.10.
CoLA is the exception to the pattern of gains over the original encoder. On its development split, BERT scores 59.50 and OK-BERT records 58.29. The RoBERTa score is 66.57 and OK-RoBERTa reaches 66.89. The same task thus gives different directions for the two encoder families. That makes it useful when reading the broader claim of applicability. The same external source can support decisions beyond the reasoning benchmarks, but the measured effect depends on the task and encoder. The GLUE results concern the development split. The authors omit MNLI because representing the retrieved descriptions for its inputs was too costly in their setup.
How much text the retrieval stage brings in
The paper’s dataset statistics describe how frequently a target example retrieves a statement and how large the returned collections can be. The matched ratio is the proportion of examples with at least one match. The reported average candidate count describes how many statements the matching procedure supplies per sample, and the average description length describes the text being encoded. The statistics provide context for the attention mechanism and the computational cost. A task may have many unmatched examples while retrieval still creates a substantial collection of candidates for those texts that match.
On the WSC benchmark, the appendix lists 273 examples, a matched ratio of 67%, an average candidate count of 129.71 and an average description length of 17.88. For PDP, the corresponding dataset size is 60, the matched ratio is 83%, the average candidate count is 189.68 and the average description length is 17.91. Winogender has 720 examples in the statistics, of which 65% match, with an average candidate count of 80.63 and an average description length of 16.83. For WinoGrande, the reported sizes are 40938/1267, with 71% matching, an average candidate count of 140.56 and an average description length of 17.91.
The general tasks also vary in how frequently a match occurs. RTE has a matched ratio of 72% and an average candidate count of 122.60. On QNLI the reported matched ratio is 52% and the average candidate count is 81.35. On CoLA, 40% of examples match and the reported average count is 84.85. SST-2 has a matched ratio of 25% and an average count of 83.07. These are retrieval statistics for the listed datasets. The GLUE prediction scores reported separately are from their development splits.
The statistics support two distinct observations about the design. First, the matching vocabulary reaches examples in several evaluation settings even though the knowledge statements have a different format and subject focus from the tasks. Second, returning a match is a much weaker condition than finding evidence useful for a prediction. A candidate pool averaging many short descriptions can contain statements that are redundant, tangential or useful for different questions. Individual descriptions are short, which helps explain why encoding one is manageable. The accumulated work of encoding the pool is what makes the omitted large task consequential.
Learning from infrequent descriptions
The authors also ask whether the system can benefit from descriptions with few opportunities to influence training. ATOMIC2020 is large enough that many entries appear infrequently among the retrieved candidates in a downstream training set. A benefit limited to repeatedly encountered statements would leave much of that source of knowledge hard to use. The authors connect this question to their decision to encode descriptions as sequences. If the contents of a description help the system use it, it may still be useful when the task supplies relatively few examples that retrieve it.
The experiment uses SST-2 and restricts the number of training samples to k = 8/16/32/64, where k denotes the size of the selected training subset. The evaluation is filtered too. It takes examples from the test set whose candidate commonsense includes knowledge that already occurred in the training sample. For the condition with 8 training examples, the authors randomly select those examples and evaluate on test examples that retrieve commonsense found with that selection. Training data is scarce, but there is an overlap between the external information encountered in training and evaluation.
The plot reports a benefit from the commonsense-enhanced systems under these low-resource conditions. The paper gives the result as curves across the training-set sizes. The finding pertains to the filtered evaluation instead of an unrestricted SST-2 test population. It shows that the signal can still help in a setting where the training set is small and the knowledge has limited opportunity to recur. It leaves open how well the systems would use descriptions first encountered at evaluation or how a benefit would be distributed across the full test set.
What the ablations show
Supplying the same source through different routes
The comparison with the unmodified BERT and RoBERTa systems measures the combined effect of adding retrieval and the architecture that handles it. The authors also compare ways of supplying ATOMIC2020 to the downstream system. This helps address whether gains follow simply from exposing the system to additional text, or whether the format and point of entry of that text matter. Their alternatives include continued pretraining on the knowledge corpus and explicit input through an ExpBERT-style arrangement.
For continued pretraining, the authors take the original encoder, train it on ATOMIC2020, then fine-tune it for the target task. The appendix specifies one epoch for continued pretraining, with a learning rate of 1e − 5 and a batch size of 64. For the general classification experiments and comparisons of knowledge introduction methods, the fine-tuning schedule uses 10 epochs. The authors choose learning rates from 1e − 5, 2e − 5 and 5e − 5. The batch size grid allows 8, 16, 32 or 64 examples. These choices define the comparison underlying the paper’s claim about domain discrepancy.
The continued-pretraining scores are frequently below the corresponding scores of the original encoders. On the RTE development split, BERT-continue scores 62.09 and RoBERTa-continue scores 74.01. The original encoders score 71.43 and 84.11, respectively, and the OK versions score 73.65 and 86.28. This is an example where treating the knowledge base as a corpus and treating it as input evidence give different outcomes on the same task and encoder family. The RTE comparison shows the clearest separation among the alternatives in this part of the general evaluation.
WSC273 shows the same direction in the comparison table. It reports 66.30 accuracy for BERT, 63.00 for BERT-continue and 67.40 for OK-BERT. The RoBERTa entries are 90.10 for the original system, 87.91 after continued pretraining and 91.58 for OK-RoBERTa. These are the figures at the precision given in the table of knowledge introduction methods. A qualification comes from the SST-2 development split. RoBERTa-continue scores 95.99, higher than the original RoBERTa score of 95.70. OK-RoBERTa reaches 96.10. The general pattern supports the authors’ concern about degradation under the tested adaptation schedule, while the sentiment result shows that the direction of change depends on the task.
For the ExpBERT comparison, the authors feed the same kind of retrieved candidates into a system that concatenates a fixed number of description representations. They set the number to 48. When a sample has more matches than slots, they randomly select 48. When there are too few, they pad the collection with null commonsense. They also run this approach with the RoBERTa encoder, calling it ExpRoBERTa. The fixed-size procedure gives the baseline workable inputs, while limiting its ability to accommodate the full candidate collection and giving random sub-sampling a role in which evidence reaches the system.
Knowledge introduction methods on the GLUE RTE development split
Layer-wise commonsense integration gives the strongest reported score within each encoder family.
The numbers
| System or setting | reported RTE score |
|---|---|
| BERT | 71.43 |
| BERT-continue | 62.09 |
| ExpBERT | 62.82 |
| OK-BERT | 73.65 |
| RoBERTa | 84.11 |
| RoBERTa-continue | 74.01 |
| ExpRoBERTa | 83.39 |
| OK-RoBERTa (this paper) | 86.28 |
Across the comparison, the OK versions typically score higher than the corresponding concatenation versions. On the QNLI development split, ExpBERT scores 87.06 against OK-BERT’s 91.58, and ExpRoBERTa scores 93.78 against OK-RoBERTa’s 94.41. The CoLA development scores show that this advantage is task-dependent. ExpBERT and OK-BERT both record 58.29. ExpRoBERTa scores 66.90 and OK-RoBERTa scores 66.89. The paper leaves the ExpBERT-style entries for WSC273 unreported because the approach as used there does not handle the cloze formulation. As a consequence, the fixed-input comparison is grounded in the classification tasks.
Taken together, these experiments favor an architecture that can weight an input-dependent candidate collection over the tested fixed-slot implementation. They also show a disadvantage to continuing pretraining on this particular knowledge corpus under the chosen schedule. The design comparison changes several things at once. The OK architecture differs in the number of candidates it can use, the way it weighs them and the point at which the resulting representation enters the target encoder. The results establish a preference between the tested systems, while leaving the individual contribution of each of those changes unresolved.
The role of a dedicated knowledge position
The authors examine the idea that an effective adaptation should preserve much of the useful pretrained representation. They are motivated by earlier work observing that parameters after fine-tuning can stay near their starting values. Their question is whether different arrangements for adding knowledge lead to different amounts of movement in the starting encoder’s parameters. A design that lets the original representation carry on much of its existing work may be easier to adapt to a new source of evidence.
They compare OK-Transformer with KnowBERT and with variants that remove the dedicated knowledge position. In one variant, the original classification token takes on the role of the query and destination for knowledge. This asks the same position to represent the input for classification and to be the site at which retrieved information is added. In another variant, the system computes an integrated vector separately for each verb phrase and adds that vector to the hidden states for the phrase. That alternative makes the transfer local to the text spans that retrieve statements.
To quantify parameter movement, the authors use L1 distance. In this setting it measures the total magnitude of coordinate-wise changes between a starting weight matrix and its trained counterpart, taking the absolute size of each change so that increases and decreases both contribute. The paper focuses on the matrix it denotes W I within the Transformer. It says this is where the main observed change occurs, following the pattern cited from earlier work. The distance figure compares that matrix across the 12 layers of the pretrained encoder. A separate SST-2 figure plots the training losses of the integration methods.
The reported distances for OK-Transformer are smaller than for KnowBERT and the phrase-level addition variant. The classification-token variant also has small changes, but its training loss fails to converge in the reported run. This matters for interpreting the distance. A method can stay close to its initial weights because it adapts effectively with modest changes, or because training fails to arrive at a useful solution. The loss curves give the parameter figure enough context to tell those outcomes apart in this comparison.
The findings are consistent with the authors’ explanation for the dedicated token. It supplies a location for new information and allows the existing classification position to stay available for its usual work. Smaller shifts in the selected matrices are an observation about how the successful training runs differ. They leave open whether the magnitude of the shifts itself explains the gain in prediction, and how other weights or hidden states change across these designs.
What happens when a candidate is removed
The paper investigates interpretability by measuring changes in prediction under candidate removal. For a given example, the system first makes a prediction with the full commonsense candidate set. The authors then remove one candidate at a time and measure the Euclidean distance between the resulting prediction and the full-set prediction. A larger distance means the output moved farther in prediction space. The approach is inspired by Perturbed Masking and gives a ranking based on the effect of intervening on the input.
One case from WSC273 concerns a promise that John makes to Bill and someone leaving later. The reference displayed in the case study is John. Among the descriptions that most affect the prediction is the idea that a person who makes a promise wants to carry it out. That connects the promise to a later action in a way that a reader could recognize as relevant to the reference decision. Other influential descriptions concern how trustworthy a promise-maker appears or what the person had to do before making the promise. These are plausible associations with promising, but their bearing on who left is less direct.
The authors find some human-readable connections in these rankings and judge the overall interpretability to be limited. Their proposed explanation is that pretraining may already supply some of the knowledge a reader would use. Accordingly, the additional description that most changes the system’s output may address a different gap. Candidate removal identifies sensitivity to a description within a particular pool. The distance measures the magnitude of the change, leaving its direction and its relationship to correctness to be examined separately. A high rank therefore gives a starting point for inspecting the decision instead of a complete account of how it was reached.
Limitations
Limits identified by the authors
Computational cost constrains the range of tasks the paper evaluates. The architecture reads the candidates associated with each input and preserves layer-specific candidate representations for integration. The authors leave MNLI out of their general classification experiments because this procedure was too expensive for that task. They suggest compression as a possible way to address the problem and leave it outside their study. The short average length of individual statements helps with a single description, while the total workload depends on how many descriptions are read for all of the inputs in a task.
The authors also describe their interpretability findings as limited. The removal examples sometimes surface a statement that naturally belongs in a human explanation. Other high-influence statements are less directly related to the reasoning a reader would offer. The paper’s observation is about these case studies. Its interpretation, that pretrained knowledge may make the useful additional information differ from what a person would articulate, remains a proposed explanation.
The low-resource setup has an explicit restriction. It evaluates examples whose commonsense candidates overlap with knowledge present in the chosen training subset. That is a way to ask whether rarely encountered descriptions can still help while controlling one source of variation. A stricter question, about using wholly new descriptions at evaluation, falls outside that setup. So does estimating performance over the full SST-2 test population after training on the small subsets. The authors’ finding concerns limited exposure to shared knowledge under the chosen filtering rule.
Limits visible in the comparisons
The evidence for domain discrepancy is tied to retraining on ATOMIC2020. The original and continued versions are compared after the authors’ chosen adaptation schedule and downstream fine-tuning. Lower target scores in many of those comparisons demonstrate deterioration under that procedure. The experiments leave open how much of the deterioration arises from the language patterns of the knowledge collection, from its event-focused content or from the training schedule. The continued-pretraining improvement for RoBERTa on SST-2 also establishes that a decline is not a universal outcome across the reported tasks.
The stronger claim of catastrophic forgetting calls for care. The comparison measures downstream decisions after fine-tuning. It can show that the extra pretraining stage leads to a worse downstream result under the matched setup. It provides less detail about exactly which capabilities were retained or lost, or how the intermediate system represented the new corpus before seeing any task labels. Identifying a loss of particular previously learned information would require evidence about those capabilities themselves. The paper instead uses the target scores as its empirical evidence for the practical cost of the mismatch.
The results also leave retrieval quality and knowledge integration partly entangled. A matching segment identifies descriptions that share language with an input. A higher matched ratio means the retrieval stage finds something more often, and its statistics do not give the proportion of statements that actually support the task decision. A large candidate count could offer useful diversity or add many weakly related statements. The null option helps the architecture represent the availability of little relevant evidence. The experiments do not establish how often it is selected or how reliably its use aligns with human judgments of relevance.
Several design differences contribute to the comparisons with other explicit-input systems. The fixed-slot baseline randomly subsamples when retrieval exceeds its capacity, while the OK architecture integrates a variable candidate set. At the same time, their integration procedures and the placement of the resulting information differ. A stronger score for OK-Transformer under these conditions does not quantify the separate effects of more candidate coverage, learned weighting and layer-wise updates. The experiments with alternative knowledge positions address part of that question through training loss and parameter movement, leaving the full partition of the performance gain open.
The evaluation spans the selected reasoning benchmarks and a collection of GLUE development tasks. Within that range, the matched baselines support a claim of gains across several distinct problems. The reported scores alone give no estimate of variation across repeated training runs for the small changes. They also do not identify which examples benefited or how much the improvement depends on a good retrieval match. CoLA illustrates why those details matter. Its BERT comparison goes in the opposite direction from the pattern on the other development tasks, and its RoBERTa comparison with the fixed-slot baseline is nearly tied.
Finally, reusing pretrained weights addresses the cost of starting the architecture with useful representations. The deployed architecture still includes a separate description encoder and integration layers, and its training updates all of them. The paper establishes that a new round of large-scale unsupervised pretraining is unnecessary for the reported adaptation. The omitted MNLI experiment shows that the cost of reading candidates during downstream use is a separate constraint. The applicability demonstrated here is therefore best understood through the encoder sizes, retrieval procedure and tasks the authors actually tested.
What came after
No later work is documented here that establishes how other researchers adopted or extended OK-Transformer. The paper itself leaves questions about whether a less expensive description encoder could preserve the reported gains, whether the architecture can exploit descriptions that first appear at evaluation, and how the influence of a retrieved statement relates to the correctness of a prediction. Those remain open beyond the experiments reported by Cui and Chen.
Cite
Cite as Wanyun Cui and Xingran Chen. 2022. Enhancing Natural Language Representation with Large-Scale Out-of-Domain Commonsense. Findings of the Association for Computational Linguistics: ACL 2022.
@inproceedings{cui2022enhancing,
title = {{Enhancing Natural Language Representation with Large-Scale Out-of-Domain Commonsense}},
author = {Wanyun Cui and Xingran Chen},
booktitle = {Findings of the Association for Computational Linguistics: ACL 2022},
year = {2022},
doi = {10.18653/v1/2022.findings-acl.138},
url = {https://doi.org/10.18653/v1/2022.findings-acl.138}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/cui-2022-enhancing-natural-language-representation-large/