CodeArt: Better Code Models by Attention Regularization When Symbols Are Lacking
Not on the map. Why?
Abstract (arXiv)
Transformer based code models have impressive performance in many software engineering tasks. However, their effectiveness degrades when symbols are missing or not informative. The reason is that the model may not learn to pay attention to the right correlations/contexts without the help of symbols. We propose a new method to pre-train general code models when symbols are lacking. We observe that in such cases, programs degenerate to something written in a very primitive language. We hence propose to use program analysis to extract contexts a priori (instead of relying on symbols and masked language modeling as in vanilla models). We then leverage a novel attention masking method to only allow the model attending to these contexts, e.g., bi-directional program dependence transitive closures and token co-occurrences. In the meantime, the inherent self-attention mechanism is utilized to learn which of the allowed attentions are more important compared to others. To realize the idea, we enhance the vanilla tokenization and model architecture of a BERT model, construct and utilize attention masks, and introduce a new pre-training algorithm. We pre-train this BERT-like model from scratch, using a dataset of 26 million stripped binary functions with explicit program dependence information extracted by our tool. We apply the model in three downstream tasks: binary similarity, type inference, and malware family classification. Our pre-trained model can improve the SOTAs in these tasks from 53% to 64%, 49% to 60%, and 74% to 94%, respectively. It also substantially outperforms other general pre-training techniques of code understanding models.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 49 of its 90 references that are in the map. First posted on arXiv 19 Feb 2024.
Builds on
49 of 90 references.
References · 49
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2023GPT-4 Technical Reportcited by 18,132
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2023Code Llama: Open Foundation Models for Codecited by 2,105
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2018Deeper Insights into Graph Convolutional Networks for Semi-Supervised Learningcited by 1,099
- 2015Effective Approaches to Attention-based Neural Machine Translationcited by 1,024
- 2021CodeT5: Identifier-aware Unified Pre-trained Encoder-Decoder Models for Code Understanding and Generationcited by 890
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
37 more
- 2020On the Bottleneck of Graph Neural Networks and its Practical Implicationscited by 624
- 2019Measuring and Relieving the Over-smoothing Problem for Graph Neural Networks from the Topological Viewcited by 544
- 2021Unified Pre-training for Program Understanding and Generationcited by 361
- 2022A Systematic Evaluation of Large Language Models of Codecited by 360
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 355
- 2017Learning to Represent Programs with Graphscited by 219
- 2019Graph Matching Networks for Learning the Similarity of Graph Structured Objectscited by 202
- 2022Representing Long-Range Context for Graph Neural Networks with Global Attentioncited by 193
- 2019TreeGen: A Tree-Based Transformer Architecture for Code Generationcited by 58
- 2022NatGen: Generative pre-training by "Naturalizing" source codecited by 53
- 2023How Effective Are Neural Networks for Fixing Security Vulnerabilitiescited by 50
- 2022jTrans: Jump-Aware Transformer for Binary Code Similaritycited by 44
- 2020Learning to Execute Programs with Instruction Pointer Attention Graph Neural Networkscited by 35
- 2020Trex: Learning Execution Semantics from Micro-Traces for Binary Similaritycited by 34
- 2022On the Transferability of Pre-trained Language Models for Low-Resource Programming Languagescited by 30
- 2021Bridging Pre-trained Models and Downstream Tasks for Source Code Understandingcited by 27
- 2023TRACED: Execution-aware Pre-training for Source Codecited by 27
- 2021How could Neural Networks understand Programs?cited by 26
- 2023A study on Prompt Design, Advantages and Limitations of ChatGPT for Deep Learning Program Repaircited by 26
- 2020InferCode: Self-Supervised Learning of Code Representations by Predicting Subtreescited by 23
- 2021Augmenting Decompiler Output with Learned Variable Names and Typescited by 23
- 2023Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errorscited by 22
- 2023Towards Efficient Fine-tuning of Pre-trained Code Models: An Experimental Study and Beyondcited by 20
- 2022Dataflow Analysis-Inspired Deep Learning for Efficient Vulnerability Detectioncited by 18
- 2023CCT5: A Code-Change-Oriented Pre-Trained Modelcited by 17
- 2020TreeCaps: Tree-Based Capsule Networks for Source Code Processingcited by 16
- 2022GALOIS: Boosting Deep Reinforcement Learning via Generalizable Logic Synthesiscited by 16
- 2021GraphCode2Vec: Generic Code Embedding via Lexical and Program Dependence Analysescited by 11
- 2023kTrans: Knowledge-Aware Transformer for Binary Code Embeddingcited by 10
- 2022Two Sides of the Same Coin: Exploiting the Impact of Identifiers in Neural Code Comprehensioncited by 9
- 2022Soft-Labeled Contrastive Pre-training for Function-level Code Representationcited by 7
- 2023PEM: Representing Binary Program Semantics for Similarity Analysis via a Probabilistic Execution Modelcited by 5
- 2023Model-Agnostic Syntactical Information for Pre-Trained Programming Language Modelscited by 4
- 2021A Comprehensive Study on Learning-Based PE Malware Family Classification Methodscited by 3
- 2023A study on the impact of pre-trained model on Just-In-Time defect predictioncited by 3
- 2021Identifying Authorship Style in Malicious Binaries: Techniques, Challenges & Datasetscited by 2
- 2020GRAPHSPY: Fused Program Semantic-Level Embedding via Graph Neural Networks for Dead Store Detectioncited by 1
Built on by
Citing papers per year: 2024: 2; 2025: 3; 2026: 2.
7 papers.
- 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineeringcited by 15
- 2024Source Code Foundation Models are Transferable Binary Analysis Knowledge Basescited by 8
- 2024WAFFLE: Finetuning Multi-Modal Models for Automated Front-End Developmentcited by 5
- 2025ASMA-Tune: Unlocking LLMs' Assembly Code Comprehension via Structural-Semantic Instruction Tuningcited by 4
- 2025Learning from Sufficient Rationales: Analysing the Relationship Between Explanation Faithfulness and Token-level Regularisation Strategiescited by 1
- 2026SoK: AI-Augmented Binary Reversingcited by 0
- 2026OASIF: An Efficient Obfuscation-Aware Self-Improving Framework for LLM-Based Assembly Code Instruction Following and Comprehensioncited by 0
- 2026OASIF: An Efficient Obfuscation-Aware Self-Improving Framework for LLM-Based Assembly Code Instruction Following and Comprehension28 Jun 2026
- 2026SoK: AI-Augmented Binary Reversing16 Jun 2026
- 2025Learning from Sufficient Rationales: Analysing the Relationship Between Explanation Faithfulness and Token-level Regularisation Strategies20 Nov 2025
- 2025Large Language Model (LLM) for Software Security: Code Analysis, Malware Analysis, Reverse Engineering7 Apr 2025
- 2025ASMA-Tune: Unlocking LLMs' Assembly Code Comprehension via Structural-Semantic Instruction Tuning14 Mar 2025
- 2024WAFFLE: Finetuning Multi-Modal Models for Automated Front-End Development24 Oct 2024
- 2024Source Code Foundation Models are Transferable Binary Analysis Knowledge Bases30 May 2024