paper-with-me

홈 › 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 structure intrinsic to source code, typically represented as Abstract Syntax Trees (ASTs). To address this, we propose a novel tree-based positional embedding approach that explicitly encodes hierarchical relationships derived from ASTs, including node depth and sibling indices. These hierarchical embeddings are integrated into the transformer architecture, specifically enhancing the CodeBERTa model. We thoroughly evaluate our proposed model through masked language modeling (MLM) pretraining and clone detection fine-tuning tasks. Experimental results indicate that our Tree-Enhanced CodeBERTa consistently surpasses the baseline model in terms of loss, accuracy, F1 score, precision, and recall, emphasizing the importance of incorporating explicit structural information into transformer-based representations of source code.

📄 PDF Abstract BibTeX arXiv:2507.04003

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

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

ReRoPE: Repurposing RoPE for Relative Camera Control

2026-02-08 · Chunyang Li, Yuanbo Yang, Jiahao Shao, Hongyu Zhou 외 arxiv

Video generation with controllable camera viewpoints is essential for applications such as interactive content creation, gaming, and simulation. Existing methods typically adapt pre-trained video models using camera pose…

Video Generation

Progress Ratio Embeddings: An Impatience Signal for Robust Length Control in Neural Text Generation

2025-12-07 · Ivanhoé Botcazou, Tassadit Amghar, Sylvain Lamprier, Frédéric Saubion arxiv

Modern neural language models achieve high accuracy in text generation, yet precise control over generation length remains underdeveloped. In this paper, we first investigate a recent length control method based on Rever…

Text Generation

AlcheMinT: Fine-grained Temporal Control for Multi-Reference Consistent Video Generation

2025-12-11 · Sharath Girish, Viacheslav Ivanov, Tsai-Shien Chen, Hao Chen 외 arxiv

Recent advances in subject-driven video generation with large diffusion models have enabled personalized content synthesis conditioned on user-provided subjects. However, existing methods lack fine-grained temporal contr…

Video Generation

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