paper-with-me

Papers

Block Transformer: Global-to-Local Language Modeling for Fast Inference

2024-06-04 · Namgyu Ho, Sangmin Bae, Taehyeon Kim, Hyunjik Jo, Yireun Kim, Tal Schuster, Adam Fisch, James Thorne, Se-Young Yun

We introduce the Block Transformer which adopts hierarchical global-to-local modeling to autoregressive transformers to mitigate the inference bottlenecks associated with self-attention. Self-attention requires the key-value (KV) cache of all previous sequences to be retrieved from memory at every decoding step to retrieve context information, leading to two primary bottlenecks during batch inference. First, there is a significant delay in obtaining the first token, as the information of the entire prompt must first be processed to prefill the KV cache. Second, computation of subsequent tokens is bottlenecked by the high memory I/O demand of fetching the entire KV cache, which grows linearly with sequence length, incurring quadratic memory reads overall. We design the Block Transformer to strategically mitigate these costs, by incorporating coarsity and locality into an integrated global-to-local architecture. At the lower layers, we aggregate tokens into fixed size blocks to apply attention across the entire sequence at coarse-grained detail, to capture the global context while minimizing KV cache overhead. At upper layers, we apply attention within each block to decode individual tokens, to model fine-grained details with a lightweight local KV cache. We pretrain vanilla and Block Transformers from scratch and demonstrate that Block Transformers reach 10--20x inference throughput compared to vanilla transformers with equivalent perplexity and zero-shot task performance. Code is available at https://github.com/itsnamgyu/block-transformer.

📄 PDF Abstract BibTeX arXiv:2406.02657

Code (1)

itsnamgyu/block-transformer 공식 구현 pytorch

Tasks

Language ModelingLanguage Modelling

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$…
Layer Normalization Unlike batch normalization, Layer Normalization directly estimates the normalization statistics from the summed inputs…
Linear Layer A Linear Layer is a projection $\mathbf{XW + b}$.
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
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…
Adam 설명 없음
Residual Connection 설명 없음

Similar Papers 제목 키워드 기반

GFocal: A Global-Focal Neural Operator for Solving PDEs on Arbitrary Geometries

2025-08-06 · Fangzhi Fei, Jiaxin Hu, Qiaofeng Li, Zhenyu Liu arxiv

Transformer-based neural operators have emerged as promising surrogate solvers for partial differential equations, by leveraging the effectiveness of Transformers for capturing long-range dependencies and global correlat…

Image Forgery Localization with State Space Models

2024-12-15 · Zijie Lou, Gang Cao

Pixel dependency modeling from tampered images is pivotal for image forgery localization. Current approaches predominantly rely on convolutional neural network (CNN) or Transformer-based models, which often either lack s…

DecoderState Space Models

Global-to-Local Modeling for Video-based 3D Human Pose and Shape Estimation

2023-03-26 · CVPR 2023 1 · Xiaolong Shen, Zongxin Yang, Xiaohan Wang, Jianxin Ma 외

Video-based 3D human pose and shape estimations are evaluated by intra-frame accuracy and inter-frame smoothness. Although these two metrics are responsible for different ranges of temporal consistency, existing state-of…

3D human pose and shape estimation3D Human Pose Estimation

CSformer: Bridging Convolution and Transformer for Compressive Sensing

2021-12-31 · Dongjie Ye, Zhangkai Ni, Hanli Wang, Jian Zhang 외

Convolution neural networks (CNNs) have succeeded in compressive image sensing. However, due to the inductive bias of locality and weight sharing, the convolution operations demonstrate the intrinsic limitations in model…

Compressive SensingInductive BiasRepresentation Learning

PoseMamba: Monocular 3D Human Pose Estimation with Bidirectional Global-Local Spatio-Temporal State Space Model

2024-08-07 · Yunlong Huang, Junshuo Liu, Ke Xian, Robert Caiming Qiu

Transformers have significantly advanced the field of 3D human pose estimation (HPE). However, existing transformer-based methods primarily use self-attention mechanisms for spatio-temporal modeling, leading to a quadrat…

3D Human Pose EstimationLong-range modelingMambaMonocular 3D Human Pose Estimation+1