
H$^{2}$MT: Semantic Hierarchy-Aware Hierarchical Memory Transformer
H2MT addresses a fundamental bottleneck in transformer inference: the cost of processing irrelevant context in long-input scenarios. By pre-computing a semantic hierarchy and routing queries through it at inference time, the approach reduces wasted computation on unrelated text while avoiding the external storage and indexing overhead that plagues retrieval-augmented generation systems. This matters because it directly tackles prefill latency and memory consumption, two metrics that constrain practical deployment of long-context LLMs. The coarse-to-fine pruning strategy represents a structural shift from flat token processing, potentially reshaping how production systems balance context window size against inference speed.62























