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

Reasoning vs Output — 둘 분리

~14 min · reasoning, output, structure

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

모델이 think하고; consumer가 read해

Reasoning은 모델용. Output은 user (또는 너의 pipeline 다음 stage)용. 둘 conflate하면 hedging과 chain-of-thought가 JSON field에 leak되는 verbose 답 만들어.

세 패턴

  • Hidden thinking — Extended Thinking, o-series. Reasoning이 consumer 절대 도달 안 함.
  • Tagged thinking — <thinking> 다음 <answer>. Operator read 가능, parser가 user 보기 전 strip.
  • External thinking — 첫 call이 plan 생성, 두 번째 call이 그것 기준으로 execute. 두 프롬프트, 두 output, 하나는 audit log용 하나는 user용.

audit-log win

production에서 뭐 잘못되면 reasoning trace는 gold야. Hidden thinking 모델은 종종 user 안 보여줘도 developer한테 노출. trace log해; 다음 incident에서 자기한테 감사할 거야.

Code

user 반환 전 thinking strip·python
import re

def strip_thinking(text: str) -> tuple[str, str]:
    m = re.search(r"<thinking>(.*?)</thinking>\s*(.*)", text, flags=re.DOTALL)
    if not m:
        return "", text
    return m.group(1).strip(), m.group(2).strip()

thinking, answer = strip_thinking(model_text)
log_trace(thinking)
return answer

External links

Exercise

현재 reasoning이 output으로 leak하는 프롬프트에서 tagged thinking으로 분리. thinking log. user한테는 answer만 return.

Progress

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

댓글 0

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

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