On Attention Redundancy: A Comprehensive Study
Paper · 2021 · Yuchen Bian, Jiaji Huang, Xingyu Cai et al.
Summary
BERT-base has 144 attention heads that can assign different weights to the same input tokens. How much variety do those heads actually produce, and how much of it matters for a task? “On Attention Redundancy: A Comprehensive Study” compares every pair of heads according to where they direct attention. It then tests a practical consequence of the comparison: whether a smaller set of heads, selected before the downstream task is known, can support comparable performance after training. The starting point is BERT.
The authors compare attention both token by token and across the entire input at once. Heads within the same layer or in neighboring layers often resemble one another, and the comparisons reveal groups that extend across layers. Measures applied at the same scale broadly agree on the structure, while token-level and whole-input measures bring out different groupings. The overall pattern changes little after fine-tuning on the tasks the authors examine. It also recurs across benchmark datasets and when the input consists of randomly generated token sequences. The authors find that pretraining dropout affects the measured redundancy, with a nearly monotonic trend for one whole-input measure and a changing direction for a token-level measure.
These observations lead to a pruning experiment. The authors use random input to group similar heads, retain a representative from each group, and then fine-tune the resulting BERT-base separately for each task. On the GLUE development sets, pruning 85% of heads gives a reported performance loss of < 5% relative to unpruned BERT-base on SST-2, MRPC, QQP, and RTE. MNLI and QNLI meet that loss criterion at 75% pruning. CoLA and STS-B are the exceptions to the reported pattern. The selection step needs no downstream examples, while the performance results depend on subsequent task-specific training. Together, the measurements and the intervention show that recurring similarities in attention can guide the choice of which heads to keep, within the architecture and tasks studied.
Deep dive: On Attention Redundancy: A Comprehensive Study
On Attention Redundancy examines why many BERT attention heads look alike and how far they can be pruned before task-specific training. · about 34 minutes to read
The problem and its context
What can be redundant in attention?
A sentence gives an attention head many possible places to look. For each token position, the head assigns weights to positions in the input. These weights govern how much information it gathers from each position when forming an output for the token. A head can concentrate strongly on a particular position or distribute its attention among several. The architecture runs several heads within a layer and repeats the process across layers. This organization comes from the Transformer and attention architecture described in Attention Is All You Need.
Giving heads separate operations makes different patterns possible. For the same token, one head might concentrate on a delimiter while another spreads weight across the surrounding text. The same design also permits similar behavior. Several heads can give similar weights to the same positions, including when the input changes. BERT-base gives the authors a setting in which to study how that similarity is organized. Each layer contributes a set of heads, and each head can be compared with heads elsewhere in the stack as well as with its immediate neighbors.
The paper uses redundancy in a particular, observable sense. Two heads are redundant to the extent that their attention weights are close under a chosen measure. The weights describe the distribution of attention for a given input. The head’s contribution to the next representation also depends on the information available at the attended positions and the transformations applied to it. A pair of heads with similar weights can therefore still make different contributions. The comparisons begin with the part that can be observed directly in the attention maps.
The scale of the question matters. An example of two heads attending to the same token can show what similarity looks like. Inspecting a collection of examples can show whether that pair frequently behaves similarly. Comparing every pair gives a different kind of evidence. It can show whether similar heads occur in isolated pairs, in groups confined to a layer, or in groups that extend through a region of the stack. This broader organization is what the authors want to characterize. A map of it could help readers interpret the division of work among heads and give compression methods a way to identify plausible candidates for removal.
What earlier work had established
The paper situates its question within research on both BERT’s internal representations and its attention weights. A contextual representation is a vector for a token that incorporates information from the surrounding input. Analyses of those vectors ask what information can be recovered from them. Analyses of attention weights ask where the system gathers information in the first place. These are related questions because attention helps build the representations, and they can be studied with different observations. The authors point to a review of this broader line of interpretability research in A Primer in BERTology.
One earlier line of work asked how linguistic information is distributed across layers. The paper describes evidence that BERT’s representations capture aspects of syntax and phrase structure. Other probes, which test whether representations support particular linguistic distinctions, found more modest gains on some semantic tasks. Studies also examined how contextual vectors occupy their representational space and whether the geometry varies across layers or groups of vectors. These findings concern the representations produced for tokens and help explain why researchers might expect different stages of BERT to do different work. The paper discusses What Does BERT Learn about the Structure of Language?, What Do You Learn from Context?, and How Contextual Are Contextualized Word Representations?.
Other analyses looked at specific linguistic relations and signals. As the authors describe it, earlier work found positional information in lower layers and associated different regions of the stack with dependency relations or attention to more distant material. Another study found that the final layers could reflect features specific to downstream tasks, while earlier layers captured more general features. These findings give layer position a possible interpretation. They also leave room for heads to overlap within a region even when the regions serve different purposes. The relevant studies include Open Sesame, Analyzing the Structure of Attention in a Transformer Language Model, and Revealing the Dark Secrets of BERT.
The closest precedents examined the attention maps themselves. The paper describes work that found repeated patterns around delimiter tokens, as well as block-like and more heterogeneous configurations. It also describes probes in which heads belonging to the same layer showed similar behavior. Such findings make attention redundancy plausible: heads can reuse a recognizable pattern, and more than one head can exhibit behavior associated with the same kind of signal. What remained to be characterized systematically was the network of similarities among heads across the full stack, including whether it persisted when researchers changed the input or the comparison measure.
Pruning studies offered a second reason to investigate those similarities. Pruning removes part of the system, such as a head or a layer, and examines what happens to the resulting system. Prior work described in the paper showed that downstream performance could survive substantial head removal and that some layers could operate with very few heads. That is evidence about what a reduced system can do under a particular pruning and evaluation procedure. It still leaves a separate selection problem: which evidence should determine what gets removed? The paper draws on work such as Analyzing Multi-Head Self-Attention and Are Sixteen Heads Really Better than One?.
The authors also describe compression methods that make their decisions during or after task adaptation. Those methods can take advantage of signals from the task. A head comparison that transfers across tasks would offer an earlier point at which to choose a reduced architecture. The paper’s proposal depends on whether a head map built without task examples still identifies useful groups. This brings the question of how attention is organized into the practical domain of efficient models and compression.
Finally, the paper takes up a question raised in earlier attention analysis about dropout. If pretraining repeatedly disrupts parts of the computation, it might affect how readily heads settle into similar patterns. The authors treat this as an experimental question and vary dropout in separate training runs. This part of the study asks what can change the amount of measured redundancy. The phase and task comparisons ask a complementary question: how much of the organization survives changes to the conditions under which it is observed?
The method, step by step
From input tokens to a comparison between heads
The authors start with a sentence or a pair of sentences, depending on the task. BERT converts the text into tokens, the units it processes. The resulting input includes special positions. [CLS] is placed at the beginning, and [SEP] is used at a sentence boundary, including between sentences in a paired input. Those positions are part of the sequence examined by the heads. Their inclusion matters because a head can allocate substantial attention to them. Splitting the text into the units used by BERT is the step called tokenization.
For a given input, a head produces a square attention matrix. A row corresponds to the token position from which attention is being directed. A column corresponds to a position that can receive that attention. The row contains the weights assigned across the available input positions, and those weights sum to 1. Looking along a row tells a reader where the head is attending for that token. Looking across the matrix shows how the distribution changes as the source position moves through the input.
Aᵢ ∈ [0, 1]ⁿˣⁿ
Aᵢ is the attention matrix from head i for the current input. The symbol ∈ indicates that the matrix belongs to the specified set. The interval [0, 1] gives the range of the individual weights, and n is the number of input tokens after BERT tokenization, including the special tokens. The superscript indicates that the matrix has n rows and n columns.
BERT-base has 12 attention layers, each with 12 heads. The authors order all 144 heads in a single list that preserves their layer positions. Flattening the layer and head indices makes it possible to apply the same comparison to any pair. A head in an early layer and one in a later layer still give matrices with corresponding positions for the same input. Those positions refer to the same token sequence even though the representations used to compute attention have passed through different amounts of processing.
The authors then create a second square matrix. Its rows and columns index heads, and each entry records the distance between two heads’ attention matrices. This is the redundancy matrix. The distinction between the two matrices matters when reading the figures. An attention matrix shows where a particular head looks within an input. A redundancy matrix shows which heads look similar according to the chosen distance. The number of input tokens can vary from example to example. The redundancy matrix keeps its shape because the set of heads is fixed.
For a comparison measure, the authors want a head to have zero distance from itself, a pair to have the same distance in either order, and closer attention patterns to receive lower values. The transformations of the individual measures use these conventions to make the heatmaps easier to compare.
dist(Aᵢ, Aᵢ) = 0
The function dist compares attention matrices, and Aᵢ is the matrix for head i on the current input. Both arguments refer to the same matrix. The equality states the intended self-distance of 0.
dist(Aᵢ, Aⱼ) = dist(Aⱼ, Aᵢ)
Aᵢ and Aⱼ are the matrices of heads i and j on the same input. The equality expresses symmetry. Exchanging the order of the heads leaves their measured separation unchanged.
dist(Aᵢ, Aⱼ) < dist(Aᵢ, Aₖ)
Aₖ is the attention matrix of a further comparison head, indexed by k. If Aᵢ is closer to Aⱼ than to Aₖ according to the measure, the distance on the left is smaller. The sign < expresses that ordering. Small entries in the resulting head map therefore indicate greater measured redundancy.
Comparing where heads look for each token
The first family of measures works row by row. Consider a single source position. Each head supplies a distribution over the positions it can attend to. A comparison takes the row for that source position from each head and returns a distance. The authors repeat this for every source position and average those distances for the input. Each position contributes to the head-pair distance through its own row comparison.
This procedure preserves alignment between source positions. A row from one head is paired with the row for the same token position from the other head. A close match means that, for that source position, both heads distribute attention similarly under the chosen measure. The average summarizes how frequently or how strongly that sort of agreement recurs across positions. By starting from corresponding rows, the procedure puts the emphasis on agreement about where to attend from each position.
Cosine similarity compares the directions of the two vectors. When used on attention distributions, it lies in [0, 1]. The authors reverse its orientation so that a higher similarity becomes a lower distance.
dcos(p, q) = 1 − cos(p, q)
Here p and q are the attention distributions from two heads for the same source position. The function cos gives their cosine similarity. The symbol dcos names the distance used for that row comparison. Subtracting the similarity from 1 puts close rows at the low end of the scale.
Pearson correlation measures linear association between the corresponding entries of the rows. For attention, a positive association means that positions receiving relatively high weight from one head tend to receive relatively high weight from the other. Its original range is [−1, 1], so the authors reverse the direction and rescale the result.
dcorr(p, q) = (1 − corr(p, q)) / 2
The distributions p and q again describe where two heads attend from the same position. The function corr is Pearson correlation. The symbol dcorr is the transformed row distance, and the slash indicates division. Subtracting from 1 reverses the association scale, and dividing by 2 maps the result into [0, 1].
Jensen–Shannon distance, abbreviated JS, is already presented as a distance between distributions on the desired scale. It compares how the heads allocate probability mass across the token positions. The paper uses it directly, with smaller values indicating closer distributions. JS is used in the opening visualization and later serves as the token-level measure in the dropout experiment. The paper names the standard distance and gives its range without deriving it.
The Bhattacharyya coefficient, abbreviated BC, describes overlap between distributions. Its role in the study is to offer another way of judging how strongly two heads concentrate attention on the same positions. The authors turn the overlap score into a distance.
dBC(p, q) = 1 − BC(p, q)
The quantities p and q are the two attention distributions for the source position. BC is their Bhattacharyya overlap coefficient, which the authors place in [0, 1]. The symbol dBC denotes the distance obtained by subtracting that coefficient from 1. Greater overlap therefore gives a smaller distance. The conversion establishes the direction used in the comparisons. The appendix’s written expression for the coefficient leaves its exact summand ambiguous.
These token-based measures emphasize different properties. Cosine compares direction, Pearson correlation compares whether relative highs and lows move together, and the distributional measures compare how mass is allocated. A recurring arrangement of close and distant heads across these choices is stronger evidence for the arrangement than a map made with a single definition. Still, two measures can agree about the location of a group while assigning different distances to individual pairs. The paper assesses that agreement by comparing the resulting head maps.
Comparing the attention matrices as a whole
The second family takes the pair of input-level attention matrices directly. The unit is the complete matrix for a sentence or sentence pair. A comparison can therefore respond to how patterns co-vary across the matrices, including structure that may be less apparent when corresponding rows are compared and averaged separately. The authors use three measures, each with a different way to describe association or closeness.
Distance correlation, abbreviated dCor, is used to capture forms of dependence beyond ordinary linear correlation. The original coefficient has a range of [0, 1]. The paper describes a coefficient of 0 in connection with independence and reverses the scale for use as a distance between attention matrices.
ddCor(Aᵢ, Aⱼ) = 1 − dCor(Aᵢ, Aⱼ)
Aᵢ and Aⱼ are the full attention matrices of heads i and j for the same input. The function dCor is the original distance correlation coefficient. The symbol ddCor denotes the transformed measure used by the study. Subtracting from 1 means that a larger value of the original coefficient gives a smaller reported distance. In the dropout results, a falling distance on this scale therefore corresponds to greater measured dependence.
The paper also uses the Procrustes coefficient, abbreviated PC, as a measure of closeness between data matrices. It places PC on [0, 1] and uses the coefficient as a distance. The appendix identifies the coefficient by name and explains its role. This comparison asks about closeness of the two matrices considered as wholes.
The canonical correlation coefficient, abbreviated CC, measures association between two sets of variables. The paper describes it through the trace of a matrix that combines covariance information from the inputs. The trace is the sum of the diagonal entries, and covariance describes how variables vary together. The authors reverse the coefficient so its direction matches the other comparisons.
dCC(Aᵢ, Aⱼ) = 1 − CC(Aᵢ, Aⱼ)
The matrices Aᵢ and Aⱼ contain the full attention weights for the two heads on the current input. The function CC is the canonical correlation coefficient used for their comparison. The quantity dCC is the corresponding distance. The subtraction from 1 makes stronger association correspond to a smaller value.
The two families share the same output structure. Given an input and a measure, they each fill a head-by-head matrix. What a small entry means depends on the family. For a token-based measure it reflects agreement under comparisons between corresponding source-token distributions. For a sentence-based measure it reflects whole-matrix closeness or dependence. Comparing maps within and across the families lets the study ask which aspects of redundancy persist when the unit of measurement changes.
Aggregating examples and comparing conditions
A redundancy matrix can be computed for each input and then averaged over a collection of inputs. In this average, a particular entry always refers to the same head pair, even when the attention matrices came from examples of different lengths. The authors draw heatmaps of the averaged distances. In each heatmap, a block of low entries identifies a group of heads that are close to one another. The fixed layer order makes it possible to see whether such blocks stay within a layer or run across adjacent layers.
The authors then compare the maps themselves. To check agreement among measures, they hold the input condition and the training phase fixed and correlate the redundancy matrices produced by different measures. To check agreement across phases, they compare the maps produced by pretrained and task-adapted BERT-base under corresponding conditions. To check agreement across tasks, they compare the task maps while holding the distance measure fixed. These are comparisons of relationships between heads. A high correlation means head pairs that read as relatively close in one map generally occupy similar positions on the scale in the other.
For the CoLA phase comparison, the authors also summarize the absolute changes between corresponding entries. That calculation asks how far the distances move in magnitude, complementing the question of whether the two maps preserve the same ordering or broad structure. A map comparison can show a recurring relation among heads even though individual rows of attention on individual examples are free to change. The object being compared here is the aggregate organization.
The benchmark examples come from the development splits of GLUE. For the attention analysis, the authors randomly select 1000 examples from a development split when it is large enough and use the full split when it is smaller. They run inputs through the pretrained BERT-base checkpoint and through versions fine-tuned for individual tasks. The checkpoint is the PyTorch BERT-base implementation distributed through Transformers.
The stated fine-tuning recipe uses a maximum length of 128 tokens, runs for 3 epochs, and uses a batch size of 32 per GPU on 8 GPUs. An epoch is a pass through the training data. The general experimental description says results are averaged across 5 trials. The pruning experiments specify a separate protocol with 10 trials for each fine-tuning task. Those trial counts belong to the procedures for which the paper reports them.
Turning a distance map into a pruning decision
The authors build the pruning map with randomly generated token sequences. The lengths vary according to a uniform distribution. The sequences go through pretrained BERT-base, from which the researchers collect the same attention matrices as in the benchmark analysis. The purpose of the random input is to elicit attention patterns with which to compare heads before accessing any downstream task examples. The head selector uses those patterns and the resulting distances. The downstream task data enter when the reduced BERT-base is fine-tuned.
Selecting and testing attention heads before task adaptation
The steps in order.
The clustering algorithm groups heads using a redundancy matrix or an average of such matrices. The authors describe a general procedure that can work with clustering methods requiring a prescribed cluster count as well as methods that determine the count themselves. If a pruning ratio is specified and the algorithm requires the count in advance, the authors set it from the intended number of retained heads.
k = ⌈144 × (1 − p)⌉
The symbol k denotes the requested cluster count. The number 144 is the head count of BERT-base. Here p is the fraction of heads targeted for pruning, distinct from the symbol p used for a row distribution earlier. In the expression, 1 − p is the fraction intended to remain, × is multiplication, and the ceiling brackets round the resulting count up to a whole number. Keeping one representative from each cluster ties the size of the retained set to k.
In the case study, the authors use spectral clustering and a silhouette criterion. Spectral clustering uses the relationships among pairs of heads to group them. The silhouette criterion evaluates how well an item fits its assigned group in relation to other groups, giving the authors a way to choose which head should represent each cluster. The selected representatives remain in BERT-base. The procedure removes parameters associated with the other heads and relevant parameters in subsequent computation, then adapts the reduced system to each downstream task.
This design makes the meaning of zero-shot specific. It describes when and how the head set is chosen. The downstream results come from the reduced system after fine-tuning. The experiment therefore evaluates whether the selected architecture can be adapted to the different tasks under the stated recipe. It also asks whether a single task-independent selection rule is useful when the performance criterion is ultimately task-specific.
Varying dropout during pre-training
The dropout study uses newly trained BERT instances and is separate from the downstream pruning pipeline. Dropout introduces random deactivation during training. The authors distinguish an attention-side dropout setting from a hidden-side setting associated with the transformations that integrate information after attention. Both settings have a default value of 0.1 in the setup they describe.
They train BERT on the masked prediction objective using the Wiki103 training split. In masked prediction, the training objective asks the system to recover hidden tokens from context. The authors set dropout values from 0.0 to 0.9 and train from scratch for 100 epochs or until the training loss converges. One series varies the attention-side setting and holds the hidden-side setting at 0.1. Another varies the hidden-side setting and holds the attention-side setting at 0.1. A joint series varies both settings.
For evaluation, they randomly draw 1000 sentences from the Wiki103 test split. For each sentence, they compute a JS redundancy matrix and a dCor redundancy matrix and summarize each by its mean distance. They then average those values over the test sentences. This produces an overall measure of separation among heads for each setting and distance family. Its purpose is to follow the amount of measured redundancy as dropout changes. The phase and task experiments instead compare the arrangement of individual pairs across their full maps.
Experiments and results
What the comparisons use as a reference
The GLUE tasks span several different prediction settings. CoLA asks whether an English sentence is acceptable, and SST-2 uses single sentences for sentiment analysis. MRPC and QQP involve decisions about relationships between sentences. STS-B is a sentence-pair regression task, so its target is a score. MNLI, QNLI, and RTE are treated as inference tasks. The authors omit WNLI because of its small size. The distinction between single-sentence and paired inputs matters for attention analysis as well as evaluation, since the formatting determines which token positions and boundaries appear in the input.
The study has several comparison points depending on the question. The pretrained checkpoint is the reference for examining change after fine-tuning. Maps from other tasks and from random token sequences are the references for examining sensitivity to the input collection. For the pruning curves, the baseline is BERT-base fine-tuned with all heads. The pruning runs use the same downstream training recipe and compare the development score of the reduced system with the unpruned reference for that particular task.
The outcome metrics serve different purposes. Attention distances quantify how similar pairs of heads are, correlation between redundancy matrices describes agreement about which head pairs are close, and downstream development performance measures the result of training and evaluating a pruned system. The pruning paper expresses its key cross-task comparison through a reported threshold of < 5% performance loss against the unpruned baseline. That threshold can be discussed across tasks without assigning them a common raw score.
How redundancy is arranged across layers
In the comparisons for pretrained BERT-base on the CoLA development data, heads in the same layer and in consecutive layers tend to be closer than heads in more distant layers. This produces blocks of small distances near the diagonal of the map. The diagonal itself represents each head compared with itself. The informative structure comes from the neighboring entries, where different heads repeatedly receive small distances. Where those entries form a larger block, they indicate that the resemblance extends beyond a single layer.
The token-level maps give a particularly clear nested pattern. They divide the layers into three groups comprising the initial four, the middle six, and the final two. The last 8 layers also fall into a larger region. A reader can see both levels of organization because a broad block can contain smaller areas where the distances are lower still. This is the basis for the paper’s description of hierarchical structure. It refers to groupings visible at more than one scale in the distances.
The sentence-level comparisons produce a somewhat different picture. The middle 10 layers show comparatively small distances, and heads within a layer can be close, especially in the first and last layers. These maps have less sharply separated blocks than the token-based maps in the CoLA example. Both families support the broader observation that redundancy is structured by layer and proximity. The apparent boundaries of groups depend on whether the comparison centers on corresponding attention distributions or on the arrangement of the complete matrices.
The authors test that reading by correlating the redundancy maps generated from the different distance functions. In the pretrained CoLA comparison, the token-based maps are highly correlated with one another, and the sentence-based maps likewise have high agreement within their family. The appendix extends these displays across other benchmark tasks and across training phases. The evidence is strongest for a recurring arrangement within each comparison family. Which groups stand out most clearly remains sensitive to the measurement scale.
What changes after fine-tuning or a change of input
On CoLA, the maps from the pretrained and fine-tuned checkpoints display much the same structure. The authors summarize the absolute differences between corresponding map entries and report a mean difference of 0.035 for this phase comparison on the CoLA development data. That value concerns head-pair distances. It says how far entries moved on average, given the measures used in the comparison.
For the broader phase analysis, the authors correlate the pretrained and fine-tuned redundancy maps for each GLUE task and distance measure. They report high correlations throughout those comparisons. In practical terms, pairs that tended to be close before task adaptation generally still tended to be close afterward. The authors call this phase independence. The checkpoints compared are the pretrained starting point and the result of downstream fine-tuning. The observation describes the resemblance between those two states.
The cross-task maps also show high correlations. Within that broad agreement, higher correlations tend to appear among tasks of similar kinds. The two single-sentence datasets, CoLA and SST-2, form one such group. The similarity and paraphrase group comprises MRPC, QQP, and STS-B. The inference group comprises MNLI, QNLI, and RTE. This organization suggests that the common head relationships coexist with subtler differences associated with the input or task family. The high cross-task agreement is a statement about the dominant pattern, while the grouping among tasks is visible in the variation around it.
For the random-input condition, the authors generate 1000 token sequences with uniformly distributed lengths and run them through pretrained BERT-base. The redundancy maps from those inputs correlate highly with maps from the GLUE development data. Thus the researchers can recover much of the same head organization without supplying natural sentences from the downstream datasets. This result provides the empirical reason for using random sequences in the pruning experiment. They supply enough structure to measure recurring relationships among heads, even though the pruning procedure will eventually be judged on task performance.
How much pruning the downstream tasks tolerate
The pruning case study tests ratios from 5% through 95% in steps of 5%. For each downstream task the authors carry out 10 fine-tuning trials. In the reported curves, the line for the pruned runs is the average score at each pruning ratio, and a band spans the best and worst results of those trials. The unpruned reference is also averaged over 10 trials. This layout lets a reader distinguish the tendency of the average score from the variation among runs.
Average development performance generally declines as more heads are removed. The decline is gradual enough on several tasks to leave substantial room for pruning. The authors report that SST-2, MRPC, QQP, and RTE meet their < 5% loss criterion at 85% pruning. MNLI and QNLI meet it at 75% pruning. These ratios refer to the removal of attention heads from BERT-base before downstream fine-tuning. The comparison is against the corresponding task’s fine-tuned, unpruned BERT-base score.
Reported head pruning ratios with less than the stated loss threshold on GLUE development tasks
The clustering-based selection tolerates heavier pruning on the sentiment, paraphrase, and RTE tasks shown than on MNLI and QNLI.
The numbers
| System or setting | Head pruning ratio % |
|---|---|
| SST-2, MRPC, QQP, RTE (this paper) | 85 |
| MNLI, QNLI | 75 |
The chart records the pruning levels the authors highlight for groups of tasks under the same performance-loss criterion. A higher ratio means that the procedure removes more heads while meeting that criterion. The bars compare tolerance for pruning, so their ordering says nothing about whether the tasks have higher or lower raw development scores. Both bars come from the clustering-based procedure. The star marks the more aggressive of the reported settings.
CoLA and STS-B are the exceptions in the discussion of pruning tolerance. The authors point to the size of their development sets, given as ≤ 1000 in this part of the paper, as a possible reason for fluctuations that make a strong conclusion difficult. They leave the behavior of these tasks open. Their treatment is important because the common pruning strategy can be applied to all the tasks while the evidence for how far it can go differs by task.
The practical result is that a head selection formed without knowledge of a target dataset can retain considerable capacity for learning several different tasks. The experiment measures performance after retraining the reduced architecture for each task. Its comparison with the unpruned baseline indicates how successfully the two architectures can be adapted under the described recipes. It also makes the boundary of the claim concrete: the cited pruning ratios describe attention-head removal, with usefulness judged by downstream development performance.
What the ablations show
Changing the distance measure changes the visible structure
The comparison of distance functions is a check on the measurement. The authors run the same inputs through the same BERT-base checkpoint and examine how the head map changes when they replace the rule that scores each pair. Within each family, the overall arrangements are similar across different measures. That agreement makes it less likely that the recurring groups in, for example, the token-based maps are a feature of a single mathematical definition.
Switching between token-level and sentence-level comparisons changes the arrangement more visibly. A pair can be close because its heads usually look at the same positions from each source token. A pair can also be close under a measure that takes account of broader structure or statistical dependence across the matrices. These are distinct grounds for judging two heads similar. The results show both overlap and differences between the maps because the measures give those grounds different weight.
This is especially clear in the CoLA heatmaps. The token-based measures divide the stack into more evident regions. The whole-input measures show shallow distances across a broad middle region and bring out close relationships within some layers at the edges. The stable conclusion across comparisons is that related heads occur in organized groups. A sharper claim about exactly where a group begins or ends needs to specify which kind of redundancy is being measured.
Changing the task preserves much of the map
The phase comparison changes the learned parameters through fine-tuning while using corresponding input conditions and measures for the maps. Its high correlations show that substantial parts of the head organization survive that transition. The cross-task comparison changes the input collection, and for fine-tuned checkpoints it also examines separately adapted BERT-base instances. The broad organization persists there as well. Together these tests establish the stability of an aggregate pattern under the kinds of task variation represented in GLUE.
The random-input test takes away the natural sentence content used by the benchmark examples and still recovers a similar arrangement in the pretrained checkpoint. This strengthens the case that the benchmark’s linguistic content is unnecessary for producing much of the average map. The authors propose a possible source of shared structure in BERT’s special tokens. Earlier work found heads that direct substantial weight toward punctuation or delimiter positions, and the paper points specifically to [CLS] and [SEP] as possible contributors. Since these positions recur in BERT input formatting, heads with common preferences for them can generate similar distributions across many examples.
That explanation is a hypothesis tied to the observations. The random-input comparison changes the source of the sequences. A dedicated test of the delimiter hypothesis would need to isolate the effect of the special positions on the resulting head map. The reported comparison establishes that natural task examples can be replaced for the purpose of estimating the broad structure. It leaves the contribution of formatting relative to other shared properties of BERT open.
Increasing pruning changes where heads are removed
The paper also examines what the clustering procedure does at different pruning ratios. Over 10 clustering trials, it records how often a head is removed and plots those frequencies by head and layer. This analysis describes selection behavior. A often removed head is one the clustering rule frequently leaves out of the retained representative set at a specified ratio.
When the pruning ratio is below 15%, heads in the initial four layers are pruned more frequently than heads deeper in the stack. In the range described as 25%∼75%, both early and deep layers are more likely to lose heads. As pruning becomes more aggressive, some heads in the middle layers still have a high chance of being retained, including at the 85% and 95% settings. The location of often removed heads therefore changes with the amount of compression. The first removals and the final decisions about what to retain bring out different parts of the cluster structure.
The concentration of early removals is consistent with the close head groups seen near the beginning of the stack. It also fits, in the authors’ interpretation, earlier observations that the earlier layers capture relatively superficial linguistic features. They conjecture that the representations available by the middle of the stack may already provide much of what the downstream tasks require, which could explain why later layers can lose many heads as long as some are retained. The selection frequencies support a statement about how the procedure behaves. The proposed explanation about where task information is formed remains an interpretation.
The study reports a drop in performance under the most aggressive pruning conditions, where heads that tend to survive milder pruning can be removed as well. Keep in view the scale of that intervention: a high pruning ratio changes a set of heads at once. The resulting development scores show that the reduced system has lost something important for adaptation at those settings. Assigning the drop to particular individual heads would require comparing interventions that isolate those heads from the rest of the retained set.
Varying dropout changes redundancy in different directions
The dropout experiments compare attention-side, hidden-side, and joint changes during Wiki103 pretraining. All three settings show a nonmonotonic response under the token-based JS measure. The mean distance first falls, reaching a low point at a dropout setting of 0.2 on that part of the curves. It then rises before falling again at higher dropout. Since smaller distance means greater redundancy, the extent of row-level agreement increases, weakens, and then increases again as dropout rises. A description based only on the endpoints would miss the reversal in the middle.
Under the sentence-based dCor measure, mean distance generally falls as dropout increases. That indicates stronger measured dependence between whole attention matrices at higher dropout. This trend is close to monotonic in the paper’s results. The JS curve and dCor curve can move in different directions over the same part of the dropout sweep because they summarize different relationships. One averages the closeness of matching rows. The other measures dependence over the matrices as wholes.
The comparison among dropout sites adds another result. The paper reports steeper changes for the hidden-side and joint settings than for the attention-side setting alone. By the authors’ interpretation, measured redundancy is more sensitive to dropout in the hidden transformations than to attention-side dropout in these runs. The comparison supports an effect of which training setting is varied, as well as of how much dropout is used. No single response curve describes the outcome across the two measures.
The dropout experiment addresses a cause more directly than the comparisons among GLUE tasks. The authors choose the dropout settings and retrain BERT from scratch, then measure the resulting attention. This makes dropout a controlled factor in the training setup. Its influence is still conditional on the Wiki103 training regime and the measure used at evaluation. The experiment connects a training choice to subsequent redundancy without fully explaining why the recurring groups take the shape observed in the pretrained checkpoint used elsewhere in the paper.
Limitations
Limits the authors state
The authors use BERT-base as their representative architecture and leave evaluation on other multilayer, multi-head systems and on more downstream tasks to future work. The observations about layer groups, stability, and pruning tolerance are grounded in the checkpoints and input collections they study. The shared architectural idea of multi-head attention motivates a broader question, while the particular groupings come from BERT-base.
The paper presents the pruning method as a case study and puts a comparative evaluation of other pruning methods outside its scope. Its direct development-score reference is unpruned BERT-base. That establishes what the reduced system preserves relative to its full counterpart under the described training setup. A comparison among pruning methods at matched ratios would answer the separate question of how much the redundancy-based choice contributes relative to other ways of picking the retained set.
The authors identify CoLA and STS-B as cases where their pruning results are harder to interpret. They suggest that fluctuations associated with the size of the development sets could play a role and defer stronger conclusions. This leaves a concrete limit on the reported task-agnostic property. The rule for selecting heads can be shared across tasks, and the evidence about a tolerable pruning level still varies with the task.
The authors also treat the fundamental cause of redundancy as open. Their training experiment varies dropout and demonstrates that the measured phenomenon responds to that choice. The response differs depending on the distance measure and where dropout is applied. The authors expect other factors to matter and leave a fuller explanation to future work. They likewise present their ideas about special tokens and the roles of early, middle, and deep heads as possible explanations of the patterns they observe.
Limits apparent from the design
The paper operationalizes redundancy using attention weights and their statistical relationships. The contribution of a head includes the vectors passed through those weights and the way the result is integrated with other computations. From a pair of similar attention patterns alone, the experiment can establish similarity of routing under the measure used. The claim that the heads supply equivalent information would require evidence about what they carry and how later layers respond. The pruning experiment adds functional evidence at the level of a selected set after fine-tuning.
The averaging procedure gives a view of recurring organization across examples. That same procedure can suppress behaviors that appear on a smaller subset of inputs. Two heads that are close on average may diverge on particular constructions or in examples that rely on a less common relation. Since benchmark scores also aggregate across examples, comparable overall performance after pruning can coexist with changes on narrower slices. The reported setup supports conclusions at the scale of the maps and benchmark scores it evaluates.
The phase comparison uses checkpoints at the endpoints of task adaptation, with a common pretrained starting point. It demonstrates that the measured relationships are persistent over that transition. The development of those relationships during original pretraining would require observations along the training trajectory. Likewise, agreement among separately fine-tuned checkpoints can arise partly from the structure they inherit. The study answers how much of that organization survives their adaptation, leaving its earliest emergence as a separate question.
Task independence is also bounded by the range of inputs and tasks compared. Random sequences provide a substantial change in the choice of ordinary tokens. They are still processed by the same BERT-base system. The experiment is well suited to demonstrating that the head map can be recovered without downstream examples. It is less suited to isolating a specific shared source of that structure. The proposed effect of special positions illustrates the distinction: their contribution could be examined by varying the formatting under controlled conditions.
Fine-tuning follows the head removal. The remaining computation can adapt to the reduction by adjusting its parameters with task data. The results therefore measure how well the pruned architecture can learn each task, including any compensation achieved during training. Performance immediately after head removal, with downstream parameters held fixed, would test a different property. That distinction also matters when interpreting a frequently retained head. Keeping it through the clustering process shows it frequently represents a group under the criterion. An intervention on that head would be required to establish its individual contribution.
The headline pruning ratios refer to the share of attention heads taken out. Realized changes in total parameter count, inference time, or resource use depend on the rest of BERT-base and the implementation of the reduced computation. The development results address the performance side of compression. A deployment claim about speed or memory would require measurements of those quantities under specified conditions.
Finally, the variation plotted across the pruning trials is a range from the observed best run to the worst run. A range describes the runs performed. It does not assign a confidence level or the probability that another run will stay below the same performance-loss threshold. The < 5% criterion is best read as the reported empirical comparison with the unpruned development baseline. The strength of that conclusion depends on the task, the observed variation, and the fine-tuning conditions.
What came after
The later citations span surveys, compression, evaluation, attention specialization, and work on answering questions through retrieval. The links establish where the paper was cited. The later titles identify the subjects under study, while the exact role of the citation and the extent of any method reuse remain unspecified. The connections below concern the questions each title brings into contact with the BERT-base results.
From head redundancy to questions about layers
ShortGPT takes up redundancy at the level of layers. That changes the unit of analysis. In Bian and colleagues’ paper, the head comparisons can cross layer boundaries, but the pruning method selects individual heads from groups. A whole layer encompasses more computation than the attention patterns of its individual heads. The relationship between the two questions is consequently specific: a head redundancy map motivates asking whether overlap persists at larger architectural scales. It does not itself provide a test of which layer can be removed. ShortGPT’s title identifies that larger unit as the subject of its compression investigation.
Redundancy as evidence in interpretation and evaluation
Explainability for Large Language Models: A Survey places a citation to the attention study in a broader body of work on explainability. The connection concerns how to interpret patterns extracted from internal computation. The attention study offers a case where several heads behave similarly under an interpretable measurement and an intervention can test how much capacity remains after some are removed. Its distinction between similar weights and comparable downstream function helps explain why the choice of evidence matters in a survey of this area.
The Dangers of Underclaiming addresses caution when drawing conclusions from apparent failures in NLP. The attention study supplies a related evaluation distinction. A score after heavy pruning is conditional on which heads were selected, how the reduced BERT-base was trained, and which task was used to assess it. A poor result under one such condition has a narrower meaning than a general claim about what a reduced system can learn. Conversely, a comparable aggregate score supports the retained architecture under the reported setup, with the uneven results across tasks setting its scope.
Specialization across development and lexical contexts
Start Making Sense(s) investigates attention specialization through lexical ambiguity. Lexical ambiguity gives a probe a focused kind of input: a token can have different senses depending on context. The comparison with the redundancy paper concerns the level at which structure is observed. Bian and colleagues look for aggregate relationships among heads and compare checkpoints before and after adaptation. A developmental probe framed around ambiguity asks how more specific head behavior can be studied in contexts that distinguish word senses. A head can belong to a recurring similarity group in an overall map while exhibiting distinctive behavior on inputs selected to expose specialization.
Moving from internal attention to retrieval
Think Parallax studies multi-hop problems through multiple retrieval views constructed around a knowledge graph. A multi-hop problem calls for connecting pieces of information through intermediate relations. Its subject is therefore the organization of evidence used for answering, in the setting of retrieval-augmented generation. The attention study examines which internal routes resemble one another. A multi-view retrieval system raises a related question at a different level: which views supply overlapping evidence, and which supply a connection that another view would miss? The citation connects the papers, while the redundancy measurements and pruning results reported by Bian and colleagues concern BERT-base heads.
Cite
Cite as Yuchen Bian, Jiaji Huang, Xingyu Cai, Jiahong Yuan and Kenneth Church. 2021. On Attention Redundancy: A Comprehensive Study. Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies.
@inproceedings{bian2021attention,
title = {{On Attention Redundancy: A Comprehensive Study}},
author = {Yuchen Bian, Jiaji Huang, Xingyu Cai, Jiahong Yuan and Kenneth Church},
booktitle = {Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies},
year = {2021},
doi = {10.18653/v1/2021.naacl-main.72},
url = {https://doi.org/10.18653/v1/2021.naacl-main.72}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bian-2021-attention-redundancy-comprehensive-study/