paper-with-me

홈 › Papers

Self-Selected Attention Span for Accelerating Large Language Model Inference

2024-04-14 · Tian Jin, Wanzin Yazar, Zifei Xu, Sayeh Sharify, Xin Wang

Large language models (LLMs) can solve challenging tasks. However, their inference computation on modern GPUs is highly inefficient due to the increasing number of tokens they must attend to as they generate new ones. To address this inefficiency, we capitalize on LLMs' problem-solving capabilities to optimize their own inference-time efficiency. We demonstrate with two specific tasks: (a) evaluating complex arithmetic expressions and (b) summarizing news articles. For both tasks, we create custom datasets to fine-tune an LLM. The goal of fine-tuning is twofold: first, to make the LLM learn to solve the evaluation or summarization task, and second, to train it to identify the minimal attention spans required for each step of the task. As a result, the fine-tuned model is able to convert these self-identified minimal attention spans into sparse attention masks on-the-fly during inference. We develop a custom CUDA kernel to take advantage of the reduced context to attend to. We demonstrate that using this custom CUDA kernel improves the throughput of LLM inference by 28%. Our work presents an end-to-end demonstration showing that training LLMs to self-select their attention spans speeds up autoregressive inference in solving real-world tasks.

📄 PDF Abstract BibTeX arXiv:2404.09336

Code (0)

등록된 구현이 없습니다.

Tasks

ArticlesLanguage ModelingLanguage ModellingLarge Language Model

Similar Papers 제목 키워드 기반

Superlinear Multi-Step Attention

2026-01-26 · Yufeng Huang arxiv

In this paper, we propose \textbf{Superlinear attention}, a fully trainable multi-step attention architecture that achieves subquadratic complexity for long sequences while preserving \textbf{random context access} (a.k.…

Salient Positions based Attention Network for Image Classification

2021-06-09 · Sheng Fang, Kaiyu Li, Zhe Li

The self-attention mechanism has attracted wide publicity for its most important advantage of modeling long dependency, and its variations in computer vision tasks, the non-local block tries to model the global dependenc…

Classificationimage-classificationImage Classification

Double-Condensing Attention Condenser: Leveraging Attention in Deep Learning to Detect Skin Cancer from Skin Lesion Images

2023-11-20 · Chi-en Amy Tai, Elizabeth Janes, Chris Czarnecki, Alexander Wong

Skin cancer is the most common type of cancer in the United States and is estimated to affect one in five Americans. Recent advances have demonstrated strong performance on skin cancer detection, as exemplified by state …

SAC: Accelerating and Structuring Self-Attention via Sparse Adaptive Connection

2020-03-22 · NeurIPS 2020 12 · Xiaoya Li, Yuxian Meng, Mingxin Zhou, Qinghong Han 외

While the self-attention mechanism has been widely used in a wide variety of tasks, it has the unfortunate property of a quadratic cost with respect to the input length, which makes it difficult to deal with long inputs.…

Graph Representation Learningimage-classificationImage ClassificationLanguage Modeling+4

High-Similarity-Pass Attention for Single Image Super-Resolution

2023-05-25 · Jian-Nan Su, Min Gan, Guang-Yong Chen, Wenzhong Guo 외

Recent developments in the field of non-local attention (NLA) have led to a renewed interest in self-similarity-based single image super-resolution (SISR). Researchers usually used the NLA to explore non-local self-simil…

Image Super-ResolutionSuper-Resolution