Skip to content

[negative result] feat(retrieval): MENTIONS 청크 question-relevance rerank — 효과 없음, 머지 보류#70

Draft
TaskerJang wants to merge 1 commit into
feat/p1-extractor-hardeningfrom
feat/chunk-rerank-p1
Draft

[negative result] feat(retrieval): MENTIONS 청크 question-relevance rerank — 효과 없음, 머지 보류#70
TaskerJang wants to merge 1 commit into
feat/p1-extractor-hardeningfrom
feat/chunk-rerank-p1

Conversation

@TaskerJang

Copy link
Copy Markdown
Owner

⚠️ 네거티브 결과 — 머지하지 말 것 (기록용 draft)

LocalRetriever 의 _EXPAND_SUBGRAPH_CYPHER 가 entity 의 MENTIONS 청크 중 임의 3개를 300자로 잘라 넘겨 질문 관련성 랭킹이 0이던 문제를 retrieve-then-rerank 로 고쳐봤으나, 80 QA 측정 결과 효과 없음 + 응답속도 4배 악화. 가설 실패를 기록으로 박제한다.

변경

  • Cypher: MENTIONS 청크를 12개까지 원문으로 retrieve ([..3]/substring 제거)
  • _rank_chunks_by_question: bge-m3 cosine 으로 entity 당 top 3 채택 + 600자 절단
  • payload 모양({chunk_id, text, page}) 유지 → 답변 프롬프트 무변경, 델타 귀속 명확

근거: Sentence-Transformers Retrieve & Re-Rank, MS GraphRAG Local Search (ranking + filtering).

측정 — gpt52_p1cleangpt52_p1clean_chunkrank (80 QA, gpt-5.2 / claude-haiku judge)

지표 VectorRAG QA GraphRAG QA
Answer Correctness 2.60 → 2.42 (−0.18) 2.05 → 1.98 (−0.07)
Faithfulness 20% → 17.5% (−2.5pp) 17.5% → 15% (−2.5pp)
수치 정확도 0.424 → 0.409 0.369 → 0.350
Entity Coverage 0.408 → 0.394 0.508 → 0.433 (−0.075)
Completeness 2.30 → 2.10 1.90 → 1.80
평균 응답 10.4s → 25.1s 11.3s → 44.4s ⚠️

전 지표 평탄~하락, 응답시간 4배.

진단 (왜 안 먹혔나)

  1. 대부분 entity 의 MENTIONS 청크가 12개 미만 → "아무거나 3개" ≈ "관련성 top 3", 바꾼 게 병목이 아니었음.
  2. 답 청크가 entity 의 MENTIONS 집합 이면 rerank 가 손댈 수 없음 (사전 명시한 한계 적중). EntCov 하락이 이 방향.
  3. OCR 로 깨진 청크는 어떤 청크를 골라도 답이 깨짐 — 병목은 청크 선택이 아니라 내용.
  4. 응답 4배는 bge-m3 가 CPU 에서 후보 청크 원문(최대 60개)을 임베딩한 비용.

결론

청크 랭킹은 병목이 아님이 측정으로 확인됨. 다음 레버는 Hybrid(BM25) — 그래프/entity-MENTIONS 병목을 우회해 어휘 매칭으로 청크를 직접 가져와 factual/numerical 약점을 정조준. 본 브랜치는 네거티브 결과 기록용으로 보존.

…d on feat/p1)

feat/chunk-rerank 가 dev 베이스라 eval 인프라(#66/#67/gpt-5.2 토글)가 없던 문제 →
feat/p1-extractor-hardening 위로 rebase. 변경 내용은 동일:

- Cypher: MENTIONS 청크를 12개까지 원문으로 retrieve ([..3]/substring 제거)
- _rank_chunks_by_question: bge-m3 cosine 으로 entity 당 top 3 채택 + 600자 절단
- payload 모양({chunk_id,text,page}) 유지 → 답변 프롬프트 무변경

근거: Sentence-Transformers Retrieve & Re-Rank, MS GraphRAG Local Search.
한계: 답 청크가 해당 entity 의 MENTIONS 집합 안에 있을 때만 동작.
TaskerJang added a commit that referenced this pull request May 30, 2026
chunk-rerank 네거티브(#70) 진단 처방: graph traversal/entity-MENTIONS 병목을
어휘 검색으로 우회. Neo4j fulltext(chunk_fulltext) → top-k 청크 → 답변.

- retrieval/bm25_retriever.py: queryNodes(Lucene/BM25) + Lucene escape + graceful
- retrieval/prompts/bm25_answer_v1.md: 청크 기반 답변(수치 원문 보존, 정직한 N/A)

근거: BEIR(Thakur 2021) BM25 robust OOD baseline; 자기 80 QA 에서 BM25 baseline
factual/numerical 압승. 한국어는 cjk analyzer 필수 (인덱스 DDL은 docstring 참조).
아직 router 미배선 — fulltext 인덱스 생성 + sanity check 통과 후 배선 예정.
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