Skip to main content
QUICK REVIEW

[Paper Review] Delta Keyword Transformer: Bringing Transformers to the Edge through Dynamically Pruned Multi-Head Self-Attention

Zuzana Jelčicová, Marian Verhelst|arXiv (Cornell University)|Mar 20, 2022
Topic ModelingComputer Science35 references4 citations
TL;DR

This paper proposes Delta Keyword Transformer, a dynamic, threshold-based pruning method that reduces multi-head self-attention (MHSA) computations in Transformers by exploiting temporal stability in sequential data. By retaining only significant feature differences (delta values) between consecutive tokens, it achieves up to 80% reduction in multiply-accumulates (MACs) with no accuracy loss, and up to 94% reduction with only 1–4% accuracy drop, enabling efficient deployment of Transformers on edge devices.

ABSTRACT

Multi-head self-attention forms the core of Transformer networks. However, their quadratically growing complexity with respect to the input sequence length impedes their deployment on resource-constrained edge devices. We address this challenge by proposing a dynamic pruning method, which exploits the temporal stability of data across tokens to reduce inference cost. The threshold-based method only retains significant differences between the subsequent tokens, effectively reducing the number of multiply-accumulates, as well as the internal tensor data sizes. The approach is evaluated on the Google Speech Commands Dataset for keyword spotting, and the performance is compared against the baseline Keyword Transformer. Our experiments show that we can reduce ~80% of operations while maintaining the original 98.4% accuracy. Moreover, a reduction of ~87-94% operations can be achieved when only degrading the accuracy by 1-4%, speeding up the multi-head self-attention inference by a factor of ~7.5-16.

Motivation & Objective

  • Address the high computational cost of multi-head self-attention (MHSA) in Transformers, which limits deployment on resource-constrained edge devices.
  • Overcome the limitations of existing pruning methods that require retraining or specialized hardware.
  • Enable real-time, low-power inference on tinyML devices by reducing MAC operations during inference without fine-tuning.
  • Achieve fine-grained, dynamic pruning at inference time using delta computations between sequential tokens.
  • Maintain high accuracy while drastically reducing computational complexity for keyword spotting on edge devices.

Proposed method

  • Apply threshold-based pruning to MHSA components by computing delta differences between corresponding features of consecutive tokens in the input sequence.
  • Only retain and process non-zero delta values above a predefined threshold, discarding insignificant changes to reduce MAC operations.
  • Introduce separate thresholds for each MHSA component: input projection (XW), query-key dot product (QK^T), softmax output, and final head projection (W_P).
  • Perform dynamic pruning at inference time without retraining, enabling immediate deployment on pre-trained models.
  • Leverage temporal redundancy in sequential data—especially in silent or stable audio segments—where most deltas are zero, enabling high compression.
  • Use a lightweight comparison-based mechanism that requires no additional hardware or complex training, making it suitable for edge deployment.

Experimental results

Research questions

  • RQ1Can dynamic, threshold-based pruning of multi-head self-attention reduce computational cost without retraining or accuracy degradation?
  • RQ2How effective is delta-based pruning in exploiting temporal stability in sequential data for edge inference?
  • RQ3What is the trade-off between computational savings and accuracy loss when varying pruning thresholds?
  • RQ4Can this method be applied universally across different layers and input types in a pre-trained Transformer?
  • RQ5To what extent can MAC operations be reduced while maintaining high accuracy in keyword spotting tasks?

Key findings

  • The method reduces up to 80% of MAC operations in multi-head self-attention with no accuracy degradation, maintaining 98.4% accuracy on the Google Speech Commands Dataset.
  • A 7.5x speedup is achieved with only a 1% accuracy drop, corresponding to 86.73–93.65% reduction in MACs.
  • Inference speedup reaches up to 16x when accuracy is reduced by 1–4%, demonstrating strong performance-computation trade-offs.
  • The method achieves 97–99.9% operation reduction for silent ("_silence_") keyword instances due to near-constant input features.
  • Some configurations even slightly outperform the original KWT-3 model (98.46%, 98.48%, 98.42% accuracy) while reducing computation.
  • On average, 70–77% of total MHSA operations are skipped across layers, with up to 87% of head projection and 95% of QK^T operations discarded.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.