PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
March 4, 20240 citationsOpen Access

Not all Layers of LLMs are Necessary during Inference

View Full Paper
SFSiqi FanXJXin JiangXLXiang Li

Key Points

Key points are not available for this paper at this time.

Abstract

The inference phase of Large Language Models (LLMs) is very expensive. An ideal inference stage of LLMs could utilize fewer computational resources while still maintaining its capabilities (e.g., generalization and in-context learning ability). In this paper, we try to answer the question, "During LLM inference, can we use shallow layers for easy instances; and deep layers for hard ones?" To answer this question, we first indicate that Not all Layers are Necessary during Inference by statistically analyzing the activated layers across tasks. Then, we propose a simple algorithm named AdaInfer to determine the inference termination moment based on the input instance adaptively. More importantly, AdaInfer does not alter LLM parameters and maintains generalizability across tasks. Experiments on well-known LLMs (i.e., Llama2 series and OPT) show that AdaInfer saves an average of 14.8% of computational resources, even up to 50% on sentiment tasks, while maintaining comparable performance. Additionally, this method is orthogonal to other model acceleration techniques, potentially boosting inference efficiency further.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Fan et al. (2024) studied this question.

synapsesocial.com/papers/68e75ddfb6db6435876d519ahttps://doi.org/10.48550/arxiv.2403.02181
Ask AI
Helpful
Bookmark
Share
View Full Paper

Also Consider

Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context:

  1. 1Not All Layers of LLMs Are Necessary During Inference2025 · 1 citations
  2. 2The Remarkable Robustness of LLMs: Stages of Inference?2024
  3. 3A Survey on Efficient Inference for Large Language Models2024 · 15 citations
  4. 4Demystifying the Roles of LLM Layers in Retrieval, Knowledge, and Reasoning2025
  5. 5SlimInfer: Accelerating Long-Context LLM Inference via Dynamic Token Pruning2025