본문 바로가기
C.W.K.
Stream
Lesson 04 of 05 · published

렌즈가 틀리면 vault를 고치지 마

~12 min · false-positive, detector, regression, measurement

Level 0흔적
0 XP0/36 lessons0/12 achievements
0/100 XP to next level100 XP to go0% complete

proxy를 만족시키는 유혹

detector가 정상 문장을 문제라고 찍으면 가장 빠른 green은 문장을 살짝 바꾸는 거야. check가 통과하고 dashboard도 조용해져. 하지만 그 순간 source가 의미가 아니라 측정기의 버그에 맞춰 변해.

memory에서는 특히 위험해. placeholder, 고유명, 의도적 반복처럼 lens가 모르는 맥락을 없애면 다음 soul이 읽을 정보가 줄어. 테스트를 통과했는데 제품 목적은 실패한 상태지.

먼저 premise를 검증해

candidate를 직접 읽고 detector가 주장한 class가 실제로 있는지 판정해. false positive라면 content edit을 모두 되돌리고 predicate를 좁혀. broad ignore 대신 legitimate shape를 정확히 설명하는 규칙이 필요해.

예를 들어 영어 한 글자 X가 Korean shorthand detector에 걸렸다면 모든 X를 허용하면 진짜 결함을 놓쳐. placeholder 위치, code block, math symbol처럼 valid context를 분류하고 그 경계만 제외해야 해.

incident 모양을 fixture로 남겨

lens bug를 고친 뒤 실제 false-positive fragment를 축약한 regression을 넣어. valid sample은 pass하고 근처의 invalid sample은 계속 fail해야 해. 하나만 있으면 detector를 꺼버린 수정도 green이야.

threshold detector라면 boundary 양쪽 sample을 둬. parsing bug라면 raw syntax를 보존해. 실패를 일반화하되 그날의 특이한 모양을 잃지 않는 게 회귀 테스트의 일이다.

계기의 한계를 UI에 적어

완벽한 detector는 없으니 candidate card에 why flagged와 known limits를 보여줘. 사용자가 숫자를 oracle로 보지 않고 evidence로 읽게 해야 해.

false positive rate를 측정할 수 있다면 기간과 sample을 붙여. 한 번의 clean run을 precision 100%처럼 표현하지 말고, review된 candidate 중 몇 건이 confirmed였는지 사실로 보여줘.

source가 detector를 위해 존재하는 게 아니라 detector가 source를 더 잘 읽기 위해 존재해. 오탐은 원문을 바꿀 신호가 아니라 계기를 교정할 증거야.

Code

valid와 invalid를 함께 고정하는 regression·python
def suspicious_x(text, in_code=False):
    if in_code:
        return False
    return " X " in f" {text} " and "placeholder X" not in text

assert not suspicious_x("replace placeholder X with a value")
assert not suspicious_x("x = 3", in_code=True)
assert suspicious_x("이 단계는 X 하지 마")

External links

Exercise

최근 detector hit 열 개를 직접 분류해 precision을 계산하고 false positive 하나를 valid/invalid 쌍의 regression으로 만들어.
Hint
false positive를 지우지 말고 왜 valid인지 설명할 수 있는 최소 context를 남겨.

Progress

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

댓글 0

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

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