paper-with-me

Papers

Scaling Stick-Breaking Attention: An Efficient Implementation and In-depth Study

2024-10-23 · Shawn Tan, Songlin Yang, Aaron Courville, Rameswar Panda, Yikang Shen

The self-attention mechanism traditionally relies on the softmax operator, necessitating positional embeddings like RoPE, or position biases to account for token order. But current methods using still face length generalisation challenges. We investigate an alternative attention mechanism based on the stick-breaking process in larger scale settings. The method works as follows: For each token before the current, we determine a break point, which represents the proportion of the stick, the weight of the attention, to allocate to the current token. We repeat this on the remaining stick, until all tokens are allocated a weight, resulting in a sequence of attention weights. This process naturally incorporates recency bias, which has linguistic motivations for grammar parsing. We study the implications of replacing the conventional softmax-based attention mechanism with stick-breaking attention. We then discuss implementation of numerically stable stick-breaking attention and adapt Flash Attention to accommodate this mechanism. When used as a drop-in replacement for current softmax+RoPE attention systems, we find that stick-breaking attention performs competitively with current methods on length generalisation and downstream tasks. Stick-breaking also performs well at length generalisation, allowing a model trained with $2^{11}$ context window to perform well at $2^{14}$ with perplexity improvements.

📄 PDF Abstract BibTeX arXiv:2410.17980

Code (2)

ibm/dolomite-engine 공식 구현 pytorch
shawntan/stickbreaking-attention 공식 구현 pytorch

Methods 이 논문이 사용한 방법론

Attention 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…

Similar Papers 제목 키워드 기반

Tree-Structured Stick Breaking for Hierarchical Data

2010-12-01 · NeurIPS 2010 12 · Zoubin Ghahramani, Michael. I. Jordan, Ryan P. Adams

Many data are naturally modeled by an unobserved hierarchical structure. In this paper we propose a flexible nonparametric prior over unknown data hierarchies. The approach uses nested stick-breaking processes to allow f…

Bayesian InferenceClustering

An elementary derivation of the Chinese restaurant process from Sethuraman's stick-breaking process

2018-01-01 · Jeffrey W. Miller

The Chinese restaurant process (CRP) and the stick-breaking process are the two most commonly used representations of the Dirichlet process. However, the usual proof of the connection between them is indirect, relying on…

Stick-Breaking Variational Autoencoders

2016-05-20 · Eric Nalisnick, Padhraic Smyth

We extend Stochastic Gradient Variational Bayes to perform posterior inference for the weights of Stick-Breaking processes. This development allows us to define a Stick-Breaking Variational Autoencoder (SB-VAE), a Bayesi…

The Mondrian Process

2008-12-01 · NeurIPS 2008 12 · Daniel M. Roy, Yee W. Teh

We describe a novel stochastic process that can be used to construct a multidimensional generalization of the stick-breaking process and which is related to the classic stick breaking process described by Sethuraman1994 …

Variational Bayesian Methods for a Tree-Structured Stick-Breaking Process Mixture of Gaussians by Application of the Bayes Codes for Context Tree Models

2024-05-01 · Yuta Nakahara

The tree-structured stick-breaking process (TS-SBP) mixture model is a non-parametric Bayesian model that can represent tree-like hierarchical structures among the mixture components. For TS-SBP mixture models, only a Ma…

Computational EfficiencyText Compression