kims6305-bjk GitHub avatar

reflection-probe-gate

kims6305-bjk

A repository documenting a reflection probe verification subgraph for citation-grounded QA that rigorously rejected its own main probe (P1) through a preregistered A/B test gate, emphasizing the gate's reusable methodology over the probes.

Stars

5

7-day growth

No data

Forks

0

Open issues

0

License

MIT

Last updated

2026-07-28

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It demonstrates a rare, honest failure case where the main probe was discarded after self‑testing, and provides a reproducible multi‑phase gate (preregistration, blind scoring, McNemar, instrument check) that can be adapted to any domain.

Who it is for

  • RAG pipeline developers seeking to validate or discard verification layers
  • LLM safety and evaluation researchers
  • ML engineers building robust A/B testing harnesses for LLM interventions
  • Practitioners studying self‑correction and citation accuracy

Use cases

  • Determining whether a verification prompt adds value or causes overcorrection in a production QA pipeline
  • Reusing the gate process to A/B test any LLM intervention (e.g., new prompting strategies, fine‑tuning)
  • Diagnosing low‑baseline error environments where verification is pure overhead
  • Conducting multi‑phase failure analysis to separate measurement failure from treatment failure

Strengths

  • Preregistration and blind scoring ensure statistical rigor and prevent cherry‑picking
  • Replicable instrument check (165 calls) confirms the measurement tool works before committing to expensive experiments
  • Cross‑domain validation (SciFact, KLUE‑NLI) shows the gate transfers to English biomedical and non‑accounting Korean tasks
  • Cost‑efficient diagnosis: 10× reduction in LLM calls by first verifying the instrument

Considerations

  • Main probe (P1) was rejected only under the tested conditions (strong model + evidence‑attached); may be valid in weaker‑model or evidence‑free settings
  • Gate and probes tested with a single LLM (claude‑sonnet‑4‑6); model transferability is unverified
  • The repository's primary deliverable is a process, not a ready‑to‑deploy verification solution; users must adapt the gate to their own domains and models

README quick start

probe-graph — Reflection Probe Verification Subgraph for Citation-Grounded QA

English | 한국어 | 中文

인용 기반 QA 파이프라인(RAG 봇)에 꽂는 검증 서브그래프 스킬과, 그 효과를 판정한 A/B 실측 하네스 전체를 담은 레포입니다.

핵심이 되는 결과부터 밝힙니다: 본 레포의 메인 프로브(P1)는 자체 실측 게이트에서 폐기 판정을 받았습니다. 이 레포의 가치는 "만능 검증 프롬프트"가 아니라, ①문헌 근거로 설계한 프로브 3종과 ②그것을 채택하기 전에 걸러낸 판정 절차 (사전 등록 → 블라인드 채점 → McNemar)의 재현 가능한 전 과정입니다.

그리고 그 이후 4단계(Phase 1~3 + 계기 검침)에서 게이트는 자기 자신의 실패까지 잡아냈습니다. 재사용 가치가 가장 높은 수치는 프로브가 아니라 게이트 쪽에 있습니다:

게이트 지표실측값의미
계기 검침 검출 회수율81.8% (9/11)측정 도구가 신호를 잡는지 본 실행 전에 확인
계기 검침 3판 재현성SPLIT 0건 / 55판정이 흔들리지 않음
옆방 검증 (영어·생의학 / 한국어·비회계)2/2 PASS, recall 100%도메인·언어·라벨러를 바꿔도 절차가 작동
진단 비용1,650콜 → 165콜실패 원인 규명을 10분의 1 비용으로
프로브 3표 합의 (Phase 1)회수율 90% 유지, 검토부담 38.9%→35.2%, 자동 오탐 0붙이지 않고 걷어내서 얻은 파레토 바깥이동

📖 이 레포가 만들어진 하루의 전 과정(설계 근거·4연속 실패·게이트가 저자의 오진을 잡은 기록)은 케이스 스터디에 순서대로 남겼습니다.

왜 만들었나 (동기)

출발점은 Anthropic 인터프리터빌리티 팀의 논문이었습니다:

"Verbalizable Representations Form a Global Workspace in Language Models" (Anthropic, 2026, transformer-circuits.pub/2026/workspace)

이 논문은 LLM 내부에 "말로 꺼낼 수 있는 표현들의 특권 집합"이 있고, counterfactual reflection — "중간에 끊고 '지금 무슨 생각해?'라고 물으면 원칙을 말하도록" 학습시키면 안 끊긴 상황의 실제 행동까지 개선된다는 것을 보였습니다. 또한 모델이 내부적으로는 이의를 인지하면서 출력에 반영하지 않는 BUT-갭(88%)을 보고했습니다.

논문의 본체 기법(J-lens)은 residual stream 접근이 필요해 API 사용자는 쓸 수 없습니다. 그래서 "물어보면 말할 내용이 곧 조용히 추론하는 내용"이라는 인과 발견만을 프롬프트 레벨로 번역한 것이 이 스킬입니다: 답변 생성 후 "이 답에서 근거 못 대는 부분을 말해봐"라고 묻는 리플렉션 프로브를 파이프라인 노드로 꽂는 설계.

범위 명시: 이 레포는 위 논문의 구현이 아닙니다. 원 논문의 counterfactual reflection은 학습(fine-tuning) 기법이고, 이 레포는 추론 시 프롬프트 검증기입니다. 논문은 설계의 동기일 뿐, 본 레포 P1/P2/P3의 효과를 입증하지 않습니다 — 효과 판정은 전적으로 아래의 자체 A/B 게이트가 담당합니다.

순진하게 만들면 해롭다 (설계 과정)

구현 전에 자기검증(self-correction) 문헌 8편을 검토했고, 순진한 프로브는 오히려 성능을 깎는다는 반대 증거가 일관되게 나왔습니다:

논문이 설계에 준 것
Huang et al., Large Language Models Cannot Self-Correct Reasoning Yet (arXiv:2310.01798)"오답 가정" 프롬프트가 최대 −9.5pp (CSQA). 정답→오답 전환이 오답→정답보다 항상 많음 → 앵커 A1("이미 정확할 가능성이 높다고 전제") · A5("문제 찾기가 아니라 일치 확인")
Dhuliawala et al., Chain-of-Verification (CoVe) (arXiv:2309.11495)factored 검증(초안 산문을 검증자에게 주지 않음)으로 FACTSCORE 55.9→71.4. yes/no 검증질문은 동조 편향 → P1은 주장 리스트만 입력 + A6(원문 발췌 강제)
FBC/EIR 계열 (verify-first ablation)"수

Description

Reflection probe verification subgraph for citation-grounded QA — with the A/B gate that rejected its own main probe (pre-registered, blinded, McNemar)

Related repositories

Similar projects matched by category, topics, and programming language.

slvDev
Featured
slvDev GitHub avatar

esp32-ai

A 28.9 million parameter language model runs on an $8 ESP32-S3 microcontroller entirely on-device, generating simple stories at about 9.5 tokens per second.

AI & Machine LearningLarge Language Models
1,960
gavamedia
Featured
gavamedia GitHub avatar

deltafin

Deltafin is a research project that runs the 2.8-trillion-parameter Mixture-of-Experts model Kimi K3 on a single Apple Silicon Mac (e.g., M1 Max with 64 GB) at about 16 seconds per token, using exact, reproducible inference with local or streaming expert loading.

AI & Machine LearningLarge Language Models
304
jamesob
Featured
jamesob GitHub avatar

local-llm

A comprehensive guide for building and configuring a high-end local machine to run state-of-the-art LLMs, with detailed hardware choices, BIOS tuning, and Docker-based model serving.

AI & Machine LearningLarge Language Models
1,660