1 of 49

2 of 49

EDGE-LLM: �Enabling Efficient Large Language Model Adaptation on Edge Devices via Layer-wise Unified Compression and Adaptive Layer Tuning and Voting

Georgia Institute of Technology

Zhongzhi Yu, Zheng Wang, Yuhan Li, Haoran You, Ruijie Gao, Xiaoya Zhou, Sreenidhi Reedy Bommu, Yang (Katie) Zhao, Yingyan (Celine) Lin

3 of 49

Motivation: Tuning LLMs on the Edge is Highly Demanding

  • LLMs are revolutionizing our life

4 of 49

Motivation: Tuning LLMs on the Edge is Highly Demanding

  • LLMs are revolutionizing our life
  • Stimulate a growing demand for tuning LLMs on the edge

Healthcare

Personal Assistant

Security

5 of 49

Challenge: Costly LLMs Prohibits Edge Tuning

  • Computation Challenge:

  • Memory Challenge:

6 of 49

Challenge: Costly LLMs Prohibits Edge Tuning

  • Computation Challenge:
    • Tens of A100 hours w/ the state-of-the-art (SOTA) efficient tuning [T. Dettmers, NeurIPS 2023]
  • Memory Challenge:

7 of 49

Challenge: Costly LLMs Prohibits Edge Tuning

  • Computation Challenge:
    • Tens of A100 hours w/ the state-of-the-art (SOTA) efficient tuning [T. Dettmers, NeurIPS 2023]
  • Memory Challenge:
    • A 1.48x ~ 3.78x memory gap

8 of 49

Challenge: Costly LLMs Prohibits Edge Tuning

  • Computation Challenge:
    • Tens of A100 hours w/ the state-of-the-art (SOTA) efficient tuning [T. Dettmers, NeurIPS 2023]
  • Memory Challenge:
    • A 1.48x ~ 3.78x memory gap
    • Edge device mem.: 8~12GB
    • Tuning mem.: 17.7GB~30.2GB �for tuning Llama-7B with �different techniques

9 of 49

Where Are We: Existing Solutions for Efficient Tuning

  • Category 1: Parameter-efficient tuning
    • Mostly commonly used
    • Add lightweight learnable modules
    • Reduces storage
      • Minimal impact on memory and computation

LoRA [E. Hu, ICLR 2022], one of the most commonly �adopted parameter-efficient tuning techniques

10 of 49

Where Are We: Existing Solutions for Efficient Tuning

  • Category 1: Parameter-efficient tuning
  • Category 2: Compression-then-tuning
    • Alleviate computation challenge
      • Marginal impact to memory overhead
    • Compress the LLM to a lower bit-width
      • Same compression setting for all layers

11 of 49

Where Are We: Existing Solutions for Efficient Tuning

  • Category 1: Parameter-efficient tuning
  • Category 2: Compression-then-tuning
    • Alleviate computation challenge
      • Marginal impact to memory overhead
    • Compress the LLM to a lower bit-width
      • Same compression setting for all layers

Open Question: How to compress?

Further reduce computation with minimal impact to accuracy

12 of 49

Where Are We: Existing Solutions for Efficient Tuning

  • Category 1: Parameter-efficient tuning
  • Category 2: Compression-then-tuning
  • Category 3: Partial tuning
    • Alleviate memory challenge
      • Cannot help much with computation overhead
    • Only update last layers to reduce backprop. depth
      • Limit the achieved accuracy

13 of 49

Where Are We: Existing Solutions for Efficient Tuning

  • Category 1: Parameter-efficient tuning
  • Category 2: Compression-then-tuning
  • Category 3: Partial tuning
    • Alleviate memory challenge
      • Cannot help much with computation overhead
    • Only update last layers to reduce backprop. depth
      • Limit the achieved accuracy

Open Question: How to Update?

Memory efficient approach to update early layers

14 of 49

Where Are We: Summary of Existing Solutions

Category

Computation

Memory

Parameter-efficient tuning

Compression-then-tuning

Partial tuning

15 of 49

Where Are We: Summary of Existing Solutions

Category

Computation

Memory

Parameter-efficient tuning

Compression-then-tuning

Partial tuning

  • Two directions to improve the efficiency

Dir. 1: Compress the model

Dir. 2: Reduce backprop. depth

16 of 49

Where Are We: Summary of Existing Solutions and Open Questions

  • Two directions to improve the efficiency

Category

Computation

Memory

Parameter-efficient tuning

Compression-then-tuning

Partial tuning

Dir. 1: Compress the model

Question 1:

How to compress?

Dir. 2: Reduce backprop. depth

Question 2:

How to update?

17 of 49

Where Are We: Summary of Existing Solutions and Open Questions

  • Two directions to improve the efficiency

Category

Computation

Memory

Parameter-efficient tuning

Compression-then-tuning

Partial tuning

???

Dir. 1: Compress the model

Question 1:

How to compress?

Dir. 2: Reduce backprop. depth

Question 2:

How to update?

Marry the merit

Question 3:

How to combine?

18 of 49

Where Are We: Summary of Existing Solutions and Open Questions

  • Two directions to improve the efficiency

Category

Computation

Memory

Parameter-efficient tuning

Compression-then-tuning

Partial tuning

Edge-LLM (Proposed)

Dir. 1: Compress the model

Question 1:

How to compress?

Dir. 2: Reduce backprop. depth

Question 2:

How to update?

Marry the merit

Question 3:

How to combine?

19 of 49

Edge-LLM: Overview

  • A comprehensive tuning framework for edge devices with improved computation and memory efficiency

20 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

21 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

22 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

How to combine above techniques? �Enabler 3:

A hardware scheduling module

23 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

How to combine above techniques? �Enabler 3:

A hardware scheduling module

24 of 49

Edge-LLM: Enabler 1 - Layer-Wise Unified Compression

  • Motivating observation: Different layers have varying sensitivities to compression

25 of 49

Edge-LLM: Enabler 1 - Layer-Wise Unified Compression

  • Motivating observation: Different layers have varying sensitivities to compression
  • Setting: Visualize MSE before and after compressing each layer in Llama-7B

Quantization

Pruning

26 of 49

Edge-LLM: Enabler 1 - Layer-Wise Unified Compression

  • Motivating observation: Different layers have varying sensitivities to compression
  • Setting: MSE before and after compressing each layer in Llama-7B

Quantization

Pruning

A layer-wise compression policy is needed

27 of 49

Edge-LLM: Enabler 1 - Layer-Wise Unified Compression

  • Goal: Generate layer-wise compression policy based on sensitivity

28 of 49

Edge-LLM: Enabler 1 - Layer-Wise Unified Compression

  • Goal: Generate layer-wise compression policy based on sensitivity
  • For pruning ratio:
    • Sensitivity gradually increases with depth
    • Fine-grained assignment to preserve differences
    • Pruning ratio inversely proportional to sensitivity

Pruning

29 of 49

Edge-LLM: Enabler 1 - Layer-Wise Unified Compression

  • Goal: Generate layer-wise compression policy based on sensitivity
  • For pruning ratio:
    • Sensitivity gradually increases with depth
    • Fine-grained assignment to preserve differences
    • Pruning ratio inversely proportional to sensitivity
  • For quantization bit-width:
    • Two types of sensitivity values
    • Same bit-width for most layers
    • An extra bit for highly sensitive layers

Quantization

30 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

How to combine above techniques? �Enabler 3:

A hardware scheduling module

31 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

How to combine above techniques? �Enabler 3:

A hardware scheduling module

32 of 49

Edge-LLM: Enabler 2 - Adaptive Layer Tuning

  • Goal: Update early layer with reduced backprop. depth

33 of 49

Edge-LLM: Enabler 2 - Adaptive Layer Tuning

  • Goal: Update early layer with reduced backprop. depth
  • Motivation: LLM’s intermediate layers can generate tokens [T. Schuster, NeurIPS 2022]
  • Key idea: Tune intermediate layers to generate tokens

34 of 49

Edge-LLM: Enabler 2 - Adaptive Layer Tuning

  • Goal: Update early layer with reduced backprop. depth
  • Motivation: LLM’s intermediate layers can generate tokens [T. Schuster, NeurIPS 2022]
  • Key idea: Tune intermediate layers to generate tokens
  • Proposed technique:
    • Add skip connections
    • Randomly activate one and update its preceding layers

Can the tuned LLM do even better?

35 of 49

Edge-LLM: Enabler 2 - Adaptive Layer Voting

  • Design knob: Many intermediate layers can generate outputs
    • Have intermediate layers vote on the final output token

36 of 49

Edge-LLM: Enabler 2 - Adaptive Layer Voting

  • Design knob: Many intermediate layers can generate outputs
    • Have intermediate layers vote on the final output token
  • Post-softmax probability indicates confidence [T. Pearce, arXiv 2021]
  • Vote for the token with maximum confidence

37 of 49

Edge-LLM: Enabler 2 - Adaptive Layer Voting

  • Design knob: Many intermediate layers can generate outputs
    • Have intermediate layers vote on the final output token
  • Post-softmax probability indicates confidence [T. Pearce, arXiv 2021]
  • Vote for the token with maximum confidence
    • A max-in-max approach
    • Select token w/ the highest probability among all layers’ outputs

38 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

How to combine above techniques? �Enabler 3:

A hardware scheduling module

39 of 49

Edge-LLM: Key Enablers

How to compress the model?

Enabler 1:

Layer-wise unified compression

How to update all layers?�Enabler 2:

Adaptive layer tuning and voting

How to combine above techniques? �Enabler 3:

A hardware scheduling module

40 of 49

Edge-LLM: Enabler 3 - Hardware Scheduling Module

  • Challenge: Difficult to schedule the irregular computation patterns
  • Require efficient memory scheduling and offloading strategies
    • Impossible to load everything to SRAM (512KB ~ 1MB)
    • Need offloading to DRAM (8GB ~ 16GB) and SSD (128GB ~ 256GB)

41 of 49

Edge-LLM: Enabler 3 - Hardware Scheduling Module

  • Proposed technique:
    • Conceptualize LLM tuning with offloading as a graph traversal problem

42 of 49

Edge-LLM: Enabler 3 - Hardware Scheduling Module

  • Proposed technique:
    • Conceptualize LLM tuning with offloading as a graph traversal problem
    • Objective: Identify a valid path through all blocks with minimized execution time

43 of 49

Edge-LLM: Enabler 3 - Hardware Scheduling Module

  • Proposed technique:
    • Conceptualize LLM tuning with offloading as a graph traversal problem
    • Objective: Identify a valid path through all blocks with minimized execution time

Search space

44 of 49

Edge-LLM: Enabler 3 - Hardware Scheduling Module

  • Proposed technique:
    • Conceptualize LLM tuning with offloading as a graph traversal problem
    • Objective: Identify a valid path through all blocks with minimized execution time
    • Execution time model: �Max latency among
      • Read/write latency across each �mem. hierarchy
      • Computation latency

Search space

45 of 49

Evaluation Setup

  • Target model: Llama-7B
  • Algorithm implementation:
    • Quantize with LLM-QAT [Z. Liu, arXiv 2023]
    • Prune with Sparse-GPT [E. Frantar, ICML 2023]

  • Evaluation methodology:
    • Apply on top of TRETA [H. Shao, VLSI 2023] to validate hardware scheduling speedup
    • Simulate with Scale-Sim [A. Samajdar, Github, 2019]
  • Dataset: MMLU
  • Hardware config:
    • SRAM: 1MB
    • DRAM: 8GB LPDDR4
    • SSD: 128GB

46 of 49

Evaluation Results

  • Achieves a 0.70%~1.29% higher accuracy, a ~4x memory reduction with the comparable theoretical computation overhead
  • With the hardware scheduling module, achieves a 2.92x~3.38x overall speedup over the vanilla implementation

47 of 49

Scan Me

Project Page

48 of 49

EDGE-LLM: �Enabling Efficient Large Language Model Adaptation on Edge Devices via Layer-wise Unified Compression and Adaptive Layer Tuning and Voting

1Georgia Institute of Technology, 2University of Minnesota, Twin Cities, 3University of California, Santa Barbara

Zhongzhi Yu1, Zheng Wang1, Yuhan Li1, Haoran You1, Ruijie Gao1, Xiaoya Zhou3, Sreenidhi Reedy Bommu1, Yang (Katie) Zhao2, Yingyan (Celine) Lin1

49 of 49