用分段图记忆机制,让长文本解析更快更省内存。
HSGM: Hierarchical Segment-Graph Memory for Scalable Long-Text Semantics
- 将长文本分段构建局部语义图,再提炼成全局摘要节点
- 推理速度提升2-4倍,内存减少60%以上,准确率超95%
- 适合需要实时处理超长文本的场景,如法律、金融文档
长文档语义解析因成对组合和内存需求呈二次增长而困难。我们提出层级分段图记忆(HSGM),将长度为 $N$ 的输入分解为 $M$ 个有意义的段落,在每段上构建局部语义图,并提取紧凑的摘要节点形成全局图记忆。HSGM 支持增量更新——仅新到达的段落需进行局部图构建与摘要节点融合;通过顶层 $K$ 检索定位相关段落后,在其局部图中进行细粒度推理。理论上,复杂度从 $O(N^2)$ 降至 $O(N hinspace k + (N/k)^2)$,其中 $k \ ext{\ll} N$,并推导出节点摘要与稀疏化阈值带来的近似误差的 Frobenius 范数界。实验在三个基准任务上验证:长文档 AMR 解析、段级语义角色标注(OntoNotes)、法律事件抽取,结果表明 HSGM 实现 2–4× 推理加速、>60% 峰值内存降低,且保持 ≥95% 基线准确率。该方法为超长文本提供了可扩展、高精度的语义建模能力,推动实时与资源受限的 NLP 应用落地。
原文摘要 · Abstract (English)
Semantic parsing of long documents remains challenging due to quadratic growth in pairwise composition and memory requirements. We introduce \textbf{Hierarchical Segment-Graph Memory (HSGM)}, a novel framework that decomposes an input of length $N$ into $M$ meaningful segments, constructs \emph{Local Semantic Graphs} on each segment, and extracts compact \emph{summary nodes} to form a \emph{Global Graph Memory}. HSGM supports \emph{incremental updates} -- only newly arrived segments incur local graph construction and summary-node integration -- while \emph{Hierarchical Query Processing} locates relevant segments via top-$K$ retrieval over summary nodes and then performs fine-grained reasoning within their local graphs. Theoretically, HSGM reduces worst-case complexity from $O(N^2)$ to $O\!\left(N\,k + (N/k)^2\right)$, with segment size $k \ll N$, and we derive Frobenius-norm bounds on the approximation error introduced by node summarization and sparsification thresholds. Empirically, on three benchmarks -- long-document AMR parsing, segment-level semantic role labeling (OntoNotes), and legal event extraction -- HSGM achieves \emph{2--4$\times$ inference speedup}, \emph{$>60\%$ reduction} in peak memory, and \emph{$\ge 95\%$} of baseline accuracy. Our approach unlocks scalable, accurate semantic modeling for ultra-long texts, enabling real-time and resource-constrained NLP applications.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。