Hasse Diagrams for Attention: A Partial Order Framework for Designing Transformer Masks
During the training of large Transformer models, attention masks regulate the scope and direction of information flow across a sequence. Numerous mask variants exist, and operators such as FlexAttention already support arbitrary attention masks. Nevertheless, a systematic formal analysis of the information-flow structure induced by arbitrary masks has been missing. This paper develops a complete theoretical framework. We prove that, with sufficient depth, the information flow of a multi-layer Transformer converges to a Hasse diagram -- a directed acyclic graph representing a partial order. Building on this, we recast the design of parallel training tasks as the problem of finding a minimal common supergraph of Hasse diagrams, and we establish a criterion for the minimal common supergraph. This yields a constructive method to derive attention masks directly from a family of tasks. Applying the framework, we design two novel masks: a block-generation attention mask that ensures training-inference consistency (Block Two-Stream Attention), and a fully supervised bidirectional attention mask (Butterfly Attention). These results demonstrate the framework's capacity to discover new structures.
Code (0)
등록된 구현이 없습니다.
Similar Papers 제목 키워드 기반
Wiring diagram extraction and gluing: a case study in classifying figure skating jumps using 3D dataset
Hasse clustering is an algorithm that extracts common patterns in sequential data and represents them in graphical forms. As the number of expected clusters grows, however, the algorithm can become infeasible to run due …
From data to concepts via wiring diagrams
A wiring diagram is a labeled directed graph that represents an abstract concept such as a temporal process. In this article, we introduce the notion of a quasi-skeleton wiring diagram graph, and prove that quasi-skeleto…
Reinforcement LearningMarket Definition: A Sensitivity Analysis
Market definition holds significant importance in antitrust cases, yet achieving consensus on the correct approach remains elusive. As a result, analysts routinely entertain multiple market definitions to ensure the resi…
SensitivityA partial order and cluster-similarity metric on rooted phylogenetic trees
Metrics on rooted phylogenetic trees are integral to a number of areas of phylogenetic analysis. Cluster-similarity metrics have recently been introduced in order to limit skew in the distribution of distances, and to en…
On (co-lex) Ordering Automata
The states of a deterministic finite automaton A can be identified with collections of words in Pf(L(A)) -- the set of prefixes of words belonging to the regular language accepted by A. But words can be ordered and among…