用聚类采样投票法,让大模型查表快上百倍还不丢准
Beyond Linear LLM Invocation: An Efficient and Effective Semantic Filter Paradigm
- 先聚类分组,再抽样问大模型,最后投票推断全表结果
- 比现有方法少1.28到355倍调用次数,准确率几乎不变
- 适合需要快速筛选海量文本的科研与工程场景
大型语言模型(LLMs)在大规模语料库上处理自然语言查询的应用日益广泛。为统一表达此类查询,研究者提出了基于关系代数的语义操作符,其中语义过滤操作符是核心。给定一个表T和自然语言谓词e,传统方法需对每条记录逐一构造提示,调用大模型获取二元判断,导致线性扫描带来高昂延迟和令牌开销。尽管已有优化工作,仍无法突破线性调用瓶颈。为此,本文提出聚类-采样-投票(CSV)框架,将调用复杂度降至亚线性,同时提供误差保证。该框架将记录嵌入语义簇,采样小样本交由大模型评估,并通过两种投票策略推断簇级标签:UniVote(均匀加权)和SimVote(按语义相似度加权)。此外,对模糊簇触发重聚类以增强鲁棒性。在真实数据集上的实验表明,相比最先进方法,CSV将大模型调用次数减少1.28至355倍,同时保持相近的准确率与F1分数。
原文摘要 · Abstract (English)
Large language models (LLMs) are increasingly used for semantic query processing over large corpora. A set of semantic operators derived from relational algebra has been proposed to provide a unified interface for expressing such queries, among which the semantic filter operator serves as a cornerstone. Given a table T with a natural language predicate e, for each tuple in the relation, the execution of a semantic filter proceeds by constructing an input prompt that combines the predicate e with its content, querying the LLM, and obtaining the binary decision. However, this tuple-by-tuple evaluation necessitates a complete linear scan of the table, incurring prohibitive latency and token costs. Although recent work has attempted to optimize semantic filtering, it still does not break the linear LLM invocation barriers. To address this, we propose Clustering-Sampling-Voting (CSV), a new framework that reduces LLM invocations to sublinear complexity while providing error guarantees. CSV embeds tuples into semantic clusters, samples a small subset for LLM evaluation, and infers cluster-level labels via two proposed voting strategies: UniVote, which aggregates labels uniformly, and SimVote, which weights votes by semantic similarity. Moreover, CSV triggers re-clustering on ambiguous clusters to ensure robustness across diverse datasets. The results conducted on real-world datasets demonstrate that CSV reduces the number of LLM calls by 1.28-355x compared to the state-of-the-art approaches, while maintaining comparable effectiveness in terms of Accuracy and F1 score.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。