9148c358d0
Topic_Agent/Topic_Blog/Topics/Topics_Biz/Topics_Meeting/Topics_Rag의 마크다운 지식 문서를 Topic_General/Topic_Programming/Topic_Graphic/Topic_Business 4개 카테고리로 재분류. - 중복 제거: frontmatter의 status:duplicate/merged + duplicate_of/redirect_to 필드로 자기 자신을 중복으로 선언한 리다이렉트 stub 1032개 제거, 완전 동일 내용 파일 472개 제거, 동일 파일명·다른 내용 충돌 시 더 큰(완전한) 버전만 유지(162개 제거) — 총 1639개 중복 제거. - 분류: 폴더 단위로 명확한 항목(AI_and_ML/Coding/Architecture 등 → Programming, Comfyui/Visual_Effects → Graphic, Topics_Biz/Topics_Meeting/사업 등 → Business, Poetic_Blog_Writing/창의성/Game_Design 등 → General)은 폴더 우선순위로, 나머지 혼재 폴더(Topic_Agent/Topic_Blog/Topics 루트/Thinking & Reasoning/Other/UI_UX_Assets)는 title/tags 키워드 스코어링으로 파일 단위 분류(불명확한 경우 General로 폴백). 원본 폴더명은 "From_*" 서브폴더로 보존해 추적 가능성 유지. - 최종 배치: Programming 2784 / General 1608 / Graphic 285 / Business 249 = 4926개 문서. - 에이전트 운영 상태(.astra/.agent/.obsidian/sessions/memory/_company/docs/lessons/_shared/src)는 지식 콘텐츠가 아니므로 재분류 대상에서 제외하고 원위치 유지. - Topics/Topic_email(상위 보호 폴더 Topic_email과 파일명 100% 중복) 삭제 — 보호 폴더 자체는 미변경. - 완전히 비게 된 Topic_Agent/Topic_Blog/Topics_Biz/Topics_Rag 폴더 제거.
5.3 KiB
5.3 KiB
id, title, category, status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, verification_status, tags, raw_sources, last_reinforced, github_commit, tech_stack
| id | title | category | status | canonical_id | aliases | duplicate_of | source_trust_level | confidence_score | verification_status | tags | raw_sources | last_reinforced | github_commit | tech_stack | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| wiki-2026-0508-introspection-자기성찰 | Introspection (자기성찰) | 10_Wiki/Topics | verified | self |
|
none | A | 0.9 | applied |
|
2026-05-10 | pending |
|
Introspection (자기성찰)
매 한 줄
"매 모델이 자기 출력을 다시 읽고 평가/수정". 철학에서는 1인칭 자기 의식 접근을 의미하고, LLM에서는 self-critique → revise loop로 정확도/정합성을 끌어올리는 핵심 prompting pattern.
매 핵심
매 두 가지 의미
- 철학 (Locke, Kant): mind 자체를 관찰하는 1인칭 access. qualia, self-model.
- LLM: 자기 응답을 input 으로 다시 받아 비판/개선. Reflexion, Self-Refine, CoVe 계열.
매 동작 원리
- Generate: 초안 응답 produce.
- Critique: 같은 모델이 초안을 평가 (오류, 누락, 가정).
- Revise: critique 반영 재생성.
- (선택) 수렴할 때까지 반복.
매 응용
- Reasoning 정확도 향상 (math, code).
- Hallucination 검출 (CoVe — Chain of Verification).
- Agent 환경: tool 호출 결과 self-evaluate 후 재시도.
- RLHF reward modeling 대안 (constitutional AI).
💻 패턴
Self-Refine (single-model loop)
def self_refine(prompt, model, max_iters=3):
answer = model.invoke(f"Answer: {prompt}")
for _ in range(max_iters):
feedback = model.invoke(
f"Critique this answer (errors, gaps):\n{answer}"
)
if "no issues" in feedback.lower():
break
answer = model.invoke(
f"Original: {prompt}\nDraft: {answer}\nFeedback: {feedback}\nRevised:"
)
return answer
Reflexion (verbal RL)
class ReflexionAgent:
def __init__(self, llm):
self.llm = llm
self.memory = [] # past reflections
def act(self, task):
ctx = "\n".join(self.memory)
result = self.llm(f"{ctx}\nTask: {task}")
if not self.evaluate(result):
reflection = self.llm(f"Why did this fail?\n{result}")
self.memory.append(reflection)
return result
Chain of Verification (CoVe)
def cove(question, llm):
draft = llm(f"Q: {question}")
plan = llm(f"List verification questions for:\n{draft}")
answers = [llm(q) for q in plan.split("\n")]
return llm(f"Original:{draft}\nVerifications:{answers}\nFinal:")
Constitutional AI (self-critique with principles)
PRINCIPLES = ["harmless", "honest", "helpful"]
def constitutional_revise(response, llm):
for p in PRINCIPLES:
critique = llm(f"Critique by '{p}':\n{response}")
response = llm(f"Revise per critique:\n{critique}")
return response
Confidence-gated introspection
def maybe_introspect(answer, llm, threshold=0.7):
score = float(llm(f"Confidence 0-1 in:\n{answer}").strip())
if score < threshold:
return self_refine(answer, llm)
return answer
LangChain self-critique chain
from langchain.chains import LLMChain, SequentialChain
draft = LLMChain(llm=llm, prompt=draft_prompt, output_key="draft")
critic = LLMChain(llm=llm, prompt=critic_prompt, output_key="critique")
final = LLMChain(llm=llm, prompt=final_prompt, output_key="final")
chain = SequentialChain(chains=[draft, critic, final],
input_variables=["q"],
output_variables=["final"])
매 결정 기준
| 상황 | Approach |
|---|---|
| 단순 factual Q&A | introspection 불필요 (latency↑) |
| Math / code | Self-Refine + verifier |
| Long-form 사실 검증 | CoVe |
| Agent 실패 학습 | Reflexion (memory 누적) |
| Safety alignment | Constitutional AI |
기본값: 1-shot Self-Refine (1회 critique → revise). 반복은 비용 대비 효과 체감 빠름.
🔗 Graph
- 부모: Prompt_Engineering, Transformer_Architecture_and_LLM_Foundations
- 변형: Reflexion, Self-Refine, Chain-of-Verification
- 응용: AI_Safety_and_Alignment
- Adjacent: Chain-of-Thought
🤖 LLM 활용
언제: multi-step reasoning, 사실 검증 필요한 long-form, agent 실패 분석, alignment. 언제 X: 단답형 classification, latency 민감, cost-bound batch inference.
❌ 안티패턴
- Critique 동일 모델만 사용: confirmation bias — 가능하면 stronger judge 사용.
- 무한 loop: 수렴 조건 없이 반복 → 비용 폭증, 답 표류.
- Critique 무시: revise 단계에서 critique 미반영 prompt.
- 자기성찰 == 자의식: LLM introspection 은 functional pattern. 철학적 self-awareness 와 구분.
🧪 검증 / 중복
- Madaan et al. 2023 (Self-Refine), Shinn et al. 2023 (Reflexion), Dhuliawala et al. 2023 (CoVe).
- Bai et al. 2022 (Constitutional AI, Anthropic).
- 신뢰도 A.
🕓 Changelog
| 날짜 | 변경 |
|---|---|
| 2026-05-08 | Phase 1 |
| 2026-05-10 | Manual cleanup — 철학/LLM 두 의미 통합, Self-Refine/Reflexion/CoVe/Constitutional 패턴 정리 |