mlsanityData to 7 Oct 2026

Beyond Self-learned Attention: Mitigating Attention Bias in Transformer-based Models Using Attention Guidance

arXiv 2402.16790 ↗First posted 26 Feb 2024cs.SE cs.AIcited by 1

Not on the map. Why?

Abstract (arXiv)

Transformer-based models have demonstrated considerable potential for source code modeling tasks in software engineering. However, they are limited by their dependence solely on automatic self-attention weight learning mechanisms. Previous studies have shown that these models overemphasize delimiters added by tokenizers (e.g., [CLS], [SEP]), which may lead to overlooking essential information in the original input source code. To address this challenge, we introduce SyntaGuid, a novel approach that utilizes the observation that attention weights tend to be biased towards specific source code syntax tokens and abstract syntax tree (AST) elements in fine-tuned language models when they make correct predictions. SyntaGuid facilitates the guidance of attention-weight learning, leading to improved model performance on various software engineering tasks. We evaluate the effectiveness of SyntaGuid on multiple tasks and demonstrate that it outperforms existing state-of-the-art models in overall performance without requiring additional data. Experimental result shows that SyntaGuid can improve overall performance up to 3.25% and fix up to 28.3% wrong predictions. Our work represents the first attempt to guide the attention of Transformer-based models towards critical source code tokens during fine-tuning, highlighting the potential for enhancing Transformer-based models in software engineering.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 37 of its 68 references that are in the map. First posted on arXiv 26 Feb 2024.

Builds on

37 of 68 references.

References · 37

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2023GPT-4 Technical Reportcited by 18,132
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  6. 2021Finetuned Language Models Are Zero-Shot Learnerscited by 3,747
  7. 2020Supervised Contrastive Learningcited by 2,803
  8. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
  9. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  10. 2019Cross-lingual Language Model Pretrainingcited by 1,088
  11. 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
  12. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
25 more
  1. 2021Unified Pre-training for Program Understanding and Generationcited by 361
  2. 2022A Systematic Evaluation of Large Language Models of Codecited by 360
  3. 2020IntelliCode Compose: Code Generation Using Transformercited by 225
  4. 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
  5. 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 85
  6. 2019A Neural Model for Generating Natural Language Summaries of Program Subroutinescited by 76
  7. 2020Contrastive Code Representation Learningcited by 76
  8. 2022Natural Attack for Pre-trained Models of Codecited by 72
  9. 2021Studying the Usage of Text-To-Text Transfer Transformer to Support Code-Related Taskscited by 70
  10. 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 68
  11. 2021SynCoBERT: Syntax-Guided Multi-Modal Contrastive Pre-Training for Code Representationcited by 63
  12. 2021CoTexT: Multi-task Learning with Code-Text Transformercited by 61
  13. 2022What Do They Capture? -- A Structural Analysis of Pre-Trained Language Models for Source Codecited by 50
  14. 2021Multilingual training for Software Engineeringcited by 43
  15. 2015SourcererCC: Scaling Code Clone Detection to Big Codecited by 40
  16. 2021What do pre-trained code models know about code?cited by 36
  17. 2020Improved Automatic Summarization of Subroutines via Attention to File Contextcited by 34
  18. 2021CodeTrans: Towards Cracking the Language of Silicon's Code Through Self-Supervised Deep Learning and High Performance Computingcited by 28
  19. 2021Bridging Pre-trained Models and Downstream Tasks for Source Code Understandingcited by 27
  20. 2023An Empirical Comparison of Pre-Trained Models of Source Codecited by 25
  21. 2022Diet Code Is Healthy: Simplifying Programs for Pre-trained Models of Codecited by 24
  22. 2020Guiding Attention for Self-Supervised Learning with Transformerscited by 14
  23. 2022An Exploratory Study on Code Attention in BERTcited by 12
  24. 2021VarCLR: Variable Semantic Representation Pre-training via Contrastive Learningcited by 11
  25. 2022Paying More Attention to Self-attention: Improving Pre-trained Language Models via Attention Guidingcited by 6

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 1.

1 paper.