Skip to content

feat(retrieval): improve lexical score ties after neural ranker failure - #75

Merged
wefio merged 1 commit into
mainfrom
feat/lexical-query-coverage-ties
Sep 29, 2026
Merged

wefio merged 1 commit into
mainfrom
feat/lexical-query-coverage-ties

Conversation

@wefio

@wefio wefio commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

变更描述

What:在纯 FTS5 词法检索中,对 Active Graph 已选出的、相邻且 combinedScore 完全相同的候选,按查询词在陈述和前 500 个证据字符中的 IDF 加权覆盖度排序。候选集合、非并列顺序、QPP 决策和混合检索保持原样。

Why:#52 后继续探索的小型神经网络排序方案没有达到产品准入门槛:在 19 条独立真实召回查询上,同一候选集 MRR(Q) 为 0.861,低于现有排序的 0.921;限制到顶部并列组后虽为 0.947,但配对结果不显著(p=1.0)。本次神经网络排序实验失败,不加入模型。程序化的词法并列排序在固定的五套召回样本中有可复核收益,尤其 LoCoMo 的 R@1 由 7.71% 升至 17.42%、MRR(Q) 由 0.1830 升至 0.3364,10/10 用户改善(按用户分组的精确符号翻转 p=0.00195)。

Changes:

  • 提取词法并列排序函数,并仅在 FTS5 路径的证据预算选择之后调用;返回结果、Active Graph selections 和检索轨迹保持同序。
  • 增加排序边界、稳定性和真实 store/trace 对齐测试。
  • 在设计、双语决策和实验记录中记录失败的神经网络方案及五套数据的完整收益与回退。LongMemEval 与 BEAM 的 MRR(Q) 分别由 0.8823 降至 0.8800、0.1352 降至 0.1338;全部数据集 R@20 不变。

未验证项

Not verified:没有运行最终回答质量/读者评分或线上 A/B;没有实测新增常驻内存 RSS 的 100 MB 硬上限。规则无需模型权重,离线重排的平均 CPU 开销约 0.13–2.0 毫秒/查询。神经网络实验只有 19 条真实查询和显式正例,没有已验证负例,不能据此估计无关内容的精确率。缓存向量的 LongMemEval 对照指标不变,未对全部混合检索组合重跑端到端回答评估。

完成检查项

本地质量检查

  • npm run verify:static 通过。
  • npm run agent:verify -- <本 PR 的 9 个路径> 通过,包含 npm run test:product、npm run build 和所有阻塞路由检查;41 项定向测试通过。
  • 未修改依赖、lockfile 或子包;未提交可再生产物。
  • npm run docs:check 通过;非平凡改动有双语决策记录和实验记录。
  • npm run complexity:gate 通过。

RCP(Repository Control Plane)

  • 首次实质写入前已登记 repo-development in-flight goal;创建 PR 后结清。
  • agent:verify 结果写入 .nmg/verification/latest.json,全部阻塞检查通过。
  • 使用 nmg-rcp forge-status --pr 75 确认 CI 全绿。
  • 提交仅含本 PR 拥有的 9 个文件;独立 worktree 的提交前后工作区均干净。

CI 完成确认

  • All checks passed 为 SUCCESS。
  • CodeFactor 通过。
  • Static job 通过。

Apply query-term coverage after Active Graph evidence selection on the FTS5-only path. Keep candidate membership, QPP decisions, and hybrid ranking intact.

Record paired retrieval results and the failed small neural ranker experiment. No neural model is added.
@wefio
wefio marked this pull request as ready for review September 29, 2026 16:42
@wefio
wefio merged commit a755a75 into main Sep 29, 2026
7 checks passed
@wefio
wefio deleted the feat/lexical-query-coverage-ties branch September 29, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant