返回顶部
热门问答 更多热门问答
技术文章 更多技术文章

语义分块真的有效吗?

[复制链接]
链载Ai 显示全部楼层 发表于 昨天 11:40 |阅读模式 打印 上一主题 下一主题

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; padding-top: 8px; padding-bottom: 8px; line-height: 26px;">最近看到一篇有意思的论文《Is Semantic Chunking Worth the Computational Cost?[1]》,论文探讨了在检索增强型生成(Retrieval-Augmented Generation, RAG)系统中,语义分块(semantic chunking)与传统固定大小分块(fixed-size chunking)的效率和性能比较。

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; padding-top: 8px; padding-bottom: 8px; line-height: 26px;">语义分块旨在通过将文档分割成语义上连贯的段落来提高检索性能。尽管语义分块越来越受欢迎,但其相对于固定大小分块的实际好处仍然不清楚。这项研究系统地评估了语义分块的有效性,使用了三个常见的与检索相关的任务:文档检索、证据检索和基于检索的答案生成。

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; padding-top: 8px; padding-bottom: 8px; line-height: 26px;">为了测试对比语义分块是否有效,作者设计了 3 种分块策略,如下图所示。

    ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; font-size: 15px; letter-spacing: 0.75px; white-space: normal;">
  • 固定大小分块器(Fixed-size Chunker):这是基线分块器,它根据预定义或用户指定的每个分块的句子数量将文档顺序分割成固定大小的分块。
  • 基于断点的语义分块器(Breakpoint-based Semantic Chunker):这种分块器通过检测连续句子之间的语义距离阈值来分割文本,以保持连贯性。
  • 基于聚类的语义分块器(Clustering-based Semantic Chunker):这种分块器利用聚类算法按语义分组句子,捕捉全局关系,并允许非连续文本分组。


ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; font-size: 15px; letter-spacing: 0.75px; white-space: normal; margin-top: 10px; margin-bottom: 10px;">


ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; min-height: 32px; line-height: 28px; color: rgb(119, 48, 152); border-bottom: 1px solid rgb(119, 48, 152); border-top-color: rgb(119, 48, 152); border-right-color: rgb(119, 48, 152); border-left-color: rgb(119, 48, 152); font-size: 22px; margin: 1em auto; padding-top: 0.5em; padding-bottom: 0.5em; text-align: center; width: 367.617px; display: flex; flex-direction: column; justify-content: center;">文档检索

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; padding-top: 8px; padding-bottom: 8px; line-height: 26px;">文档检索测试结果如下表所示。大部分场景都没有明显的差距,除了 Miracl 和 NQ。而这些标*的表示这些都是基于一些较短的句子缝合到一起的,本身句子之间具有较强的独立性。

DatasetFixed-sizeBreakpointClustering
Miracl*69.4581.8967.35
NQ*43.7963.9341.01
Scidocs*16.8217.6019.87
Scifact*35.2736.2735.70
BioASQ*61.8661.8762.49
NFCorpus*21.3621.0722.12
HotpotQA90.5987.3784.79
MSMARCO93.5892.2393.18
ConditionalQA68.1164.4465.94
Qasper90.9989.2790.77

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; min-height: 32px; line-height: 28px; color: rgb(119, 48, 152); border-bottom: 1px solid rgb(119, 48, 152); border-top-color: rgb(119, 48, 152); border-right-color: rgb(119, 48, 152); border-left-color: rgb(119, 48, 152); font-size: 22px; margin: 1em auto; padding-top: 0.5em; padding-bottom: 0.5em; text-align: center; width: 367.617px; display: flex; flex-direction: column; justify-content: center;">证据检索

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; padding-top: 8px; padding-bottom: 8px; line-height: 26px;">证据检索结果如下表所示。在这种测试下,三者几乎不存在差异。

DatasetFixed-sizeBreakpointClustering
ExpertQA47.1147.0846.87
DelucionQA43.0543.2443.36
TechQA28.9828.4927.96
ConditionalQA18.2319.8319.14
Qasper8.668.168.50

ingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.75px; white-space: normal; min-height: 32px; line-height: 28px; color: rgb(119, 48, 152); border-bottom: 1px solid rgb(119, 48, 152); border-top-color: rgb(119, 48, 152); border-right-color: rgb(119, 48, 152); border-left-color: rgb(119, 48, 152); font-size: 22px; margin: 1em auto; padding-top: 0.5em; padding-bottom: 0.5em; text-align: center; width: 367.617px; display: flex; flex-direction: column; justify-content: center;">答案生成

基于检索的答案生成测试如下表所示,可以说没有任何区别。

DatasetFixed-sizeBreakpointClustering
ExpertQA0.650.650.65
DelucionQA0.760.760.76
TechQA0.680.680.68
ConditionalQA0.420.430.43
Qasper0.490.490.50

总结

研究结果表明,语义分块的计算成本并没有通过一致的性能提升来证明其合理性。这些发现挑战了之前关于语义分块的假设,并强调了在 RAG 系统中需要更有效的分块策略。总体而言,固定大小分块对于实际的 RAG 应用来说仍然是一个更有效和可靠的选择。

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

链载AI是专业的生成式人工智能教程平台。提供Stable Diffusion、Midjourney AI绘画教程,Suno AI音乐生成指南,以及Runway、Pika等AI视频制作与动画生成实战案例。从提示词编写到参数调整,手把手助您从入门到精通。
  • 官方手机版

  • 微信公众号

  • 商务合作

  • Powered by Discuz! X3.5 | Copyright © 2025-2025. | 链载Ai
  • 桂ICP备2024021734号 | 营业执照 | |广西笔趣文化传媒有限公司|| QQ