arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.01157cs.DBcs.AIcs.IR
收藏

超越鸭子叫:将语言模型和RAG深度整合到DuckDB中

Beyond Quacking: Deep Integration of Language Models and RAG into DuckDB

Polytechnique Montréal(蒙特利尔理工学院);University of Waterloo(滑铁卢大学)

Anas Dorbani, Sunny Yasser, Jimmy Lin, Amine Mhedhbi

AI总结:

本文提出FlockMTL,通过整合语言模型和RAG技术,简化了知识密集型分析应用的开发,采用模型驱动的函数和SQL抽象优化实现效率。

摘要:

知识密集型分析应用需要从结构化表格数据和非结构化文本文档中检索上下文以做出有效决策。大型语言模型(LLMs)使此类检索和推理数据管道的原型设计变得容易。然而,高效实现这些管道仍需大量努力并面临诸多挑战。这通常涉及协调异构数据系统、管理数据移动以及处理低层实现细节,例如LLM上下文管理。为了解决这些挑战,我们引入了FlockMTL:一种DBMS扩展,深度整合LLM能力和检索增强生成(RAG)。FlockMTL包括模型驱动的标量和聚合函数,通过元组级映射和减少实现链式预测。受关系模型的启发,FlockMTL纳入:(i) 基于成本的优化,无缝应用批处理和缓存技术;以及(ii) 通过新型SQL DDL抽象:PROMPT和MODEL实现的资源独立性,这些抽象作为第一类模式对象与TABLE一起引入。FlockMTL简化了知识密集型分析应用的开发,其优化减轻了实现负担。

英文摘要:

Knowledge-intensive analytical applications retrieve context from both structured tabular data and unstructured, text-free documents for effective decision-making. Large language models (LLMs) have made it significantly easier to prototype such retrieval and reasoning data pipelines. However, implementing these pipelines efficiently still demands significant effort and has several challenges. This often involves orchestrating heterogeneous data systems, managing data movement, and handling low-level implementation details, e.g., LLM context management. To address these challenges, we introduce FlockMTL: an extension for DBMSs that deeply integrates LLM capabilities and retrieval-augmented generation (RAG). FlockMTL includes model-driven scalar and aggregate functions, enabling chained predictions through tuple-level mappings and reductions. Drawing inspiration from the relational model, FlockMTL incorporates: (i) cost-based optimizations, which seamlessly apply techniques such as batching and caching; and (ii) resource independence, enabled through novel SQL DDL abstractions: PROMPT and MODEL, introduced as first-class schema objects alongside TABLE. FlockMTL streamlines the development of knowledge-intensive analytical applications, and its optimizations ease the implementation burden.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑