paper-with-me

Papers

Dual Triangle Attention: Effective Bidirectional Attention Without Positional Embeddings

2026-04-09 · Logan Hallee, Jason P. Gleghorn arxiv

Bidirectional transformers are the foundation of many sequence modeling tasks across natural, biological, and chemical language domains, but they are permutation-invariant without explicit positional embeddings. In contrast, unidirectional attention inherently encodes positional information through its triangular mask, enabling models to operate without positional embeddings altogether. Here, we introduce Dual Triangle Attention, a novel bidirectional attention mechanism that separates the query-key subspace of each attention head into two complementary triangular masks: one that attends to past-and-self positions and one that attends to future-and-self positions. This design provides bidirectional context while maintaining the causal mask's implicit positional inductive bias in both directions. Using PyTorch's flex_attention, Dual Triangle Attention is implemented as a single compiled kernel call with no additional parameters beyond standard multi-head attention. We evaluated Dual Triangle Attention across three settings: (1) a synthetic argmax position probe, (2) masked language modeling (MLM) on natural language, and (3) MLM on protein sequences. In the argmax task, both Dual Triangle Attention and causal attention learn positional information without explicit positional embeddings, whereas standard bidirectional attention cannot. In the MLM experiments, Dual Triangle Attention with Rotary Positional Embeddings (RoPE) achieved the best context extension performance and strong performance across the board. These findings suggest that Dual Triangle Attention is a viable attention mechanism for bidirectional transformers, with or without positional embeddings.

📄 PDF Abstract BibTeX arXiv:2604.18603

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

The Attention Triangle in Audio-Video Models

2026-09-03 · Sagi Polaczek, Noa Kraicer, Gal Metzer, Zhuo Ning 외 hf

Audio-video diffusion models rely on cross-modal attention to coordinate text, sound, and visual content, yet this same mechanism can introduce subtle and systematic semantic leakage. We study these models by probing and…

Audio GenerationVideo Generation

Accelerating Prefilling via Decoding-time Contribution Sparsity

2025-07-29 · Zhiyuan He, Yike Zhang, Chengruidong Zhang, Huiqiang Jiang 외 arxiv

Large Language Models (LLMs) incur quadratic attention complexity with input length, creating a major time bottleneck in the prefilling stage. Existing acceleration methods largely exploit attention score sparsity by est…

Multi-granularity Interactive Attention Framework for Residual Hierarchical Pronunciation Assessment

2026-01-05 · Hong Han, Hao-Chen Pei, Zhao-Zheng Nie, Xin Luo 외 arxiv

Automatic pronunciation assessment plays a crucial role in computer-assisted pronunciation training systems. Due to the ability to perform multiple pronunciation tasks simultaneously, multi-aspect multi-granularity pronu…

Bidirectional Attention as a Mixture of Continuous Word Experts

2023-07-08 · Kevin Christian Wibisono, Yixin Wang

Bidirectional attention $\unicode{x2013}$ composed of self-attention with positional encodings and the masked language model (MLM) objective $\unicode{x2013}$ has emerged as a key component of modern large language model…

Language ModellingMixture-of-ExpertsSentenceWord Embeddings

Dual-Attention Enhanced BDense-UNet for Liver Lesion Segmentation

2021-07-24 · Wenming Cao, Philip L. H. Yu, Gilbert C. S. Lui, Keith W. H. Chiu 외

In this work, we propose a new segmentation network by integrating DenseUNet and bidirectional LSTM together with attention mechanism, termed as DA-BDense-UNet. DenseUNet allows learning enough diverse features and enhan…

Lesion SegmentationSegmentation