arXiv:2509.12610cs.DBcs.AI2025-09被引 2

用轻量代理模型加速大文档语义查询,大幅降低大模型调用次数。

ScaleDoc: Scaling LLM-based Predicates over Large Document Collections

  • 离线用大模型生成文档语义表示,线上用轻量代理模型快速筛选。
  • 相比直接使用大模型,查询速度提升2倍以上,大模型调用减少85%。
  • 适合需要处理海量非结构化文档的智能分析系统开发者。

谓词是数据管理系统的核心组件。然而,现代工作负载越来越多涉及非结构化文档,要求超越传统值匹配的语义理解能力。面对海量文档与临时查询,尽管大语言模型(LLM)具备强大的零样本推理能力,但其高昂的推理开销导致难以接受的延迟。为此,我们提出 extsc{ScaleDoc},一个将谓词执行解耦为离线表示阶段和在线优化过滤阶段的新系统。离线阶段, extsc{ScaleDoc} 利用 LLM 为每个文档生成语义表示;在线阶段,针对每个查询,在这些表示上训练轻量级代理模型以过滤绝大多数文档,仅将模糊案例传递给 LLM 做最终判断。此外, extsc{ScaleDoc} 提出两项核心创新:(1) 基于对比学习的框架,使代理模型生成可靠的预测决策分数;(2) 自适应级联机制,在满足特定准确率目标的前提下确定最优过滤策略。在三个数据集上的评估表明, extsc{ScaleDoc} 实现了超过2倍的端到端速度提升,并将昂贵的 LLM 调用减少高达85%,使大规模语义分析变得高效可行。

原文摘要 · Abstract (English)

Predicates are foundational components in data analysis systems. However, modern workloads increasingly involve unstructured documents, which demands semantic understanding, beyond traditional value-based predicates. Given enormous documents and ad-hoc queries, while Large Language Models (LLMs) demonstrate powerful zero-shot capabilities, their high inference cost leads to unacceptable overhead. Therefore, we introduce \textsc{ScaleDoc}, a novel system that addresses this by decoupling predicate execution into an offline representation phase and an optimized online filtering phase. In the offline phase, \textsc{ScaleDoc} leverages a LLM to generate semantic representations for each document. Online, for each query, it trains a lightweight proxy model on these representations to filter the majority of documents, forwarding only the ambiguous cases to the LLM for final decision. Furthermore, \textsc{ScaleDoc} proposes two core innovations to achieve significant efficiency: (1) a contrastive-learning-based framework that trains the proxy model to generate reliable predicating decision scores; (2) an adaptive cascade mechanism that determines the effective filtering policy while meeting specific accuracy targets. Our evaluations across three datasets demonstrate that \textsc{ScaleDoc} achieves over a 2$\times$ end-to-end speedup and reduces expensive LLM invocations by up to 85\%, making large-scale semantic analysis practical and efficient.

大模型语义查询效率优化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。