Exploiting Sparsity for Long Context Inference: Million Token on Commodity GPUs

teleforce1 pts0 comments

[2502.06766] Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUs

Skip to main content

arXiv is now an independent nonprofit!<br>Learn more<br>&times;

Search arXiv

Press Enter to search &middot; Advanced search

-->

Computer Science > Computation and Language

arXiv:2502.06766 (cs)

[Submitted on 10 Feb 2025 (v1), last revised 12 Feb 2025 (this version, v2)]

Title:Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUs

Authors:Ryan Synk, Monte Hoover, John Kirchenbauer, Neel Jain, Alex Stein, Manli Shu, Josue Melendez Sanchez, Ramani Duraiswami, Tom Goldstein<br>View a PDF of the paper titled Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUs, by Ryan Synk and 8 other authors

View PDF<br>HTML (experimental)

Abstract:There is growing demand for performing inference with hundreds of thousands of input tokens on trained transformer models. Inference at this extreme scale demands significant computational resources, hindering the application of transformers at long contexts on commodity (i.e not data center scale) hardware. To address the inference time costs associated with running self-attention based transformer language models on long contexts and enable their adoption on widely available hardware, we propose a tunable mechanism that reduces the cost of the forward pass by attending to only the most relevant tokens at every generation step using a top-k selection mechanism. We showcase the efficiency gains afforded by our method by performing inference on context windows up to 1M tokens using approximately 16GB of GPU RAM. Our experiments reveal that models are capable of handling the sparsity induced by the reduced number of keys and values. By attending to less than 2% of input tokens, we achieve over 95% of model performance on common benchmarks (RULER, AlpacaEval, and Open LLM Leaderboard).

Comments:<br>9 pages, 9 figures, 2 tables in main body

Subjects:

Computation and Language (cs.CL)

Cite as:<br>arXiv:2502.06766 [cs.CL]

(or<br>arXiv:2502.06766v2 [cs.CL] for this version)

https://doi.org/10.48550/arXiv.2502.06766

Focus to learn more

arXiv-issued DOI via DataCite

Submission history<br>From: Monte Hoover [view email]<br>[v1]<br>Mon, 10 Feb 2025 18:47:04 UTC (7,688 KB)

[v2]<br>Wed, 12 Feb 2025 15:55:37 UTC (7,689 KB)

Full-text links:<br>Access Paper:

View a PDF of the paper titled Exploiting Sparsity for Long Context Inference: Million Token Contexts on Commodity GPUs, by Ryan Synk and 8 other authors<br>View PDF<br>HTML (experimental)<br>TeX Source

view license

Current browse context:

cs.CL

next >

new<br>recent<br>| 2025-02

Change to browse by:

cs

References & Citations

NASA ADS<br>Google Scholar

Semantic Scholar

export BibTeX citation<br>Loading...

BibTeX formatted citation

&times;

loading...

Data provided by:

Bookmark

Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle

Bibliographic Explorer (What is the Explorer?)

Connected Papers Toggle

Connected Papers (What is Connected Papers?)

Litmaps Toggle

Litmaps (What is Litmaps?)

scite.ai Toggle

scite Smart Citations (What are Smart Citations?)

Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle

alphaXiv (What is alphaXiv?)

Links to Code Toggle

CatalyzeX Code Finder for Papers (What is CatalyzeX?)

DagsHub Toggle

DagsHub (What is DagsHub?)

GotitPub Toggle

Gotit.pub (What is GotitPub?)

Huggingface Toggle

Hugging Face (What is Huggingface?)

ScienceCast Toggle

ScienceCast (What is ScienceCast?)

Demos

Demos

Replicate Toggle

Replicate (What is Replicate?)

Spaces Toggle

Hugging Face Spaces (What is Spaces?)

Spaces Toggle

TXYZ.AI (What is TXYZ.AI?)

Related Papers

Recommenders and Search Tools

Link to Influence Flower

Influence Flower (What are Influence Flowers?)

Core recommender toggle

CORE Recommender (What is CORE?)

Author

Venue

Institution

Topic

About arXivLabs

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs .

Which authors of this paper are endorsers? |<br>Disable MathJax (What is MathJax?)

Major funding support from

toggle arxiv inference long context sparsity

Related Articles