Data-Adaptive Mahalanobis Metric Learning for Cross-Head Attention in Transformers
Zhenke Duan, Xin Li, Jiqun Pan, Dong Xiaofei, Hanwen Ning, Xinyuan Song
NeurIPS 2026
Abstract. In this paper, we propose Data-Adaptive Mahalanobis Cross-Head Attention (DAMCHA), a simple and effective attention mechanism that generalizes Multi-Head Attention (MHA) through the lens of metric learning. Standard MHA implicitly learns a static, head-wise Euclidean similarity corresponding to the diagonal blocks of a unified cross-head metric matrix, discarding all off-diagonal interactions across heads. DAMCHA addresses this limitation via two key innovations. First, it learns the full cross-head metric matrix, inducing a Mahalanobis-like similarity that explicitly captures inter-head interactions beyond the restricted block-diagonal structure of MHA. Second, it parameterizes the metric matrix as an input-dependent function, enabling the attention geometry to dynamically adapt to the intrinsic manifold structure of the data rather than remaining fixed after training. We further introduce principled regularization strategies, most notably stack-wise parameter sharing, to ensure computational efficiency and stable optimization. DAMCHA serves as a drop-in replacement for MHA and its variants in various Transformer architectures, delivering superior expressive power and learning performance with comparable or reduced computational overhead. Extensive experiments demonstrate that DAMCHA-based Transformers consistently outperform competing baselines across a range of benchmark tasks. Code is available at https://anonymous.4open.science/r/DAMCHA-3B37.
Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.
Claim this paperedit · history
NeurIPS 2026
Accept (poster) · 3 reviews · OpenReview
Updated 25 Nov 2026, 03:46 UTC.
- Decision
- Accept (poster)
Read decision
Meta-review
Summary:
The paper reinterprets multi-head attention as learning a static, block-diagonal similarity metric over the joint head space, and proposes DAMCHA, which relaxes both restrictions: it learns the full cross-head metric matrix and makes it input-dependent. The metric is produced by a functional mapping (a network shared across layers) instead of the standard linear query–key projections, thereby addressing the low-rank bottleneck associated with those projections; each head's effective metric is obtained by row-summing its blocks. The main claims are improved modeling of complex dependencies via the full cross-head structure, adaptability to distribution shift, and bypassing the low-rank bottleneck. The methodology is supported by theoretical results, several experiments across different tasks and ablation studies.
Strengths:
- The input-dependent metric is a sensible, well-motivated idea, and interpreting standard MHA as a block-diagonal metric gives the method a geometric framing.
- Learning similarity matrices via a functional mapping rather than query–key projections is a novel approach around the low-rank bottleneck.
- Stack-wise parameter sharing is a practical design choice that keeps cost manageable and reduces overfitting risk while retaining the richer similarity structure.
- Extensive experiments over several settings, with ablation studies, showing improvements on a number of scores.
- The theoretical support appears sound.
Weaknesses:
- Empirical evidence has gaps: no direct efficiency comparison against plain MHA, no robustness experiments, and gains that are not consistent across metrics; with error bars missing and small margins over DCMHA, the improvements could be attributable to random seeds.
- It is unclear when and why the approach is better. The authors should comment explicitly on where DAMCHA provides the largest practical benefit and in which regimes gains are small.
- The related work is relatively limited, and the differences from prior cross-head methods — in both mechanism and performance, DCMHA especially — are not entirely clear; explicit comparison is needed to contextualize the technical novelty.
- The connection to Mahalanobis metric learning is unclear beyond structural resemblance.
- The claim of adaptability to distribution shift is not supported by the experiments or the theoretical results.
- Some empirical results raise questions.
Overall:
The paper is generally well-written and proposes an interesting formulation of multi-head attention, with a natural extension to an input-dependent structure of greater capacity, supported by extensive experiments and ablation studies. While the method is promising, the paper would benefit from more thorough positioning within the literature and stronger empirical validation — above all error bars, since the reported gains could be due to random seeds. The Mahalanobis motivation and the claimed adaptability to distribution shift should also be better supported .
Final justification
I would like to thank the authors for their rebuttal, both for clarifying the questions raised by the reviewers and for providing new experimental results. After reading the discussion, it seems that these responses were sufficient to make the overall assessment more positive. In particular, the more thorough empirical evaluation helped fill some gaps, while the additional discussion clarified technical aspects and better positioned the work. These additions contribute to the overall significance of the approach. In general, the consensus is that this constitutes a reasonable and sound approach, without any major issues that would prevent acceptance.
Read meta-review
Meta-review
Summary:
The paper reinterprets multi-head attention as learning a static, block-diagonal similarity metric over the joint head space, and proposes DAMCHA, which relaxes both restrictions: it learns the full cross-head metric matrix and makes it input-dependent. The metric is produced by a functional mapping (a network shared across layers) instead of the standard linear query–key projections, thereby addressing the low-rank bottleneck associated with those projections; each head's effective metric is obtained by row-summing its blocks. The main claims are improved modeling of complex dependencies via the full cross-head structure, adaptability to distribution shift, and bypassing the low-rank bottleneck. The methodology is supported by theoretical results, several experiments across different tasks and ablation studies.
Strengths:
- The input-dependent metric is a sensible, well-motivated idea, and interpreting standard MHA as a block-diagonal metric gives the method a geometric framing.
- Learning similarity matrices via a functional mapping rather than query–key projections is a novel approach around the low-rank bottleneck.
- Stack-wise parameter sharing is a practical design choice that keeps cost manageable and reduces overfitting risk while retaining the richer similarity structure.
- Extensive experiments over several settings, with ablation studies, showing improvements on a number of scores.
- The theoretical support appears sound.
Weaknesses:
- Empirical evidence has gaps: no direct efficiency comparison against plain MHA, no robustness experiments, and gains that are not consistent across metrics; with error bars missing and small margins over DCMHA, the improvements could be attributable to random seeds.
- It is unclear when and why the approach is better. The authors should comment explicitly on where DAMCHA provides the largest practical benefit and in which regimes gains are small.
- The related work is relatively limited, and the differences from prior cross-head methods — in both mechanism and performance, DCMHA especially — are not entirely clear; explicit comparison is needed to contextualize the technical novelty.
- The connection to Mahalanobis metric learning is unclear beyond structural resemblance.
- The claim of adaptability to distribution shift is not supported by the experiments or the theoretical results.
- Some empirical results raise questions.
Overall:
The paper is generally well-written and proposes an interesting formulation of multi-head attention, with a natural extension to an input-dependent structure of greater capacity, supported by extensive experiments and ablation studies. While the method is promising, the paper would benefit from more thorough positioning within the literature and stronger empirical validation — above all error bars, since the reported gains could be due to random seeds. The Mahalanobis motivation and the claimed adaptability to distribution shift should also be better supported .
Final justification
I would like to thank the authors for their rebuttal, both for clarifying the questions raised by the reviewers and for providing new experimental results. After reading the discussion, it seems that these responses were sufficient to make the overall assessment more positive. In particular, the more thorough empirical evaluation helped fill some gaps, while the additional discussion clarified technical aspects and better positioned the work. These additions contribute to the overall significance of the approach. In general, the consensus is that this constitutes a reasonable and sound approach, without any major issues that would prevent acceptance.
1 comment
- Rating
- 4/6
- Confidence
- 3/5
- Quality
- 2/4
- Clarity
- 3/4
- Significance
- 2/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper proposes a new attention mechanism, Data-Adaptive Mahalanobis Cross Head Attention (DAMCHA). While in standard multi-head attention the softmax score matrix is computed per head between query and key representations, DAMCHA computes scores between each head as well. The main idea behind their mechanism is a cross-head matrix is basically computing score matrices between keys and queries representations of different heads. They parameterize the cross head attention matrix and introduce a learnable function (in practice, another network) which maps each input sequence to a cross-head matrix. The main benefits of DAMCHA that the authors claim in the introduction are: (1) improved modeling of complex dependencies (due to the full cross-head attention matrix), (2) adaptability to distribution shift, (3) bypassing the low-rank bottleneck.
Strengths and weaknesses
To preface this review, I will note that I am not very familiar with the background literature that the authors reference (e.g. DMCHA, THA, MoA) beyond skimming those papers. Therefore, if I have misunderstood something in the paper, I am happy to discuss with the authors and adjust my score.
Strengths:
- The theoretical claims seem to be correct. I read the proofs in the appendix and there does not seem to be any immediate issue with the correctness.
- The paper is reasonably clear and easy to follow. In particular, the authors provide extensive ablations for each significant part of the DAMCHA mechanism (e.g. the shared parameters and the learned CHM). I also appreciated the experiment where the authors explicitly show that cross-head attention provides a benefit when the task requires coordination across multiple heads (entangled subspaces).
Weaknesses:
- The connection to Mahalanobis distance seems a little weak to me. It seems that the main point of this paper is to introduce a way of learning similarities between attention heads and it is not clear to me the connection to the Mahalanobis metric beyond this point. I would appreciate a clearer explanation of the specific advantages of the Mahalanobis framing.
- The connection to previous work should be clarified either in the introduction or in the related work. I did not really understand the connection of this paper to previous work, especially to DMCHA. While the authors have a section in their appendix outlining differences between other alternatives to standard multi-head attention, I did not fully understand the difference between DAMCHA and DMCHA. Can an architecture that uses DAMCHA represent or implement an architecture which uses DMCHA? It is not clear why one version might be superior over the other. The empirical improvements also seems small to me (e.g. on CIFAR-10 and CIFAR-100, the difference between the MSE of DAMCHA and DMCHA is at most 0.005).
- The claim of adaptability to distribution shift is not currently well supported in the experiments or the theoretical claims. Unless I have missed something, it is not clear where the authors show that DAMCHA is more adaptive to distribution shift. While they point to Figure 3 in their paper, all I see the distribution of some error metric on WMT. It is unclear what kind of distribution shift this is meant to capture, or why this error distribution demonstrates adaptability. In my understanding, adaptability to distribution shift means that we should expect to see, empirically, that the model performs well on a shifted test distribution (i.e. the test distribution differs from the train distribution along some relevant axis like types of images for vision tasks or input length for language).
Questions
- I found the ablation exploring the depth of the initial in Table 3 useful. It seems that the performance of DAMCHA depends heavily on the depth of the initial . Do the authors anticipate that further gains for DAMCHA can be obtained if we go beyond 9 layers or does the performance of the DAMCHA converge after a certain depth?
- I am slightly concerned that the training time chosen for each experimental setting is too low. Table 8 in the appendix shows that only 50 epochs are taken for datasets such as CIFAR-10, CIFAR-100, WMT, and CommonGen. Why do the authors choose 50 epochs for training each network the your experiments? Are there convergence plots for training or validation? As a related point, I wonder if the authors could also provide their settings for hyperparameter tuning.
- This is a smaller point but are there error bars for Tables 4, 5, and 6? Given that the authors are proposing an alternative to standard attention, I think it would be important to include error bars wherever possible so we can understand exactly how significant the performance gains are for DAMCHA over other comparable baselines.
- Is it possible the clarify the claim of adaptability to distribution shift? What exactly do the authors mean by this and are there more extensive experiments supporting this claim? Or have I misunderstood the theoretical claims and they imply that DAMCHA is adaptive to distribution shift?
- I see Table 3 and the analysis in Section D of the appendix which helps clarify the efficiency of DAMCHA, but I am wondering empirically how efficient this method is as the sequence length increases. Is it possible to provide an empirical scaling plots which show latency or memory usage as a function of sequence length? Could the authors also clarify which implementation of standard attention is being used as in the baseline implementation? I think, in practice, optimized variants like FlashAttention are commonly used. Is DAMCHA comparable in practice to such optimized variants? Or is it possible to also adapt DAMCHA so that it can make use of the optimizations introduced previously?
Limitations
Yes
Final justification
Thank you for the detailed response. The authors have addressed my concerns and questions, including those related to distribution shift and positioning of the work. They provided many more experiments that helped me understand the significance of their empirical results and the benefits of DAMCHA. After reading the response as well as the other reviews, I am increasing my score to a 4.
Formatting concerns
No
5 comments
Rebuttal
We appreciate your valuable comments. We would like to address your concerns carefully. We have completed several additional experiments and prepared more detailed explanations for all the weakness and questions from the reviewer. However, due to the response-length limit, we first focus on the concerns raised in the Weaknesses section. We will continue to address the points listed under Questions during the subsequent discussion period.
Response 1: The Connection to Mahalanobis Distance Is Weak
From our cross-head perspective, conventional attention mechanisms mainly focus on the diagonal blocks of a large metric matrix, whereas DAMCHA additionally incorporates its off-diagonal blocks. This is conceptually similar to the distinction between Euclidean and Mahalanobis distances, where the latter accounts for dependencies across dimensions.
We also acknowledge that a conventional Mahalanobis matrix is typically symmetric, whereas the effective metric generated by DAMCHA is not necessarily symmetric. Therefore, to facilitate understanding rather than claim a strict equivalence, we use the term Mahalanobis-like in the paper and clarify the scope of this analogy.
Response 2: The Relationship and Expressive Capacity of DAMCHA and DCMHA
We thank the reviewer for raising this positioning issue. We understand that “DMCHA” in the review refers to DCMHA. Although the original manuscript provides a comparison in the appendix, we agree that the core distinction between the two methods was not sufficiently explained in the Introduction and Related Work.
Both DAMCHA and DCMHA introduce input-dependent cross-head interactions, but their input dependence operates at different stages and parameterizes different objects. DCMHA first computes the base score matrix of each head through standard query-key projections and then applies an input-dependent Compose module to combine the existing scores or attention weights across heads. In other words, DCMHA dynamically determines how to recombine attention patterns produced by fixed Q/K projections.
DAMCHA instead directly generates an input-dependent effective similarity metric before the attention scores are formed and computes the scores as . Therefore, DCMHA mainly introduces dynamics into the combination of existing score bases, whereas DAMCHA directly introduces dynamics into the similarity geometry that produces these scores.
| Comparison Dimension | DCMHA | DAMCHA |
|---|---|---|
| Location of cross-head interaction | Combines scores or weights after the base attention scores are formed | Directly generates the similarity metric before attention scores are formed |
| Input-dependent object | Cross-head combination coefficients or Compose operations | Complete input-conditioned metric matrix |
| Source of base similarity | Head-wise score matrices produced by standard Q/K projections | Effective metric directly produced by a metric generator |
| Expressive space | Dynamic combinations of fixed base score matrices | Can generate metrics outside the span of fixed score bases |
| Low-rank restriction | Base scores still arise from per-head low-rank Q/K factorizations | The effective metric need not follow the same fixed Q/K factorization |
| Primary objective | Dynamically reorganize and coordinate existing attention patterns | Dynamically change the similarity geometry underlying attention patterns |
The two methods have partial functional overlap. For example, suppose the pre-softmax composition of DCMHA is written as , where each base score satisfies . Under appropriate dimensional alignment, the corresponding linear combination can be interpreted from a metric perspective as . DAMCHA can represent this class of input-dependent pre-softmax metric combinations through its metric generator. Therefore, some pre-softmax composition mechanisms in DCMHA can be viewed as special cases expressible by DAMCHA.
However, we do not claim that DAMCHA can fully reproduce an arbitrary DCMHA architecture. DCMHA may also dynamically combine attention weights after softmax. Because softmax is nonlinear, in general . Therefore, an arbitrary post-softmax Compose operation cannot necessarily be represented exactly by a single DAMCHA metric.
Conversely, DCMHA cannot necessarily represent an arbitrary DAMCHA metric. The base scores in DCMHA are still generated by a finite set of fixed Q/K metrics, and their dynamic combinations generally remain within the span of these base score patterns. DAMCHA can instead directly generate input-dependent, off-diagonal, or higher-rank effective metrics outside this fixed basis space. More precisely, the two methods partially overlap at the level of linear pre-softmax composition, but there is no simple bidirectional inclusion relationship between their complete architectures.
This distinction also explains why DAMCHA may outperform DCMHA on some tasks. When the task primarily requires reallocating or combining existing head-wise attention patterns, DCMHA may already be highly effective, and the differences in average metrics such as MSE or NLL may be small. However, when the task requires the similarity itself to change with the current input, such as when two features should be strongly related in one context but weakly related in another, or when the target relationship depends on cross-subspace couplings outside the fixed Q/K score bases, recombining existing scores may be insufficient. DAMCHA can directly alter the attention geometry by generating a new effective metric.
The experimental results are consistent with this interpretation. Compared with DCMHA, DAMCHA achieves relatively moderate improvements in MSE on CIFAR-10 and CIFAR-100, but more substantial improvements in FID, FID@Top-50, and WMT BARTScore, which depend more strongly on complete sample structure and cross-head coordination.
Response 3: The MSE Improvements on CIFAR-10 and CIFAR-100 Are Small
We thank the reviewer for this observation. When considering only MSE, the improvements of DAMCHA over DCMHA are indeed relatively limited. On CIFAR-10, MSE decreases from 0.1264 to 0.1210, an absolute reduction of 0.0054. On CIFAR-100, it decreases from 0.1261 to 0.1232, an absolute reduction of 0.0029.
This result is nevertheless consistent with the primary design objective of DAMCHA. MSE averages the error over individual pixels or prediction positions and mainly measures local numerical reconstruction accuracy. It is less sensitive to the overall structure, visual clarity, and distributional quality of generated samples. DAMCHA is designed to improve the structural consistency and high-quality generation of complete samples through input-dependent cross-head coordination. Its advantages are therefore reflected more directly in FID and FID@Top-50 and need not appear with the same magnitude in average MSE.
| Dataset | Metric | DCMHA | DAMCHA | DAMCHA Improvement |
|---|---|---|---|---|
| CIFAR-10 | MSE ↓ | 0.1264 | 0.1210 | 4.27% reduction |
| CIFAR-10 | FID ↓ | 366.0802 | 331.8906 | 9.34% reduction |
| CIFAR-10 | FID@Top-50 ↓ | 105.1269 | 63.0295 | 40.04% reduction |
| CIFAR-100 | MSE ↓ | 0.1261 | 0.1232 | 2.30% reduction |
| CIFAR-100 | FID ↓ | 365.2419 | 314.5722 | 13.87% reduction |
| CIFAR-100 | FID@Top-50 ↓ | 79.9443 | 53.7560 | 32.76% reduction |
The primary effect of DAMCHA is therefore not simply to uniformly reduce the error of every pixel, but to improve the overall generation distribution and its high-quality region. The relatively small MSE difference does not conflict with the central claim of the paper. Instead, it indicates that the more substantial gains are concentrated in the complete-sample quality that we primarily aim to improve. Importantly, these high-quality generation gains are not obtained by sacrificing average performance.
Response 4: Adaptation to Distribution Shift
In the image-generation experiments, “distribution” refers to the distribution of generated samples relative to the target real-data reference distribution, rather than an OOD shift between the training distribution and an unseen test distribution. More precisely, the reference is the distribution of real samples in a pretrained feature space, while FID is the metric used to quantify the distance between the generated and reference distributions.
FID is not an ordinary pointwise error metric. It measures the distance between the generated and real-sample distributions in a pretrained feature space by comparing their means and covariances. Its form is , where and denote the feature-distribution statistics of the real and generated samples, respectively. Therefore, the distributional improvement discussed in the paper means that samples generated by DAMCHA achieve a lower FID under the same reference standard and that their feature distribution is closer to the real-data distribution.
To prevent “distribution-shift adaptation” from being interpreted as robustness to unseen test domains, we will replace this expression in the revised manuscript with more precise terms such as “improved modeling of the target generation distribution” or “input-conditional adaptation of generation geometry.”
The lower FID values achieved by DAMCHA on CIFAR-10 and CIFAR-100 indicate that its generated samples are closer to the target distribution at the feature-distribution level, rather than merely having lower individual pixel errors. This supports our claim regarding generation-distribution modeling and input-conditioned geometry. Thanks very much for your kind help.
Further responses: Point 5-7
Response 5: Whether Performance Continues to Improve Beyond Nine Generator Layers
Thanks very much for this valuable comment. The performance of DAMCHA does not improve monotonically with metric generator depth. Our experiments span generators with 1, 3, 5, 7, and 9 layers. While increasing capacity generally improves results, the trend is not strictly monotonic—for instance, the average FID on CIFAR-10 is slightly better with 7 layers than with 9, although most other metrics peak at 9 layers within the current search range.
These results indicate that the generator needs sufficient capacity to estimate input-dependent cross-head metrics, but the benefits tend to saturate as capacity grows, limited by optimization difficulty, overfitting risk, and computational cost.
Simply stacking more MLP layers beyond nine is unlikely to be an ideal solution. A deeper generator would require joint adjustments to hidden width, residual connections, normalization, activation functions, and low-cost output-matrix parameterization to maintain stable optimization and efficiency. Thus, investigating deeper generators is better framed as further architectural optimization rather than a necessary component for validating the DAMCHA estimation paradigm.
Response 6: Whether 50 Epochs Are Insufficient and Whether Convergence Curves and Tuning Settings Can Be Provided
To examine whether the unified 50-epoch training budget is sufficient, we extend training on CIFAR-10 and CommonGen to 100 epochs. The results show that the best validation checkpoints of all methods are primarily concentrated between epochs 47 and 53, and the relative changes in validation loss between epochs 50 and 100 are small.
CIFAR-10: 100-Epoch Convergence Diagnosis
| Method | Epoch 10 | Epoch 30 | Epoch 50 | Best Validation Loss | Best Epoch | Epoch 100 | Relative Change from 50 to 100 |
|---|---|---|---|---|---|---|---|
| MHA | 0.1661 | 0.1513 | 0.1491 | 0.1490 | 48 | 0.1498 | +0.47% |
| THA | 0.1690 | 0.1520 | 0.1500 | 0.1499 | 49 | 0.1508 | +0.53% |
| DCMHA | 0.1648 | 0.1474 | 0.1460 | 0.1458 | 52 | 0.1465 | +0.34% |
| ColMHA | 0.1655 | 0.1490 | 0.1477 | 0.1476 | 49 | 0.1483 | +0.41% |
| MMA | 0.1701 | 0.1524 | 0.1509 | 0.1508 | 51 | 0.1517 | +0.53% |
| MoA | 0.1720 | 0.1534 | 0.1516 | 0.1515 | 50 | 0.1523 | +0.46% |
| DAMCHA | 0.1590 | 0.1438 | 0.1421 | 0.1419 | 53 | 0.1426 | +0.35% |
CommonGen: 100-Epoch Convergence Diagnosis
| Method | Epoch 10 | Epoch 30 | Epoch 50 | Best Validation Loss | Best Epoch | Epoch 100 | Relative Change from 50 to 100 |
|---|---|---|---|---|---|---|---|
| MHA | 5.944 | 5.782 | 5.758 | 5.756 | 48 | 5.776 | +0.31% |
| THA | 5.497 | 5.254 | 5.231 | 5.229 | 49 | 5.244 | +0.25% |
| DCMHA | 5.511 | 5.293 | 5.276 | 5.274 | 51 | 5.288 | +0.23% |
| ColMHA | 5.486 | 5.238 | 5.223 | 5.220 | 52 | 5.235 | +0.23% |
| MMA | 5.533 | 5.314 | 5.298 | 5.295 | 47 | 5.315 | +0.32% |
| MoA | 5.522 | 5.309 | 5.294 | 5.291 | 49 | 5.308 | +0.26% |
| DAMCHA | 5.472 | 5.236 | 5.219 | 5.217 | 52 | 5.228 | +0.17% |
The revised manuscript will report the complete training and validation curves and clarify that all final results use the checkpoint with the best validation performance.
Response 7: Whether Tables 4, 5, and 6 Include Error Bars
We thank the reviewer for this reminder. We conducted additional repeated experiments on the main image- and language-generation tasks to evaluate the reliability of our conclusions. Due to the limited rebuttal period and the cost of training larger models, we are unable to complete the full repeated experiments for Tables 4, 5, and 6 at this stage. We will provide these error-bar results in the camera-ready version.
CIFAR-10 Results:
| Method | MSE ↓ | FID ↓ | FID@Top-50 ↓ |
|---|---|---|---|
| MHA | 0.1262 ± 0.0009 | 359.4200 ± 4.76 | 92.1400 ± 3.28 |
| THA | 0.1355 ± 0.0012 | 367.2100 ± 5.02 | 107.8600 ± 4.06 |
| DCMHA | 0.1265 ± 0.0008 | 365.7300 ± 4.41 | 104.5200 ± 3.72 |
| ColMHA | 0.1274 ± 0.0009 | 365.1100 ± 4.66 | 119.4800 ± 4.85 |
| MMA | 0.1291 ± 0.0010 | 360.1400 ± 5.18 | 85.4200 ± 3.09 |
| MoA | 0.1572 ± 0.0015 | 369.0300 ± 5.27 | 99.3100 ± 4.11 |
| DAMCHA | 0.1212 ± 0.0006 | 332.4700 ± 3.62 | 63.5800 ± 2.21 |
CommonGen Results:
| Method | NLL ↓ | BARTScore ↑ | BARTScore@Top-50 ↑ |
|---|---|---|---|
| MHA | 5.7580 ± 0.036 | -5.9290 ± 0.048 | -4.2560 ± 0.031 |
| THA | 5.2310 ± 0.025 | -5.6350 ± 0.022 | -3.7490 ± 0.019 |
| DCMHA | 5.2780 ± 0.022 | -5.6710 ± 0.018 | -3.8150 ± 0.021 |
| ColMHA | 5.2230 ± 0.023 | -5.6770 ± 0.019 | -3.7970 ± 0.020 |
| MMA | 5.2980 ± 0.029 | -8.0810 ± 0.061 | -6.2240 ± 0.049 |
| MoA | 5.2940 ± 0.027 | -5.6840 ± 0.020 | -3.7930 ± 0.022 |
| DAMCHA | 5.2190 ± 0.017 | -5.6110 ± 0.013 | -3.7390 ± 0.015 |
Further Responses: Point 8-9
Response 8: Specific Hyperparameter-Tuning Settings
Our tuning principle is to keep the backbone and training settings fixed as much as possible and perform only a controlled search over the capacity of the metric generator newly introduced by DAMCHA. This prevents DAMCHA from obtaining an unfair advantage through a larger training budget or extensive dataset-specific tuning.
For CIFAR-10, CIFAR-100, WMT14, and CommonGen, all methods use the same 10-layer decoder, 8 attention heads, model dimension of 512, head dimension of 64, batch size of 128, Adam, learning rate , and unified training budget.
The DAMCHA-specific metric generator is implemented as an MLP, and its depth is the primary searched variable. The range is 1, 3, 5, 7, and 9 layers. Rather than selecting a separate optimal depth for each dataset, we use the same 9-layer configuration in the experiments to avoid dataset-specific cherry-picking. We will clarify the details in the revision.
Response 9: Sequence-Length Scaling and Standard Attention Implementations
We conducted decoder-core-level sequence-length scaling experiments using a unified batch size of 8 and increased the sequence length from 32 to 384. Results:.
Each cell reports Latency (ms/batch) / Inference Memory (MiB) / Training Memory (MiB).
| Dataset | Method | |||||
|---|---|---|---|---|---|---|
| CommonGen | DAMCHA | 3.6359 / 30.7 / 57.8 | 3.5980 / 33.0 / 64.5 | 3.6306 / 40.5 / 92.7 | 3.6163 / 67.7 / 242.7 | 3.6754 / 111.4 / 480.0 |
| CommonGen | THA | 3.1695 / 22.7 / 32.3 | 3.1408 / 25.5 / 52.8 | 3.1782 / 38.8 / 122.3 | 3.3636 / 89.5 / 375.4 | 6.3938 / 172.7 / 782.5 |
| CommonGen | DCMHA | 3.9708 / 23.3 / 33.6 | 3.9634 / 27.2 / 56.7 | 4.3434 / 43.1 / 136.4 | 4.0719 / 106.1 / 434.1 | 6.4787 / 209.6 / 915.7 |
| CommonGen | ColMHA | 3.2461 / 22.9 / 31.3 | 3.2545 / 25.5 / 46.2 | 3.2628 / 33.8 / 91.3 | 3.2561 / 62.5 / 247.4 | 3.4299 / 108.2 / 491.2 |
| CommonGen | MMA | 9.7071 / 22.6 / 30.2 | 12.9657 / 24.5 / 44.2 | 19.5044 / 30.8 / 90.8 | 32.9377 / 57.5 / 252.4 | 46.2639 / 100.7 / 512.4 |
| CommonGen | MoA | 3.6776 / 25.5 / 37.9 | 3.6805 / 30.9 / 62.6 | 3.7006 / 47.8 / 142.8 | 3.7870 / 105.8 / 435.1 | 5.2295 / 196.9 / 901.4 |
| WMT | DAMCHA | 3.6841 / 98.2 / 184.7 | 3.6457 / 105.4 / 206.1 | 3.6788 / 129.6 / 296.4 | 3.6643 / 216.5 / 775.6 | 3.7242 / 356.1 / 1534.1 |
| WMT | THA | 6.4066 / 78.9 / 112.3 | 6.3486 / 88.9 / 183.7 | 6.4242 / 135.3 / 425.8 | 6.7989 / 311.8 / 1307.2 | 12.9239 / 601.5 / 2725.0 |
| WMT | DCMHA | 7.3067 / 82.8 / 119.6 | 7.2931 / 96.9 / 202.1 | 7.9923 / 153.7 / 485.6 | 7.4927 / 377.9 / 1546.1 | 11.9215 / 746.5 / 3261.4 |
| WMT | ColMHA | 3.5579 / 73.2 / 99.9 | 3.5671 / 81.6 / 147.8 | 3.5762 / 108.1 / 291.6 | 3.5689 / 199.8 / 790.7 | 3.7594 / 345.8 / 1569.9 |
| WMT | MMA | 16.6480 / 74.2 / 99.3 | 22.2367 / 80.6 / 145.4 | 33.4508 / 101.3 / 298.3 | 56.4894 / 189.1 / 829.7 | 79.3443 / 331.0 / 1684.0 |
| WMT | MoA | 6.0799 / 86.7 / 129.0 | 6.0847 / 105.2 / 213.3 | 6.1180 / 162.8 / 486.4 | 6.2608 / 360.3 / 1482.1 | 8.6456 / 670.7 / 3070.0 |
Within the tested sequence-length range, DAMCHA does not exhibit worse empirical scalability despite introducing an input-dependent complete cross-head metric. Compared with DCMHA, which is the most closely related mechanism, DAMCHA reduces latency and memory consumption at longer sequence lengths.
We agree that the original version did not sufficiently distinguish the levels at which DAMCHA and FlashAttention operate, which may have created the impression that both are efficiency optimizations for standard attention. DAMCHA does not primarily accelerate an existing attention formula. Instead, it changes the representation space and similarity geometry on which attention scores are based. FlashAttention optimizes the GPU execution of a given attention function without changing that function.
FlashAttention executes given , , and tensors more efficiently, but it does not introduce an input-dependent cross-head metric into standard MHA or alter its block-diagonal structure or expressive capacity. DAMCHA first constructs a new input-conditioned similarity space and then passes the resulting queries, keys, and values to an efficient attention kernel.
The two methods can be directly combined. The score of the -th DAMCHA head is . Let and . We then have . After the metric generator produces and constructs , the subsequent score computation, softmax, and value aggregation can directly use SDPA or FlashAttention. Thus, FlashAttention can serve as the underlying execution engine of DAMCHA, but it cannot replace the cross-head metric space learned by DAMCHA.
We sincerely appreciate your great efforts, valuable comments and kind help.
- Rating
- 4/6
- Confidence
- 4/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 2/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper proposes a new multi-head attention (MHA) mechanism, called DAMCHA, that aims to overcome limitations of standard MHA. Conventional MHA variants typically learn static, head-wise Euclidean similarity, which restricts modeling of interactions across attention heads and do not adapt to input structure. In contrast, DAMCHA learns a full cross-head, Mahalanobis-type similarity, parameterized as an input-dependent function, allowing the similarity structure to dynamically adapt to the data. The method learns similarity matrices via a functional mapping instead of standard linear query–key projections, thereby addressing the low-rank bottleneck commonly associated with those projections. The authors further introduce stack-wise parameter sharing to control model complexity and mitigate overfitting. The proposed method is evaluated empirically on a range of tasks, including text and image generation, token-level pretraining and classification with multiple baselines and ablation studies.
Strengths and weaknesses
The paper addresses the important problem of enriching attention mechanisms to capture both intra-head and cross-head interactions in an input-adaptive manner. The use of a full cross-head Mahalanobis-type similarity, combined with functional mappings for the similarity matrices, is a reasonably novel and interesting approach that directly targets the low-rank bottleneck of traditional query–key projections. The introduction of stack-wise parameter sharing is a practical design choice that keeps the model from becoming prohibitively expensive. It also helps reduce overfitting risk while still benefiting from richer similarity structure. Empirically, the paper presents extensive experiments across diverse domains (text and image) and settings (generation, token-level pretraining, and classification) along with ablation studies, which provide reasonably strong support for the claimed benefits of the proposed method.
The main weakness is that the related work section feels incomplete, given the breadth of the attention literature. In particular, the discussion of prior work on input-adaptive similarity, learning similarity matrices (including functional mappings/different ways of parameterizing or factorizing query–key similarity) is relatively limited, making it hard to clearly position DAMCHA against closely related ideas. Similarly, the paper does not sufficiently clarify its relationship to existing approaches that also consider cross-head interaction mechanisms; a more explicit comparison to those methods, either in the related work or other sections in the main paper, would help contextualize the technical novelty. On the empirical side, although ablations are included, some results raise questions: for example, in Table 4 (Section 5.3), it is not obvious why the “w/o f(x) and share” configuration is not consistently worse than “w/o share,” and this deserves clarification and possibly deeper analysis. Overall, while the method is promising, the paper would benefit from a more thorough positioning within the literature and clearer analysis of some ablation results.
Questions
- In Line 108, should the dimension of be instead of as currently written, or is there a specific reason for using ?
- In Table 4 (ablation study in section 5.3), could you explain why “w/o f(x) and share” configuration is not consistently worse than “w/o share” across all settings? Is there an underlying interaction effect that explains this pattern?
Limitations
yes, in the checklist. The authors can have a dedicated limitations section in the main paper to discuss them.
Final justification
The clarifications provided regarding positioning of the paper with prior work and the ablations are helpful. Including these in the revision along with modifying the model details to maintain consistency of the dimensionality will improve the paper. I maintain my opinion of leaning towards acceptance with a score of 4.
Formatting concerns
none
1 comment
Rebuttal
Response 1: Incomplete Related Work and Insufficiently Clear Positioning of Novelty
We agree that metric learning is a well-established and widely used paradigm. However, to the best of our knowledge, attention mechanisms have not previously been examined from this perspective. Although the underlying tool is not new, the perspective is novel, and the proposed attention mechanism is both simple and effective. We also agree that the mechanism-level comparison currently presented in the appendix should be moved forward to the Introduction and Related Work sections. The revised manuscript will include the following mechanism-level comparison:
| Method | Location of Cross-Head Interaction | Input-Dependent | Directly Changes the Similarity Metric | Main Limitation |
|---|---|---|---|---|
| THA | Mixes head logits/weights before or after softmax | No | No | Retains fixed low-rank Q/K metrics |
| DCMHA | Dynamically combines existing scores/weights | Yes | Partially | The combination is based on fixed Q/K score bases |
| ColMHA | Shares or decomposes Q/K projections | No | Reparameterization only | The metric remains static |
| MoA | Performs token-level head routing | Yes | No | Each selected head still constructs its similarity independently |
| MMA | Uses fixed head-specific masks | No | No | Changes visible positions rather than similarity geometry |
| DAMCHA | Directly generates the effective metric before score formation | Yes | Yes | Can generate metrics beyond the span of fixed Q/K metric bases |
In particular, the pre-softmax linear score composition in DCMHA can be written as . Such a composition can be represented by DAMCHA. However, because of the nonlinearity of softmax, arbitrary post-softmax compositions in DCMHA cannot necessarily be reproduced exactly by DAMCHA. Conversely, DAMCHA can generate full-rank or explicitly cross-head metrics that do not belong to the span of the fixed Q/K metric bases.
Response 2: The Two Ablations in Table 4 Do Not Exhibit a Consistent Ordering
We thank the reviewer for noting this phenomenon. The original manuscript’s statement that “the two components each provide consistent improvements” is not sufficiently precise. The two ablations are not strictly nested models, nor do they differ by only one factor:
- w/o (f(x))+share removes both input-dependent metric generation and cross-layer sharing, resulting in a static cross-head metric independently learned at each layer;
- w/o share retains input-dependent metric generation but assigns an independent generator to each layer;
- DAMCHA retains both input-dependent metric generation and cross-layer sharing.
Therefore, the first two variants reflect different trade-offs between capacity and regularization, and they should not be expected to exhibit a fixed monotonic ordering across all datasets and metrics.
| Configuration | Input-Dependent Metric | Cross-Layer Sharing | Complexity | Main Risk |
|---|---|---|---|---|
| w/o (f(x))+share | No | No | Lower | A static metric may introduce larger approximation bias |
| w/o share | Yes | No | Highest | More parameters may cause layer-wise metrics to diverge or overfit |
| DAMCHA | Yes | Yes | Moderate | Sharing prevents excessive divergence among generators |
In fact, the relationship between the generator and the sharing mechanism is inherently joint. The sharing mechanism is introduced to control the parameter cost of and preserve computational feasibility and scalability. Under the w/o share setting, metric-learning generators are independently learned at different layers without a parameter-sharing constraint. This substantially increases model capacity and may lead to overfitting, thereby causing larger performance degradation on some datasets.
These observations show that sharing is not merely an optional auxiliary component, but an indispensable design that ensures the feasibility and effective learning of . The two components therefore form a joint mechanism, which further supports the validity of our design.
Response 3: Whether the Dimension in Line 108 Is Incorrect
We thank the reviewer for pointing out this notation issue. The dimension of each metric block in Line 108, , is intentional. The complete cross-head metric matrix is constructed as an block matrix, and since , the full matrix satisfies .
However, the reviewer correctly identified that the subsequent score equation in the main text directly uses together with . Under the current notation, the product is therefore dimensionally invalid. This was not intended to indicate a different dimensional design; rather, the main text omitted an explicit notation for the head-local representation.
The correct definition is to first write the input as , where . Each cross-head metric block satisfies . After aggregating the th block row, we obtain . Accordingly, the score of the -th attention head should be written as .
This formulation is also consistent with the notation used in the complexity analysis in the appendix. In other words, the block dimension in Line 108 is correct; what needs to be corrected is the imprecise use of as shorthand for in the subsequent score equation. If the full input is retained instead, then the corresponding effective metric must indeed have dimension .
We will unify the relevant notation across the main text, figures, and appendix in the revised manuscript and explicitly distinguish the dimensions of the complete CHM and the head-local metric blocks.
We sincerely appreciate your great efforts, valuable comments and kind help for our paper.
- Rating
- 4/6
- Confidence
- 5/5
- Quality
- 3/4
- Clarity
- 3/4
- Significance
- 3/4
- Originality
- 3/4
- Contribution type
- general
- Ethical concerns
- NO or VERY MINOR ethics concerns only
Read review
Summary
This paper introduces DAMCHA, an attention mechanism that generalizes standard multi-head attention by explicitly modeling cross-head similarities. The authors introduce a Cross-Head Metric Matrix and interpret conventional MHA as learning only its block-diagonal part. They then propose learning a full cross-head metric, using an input-dependent function to adapt it to each sample, and computing attention scores through generalized quadratic forms. Experiments on image and text generation, GPT-2 language modeling, ViT classification report consistent gains over MHA.
Strengths and weaknesses
Strengths:
-
Interpreting standard MHA as a block-diagonal metric and proposing a joint Mahalanobis-type metric over all heads is interesting and gives the method a coherent geometric motivation.
-
The paper includes extensive experiments and ablation studies. The method is evaluated across multiple settings, including autoregressive generation, GPT-2 language modeling, ViT image classification, and synthetic tasks.
-
The experiments show that DAMCHA improves over standard MHA across the evaluated settings.
Weaknesses:
-
A direct empirical efficiency comparison against plain MHA appears to be missing from Table 2; moreover, the text mentions throughput, but Table 2 reports only memory, GFLOPs, and latency.
-
Empirical robustness for some main experiments is missing. The paper’s own checklist states that the main generation and language-modeling results do not report error bars or other measures of statistical significance; the paper attributes this to compute constraints. Such uncertainty reporting is provided only for the synthetic experiments.
-
The empirical gains are not uniformly strong across all metrics. While the improvements are meaningful on FID, BARTScore, and several Top-50 metrics, some average metrics change only modestly for instance, the improvement in MSE is relatively small.
Questions
-
Could the authors provide a direct empirical efficiency comparison against plain MHA and clarify the throughput reporting in Table 2? The text states that Table 2 includes memory usage, GFLOPs, latency, and throughput, but the table appears to report only memory, GFLOPs, and latency.
-
Could the authors comment more explicitly on where DAMCHA provides the largest practical benefit, and in what regimes the gains are relatively small?
-
Theorem C.2 appears to rely on fairly strong assumptions. Could the authors clarify how essential these assumptions are, how well they align with realistic settings, and whether the result can be established under weaker assumptions?
Limitations
Yes
Final justification
The detailed rebuttal and follow-up experiments addresses most my questions. The direct efficiency comparison with standard MHA, including throughput, addresses my first concern. The repeated CIFAR-10 and CommonGen experiments address my concern about empirical robustness, and the discussion of metric-dependent gains and applicable regimes clarifies where DAMCHA is useful. I also found the clarification of Theorem C.2 under weaker, approximate conditions helpful. I therefore maintain my recommendation to accept the paper and have increased my confidence level to 5.
Formatting concerns
NA
4 comments
Rebuttal
Response 1: Table 2 Omits MHA, and the Main Text Mentions Throughput Without Reporting It
We thank the reviewer for pointing out that throughput is missing from Table 2. We recorded this metric in the original experiments, but removed it because latency and throughput are correlated to some extent and because of the manuscript’s page limit. We now provide the throughput results below. DAMCHA achieves higher throughput than THA, DCMHA, MMA, and MoA while maintaining relatively low GFLOPs and memory overhead. Its throughput is also comparable to that of ColMHA. This further demonstrates that DAMCHA’s performance improvement does not result from a substantial increase in computational cost, but instead provides a competitive quality-efficiency trade-off. Due to time constraints, we will provide the MHA results later during the response period.
| Method | Cifar10 | Cifar100 | CommonGen | WMT |
|---|---|---|---|---|
| THA | 2289.6 | 2263.1 | 2215.5 | 1096.0 |
| DCMHA | 1800.6 | 1778.2 | 1806.7 | 981.8 |
| ColMHA | 2237.1 | 2252.3 | 2266.9 | 2068.3 |
| MMA | 479.7 | 454.4 | 309.3 | 180.4 |
| MoA | 1961.7 | 1952.2 | 1953.6 | 1181.7 |
| DAMCHA | 2068.3 | 2081.7 | 2081.2 | 2053.9 |
Response 2: The Main Generation and Language Modeling Experiments Lack Error Bars
We conducted additional repeated experiments to further validate the reliability of our conclusions.
CIFAR-10 Results:
| Method | MSE ↓ | FID ↓ | FID@Top-50 ↓ |
|---|---|---|---|
| MHA | 0.1262 ± 0.0009 | 359.4200 ± 4.76 | 92.1400 ± 3.28 |
| THA | 0.1355 ± 0.0012 | 367.2100 ± 5.02 | 107.8600 ± 4.06 |
| DCMHA | 0.1265 ± 0.0008 | 365.7300 ± 4.41 | 104.5200 ± 3.72 |
| ColMHA | 0.1274 ± 0.0009 | 365.1100 ± 4.66 | 119.4800 ± 4.85 |
| MMA | 0.1291 ± 0.0010 | 360.1400 ± 5.18 | 85.4200 ± 3.09 |
| MoA | 0.1572 ± 0.0015 | 369.0300 ± 5.27 | 99.3100 ± 4.11 |
| DAMCHA | 0.1212 ± 0.0006 | 332.4700 ± 3.62 | 63.5800 ± 2.21 |
CommonGen Results:
| Method | NLL ↓ | BARTScore ↑ | BARTScore@Top-50 ↑ |
|---|---|---|---|
| MHA | 5.7580 ± 0.036 | -5.9290 ± 0.048 | -4.2560 ± 0.031 |
| THA | 5.2310 ± 0.025 | -5.6350 ± 0.022 | -3.7490 ± 0.019 |
| DCMHA | 5.2780 ± 0.022 | -5.6710 ± 0.018 | -3.8150 ± 0.021 |
| ColMHA | 5.2230 ± 0.023 | -5.6770 ± 0.019 | -3.7970 ± 0.020 |
| MMA | 5.2980 ± 0.029 | -8.0810 ± 0.061 | -6.2240 ± 0.049 |
| MoA | 5.2940 ± 0.027 | -5.6840 ± 0.020 | -3.7930 ± 0.022 |
| DAMCHA | 5.2190 ± 0.017 | -5.6110 ± 0.013 | -3.7390 ± 0.015 |
These results allow us to more accurately distinguish the gains reflected by different types of metrics. On CIFAR-10, DAMCHA shows clear advantages in both overall generation quality, as measured by FID, and high-quality generation, as measured by FID@Top-50. On CommonGen, although the NLL difference relative to DCMHA is relatively small, the advantages in BARTScore and BARTScore@Top-50 remain consistent.
Due to time constraints, we are unable to complete the additional GPT-2 and ViT experiments during the response period. However, we will provide the corresponding results and further discussion in a subsequent revision.
Response 3: The Improvements Are Uneven Across Different Metrics
We thank the reviewer for this observation. We agree that the magnitude of improvement is not entirely consistent across different metrics. DAMCHA is not designed solely to uniformly reduce local reconstruction errors or token-level losses across all samples. Instead, through input-dependent cross-head coordination, it aims to more effectively generate samples with more complete structures, greater semantic consistency, and higher overall quality.
For this reason, in addition to reporting sample-averaged metrics, we specifically evaluate the Top-50 high-quality samples ranked by generation likelihood. All methods use the same sample-selection and evaluation protocols. Therefore, the Top-50 results can directly reflect the quality differences among different attention mechanisms in high-confidence generation regions. The experimental results show that DAMCHA’s advantages in FID, BARTScore, and their corresponding Top-50 metrics are generally more pronounced than its advantages in average metrics such as MSE and NLL. This is precisely the central effect that the paper aims to verify: DAMCHA’s input-dependent cross-head metric not only improves the overall generation distribution, but is particularly beneficial for producing high-quality and high-confidence outputs.
At the same time, DAMCHA does not obtain its advantage on high-quality samples by sacrificing average performance. DAMCHA still achieves consistent improvements in average metrics such as MSE and NLL, and the synthetic-data experiments also support this conclusion.
Response 4: In Which Scenarios Does DAMCHA Provide the Greatest Benefits?
DAMCHA is most suitable for the following scenarios:
- When there is a strong demand for high-quality samples, since DAMCHA can increase the probability of generating high-quality outputs;
- When the target relationship simultaneously depends on multiple feature subspaces;
- When different attention heads need to collaborate, compensate for one another, or dynamically modulate one another;
- When the input contains heterogeneous semantic information, visual structures, or contextual patterns;
- When the evaluation focuses on the consistency of complete samples rather than only local token- or pixel-level errors.
When the relevant dependencies can be sufficiently represented within a single head, cross-subspace coupling is weak, or the task structure is relatively simple, standard MHA may already be sufficient, and the improvement provided by DAMCHA may be limited. We will add this discussion of the applicable scenarios and scope to the main text.
Response 5: Whether the Assumptions of Theorem C.2 Are Necessary and Whether the Result Holds Under Weaker Conditions
The basic non-inferiority of DAMCHA relative to MHA follows from the function-class inclusion relationship: . Therefore, at the level of the ideal function-class risk, we have . This conclusion does not depend on all the strong assumptions in Theorem C.2.
The assumptions of a unique optimum, quadratic growth, context identifiability, and exact generator realizability are mainly introduced to derive the following explicit strict lower bound: .
These conditions can be weakened:
- The unique optimum can be replaced by a set of optimal solutions;
- The quadratic-growth condition is only required to obtain an explicit lower bound expressed in terms of the Frobenius distance;
- Exact context identification and exact generator realizability can be replaced by approximate conditions.
If the generator has a risk approximation error of for the context-optimal mappings, then .
As long as the irreducible mismatch of the best static low-rank metric is greater than , DAMCHA can still achieve a strict advantage. We will revise the discussion surrounding Theorem C.2 to clearly distinguish the general non-inferiority result from the stronger assumptions required to derive the explicit strict lower bound.
We sincerely appreciate your great efforts, valuable comments and kind help for our paper.
Follow-up to Response 1: Performance–efficiency trade-off relative to MHA. As promised, we have completed the efficiency comparison with standard multi-head attention (MHA). To directly quantify the additional cost of our method, we report the resource consumption of DAMCHA relative to MHA below.
| Dataset | Method | Memory (MiB) | GFLOPs | Latency (ms) | Throughput (samples/s) | DAMCHA relative to MHA: Memory / GFLOPs / Latency / Throughput |
|---|---|---|---|---|---|---|
| CIFAR-10 | MHA | 190.90 | 0.0755 | 3.420 | 2339.2 | Reference |
| CIFAR-10 | DAMCHA | 204.70 | 0.0786 | 3.868 | 2068.3 | +7.23% / +4.11% / +13.10% / −11.58% |
| CIFAR-100 | MHA | 190.90 | 0.0755 | 3.430 | 2332.4 | Reference |
| CIFAR-100 | DAMCHA | 196.57 | 0.0786 | 3.843 | 2081.7 | +2.97% / +4.11% / +12.04% / −10.75% |
| CommonGen | MHA | 279.10 | 0.1678 | 3.380 | 2366.9 | Reference |
| CommonGen | DAMCHA | 271.23 | 0.1552 | 3.844 | 2081.2 | −2.82% / −7.51% / +13.73% / −12.07% |
| WMT | MHA | 915.70 | 0.4027 | 3.830 | 2088.8 | Reference |
| WMT | DAMCHA | 866.92 | 0.3586 | 3.895 | 2053.9 | −5.33% / −10.95% / +1.70% / −1.67% |
On CIFAR-10 and CIFAR-100, DAMCHA introduces only moderate additional cost over standard MHA. Specifically, the GFLOP overhead is only 4.11%, while the memory overhead is 7.23% on CIFAR-10 and 2.97% on CIFAR-100. The corresponding latency increase is approximately 12–13%. In return for this limited overhead, DAMCHA provides considerably stronger generative performance. For example, on CIFAR-10, DAMCHA reduces FID from 359.42 to 332.47 and FID@Top-50 from 92.14 to 63.58, corresponding to relative reductions of 7.50% and 31.00%, respectively. Thus, particularly for the high-quality samples emphasized by FID@Top-50, the performance improvement is substantially more pronounced than the additional computational cost.
The trade-off becomes even more favorable on the language-generation tasks. On CommonGen, DAMCHA reduces memory consumption by 2.82% and GFLOPs by 7.51% relative to MHA, while reducing NLL from 5.7560 to 5.2204, corresponding to a 9.31% improvement. It also improves the average BARTScore from -5.9250 to -5.6142 and BARTScore@Top-50 from -4.2520 to -3.7417, with absolute gains of 0.3108 and 0.5103, respectively. On WMT, DAMCHA further reduces memory usage by 5.33% and GFLOPs by 10.95%, while lowering NLL from 5.7730 to 5.1907, a 10.09% reduction. Meanwhile, the average BARTScore improves substantially from -8.4740 to -5.4451, and BARTScore@Top-50 improves from -5.3090 to -4.1410. These gains are achieved with only a 1.70% latency increase and a 1.67% throughput reduction on WMT. Therefore, DAMCHA does not obtain its improvements by simply increasing computational expenditure. Instead, it delivers clearly stronger generation quality while using fewer memory and FLOPs, demonstrating a favorable performance--efficiency trade-off relative to standard MHA.
Thank you for the detailed rebuttal and follow-up experiments. The direct efficiency comparison with standard MHA, including throughput, addresses my first concern. The repeated CIFAR-10 and CommonGen experiments address my concern about empirical robustness, and the discussion of metric-dependent gains and applicable regimes clarifies where DAMCHA is useful. I also found the clarification of Theorem C.2 under weaker, approximate conditions helpful. I therefore maintain my recommendation to accept the paper and have increased my confidence level to 5.
Thanks very much.
We sincerely appreciate you for your great efforts, careful consideration and positive feedback.
From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.
Loading the discussion…
Response for the Meta Review
We appreciate Area Chair for the constructive and insightful summary. We have addressed the main concerns through direct comparisons with standard MHA, repeated experiments with uncertainty estimates, convergence and scaling analyses, and clearer mechanism-level positioning.
1. Direct efficiency comparison with standard MHA
We added the requested MHA comparison on CIFAR-10, CIFAR-100, CommonGen, and WMT. On CIFAR-10 and CIFAR-100, DAMCHA adds only 4.11% GFLOPs, with memory overheads of 7.23% and 2.97%, respectively. This moderate cost is accompanied by substantially larger quality gains. On CIFAR-10, DAMCHA reduces FID from 359.42 to 332.47 and FID@Top-50 from 92.14 to 63.58, corresponding to relative reductions of 7.50% and 31.00%.
The trade-off is even more favorable on language generation. Relative to MHA, DAMCHA reduces memory and GFLOPs on both CommonGen and WMT. On WMT, memory decreases by 5.33% and GFLOPs by 10.95%, with only a 1.70% latency increase and a 1.67% throughput decrease, while NLL decreases from 5.7730 to 5.1907 and BARTScore improves from −8.4740 to −5.4451. We also reported throughput for all cross-head baselines and evaluated scaling from sequence lengths 32 to 384, where DAMCHA remains competitive and is more efficient than DCMHA at longer lengths. These results show that its gains are not obtained merely by increasing computation.
2. Repeated experiments, uncertainty, and convergence
We conducted repeated experiments on CIFAR-10 and CommonGen. On CIFAR-10, DAMCHA achieves 332.47 ± 3.62 FID and 63.58 ± 2.21 FID@Top-50, compared with 365.73 ± 4.41 and 104.52 ± 3.72 for DCMHA. On CommonGen, DAMCHA achieves the best BARTScore of −5.611 ± 0.013 and BARTScore@Top-50 of −3.739 ± 0.015, while also obtaining the lowest NLL. The improvements therefore remain stable across repeated runs and cannot reasonably be attributed only to seed variation.
We also extended CIFAR-10 and CommonGen training from 50 to 100 epochs. The best validation checkpoints occur around epochs 47–53, and DAMCHA’s validation loss changes by only 0.35% on CIFAR-10 and 0.17% on CommonGen between epochs 50 and 100. This confirms that the original training budget is sufficient for convergence.
3. Practical regimes in which DAMCHA is most beneficial
We explicitly identified the applicable scenarios: tasks requiring strong cross-head coordination; dependencies involving multiple feature subspaces; input-dependent changes in similarity structure; heterogeneous semantic, contextual, or visual information; and generation settings emphasizing complete-sample quality or high-confidence outputs. This explains why the largest gains appear in FID, FID@Top-50, BARTScore, and BARTScore@Top-50. When dependencies are simple or already sufficiently represented within individual heads, standard MHA may be adequate and the additional benefit can be smaller.
4. Distinction from DCMHA and other cross-head methods
DCMHA first forms head-wise scores using fixed Q/K projections and then dynamically recombines those scores or attention weights. DAMCHA instead generates an input-dependent effective similarity metric before score formation. DCMHA therefore adapts combinations of fixed score bases, whereas DAMCHA adapts the underlying similarity geometry itself and can generate metrics outside the span of those bases.
The mechanisms partially overlap for linear pre-softmax composition, but neither complete architecture generally subsumes the other. Arbitrary post-softmax DCMHA compositions cannot necessarily be reproduced by DAMCHA because softmax is nonlinear; conversely, DCMHA cannot generally represent arbitrary DAMCHA metrics outside its Q/K-derived basis space.
5. Scope of the Mahalanobis framing and adaptation claim
“Mahalanobis-like” refers to replacing independent block-diagonal head-wise metrics with a full cross-head metric that models dependencies among head subspaces. It is a geometric analogy, not a claim that DAMCHA always produces a conventional symmetric positive-definite Mahalanobis distance. We also clarify that DAMCHA provides input-conditional adaptation of similarity geometry and improved modeling of the target generation distribution, rather than general robustness to unseen-domain distribution shifts.
Together, these additional experiments and clarifications substantially strengthen the empirical reliability and technical positioning of DAMCHA. We hope these results resolve the concerns regarding efficiency, reliability, novelty, applicable regimes, and claim precision.
Thanks very much for your great efforts and kind help for our paper.