HEAL: Hybrid-Bonding Architecture with Hybrid Sparse Attention for Efficient Long-Context LLM Inference

Zizhuo Fu, Xiaotian Guo, Wenxuan Zeng, Shuzhang Zhong, Yadong Zhang, Peiyu Chen, Runsheng Wang, Le Ye, Meng Li

Abstract

As Large Language Models (LLMs) evolve to handle increasingly massive context windows, the memory and computational demands of the Key-Value (KV) cache have become a primary bottleneck, particularly for edge devices. This paper introduces H²EAL, a hardware-algorithm co-design that integrates emerging Hybrid Bonding (HB) memory technology with a novel Hybrid Sparse Attention mechanism. By categorizing attention heads into "streaming" and "retrieval" types and optimizing their mapping to 3D-stacked memory banks, H²EAL achieves significant performance gains. Our evaluations demonstrate up to a 48x speedup and 73x energy efficiency improvement over standard HB implementations with a negligible accuracy impact of less than 1%.

1. Introduction

The utility of Large Language Models is increasingly tied to their ability to process long sequences—ranging from entire books to complex codebases. However, the KV cache required to store previous tokens grows linearly with sequence length, quickly exceeding the memory capacity and bandwidth of traditional edge hardware (e.g., smartphones or local AI accelerators).

While Near-Memory Processing (NMP) and Hybrid Bonding (HB) offer promising high-bandwidth solutions, they introduce a new challenge: workload imbalance. In 3D-stacked architectures, memory is partitioned into independent banks. If the attention mechanism's workload is not distributed evenly across these banks, the system suffers from "hot spots" where certain hardware units are overwhelmed while others remain idle. H²EAL addresses these challenges through a unified approach that optimizes both the attention algorithm and the underlying hardware mapping.

2. The H²EAL Methodology

H²EAL employs a two-pronged co-design strategy to bridge the gap between algorithmic sparsity and hardware constraints.

2.1 Algorithmic Innovation: Hybrid Sparse Attention

Traditional sparse attention often treats all attention heads uniformly, which can lead to information loss. H²EAL identifies two distinct functional behaviors within LLM attention heads:

  • Streaming Heads: These heads focus primarily on the initial "sink" tokens and the most recent tokens in a sequence. They utilize static sparsity, which is highly predictable and computationally efficient for hardware scheduling.
  • Retrieval Heads: These heads are responsible for identifying specific, relevant information scattered throughout the past context. They utilize dynamic sparsity, selecting "pages" of tokens on-the-fly based on the current query's relevance.

By differentiating these roles, H²EAL maintains high model accuracy while significantly reducing the amount of data that must be fetched from memory.

2.2 Hardware Innovation: HB-Based Accelerator

Hybrid Bonding (HB) allows for the vertical stacking of logic and memory with high-density Copper-to-Copper (Cu-Cu) connections. H²EAL optimizes this architecture through:

  • Memory-Compute Co-placement: KV cache data is stored in the same vertical stack as the processing units that require it, drastically reducing lateral data movement and energy consumption.
  • Interleaved Storage: To mitigate the distributed memory bottleneck, KV cache pages are interleaved across multiple memory banks, ensuring that no single bank becomes a performance bottleneck.
  • Adaptive Tiling Mapping: Recognizing that different LLMs (e.g., Llama3 vs. Qwen2) have varying head counts, the authors implemented a "max-flow" optimization algorithm. This scheduler maps attention heads to hardware tiles in a manner that minimizes communication distance and balances the load across the 3D stack.

3. Experimental Evaluation

The researchers evaluated H²EAL using popular open-source models, including Mistral-7B, LLaMA2-7B, and LLaMA3-8B. Performance was measured across two rigorous benchmarks:

  • LongBench: A suite of 21 datasets testing summarization, Q&A, and long-context reasoning.
  • Needle-In-A-Haystack (NIAH): A stress test designed to evaluate the model's ability to retrieve a specific fact buried within a massive document.

3.1 Key Results

Compared to a baseline Hybrid Bonding implementation without H²EAL’s optimizations, the system demonstrated:

  • Inference Speedup: A range of 5.20× to 48.21× faster processing.
  • Energy Efficiency: Improvements between 6.22× and 73.48×.
  • High Throughput: On LLaMA3-8B with a 256k context window, H²EAL achieved 469.7 tokens/s, a stark contrast to the 113.1 tokens/s achieved by full-attention baselines.
  • Accuracy Retention: The average accuracy drop across all benchmarks was only 0.87%. Interestingly, in some cases, sparse attention acted as a "denoiser," helping the model focus on relevant tokens and slightly improving performance over full attention.

4. Discussion and Future Work

H²EAL demonstrates that head heterogeneity is a critical factor in optimizing LLM inference. By acknowledging that not all heads perform the same task, hardware can be tuned to handle predictable and unpredictable data patterns simultaneously.

However, several avenues for future research remain. Currently, H²EAL uses a static ratio (0.5) for streaming versus retrieval heads; dynamic adjustment of this ratio per layer could further optimize efficiency. Additionally, while the KV cache is the primary bottleneck for long contexts, the Feed-Forward Network (FFN) layers still contribute significantly to total energy consumption. Finally, while these results are based on high-fidelity cycle-level simulations of 22nm logic and 3D-stacked DRAM, physical silicon validation will be necessary to fully characterize thermal and power profiles in real-world edge environments.

5. Conclusion

H²EAL represents a significant step forward for edge-based AI. By co-designing the attention algorithm with 3D-stacked memory architectures, it overcomes the memory wall and workload imbalance issues that previously hindered long-context LLM inference on resource-constrained devices.

Summary updated

Abstract

Large language models (LLMs) have demonstrated remarkable proficiency in a wide range of natural language processing applications. However, the high energy and latency overhead induced by the KV cache limits the edge deployment, especially for long contexts. Emerging hybrid bonding (HB) technology has been proposed as a promising alternative to conventional near-memory processing (NMP) architectures, offering improved bandwidth efficiency and lower power consumption while exhibiting characteristics of distributed memory.In this paper, we propose H2EAL, an HB-based accelerator with sparse attention algorithm-hardware co-design for efficient LLM inference at the edge. At the algorithm level, we propose a hybrid sparse attention scheme with static and dynamic sparsity for different heads to fully leverage the sparsity with high accuracy. At the hardware level, we co-design the hardware to support hybrid sparse attention and propose memory-compute co-placement to address the distributed memory bottleneck. Since different attention heads exhibit different sparse patterns and the attention structure often mismatches the HB architecture, we further develop a load-balancing scheduler with parallel tiled attention to address workload imbalance and optimize the mapping strategy. Extensive experiments demonstrate H2EAL achieves 5.20 ∼ 48.21× speedup and 6.22 ∼ 73.48× energy efficiency improvement over baseline HB implementation, with a negligible average accuracy drop of 0.87% on multiple benchmarks.
BibTeX
@inproceedings{fu2025heal,
  author = {Zizhuo Fu and Xiaotian Guo and Wenxuan Zeng and Shuzhang Zhong and Yadong Zhang and Peiyu Chen and Runsheng Wang and Le Ye and Meng Li},
  title = {{HEAL: Hybrid-Bonding Architecture with Hybrid Sparse Attention for Efficient Long-Context LLM Inference}},
  booktitle = {ICCAD},
  year = {2025},
  url = {https://openreview.net/forum?id=6Ii3hpmpTK},
}
Figure