paper-with-me

홈 › Papers

Integrating Tree Path in Transformer for Code Representation

2021-12-01 · NeurIPS 2021 12 · Han Peng, Ge Li, Wenhan Wang, YunFei Zhao, Zhi Jin

Learning distributed representation of source code requires modelling its syntax and semantics. Recent state-of-the-art models leverage highly structured source code representations, such as the syntax trees and paths therein. In this paper, we investigate two representative path encoding methods shown in previous research work and integrate them into the attention module of Transformer. We draw inspiration from the ideas of positional encoding and modify them to incorporate these path encoding. Specifically, we encode both the pairwise path between tokens of source code and the path from the leaf node to the tree root for each token in the syntax tree. We explore the interaction between these two kinds of paths by integrating them into the unified Transformer framework. The detailed empirical study for path encoding methods also leads to our novel state-of-the-art representation model TPTrans, which finally outperforms strong baselines. Extensive experiments and ablation studies on code summarization across four different languages demonstrate the effectiveness of our approaches. We release our code at \url{https://github.com/AwdHanPeng/TPTrans}.

📄 PDF Abstract BibTeX

Code (1)

awdhanpeng/tptrans 공식 구현 pytorch

Tasks

Code Summarization

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Adam 설명 없음
Position-Wise Feed-Forward Layer 설명 없음
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…
Label Smoothing Label Smoothing is a regularization technique that introduces noise for the labels. This accounts for the fact that datasets may have mistakes in them, so maximizing the…
Multi-Head Attention 설명 없음

Similar Papers 제목 키워드 기반

Seamlessly Integrating Tree-Based Positional Embeddings into Transformer Models for Source Code Representation

2025-07-05 · Patryk Bartkowiak, Filip Graliński arxiv

Transformer-based models have demonstrated significant success in various source code representation tasks. Nonetheless, traditional positional embeddings employed by these models inadequately capture the hierarchical st…

Integrating Dependency Tree Into Self-attention for Sentence Representation

2022-03-11 · Junhua Ma, Jiajun Li, Yuxuan Liu, Shangbo Zhou 외

Recent progress on parse tree encoder for sentence representation learning is notable. However, these works mainly encode tree structures recursively, which is not conducive to parallelization. On the other hand, these w…

Computational EfficiencyRepresentation LearningSentence

ViTree: Single-path Neural Tree for Step-wise Interpretable Fine-grained Visual Categorization

2024-01-30 · Danning Lao, Qi Liu, Jiazi Bu, Junchi Yan 외

As computer vision continues to advance and finds widespread applications across various domains, the need for interpretability in deep learning models becomes paramount. Existing methods often resort to post-hoc techniq…

Decision MakingFine-Grained Visual Categorization

PS3: A Multimodal Transformer Integrating Pathology Reports with Histology Images and Biological Pathways for Cancer Survival Prediction

2025-09-24 · Manahil Raza, Ayesha Azam, Talha Qaiser, Nasir Rajpoot arxiv

Current multimodal fusion approaches in computational oncology primarily focus on integrating multi-gigapixel histology whole slide images (WSIs) with genomic or transcriptomic data, demonstrating improved survival predi…

Dependency Transformer Grammars: Integrating Dependency Structures into Transformer Language Models

2024-07-24 · Yida Zhao, Chao Lou, Kewei Tu

Syntactic Transformer language models aim to achieve better generalization through simultaneously modeling syntax trees and sentences. While prior work has been focusing on adding constituency-based structures to Transfo…

ARCInductive BiasLanguage ModelingLanguage Modelling