C.W.K.
Stream
Lesson 05 of 10 · published

프롬프트 안에서 source citing

~14 min · context, citations, grounding

Level 0수련생
0 XP0/100 lessons0/14 achievements
0/120 XP to next level120 XP to go0% complete

모델이 citation 못 하면 user는 trust 못 해

Ungrounded 답은 confidence trick이야. user가 어느 chunk에서 문장 왔는지 verify할 수 있으면 두 가지 일어나: hallucination이 detect 가능 (cited chunk가 그 말 안 함), user의 trust가 정확하게 calibrate. Citation은 decoration이 아니라 verifier야.

Shape

각 chunk가 프롬프트 안에서 stable한 id 받아 (chunk-7 같은 거나 진짜 document_id). Synthesis 프롬프트가 모든 factual claim이 bracketed id로 끝나야 한다고 require. 여러 chunk가 claim 지원하면 여러 id 나열. 어떤 chunk도 지원 안 하면 모델이 explicit하게 mark해야.

Native citation

Anthropic의 Citations feature는 response랑 같이 structured citation return — output span을 input span에 mapping. OpenAI랑 Gemini는 application layer에서 처리. structured feature 가능하면 써, 아니면 bracketed id로 fallback.

Code

Citation-required synthesis 프롬프트·markdown
# System
Answer using only <context>.
Every factual claim must end with [<chunk-id>] referencing a chunk in <context>.
If no chunk supports a claim, prepend "Unverified: " to the sentence.

# User
Question: {{q}}

<context>
[chunk-1] ...
[chunk-2] ...
[chunk-3] ...
</context>

External links

Exercise

RAG synthesis 프롬프트에 bracketed-id citation 추가. citation이 cited chunk에 진짜 안 나오면 flag하는 programmatic verifier 작성.

Progress

Progress is local-only — sign in to sync across devices.
이 페이지에서 버그를 발견하셨거나 피드백이 있으세요?문제 신고

댓글 0

🔔 답글 알림 (로그인 필요)
로그인댓글을 남기려면 로그인해 주세요.

아직 댓글이 없어요. 첫 댓글을 남겨보세요.