Elamur Research

Deriving Machine Attention from Human Rationales

Paper · 2018 · Yujia Bao, Shiyu Chang, Mo Yu et al.

Summary

A reviewer can praise a hotel’s service and complain about its location in the same paragraph. A system trained to judge the location has to learn which parts of the review bear on that judgment. When labeled examples are scarce, asking people to highlight the words that support each label gives the system more to learn from. In Deriving Machine Attention from Human Rationales, the authors ask how to turn those highlights into effective supervision for text classification.

A human rationale marks words as selected or unselected. Attention, in the classifier studied here, assigns a weight to each word’s contextual representation before combining those representations to make a prediction. The authors develop a method called R2A that learns to turn a rationale into a distribution of attention weights. They train this conversion on beer reviews, where abundant ratings allow classifiers to learn useful attention from the prediction task itself. Automatically selected rationales provide the corresponding highlights. To help the conversion carry over to hotel reviews, the authors align representations of beer and hotel text using hotel reviews without labels.

Once R2A has learned the conversion, it takes the human highlights on a small set of labeled target reviews and produces attention distributions for them. Those distributions guide the training of a new classifier alongside the ordinary labels. At test time, that classifier reads the review and produces its own attention. The human work goes into the training set, so an incoming review needs only its text.

In beer-to-hotel transfer, with 200 labeled training reviews and human rationales per hotel aspect, the method reaches test accuracies of 84.52% for location, 90.66% for cleanliness and 89.93% for service. The authors report an average error reduction of 15.08% over the best baseline in this setting. The method also improves classification when transferring between aspects of beer reviews. On the hotel training examples, its generated weights are closer than the original highlights to attention learned with extensive labeled hotel data. The experiments therefore connect two distinct observations: a learned conversion makes the supervision look more like the attention of a well-trained classifier, and a classifier trained with that supervision makes more accurate predictions in the settings tested.

Deep dive: Deriving Machine Attention from Human Rationales

Deriving Machine Attention from Human Rationales shows how highlights from readers help train text classifiers when labeled examples are scarce. · about 34 minutes to read

The problem and its context

A label gives the verdict, and a rationale points to the evidence

An aspect rating concerns a particular property of the item under review. For a hotel, the aspect can be location, cleanliness or service. The text remains the same regardless of which aspect the classifier is asked to judge. The passages worth emphasizing can change substantially. A remark about how long the reviewer waited for transport bears on location. Praise for a swimming pool can coexist with that complaint and contribute little to the location judgment. A single positive or negative label tells the classifier how the aspect was rated. It leaves the classifier to discover which parts of the review support the rating.

With enough labeled reviews, a classifier can learn these associations through repeated examples. Words about transport appear in many reviews, in different combinations and with different outcomes. The classifier can learn a representation of each word in context and give more weight to representations that help predict the aspect rating. With few reviews, it has fewer opportunities to separate a reliable cue from something that happens to accompany one. The paper studies whether richer annotations can make each scarce training example do more work.

The rationale annotations are selections from the text itself. An annotator can highlight a span that makes a rating understandable, including the words needed to read it as a coherent phrase. That span may contain the object being judged, a descriptive word and grammatical material that connects them. A selection gives all those words the same marked status. In the classifier’s attention calculation, the corresponding positions can receive quite different weights. Those weights apply to vectors that already encode information from neighboring words, so the unit being weighted carries more than the identity of the printed word.

This distinction creates room for a learned conversion. Consider a beer review that describes the drink’s appearance, smell, taste and texture in succession. A human rationale for aroma can identify the passage about smell. A classifier may then benefit from emphasizing the expressions that distinguish the character of the aroma, with smaller weights on positions whose representations contribute less to predicting the rating. The rationale narrows down the evidence. The distribution determines how strongly each contextual representation contributes to the combined review representation.

The authors give several reasons for treating these as different forms of information. Rationales are binary at the level of word positions. Their extent is also a matter of human judgment, and annotators can disagree about where a relevant passage begins or ends. Attention is learned inside a particular architecture. Its weights depend on the contextual representations available to that architecture and on how the resulting weighted representation is used for prediction. The connection matters for interpretability because a display of attention can look like a rationale even though the two arise from different procedures.

Earlier uses of attention and human highlights

In the work reviewed by the authors, attention had been used successfully in settings with substantial training data. Their examples include machine translation, abstractive summarization, document classification and open-domain question answering. In the translation work by Bahdanau and colleagues, learning how to align relevant portions of the input was part of learning to translate. The paper places this alongside other uses in which the task objective can train attention through the quality of the final predictions. Neural Machine Translation by Jointly Learning to Align and Translate

Researchers had also supplied attention with more direct guidance. The paper describes work that uses word alignments for translation, information about arguments for event detection and linguistic annotations for constituency parsing. Each example supplies a signal tied to what the task needs to identify. The event-detection example is especially close in form, because information about selected words guides attention. In the rationale setting, the selected text supports the example’s label and can be used across tasks that share this annotation format. Exploiting Argument Information to Improve Event Detection via Supervised Attention Mechanisms

Earlier rationale research used highlights to constrain a classifier’s behavior. In the linear classification work by Zaidan and colleagues, removing the rationale was expected to reduce confidence in the prediction. This creates a useful training comparison between the original input and a version with its stated evidence removed. A later convolutional approach used rationales to guide the contributions of sentences. It first learned to estimate whether sentences contained rationale words, then used those estimates when combining sentence representations. These precedents show different ways to turn a human highlight into a training signal. Neither procedure requires learning the word-level conversion that R2A investigates. Using Annotator Rationales to Improve Machine Learning for Text Categorization

The paper also describes two established routes to transfer. In one, a system learns an encoder on source tasks and adapts it to a target task through fine-tuning. In the other, several tasks help train a common encoder. Both routes transfer knowledge through the way text is represented. R2A uses a shared encoder and later reuses its parameters, but the particular object the authors want to transfer is a procedure for assigning weights given a text and a rationale. A new target task can supply its own evidence through the rationale even when none of the source tasks predicts that same label.

The authors relate this procedure to unsupervised domain adaptation. Earlier methods cited in the paper align feature representations from source and target data so that a classifier can better accommodate a change of domain. Here, the learned conversion needs comparable inputs when it moves from one kind of review to another. Unlabeled target reviews help establish that common representation. The eventual target classifier still needs a small labeled set, and the attention supervision comes from human highlights within that set. Whether the target is labeled therefore depends on which part of the procedure is being trained.

The method, step by step

From source reviews to a target classifier

The method begins with source tasks that have enough labeled reviews to train attention through prediction. Each source training example also needs a rationale. Marking a large source corpus by hand would defeat part of the purpose, so the authors use an existing rationale-selection method to produce these highlights automatically. The result is a pairing between discrete selections and attention distributions learned from the source prediction tasks. The pairing tells R2A what sort of weights it should learn to produce from a marked-up review. Rationalizing Neural Predictions

The source attention and the converter play different roles. Source attention is learned by asking whether a weighted representation predicts an observed label or rating. The converter learns by comparing its own weights with the source attention for the same example. It can see the rationale and the text representation, which lets it learn distinctions among selected words and respond to their surroundings. The source predictor and the other components learn jointly. The source attention is an intermediate result of that training procedure.

For a change of domain, the common encoder reads both source and unlabeled target text. The method trains it to represent words in context and adds a transformation whose outputs are encouraged to have similar distributions across the domains. That transformation provides the representations the converter sees. This is how target text can influence the conversion during its training even though target ratings and target rationales are reserved for a later stage.

The trained converter is then applied to the labeled target training examples, using their human rationales to produce attention distributions. A separate target classifier learns from the labels and the generated weights. It starts with the encoder learned in the earlier stage, and its own attention mechanism learns to weight text using the text alone. That last distinction makes the procedure usable for reviews that arrive without annotations. The converter helps prepare training supervision, while the trained classifier handles prediction.

Learning attention supervision from human rationales

The steps in order.

Learning attention supervision from human rationalesStep 1: Generate source rationales automatically1. Generate source rationales automaticallyStep 2: Learn source attention through rating prediction2. Learn source attention through rating predictionStep 3: Align features using source and unlabeled target text3. Align features using source and unlabeled target textStep 4: Learn to predict attention from rationale features4. Learn to predict attention from rationale featuresStep 5: Convert human target rationales into attention weights5. Convert human target rationales into attention weightsStep 6: Train the target classifier with weights and labels6. Train the target classifier with weights and labelsStep 7: Classify new target reviews from text alone7. Classify new target reviews from text alone

Learning the source attention

The paper considers a collection of source tasks and a target task. Each source task has labeled examples and automatically generated rationales. The cross-domain target has many reviews without labels and a small set with both labels and human rationales. An example’s text enters an encoder shared across the source tasks. The encoder is a bidirectional long short-term memory network, or LSTM. It processes the sequence in both directions so that a representation at a word position can reflect what came before and what came after.

hᵗ = enc(xᵗ)

Here t identifies a source task, xᵗ is the example’s input word sequence, and enc is the shared bidirectional encoder. The output hᵗ is the sequence of contextual vectors. Its entry hᵗᵢ is the vector at position i. The task index identifies the example’s task, while the same encoder parameters are used across those tasks.

Each task has its own attention module. A cleanliness predictor and a location predictor can share a way of encoding text while still learning different rules for which vectors to emphasize. Within a source task, the first attention operation projects each contextual vector and passes the result through a nonlinear function. The same task-specific projection is applied at every position.

h̃ᵗᵢ = tanh(Wₐₜₜᵗ hᵗᵢ + bₐₜₜᵗ)

Here h̃ᵗᵢ is the projected vector for position i in task t. The input hᵗᵢ comes from the shared encoder. The learnable matrix Wₐₜₜᵗ and bias vector bₐₜₜᵗ belong to the task’s attention module. tanh is the hyperbolic tangent applied to the entries of the resulting vector. The subscript att identifies parameters used for attention.

The module compares each projected vector with a learned task-specific query. The query is a parameter used to score review positions, the same for examples of that task. The score is converted into a weight by exponentiating it and normalizing across all positions of the review. As a result, the weights express relative emphasis within the example. A position receives more weight when its score is high relative to the other positions.

αᵗᵢ = exp(⟨h̃ᵗᵢ, qₐₜₜᵗ⟩) / Σⱼ exp(⟨h̃ᵗⱼ, qₐₜₜᵗ⟩)

Here αᵗᵢ is the attention weight at position i in task t, and qₐₜₜᵗ is that task’s learned query vector. The angle brackets denote the inner product between the query and the projected vector. exp is the exponential function. The summation indexed by j gives the total of the exponentiated scores over the review. Dividing by that total is the softmax operation. The collection of weights over positions is the distribution αᵗ.

The classifier then uses these weights to combine the contextual vectors produced by the original encoder. That detail is important. The projected vectors are used to decide the weights, and the original contextual vectors are what the classifier pools. A word with high attention contributes its entire contextual vector to the sum, including information it carries from its surroundings.

ŷᵗ = predᵗ(Σᵢ αᵗᵢ hᵗᵢ)

Here ŷᵗ is the prediction for the example in task t. The function predᵗ is a task-specific multilayer perceptron, a sequence of learned transformations that predicts from the pooled review vector. The sum over positions i combines each original vector hᵗᵢ with its scalar weight αᵗᵢ. The observed label or rating is called yᵗ. The prediction loss compares ŷᵗ with yᵗ across the labeled source examples.

The formulation uses cross-entropy for classification and mean squared loss for regression. Cross-entropy penalizes the classifier when it assigns low probability to the observed category. Mean squared loss compares a numerical prediction with the observed numerical rating. This allows the attention-learning procedure to use source prediction tasks expressed in either form. In both cases, the basis for learning the source attention is the accuracy of the source predictor. The source rationale is used by the conversion branch.

Grounding and aligning the representation

A representation learned exclusively to predict beer ratings has good reason to emphasize information peculiar to beer reviews. R2A must also process texts in the target domain. The authors therefore give the shared encoder a word-prediction objective on available source and unlabeled target reviews. This makes those target reviews useful before any hotel ratings or human highlights enter the procedure.

The two directions of the encoder provide separate prediction signals. To predict a word using preceding text, the forward predictor uses the state immediately before the word. To predict it using following text, the backward predictor uses the state immediately after it. Using these neighboring states keeps the word being predicted out of the context available to the respective predictor. Each direction has its own softmax classifier. The resulting cross-entropy is called the language-modeling loss, written Lₗₘ in the combined objective below.

At any given position, the contextual representation is formed by joining the two directional outputs. The notation can distinguish the two vectors explicitly.

hᵢ = [h⃗ᵢ ; h⃖ᵢ]

Here hᵢ is the contextual vector at position i. The right-pointing arrow marks h⃗ᵢ as the forward output, and the left-pointing arrow marks h⃖ᵢ as the backward output. The bracketed expression joins the entries of the two vectors in order. The separator inside the brackets denotes concatenation.

Predicting words on both corpora helps make the encoder applicable to both. A separate objective encourages its transformed features to be comparable across domains. To create those features, the paper applies the same learned linear transformation, with a bias, to the contextual vector at each position. The result is a second sequence of vectors. The attention converter uses this transformed sequence, while the source task predictor uses the contextual sequence described earlier.

hᵢⁱⁿᵛ = Wⁱⁿᵛ hᵢ + bⁱⁿᵛ

Here i is a word position, hᵢ is its original contextual vector, and hᵢⁱⁿᵛ is its transformed representation. The superscript inv marks the representation that the training objective aims to make domain-invariant. The matrix Wⁱⁿᵛ and bias bⁱⁿᵛ are learned. The transformation preserves a separate vector for each position so the attention generator can still score the review word by word.

Reviews vary in length, so the alignment calculation needs a fixed-size summary. The authors concatenate the first and last vectors of each transformed sequence. These are contextual states produced after the input has been processed in both directions. The distance calculation operates on the distribution of these summaries, while the converter goes on to use the entire sequence. Each domain supplies examples to the comparison. A beer review needs no paired hotel review for the calculation.

The paper uses Wasserstein distance to encourage the domain summaries to occupy similar distributions. The objective can be understood through a scalar scoring function. If the function systematically gives different scores to the summaries from the two domains, their average scores differ. The training procedure seeks a function that exposes a large difference, subject to a smoothness constraint, and learns representations that reduce the discrepancy. This is the adversarial part of the method. Wasserstein GAN

L_wd = sup‖f‖ᴸ≤ᴷ ( E_{hⁱⁿᵛ ∼ Pₛ} f([h₁ⁱⁿᵛ ; hᴸⁱⁿᵛ]) − E_{hⁱⁿᵛ ∼ Pₜ} f([h₁ⁱⁿᵛ ; hᴸⁱⁿᵛ]) )

Here L_wd is the Wasserstein alignment objective. The sequence hⁱⁿᵛ contains the transformed vectors, and L is the sequence length for the example being summarized. In the concatenation, h₁ⁱⁿᵛ and hᴸⁱⁿᵛ are its first and last vectors. Pₛ and Pₜ are the source and target distributions of the transformed representations. Each E denotes an expectation, or average under the indicated distribution, and ∼ indicates sampling from that distribution. The scalar function f assigns a score to a concatenated summary. The supremum sup denotes the greatest value attainable or approachable over the allowed functions. In the constraint, ‖f‖ᴸ denotes the Lipschitz constant of f, with the superscript on the norm referring to Lipschitz continuity. The bound K limits how sharply the score can change as its input changes.

In practice, the authors approximate the scoring function with a multilayer perceptron and use a gradient penalty to enforce the smoothness constraint. The penalty addresses how the score changes with its input. The distributional comparison complements the word-prediction objective. The latter asks the encoder to capture enough context to predict words on the two corpora. The former asks the transformation to reduce domain differences in the summaries it supplies to the alignment calculation.

Producing an attention distribution from a rationale

The conversion module combines the transformed text with two kinds of rationale information. The first is the binary indication for the current example. It records whether each word position was selected. The second is a task-level frequency feature for that word, computed from rationale occurrences in the task’s training examples. It gives the converter information about how frequently the word serves as evidence for that task. The paper calls this a unigram likelihood because it concerns the individual word.

The frequency feature and the example-specific flag can convey different information. A word may commonly appear in rationales for one aspect and be unmarked in a particular review. An unusual word can be marked because it matters in that particular context. The converter sees both features alongside the contextual text vector. It can learn how to weigh their contributions instead of requiring a marked word to receive a fixed share of the attention.

The paper denotes the augmented sequence of rationale features by r̃ᵗ. Before generating weights, a separate sequence encoder processes those features together with the transformed text. As with the original encoder, this step lets the output at a position reflect other parts of the sequence. The rationale conversion encoder is shared across tasks. Task dependence comes through the features supplied for the current task, including the selection and the frequency statistics.

uᵗ = encᵣ₂ₐ([hⁱⁿᵛ,ᵗ ; r̃ᵗ])

Here t identifies the task and uᵗ is the output sequence of the conversion encoder encᵣ₂ₐ. The sequence hⁱⁿᵛ,ᵗ contains the transformed contextual vectors for the example in task t. The sequence r̃ᵗ contains the augmented rationale features for the same positions. Concatenation, shown by the bracketed expression and its separator, joins the text vector and the rationale features at each position before the encoder processes the sequence.

The converter then prepares its hidden vectors for scoring. Its attention parameters are shared across tasks, since the purpose is to learn a repeatable way of using rationale information. A different rationale for the same review changes what enters the encoder and can therefore change the distribution without requiring a new scoring mechanism.

ũᵗᵢ = tanh(Wₐₜₜʳ²ᵃ uᵗᵢ + bₐₜₜʳ²ᵃ)

Here uᵗᵢ is the conversion encoder’s output for position i in task t, and ũᵗᵢ is its projection for attention scoring. The learnable matrix Wₐₜₜʳ²ᵃ and bias bₐₜₜʳ²ᵃ belong to the converter. tanh is applied to the projected vector’s entries. The superscript r2a on the parameters distinguishes these shared weights from the task-specific source attention parameters.

α̂ᵗᵢ = exp(⟨ũᵗᵢ, qₐₜₜʳ²ᵃ⟩) / Σⱼ exp(⟨ũᵗⱼ, qₐₜₜʳ²ᵃ⟩)

Here α̂ᵗᵢ is the attention weight generated by the converter at position i for an example in task t. The hat distinguishes the generated weight from the source task predictor’s weight αᵗᵢ. The query qₐₜₜʳ²ᵃ is learned and shared across tasks. The inner product in angle brackets scores a projected vector ũᵗᵢ against the query. The denominator sums the exponentiated scores over all positions j, and exp denotes exponentiation. The distribution α̂ᵗ contains the resulting weights.

For a source example, the converter’s distribution and the source predictor’s distribution refer to the same review and the same aspect. They can be compared position by position. The converter learns from the differences between the distributions as a whole. The paper allows a choice of distance for this comparison and uses a cosine-based loss with a margin.

Lₐₜₜ = Σ_{(αᵗ, α̂ᵗ), t ∈ {Sᵢ}ᵢ₌₁ᴺ} d(αᵗ, α̂ᵗ)

Here Lₐₜₜ is the attention-matching loss. The sum runs over paired distributions for labeled source examples. t is the source task for a pair, and {Sᵢ}ᵢ₌₁ᴺ denotes the collection of N source tasks indexed by i. The symbol ∈ means that t belongs to that collection. The distribution αᵗ is learned by the source task predictor, α̂ᵗ is generated by R2A, and d is the distance used to compare them.

d(a, b) = max(0, 1 − cos(a, b) − 0.1)

Here a and b are vectors, in this application the two attention distributions for a review. The function cos is cosine similarity, the inner product scaled by the lengths of both vectors. It measures how closely the vectors point in the same direction. The expression beginning with 1 converts this similarity into a distance and subtracts the margin 0.1. The maximum with 0 keeps the loss non-negative and makes the penalty vanish when the distance falls within the margin. The converter is thus trained to approach the source pattern of weights to within a tolerance.

Training objectives and the final handoff

The source prediction branch, the representation losses and the conversion branch are optimized together. The source labels supply the evidence for learning the original attention. The attention comparison teaches the conversion. Word prediction uses text from the available corpora, and the Wasserstein term uses the distinction between source and target. The loss weights control the contribution of these signals to the joint training objective.

L = Lₗᵦₗ + λₐₜₜ Lₐₜₜ + λₗₘ Lₗₘ + λ_wd L_wd

Here L is the combined training objective and Lₗᵦₗ is the prediction loss on the labeled source tasks. Lₐₜₜ measures the discrepancy between source attention and the converter’s output. Lₗₘ comes from predicting words using context, and L_wd is the domain alignment objective. The coefficients λₐₜₜ, λₗₘ and λ_wd are hyper-parameters that determine how strongly the corresponding terms enter the objective. They are set as part of the experimental configuration.

For domain transfer, the authors set the word-prediction coefficient to 0.1, the Wasserstein coefficient to 0.01, and the attention-matching coefficient to 0.01. For transfer between beer aspects they use the same settings with the Wasserstein coefficient set to 0, since those tasks already share a domain. In that setting they also add a consistency regularizer based on the cosine distance between generated attention and the rationale supplied to the converter. This encourages the converter to stay close to the input selection while it learns to reproduce source attention.

The text input uses pretrained fastText word embeddings. The bidirectional LSTM for the shared text encoder has 200 dimensions, and the bidirectional LSTM for the conversion encoder has 50 dimensions. The authors apply dropout at rate 0.1 to the embeddings and to the final hidden layers of the classifiers. They optimize with Adam, beginning with a learning rate of 0.001 and dividing it by 10 when development performance plateaus. Enriching Word Vectors with Subword Information · Dropout · Adam

A vocabulary-wide word prediction would make the auxiliary objective expensive in both time and memory. In the experiments, the authors randomly partition the vocabulary and predict the bin containing the word. They report a bin size of 100. This preserves a contextual prediction task for the encoder while reducing the cost of computing the auxiliary loss. The paper makes the R2A code and data available.

Once this joint training is finished, R2A processes the target training examples and their human rationales to generate supervision. The target classifier uses the same kind of architecture as a source classifier and initializes its text encoder from the encoder already trained in R2A. Its target attention is learned through two signals. The correct labels reward a useful prediction, and the generated attention supplies a pattern of emphasis to approximate.

L = Lₗᵦₗᵀ + λₐₜₜᵀ Lₐₜₜᵀ

Here L is the objective for the separate target classifier and T identifies the target task. The term Lₗᵦₗᵀ is the target prediction loss on the labeled training examples. The term Lₐₜₜᵀ is the cosine distance between the attention generated by R2A and the target classifier’s own attention. The coefficient λₐₜₜᵀ controls the weight of that distance during training. The authors tune this coefficient for the systems trained with an attention target.

A new review enters through the target classifier’s text encoder. Its weights are computed by the classifier’s own attention module from the resulting contextual vectors. The label predictor then uses the pooled review representation. At this point, the role of the human rationale is embodied in what the classifier learned on the training set.

Experiments and results

Transferring between aspects of beer reviews

The within-domain experiment uses BeerAdvocate reviews with ratings for look, aroma and palate. The ratings lie in the range [0, 1]. To define the binary target classification tasks, the authors assign a negative label to ratings at or below 0.4 and a positive label to ratings at or above 0.6. They randomly sample equal numbers of the two categories to form the target data. A sample of 200 training examples per target aspect receives human rationales. Each aspect also has 200 development examples.

The role of each aspect rotates. For a look classifier, aroma and palate are the source tasks. For an aroma classifier, the sources are look and palate. For a palate classifier, the sources are look and aroma. This design asks whether a way of learning to weight highlighted language carries over when the new task concerns a different property of the same product. The authors do not require unlabeled target data for this experiment, since the source and target reviews are from the same domain.

The source corpora are larger than the target training sets. Look has 43,351 source training examples and 10,170 source development examples. Aroma has 39,825 source training examples and 8,772 source development examples. Palate has 30,041 and 7,152 in the corresponding source splits. When used as target tasks, the test splits contain 4,014 examples for look, 4,212 for aroma and 3,804 for palate. These counts distinguish the plentiful supervision used to learn the conversion from the small annotated sets on which the final target classifiers are trained.

Transferring from beer to hotel reviews

The across-domain experiment uses all the beer aspects as sources. The targets are location, cleanliness and service in TripAdvisor hotel reviews. For each hotel aspect, ratings above 3 count as positive and ratings below 3 count as negative. This defines a binary prediction task for each aspect using the hotel rating scale. The change of domain introduces different subject matter as well as different targets. Evidence about location or room cleanliness comes from language that need not have served as evidence for any beer aspect.

Each hotel aspect has 200 labeled training examples with human rationales, 200 development examples and 14,472 unlabeled target examples in the data statistics. The test sets contain 1,808 examples for location, 12,684 for cleanliness and 18,762 for service. The unlabeled reviews are used during the training of R2A. The ratings and rationales for the annotated training reviews are used to prepare the supervision and train the target classifier afterwards. The test sets are used to evaluate the classifiers’ predictions from text.

The training counts therefore describe different kinds of resources. A target classifier learns directly from a small set of labeled examples. The conversion trained before it can draw on extensive beer supervision and substantial unlabeled hotel text. The hotel numbers show what the procedure can achieve with few target ratings and highlights under those conditions. They also explain why a comparison with a target-only classifier and one with a transferred encoder answer different experimental questions.

What the comparisons hold in common

The simplest baseline is a linear support vector machine, abbreviated SVM, trained on the labeled target reviews. It uses a bag of n-grams, with features for individual words and sequences of two or three words. These features receive TF-IDF weights, which reflect occurrence in a review together with how widely the feature occurs across reviews. This baseline measures how well a classifier using local text features and the available labels can perform.

The rationale-augmented SVM, RA-SVM, uses human selections to regularize the boundary the classifier learns. The rationale-augmented convolutional classifier, RA-CNN, first estimates how likely each sentence is to contain rationale words. It then weights sentence representations according to those estimates and predicts from the combined representation. These methods offer ways to exploit human highlights without the source-trained conversion. Their inclusion tests whether the extra annotation already yields similar gains through established rationale-based methods.

The most direct comparisons are the transfer baselines. TRANS initializes its encoder from the trained shared encoder and learns the target task from the label loss. RA-TRANS also has the transferred encoder, and adds a cosine loss that compares the target classifier’s attention directly with the human rationale. The proposed method uses labels and an attention-matching loss as well. Its comparison target is the distribution produced by R2A from the human rationale. All these transfer systems have access to source training through initialization. In the domain experiment, that encoder has also been exposed to unlabeled hotel text.

The oracle comparison uses the same classifier architecture with an attention target derived from a held-out collection containing extensive labeled data for the target task. The ordinary low-resource target learner could not produce that attention from the same small annotation set. For the experiment, the oracle shows what happens when the target classifier receives attention derived from a much better-resourced predictor. Its role is a reference for the quality of the supervision obtainable under this architecture and experimental setup.

The primary metric is classification accuracy, the share of target test reviews assigned the correct label for the designated aspect. The paper also reports average error reduction for domain transfer, which expresses improvement relative to the baseline’s rate of mistakes. The attention analysis uses average cosine distance on the target training set. That last metric compares distributions, whereas test accuracy evaluates the trained classifier’s labels.

The gains within beer reviews

The authors report that R2A improves over the baselines across the beer target aspects. The aroma result shows how the comparisons fit together. Its target-only SVM achieves 68.57% test accuracy. TRANS, which gains access to a transferred encoder, reaches 69.92%. Direct rationale supervision with RA-TRANS reaches 76.45%, and R2A reaches 77.94%. The oracle reaches 78.11%. For this aspect, raw rationale supervision already helps considerably, and converting the rationale to a distribution improves on that result.

BeerAdvocate aroma target test accuracy after transfer from look and palate

The learned conversion improves on direct rationale supervision and approaches the oracle result.

BeerAdvocate aroma target test accuracy after transfer from look and palateSVM: 68.57SVM68.57TRANS: 69.92TRANS69.92RA-TRANS: 76.45RA-TRANS76.45R2A (this paper): 77.94R2A (this paper)77.94Oracle: 78.11Oracle78.11
The numbers
System or settingaccuracy %
SVM68.57
TRANS69.92
RA-TRANS76.45
R2A (this paper)77.94
Oracle78.11

The palate comparison gives a different ordering among the transfer baselines. TRANS reaches 74.66% test accuracy, compared with 73.40% for RA-TRANS. The classifier trained with R2A-generated supervision achieves 75.24%, and the oracle achieves 75.50%. The relationship between raw rationale supervision and the transferred encoder alone therefore depends on the aspect. In both aroma and palate, the learned conversion gives the best result among the methods that operate under the ordinary low-resource conditions.

The rationale-based target-only comparisons help put those results in context. On aroma, the rationale-augmented SVM reaches 69.23% test accuracy and the rationale-augmented convolutional classifier reaches 67.55%. The corresponding palate results are 67.82% and 65.72%, alongside 63.88% for the plain SVM. A rationale can improve a low-resource classifier, but the gains depend on how the information is used. The paper summarizes the beer oracle comparison with a reported absolute difference of 0.40% across aspects.

The gains from beer to hotels

In cross-domain transfer, R2A reaches 84.52% test accuracy on location, 90.66% on cleanliness and 89.93% on service. The corresponding oracle reference results are 85.43%, 92.09% and 92.42%. The paper reports an average error reduction of 15.08% over the best baseline for domain transfer. The baselines are strongest on different aspects, so the result is best understood alongside the individual comparisons.

On location, RA-TRANS is the strongest ordinary baseline at 82.10% test accuracy. TRANS reaches 80.42%. The rationale-augmented convolutional classifier reaches 79.28%, and the rationale-augmented SVM reaches 79.09%. This aspect gives a progression across the transfer variants. The shared encoder supports the label-only classifier, direct attention supervision from highlights helps further, and the generated weights yield the strongest test result among the variants using the ordinary target resources.

TripAdvisor hotel location test accuracy after transfer from beer reviews

Rationale-derived attention gives the strongest non-oracle result for hotel location.

TripAdvisor hotel location test accuracy after transfer from beer reviewsSVM: 78.65SVM78.65RA-CNN: 79.28RA-CNN79.28TRANS: 80.42TRANS80.42RA-TRANS: 82.10RA-TRANS82.10R2A (this paper): 84.52R2A (this paper)84.52Oracle: 85.43Oracle85.43
The numbers
System or settingaccuracy %
SVM78.65
RA-CNN79.28
TRANS80.42
RA-TRANS82.10
R2A (this paper)84.52
Oracle85.43

For cleanliness, RA-CNN is the strongest ordinary baseline at 89.01% test accuracy. RA-TRANS reaches 87.15%, and TRANS reaches 86.95%. The plain SVM reaches 86.44%, while RA-SVM reaches 86.68%. These results show that the sentence-based use of a rationale can be competitive against the transferred encoder and direct word-level rationale supervision. R2A nevertheless reaches a higher test accuracy than all of these alternatives on cleanliness.

On service, RA-CNN again provides the strongest ordinary baseline, with 87.91% test accuracy. TRANS reaches 87.37%, and RA-TRANS reaches 86.40%. The plain and rationale-augmented SVMs reach 85.34% and 86.61%, respectively. As with beer palate, asking the classifier to match the raw rationale produces a lower accuracy than training the transferred classifier on labels alone. The better service result from R2A, which uses the same kind of human annotation, shows why the conversion is consequential in this comparison.

The hotel learning curves examine whether the relative performance persists as the amount of target annotation changes. For neural methods the authors repeat the runs with five random seeds and display the mean with its standard deviation. They report that R2A improves steadily as more annotation becomes available and maintains an advantage over the baselines on these curves. The curves supplement the fixed training-set comparison by showing the behavior over a range of annotation amounts.

What the ablations show

Removing the auxiliary objectives

The authors remove the language-modeling loss and the Wasserstein loss separately in beer-to-hotel transfer. Each comparison asks how well the proposed system works with one part of the joint training objective omitted. The full system keeps both. The evaluation is the target classifier’s test accuracy on each hotel aspect, so the comparison links the auxiliary objective to the end result rather than measuring alignment alone.

With the Wasserstein term removed, location accuracy is 82.36%, cleanliness accuracy is 89.79%, and service accuracy is 89.61%. With the language-modeling term removed, the corresponding values are 82.47%, 90.05% and 89.75%. The full system reaches 84.52%, 90.66% and 89.93% on those same hotel test sets. Each removal lowers the reported accuracy for each aspect. Omitting the Wasserstein objective gives the lower of the two ablated scores each time, and location exhibits the largest separation between the full system and either ablated version.

TripAdvisor hotel location test accuracy with source-training objectives removed

Both auxiliary objectives contribute to location accuracy, with the lowest score after removing domain alignment.

TripAdvisor hotel location test accuracy with source-training objectives removedWithout Wasserstein alignment: 82.36Without Wasserstein alignment82.36Without language modeling: 82.47Without language modeling82.47Full R2A (this paper): 84.52Full R2A (this paper)84.52
The numbers
System or settingaccuracy %
Without Wasserstein alignment82.36
Without language modeling82.47
Full R2A (this paper)84.52

The ablation scores concern the whole training pipeline. The word-prediction objective shapes the contextual states used by the other branches, and the Wasserstein objective shapes the transformed versions used by the converter. Removing either changes the representations on which downstream learning depends. The results support keeping both losses in the tested setting. Since the terms were removed individually, the reported comparisons leave their joint contribution and possible interactions unresolved.

Inspecting the aligned review representations

The paper also examines where source and target review representations appear in a t-SNE visualization. This technique projects high-dimensional data to a form that can be plotted. The authors use 200 beer reviews and 200 hotel reviews. For each review they concatenate the first and last transformed vectors, the same kind of summary used in the alignment objective. They observe that the source and target feature distributions appear aligned in the visualization.

The choice of representation ties the plot directly to the objective. The Wasserstein loss compares review summaries constructed from the ends of the transformed sequence, and the visualization projects those summaries. The attention converter still receives individual transformed word vectors. The plot provides a view of the domain alignment at the review-summary level. The ablation supplies separate evidence that the alignment objective contributes to prediction accuracy.

Comparing highlights and generated weights with oracle attention

The attention comparison asks whether the conversion moves the supervision toward the pattern produced by a target classifier with abundant labeled data. The authors take the human rationales and the R2A-generated weights for the hotel training examples and compute their average cosine distances to oracle attention. A lower distance means that the compared vectors have a more similar pattern of relative emphasis across positions.

For hotel location, the average distance to oracle attention is 0.5185 for the human rationale and 0.2371 for the R2A distribution. For cleanliness, the respective averages are 0.5948 and 0.3141. For service, they are 0.5833 and 0.2871. To train the converter for this analysis, the researchers used beer reviews alongside hotel reviews that had no labels. Its application to the target examples uses human hotel rationales, and the comparison is made on the hotel training set where those rationales are available.

These distances complement the classification comparisons in a specific way. RA-TRANS uses the original highlight as its attention target, while R2A supplies a distribution generated using the highlight and the review. The generated distribution is closer to the oracle on every hotel aspect, and the corresponding classifiers have higher test accuracy than RA-TRANS on those aspects. The distances describe what changes in the supervision. The test results describe what happens when a classifier learns from it.

A visual example holds a hotel review fixed and uses the rationales for location, cleanliness and service in turn. The review discusses the state of rooms and facilities, a favorable interaction with staff, and the balance of price and location. The converter produces different patterns of emphasis for the different aspects. In the cleanliness case, the rationale spans a qualification about the rooms and a more favorable assessment of the bed and bathroom. The generated attention concentrates more on words identifying the places being judged and on the expressions about cleanliness than on some of the other words in the selected span.

This example illustrates the granularity that motivates the method. A human can select enough of a statement to retain its meaning. The converter can put more weight on some positions within that selection. Because the classifier pools contextual vectors, a relatively low weight on a connecting word still leaves room for that word to affect the contextual representations of nearby positions. The figure illustrates an aspect-sensitive change in emphasis. The averaged distances show that the proximity to oracle attention extends beyond that example on the analyzed training set.

Comparing rationales with more labels

The authors also compare collecting highlights with collecting additional labels. They cite earlier work estimating that adding a rationale roughly doubles the cost of annotation. Under that premise, the practical question is how many additional labeled reviews a classifier would need to reach the accuracy delivered by a smaller set with human highlights. The paper varies the amount of labeled target data available to an attention classifier trained without rationales and compares its curve with the R2A result from 200 training examples with rationales.

The reported label-only training counts needed to reach the reference performance are 800 for location, 3100 for cleanliness and 1900 for service. The count depends on the aspect. The experiment connects a particular allocation of target annotation to the achieved test accuracy instead of assuming that a rationale always carries the same value. Its comparison is with the observed learning curve of the classifier in the paper. The annotation cost estimate itself comes from the earlier rationale work. Using Annotator Rationales to Improve Machine Learning for Text Categorization

Limitations

Limits the authors identify

The method requires human rationales for labeled target training examples. The aim is to use a limited annotated set more effectively, and the classification experiment is built around the availability of that set. The cross-domain setup also assumes access to unlabeled target reviews so that the encoder and its transformation can learn from the target domain. On the source side, the authors need sufficient labeled examples to learn useful attention and an automatic method for producing rationales at scale. These resources enter at different stages, and the training procedure depends on each of them in the setting where it is used.

The paper explicitly points out the mismatch between human selections and the attention learned by a particular classifier. Rationales can vary between annotators, give binary indications and reflect human judgments about what counts as evidence. The architecture and the prediction objective shape attention. R2A is an attempt to use the information the two have in common. If the architecture changes, the distribution that makes an effective training target can change as well. The paper’s source attention and target classifier are chosen to make the transfer meaningful within a common architectural setup.

The oracle requires extensive target annotation and is introduced as an experimental reference. Its attention illustrates a kind of supervision that is useful with few target labels. The standard version of R2A has to approximate that kind of attention using source supervision and target rationales. The paper also conducts its experiments with one source domain at a time. The authors describe the framework as adaptable to multiple source domains. Their beer-to-hotel experiment pools several source aspects from the beer domain.

Limits visible in the experiments

The within-domain and cross-domain tests both concern ratings in review text. The domains differ in vocabulary and subject matter, and the aspects require attention to different evidence, but the source and target tasks retain a common structure. Each classifier predicts an aspect judgment from a review, and a person can point to relevant wording within that review. Transfer to applications with different kinds of evidence, outputs or annotation conventions remains outside these experiments. The paper’s comparisons establish that the conversion can carry across the tested aspects and domains.

The binary tasks also restrict the range of ratings the classifier is asked to handle. The beer data uses explicit positive and negative thresholds and is constructed with equal numbers of positive and negative examples. The hotel decision rules use ratings above and below the dividing value. The reported accuracies are for predictions on these defined target tasks. They do not measure fine-grained rating prediction, handling an intermediate judgment or performance under a differently sampled set of reviews.

Source rationales are generated automatically and target rationales come from humans. The positive results show that the particular mismatch is manageable in these experiments. The supplied comparisons leave open how the conversion would respond to different conventions for selecting words, different automatic selectors or systematic disagreements among target annotators. In particular, the frequency feature is derived from the task’s training examples. A small training set provides limited evidence about how frequently uncommon expressions occur as rationales.

The alignment objective and its visualization also concern a particular representation of each review. The first and last transformed states give a fixed-size summary that the adversarial objective can compare across domains. Similarity at that level leaves open how much domain information remains in the intervening states. The plot supports the authors’ description of the summarized features. The accuracy ablation is the evidence that including the objective helps the end task under the tested configuration.

Finally, oracle similarity, correct classification and a faithful account of an individual prediction are separate properties. The paper measures the first on rationale-bearing target training examples and the second on target test sets. A high attention weight scales a contextual representation, and that representation can contain information from other parts of the review. The eventual prediction also depends on how the pooled representation is processed. The experiments therefore leave open how a particular prediction would change if a highlighted word were removed or its attention weight altered. The annotation-budget curves similarly establish the reported comparison for this classifier and these aspects, while the time required to collect rationales can depend on the instructions, the review and the annotator.

What came after

The later papers that cite R2A take up questions about explanations, learning from few examples and the stability of classifiers. The titles indicate the questions each work addresses. The citation establishes a connection to R2A, while details of the later methods and their results remain unspecified.

Attention is not Explanation (2019) takes up the status of attention as an explanation. R2A uses similarity to attention learned with abundant labels as a diagnostic for a training signal. Its hotel accuracy comparisons test what that signal helps a classifier learn. Whether the resulting attention weights faithfully explain a particular prediction is a different question, and the later paper’s title addresses that question directly.

Few-shot Text Classification with Distributional Signatures (2019) brings distributional signatures to text classification with few examples. The connection is the problem of using additional information to learn from scarce labels. R2A’s conversion combines a contextual representation with an example’s highlight and a task-level frequency feature. The later work’s title identifies distributional signatures as its approach to few-shot learning, while leaving the relationship between the two methods’ features unspecified.

Aligning Faithful Interpretations with their Social Attribution (2021) explicitly connects faithful interpretation with social attribution. R2A gives a human highlight and a classifier’s attention distinct roles. The highlight expresses an annotator’s judgment about the evidence, and the attention weights act on the representations used for prediction. The later work’s framing invites a related distinction between the role people assign to an interpretation and its fidelity to the system being interpreted.

Evaluating Explanations: How Much Do Explanations from the Teacher Aid Students? (2022) asks how useful an explanation is to a learner that receives it from a teacher. R2A poses a concrete instance of that kind of evaluation. The information supplied during training can be the human selection itself, a converted distribution or the attention of a better-resourced predictor. The classifier’s final task performance makes it possible to compare those signals by what the learner gains from them.

Predict then Interpolate: A Simple Algorithm to Learn Stable Classifiers (2021) addresses classifier stability through prediction and interpolation. R2A’s use of beer and hotel reviews raises a related question about retaining useful predictive behavior as the context changes. Its own answer is to align representations and transfer an attention conversion. The later paper’s title identifies stability as the desired property and prediction followed by interpolation as its algorithmic approach.

Cite

Cite as Yujia Bao, Shiyu Chang, Mo Yu and Regina Barzilay. 2018. Deriving Machine Attention from Human Rationales. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/d18-1216

@inproceedings{bao2018deriving,
  title = {{Deriving Machine Attention from Human Rationales}},
  author = {Yujia Bao, Shiyu Chang, Mo Yu and Regina Barzilay},
  booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1216},
  url = {https://doi.org/10.18653/v1/d18-1216}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bao-2018-deriving-machine-attention-human-rationales/