메뉴
HN
Hacker News 14일 전

최고가 AI 모델이 필요한 순간은 단 한 번뿐이다

IMP
8/10
핵심 요약

AI 코딩 에이전트를 설계할 때, 비싼 모델(수석 설계자)은 계획을 세우고 저렴한 모델(주니어)이 코드를 작성하게 하는 '분업' 방식이 오히려 비용 증가와 성능 저하를 초래합니다. AI 에이전트 비용의 대부분은 '코드 작성'이 아니라 방대한 문맥을 '읽는 것(Reading)'에서 발생하기 때문에, 두 모델이 같은 코드를 이중으로 읽게 만드는 계획 문서 전달은 비효율적입니다. 대신 최고 성능의 모델이 충분히 탐색하고 첫 코드 수정을 시작하는 시점에 문맥(Context) 전체를 저렴한 모델에 넘기는 '/prewalk' 방식이 훨씬 효율적입니다.

번역된 본문

원숭이도 나무에서 떨어진다! 🍌 최고 수준(frontier) 모델 성능의 97%를 달성하면서, 비용($$)은 41% 더 저렴하고, 작업 완료는 1.9배 더 빠르며, 환각/오작동을 저지를 확률은 약 3배 낮습니다.

/plan 명령은 완벽해 보입니다. 하지만 실제로는 그래서는 안 됩니다! 여러분은 이런 피치(영업)를 들어봤을 것이고, 심지어 실제 프로젝트에 적용해 봤을 수도 있습니다. 비싼 모델이 분명 더 뛰어난 설계자(Architect)이긴 하지만, 전체 파이프라인에 걸쳐 그 모델을 사용하는 것은 낭비처럼 느껴집니다. 그래서 왜 비싼 모델에게 "어려운 부분"만 맡기지 않는 건가요? 코드를 읽고, 깊이 생각한 다음, 정확한 계획을 작성하는 것이죠. 그런 다음 가격이 10분의 1에 불과한 모델이 그 계획을 실행합니다. 수석 아키텍트와 주니어 엔지니어의 조합입니다. 완벽하게 들리시죠?

위에서 /plan† 라벨이 붙은 빨간 점을 찾아보세요. Opus는 읽기 전용으로 계획을 세우고 Gemini Flash가 이를 구현합니다: 작업당 $3.18, 10.7분, 성공률 84.6%가 나옵니다. 반면 Opus가 주니어 모델에 작업을 넘기지 않고 전체 작업을 단독으로 수행할 때는: $2.78, 10.1분, 성공률 84.6%가 나옵니다. 즉, 이 "비용 절감" 조치가 오히려 아무것도 하지 않을 때보다 14% 더 비용이 듭니다. 어찌 된 일일까요?

실수는 아키텍처 다이어그램을 그리기 전의 근본적인 발상에서부터 비롯됩니다. 사람들은 사람을 평가하듯 에이전트의 비용을 평가합니다. 수석의 시간은 비싸니 수석의 개입을 최소화하라는 식입니다. 하지만 AI 에이전트의 하루 중 비용이 많이 드는 부분은 무언가를 고치거나, 빌드하거나, 생각하는 것이 아닙니다. Opus가 무언가를 수정하는 데는 돈이 들지 않습니다. 돈이 드는 부분은 바로 Opus가 '읽는 작업'을 수행하는 것입니다.

토큰이 어디에 소비되었는지 보여주는 (다소 주관적일 수 있는) 분포를 보면, 완전히 자동화된 에이전트들도 상황이 다르지 않습니다. 전체 토큰의 단 9%만이 코드 '수정'에 사용됩니다. 나머지는 전부 '읽기'에 사용됩니다. 그리고 이러한 비율은 특정 프레임워크의 변칙적인 현상도 아니며, 쉽게 "고칠 수 있는" 문제도 아닙니다. 저희가 말씀드립니다. 저희도 온갖 방법을 시도해 봤고, 그 결과물이 'snapcompact'입니다. 어떤 에이전트, 어떤 모델, 어떤 스캐폴딩(Scaffold)을 사용하든 결제 금액은 본질적으로 O(reads), 즉 읽어 들인 양에 비례합니다.

이 점을 염두에 두고 여러분이 /plan을 선택하게 되는 모든 이유를 곱씹어 보십시오:

"대형 모델의 깊은 이해도가 필요하잖아." 그 깊은 이해도는 읽어 들인 파일, 제거된 막다른 길, 테스트된 가설 등 10만 개 이상의 토큰으로 이루어진 방대한 문맥(Context)에 존재합니다. 계획 문서는 그 방대한 문맥에서 파생된 2,000 토큰 정도의 엽서에 불과합니다. 실행 모델이 받는 것은 '이해도'가 아니라 '엽서'이며, 나머지 문맥은 자신의 비용으로 다시 처음부터 구축해야 합니다.

"작업이 매우 복잡하거든." 그렇다면 메인 에이전트가 작업을 실행하게 두어서는 안 됩니다. 읽기 전용으로 계획만 세우는 한 번의 턴(turn)으로는 해결되지 않습니다. 에이전트가 충분히 탐색하게 둔 다음, 하위 에이전트(Sub-agent)들을 파견하여 실제 작업을 수행하게 해야 합니다. 이 경우 '전화 게임(잘못 전달되는 현상)'은 전혀 도움이 되지 않습니다.

"비용 제약이 있어." 돈이 드는 부분은 바로 '읽기'입니다. /plan 명령은 비싼 최고 수준의 모델이 모든 것을 비싼 가격으로 읽게 만든 다음, 이번엔 저렴한 모델이 그걸 다시 읽게 만듭니다. 여러분은 비용이 많이 드는 부분을 이동시킨 게 아니라, 중복해서 비용을 지불하게 만든 것입니다.

이것이 실제로 어떻게 진행되는지 보여주는 다이어그램(저희가 너무 많은 시간을 쏟은)을 보십시오. 상단 리본을 보세요. Opus는 base.py, signing.py, 테스트 파일(회색 카드 20장)을 읽은 다음 계획을 작성하고 자리를 뜹니다. 그리고 Flash가 그 아름다운 문서를 받자마자 하는 일이 무엇일까요? 계획서는 곧 파일이 아니고 글을 수정할 수 없기 때문에, Flash는 다시 base.py와 테스트 파일을 읽기 시작합니다. 회색으로 표시된 '읽기' 작업은 그대로 쌓여갑니다. 첫째로 비싼 Opus의 가격으로 읽고, 그다음엔 또 Flash의 가격으로 읽어 내려가는 것입니다. 두 번째 리더(Reader)를 두는 방식이 비용을 최적화하는 경우는 세상에 존재하지 않습니다.

'동화책'이 아니라 '궤적(Trajectory)'을 넘겨라 계획 문서는 문자 그대로 가보지 않은 여행을 묘사하는 엽서와 같습니다. 실제로 가치 있는 것을 전달할 수 있는 것은 바로 컨텍스트 윈도우(Context Window) 자체입니다. /prewalk 방식은 다음과 같이 작동합니다:

최고 수준의(frontier) 모델에서 작업을 시작하되, 숨겨진 단 하나의 지시문을 맨 앞에 붙입니다. '계획을 깊이 세운 다음, 해당 계획을 할 일(to-do) 목록으로 캡처하고 작업을 시작하라'는 것입니다. 최고 수준의 모델이 코드를 탐색하고, 계획을 작성하고, 할 일 목록을 초기화합니다. 그러다 첫 번째 코드 수정(edit)이 이루어지는 순간(즉, 에이전트가 확신을 갖고 행동할 수 있는 지점)에 저렴한 모델로 교체하고 컨텍스트에서 계획 관련 지시문을 가지치기(prune)하여 삭제합니다.

요령은 이것입니다. 저렴한 모델은 절대 "잠깐, 우린 지금 계획을 세우고 있던 거 아니었어?"라고 되묻지 않습니다. 이미 컨텍스트에 계획 지시문이 남아있지 않기 때문입니다. 저렴한 모델의 관점에서 보면, 그저 스스로 코드를 둘러보고 포괄적인 할 일 목록을 형태로 계획을 세운 다음, 자신만만하게 실행을 시작한 것처럼 보입니다. 더 좋은 건, 이미 유효한 첫 행동(수정)을 하나 해둔 상태라는 것입니다! (이는 완벽한 인-컨텍스트 예시 역할을 합니다)

우리가 이곳에 도달하기까지 오픈소스 환경에서 일하는 장점은 사람들이 어떻게 일하는지에 대해 직접 이야기 나눌 수 있다는 것입니다.

원문 보기
원문 보기 (영어)
Monkey see, monkey do! 🍌 97% of frontier performance 41% cheaper in $$ 1.9× faster completion ~3× less likely to cheat /plan makes perfect sense. It really shouldn't! You've heard this pitch; you may have even shipped it. The expensive model is clearly the better architect, but it feels like a waste to use it for the entire pipeline. Why not let it do the "hard part"? Read the code, think deeply, write a precise plan. Then a model a tenth the price executes the plan. Senior architect, junior engineer. Sounds great, right? Find the red dot above, labeled Opus 4.8 + /plan† . Opus plans read-only, Gemini Flash implements: lands at $3.18 per task, 12.7 minutes, 84.6% pass . Opus doing the entire task by itself, no handoff, no junior: $2.78, 10.1 minutes, 84.6% . The "cost-saving" measure costs 14% more than not saving. Huh? The mistake is upstream of the architecture diagram. People price agents the way they price people: senior time is expensive, so minimize senior involvement. But the expensive part of an agent's day is not the fixing, building, or even the thinking. Opus fixing things does not cost money. Opus reading things costs money. Take a look at this admittedly anecdotal distribution of where our tokens went; fully automated agents look no different. Nine percent of the tokens are edits. The rest is reading, and this split is not a quirk of one harness, or something you can "fix". Trust us, we've tried — that's how snapcompact happened. Any agent, any model, any scaffold: the bill is essentially O(reads) . Now walk through every reason you'd reach for /plan, with that in mind: "I want the deep understanding of the big model." The understanding lives in 100K+ tokens of grounded context: files read, dead ends eliminated, hypotheses tested. The plan document is a 2K-token postcard from that context. The executor gets the postcard, not the understanding, and has to rebuild the rest at its own expense. "The task is very complicated." Then you don't want the main agent executing at all ; a single read-only planning turn isn't the answer. Let it explore, then dispatch sub-agents to do the work. A game of telephone doesn't help you here. "I'm cost constrained." Reading is the cost. /plan makes the frontier model read everything at frontier prices, then makes the cheap model read it again . You didn't move the expensive part; you duplicated it. Here's what that looks like in practice, with a diagram we've spent way too much time on: Look at the top ribbon. Opus reads base.py , signing.py , the test file (twenty cards of gray), then writes its plan and leaves. And what's the first thing Flash does with that beautiful document? It re-reads base.py and the test file, because a plan is not a file and you cannot edit prose. The gray reads just keep stacking, first at Opus prices, then again at Flash prices. There is no version of this where a second reader is the cost optimization. Hand off a trajectory, not a fairytale A plan document is a literal postcard, describing a journey to a model that never took it. What actually could transfer something of value is the context window itself: /prewalk does this: Start the task on the frontier model with one hidden instruction prefixed: plan deeply, then capture the plan as a todo list, then start. The frontier model explores, writes the plan, initializes the todo list. The moment the first edit lands (the point where it was confident enough to act), you swap to the cheap model and prune the planning instruction from context. The trick is that: The cheap model never goes "wait, I thought we were planning". There is no planning instruction left in its context. As far as it knows, it explored around, created a comprehensive plan in the form of a todo list, and then confidently started executing. Even better, it already made one valid move ! (a free in-context example) How we got here The nice thing about working in an open-source harness is that you get to chat with people about how they do things, and almost everyone has a completely different setup. Anyhow: I'd occasionally start easy-to-medium tasks with a frontier model, then switch to Kimi K27 after a few turns so it wouldn't fall into its usual thought loops. I never bothered to measure whether this was rational... until someone else mentioned doing the same thing. Naturally, we had to benchmark it: are we idiots, or does this actually work, and when? First attempt: swap at a fixed turn, say #4. Obviously bad in hindsight: sometimes the frontier model is still lost at turn four, sometimes it has already finished the whole fix. Second attempt: swap after the first edit. The model has demonstrated the pattern once, in place, in style. Pretty nice, although still finicky: small models kept declaring the task done out of nowhere. The solution was to ask our unwitting herding agent to spell out a plan step by step, and then, once it's ready to execute, init a TODO list with a validation step for each item. It then edits some piece of code, and that's when we trigger the swap. Gating on any edit alone is no good; the todo list still has a very important role here. Our tiny friend can forget the plan, a validation step, or what it's doing entirely, but it cannot forget the todo reminder that bugs it endlessly, giving us free steering. Another funny failure mode: GPT 5.6 as the guide really likes creating 60-item TODO lists and completing them in batches (do they just hand out rewards for anything?), so an item limit in the prompt is a must. The receipts GPT-5.6 Sol : 97% of Sol's pass rate at 61% of the cost, and it's the fastest of the three , because Sol stops burning slow frontier tokens after the opening and Luna doesn't waste turns lost in the woods. Opus 4.8 : 92% of Opus at 53% of the cost, 1.5× the speed, +18 points over oneshot Flash. One more thing before we move on. Scroll back up to the ribbons from our django-13279 test ride and look for something that isn't there: cheating! The effect we didn't expect Every SWE-bench task is a bug that was really fixed, years ago, in public. The answer to the exam is on GitHub. Below: the share of runs that went poking around the web for it. Filthy cheaters! Same model, same scaffolds, almost the same idea, yet wildly different behavior. Why does /plan still cheat while /prewalk doesn't? Best explanation we have: prewalk starves it, from both ends. Cheating is what a capable model does when it gets desperate. In the solo traces the GitHub turns start mid-run, once exploration stalls: Sol breaks around turn 14, Opus around turn 12. Prewalk terminates the frontier model at the beginning of its effort budget, median ~7 turns: it exits while it's still deriving an approach and landing a first edit (the confident phase), well before its googling phase begins. /plan gets neither mercy: it has no turn limit, and its deliverable (a comprehensive document explaining how the fix should work, without ever testing an edit against the code) is exactly the kind of assignment that breeds desperation. The executor then inherits the opposite of desperation: a context where the approach already survived contact with the code. Repro written, first edit landed, checklist ticking. Nothing in that context looks like searching, so the imitation machine doesn't search. Prefill walked so prewalk could run None of this is a new idea. It's the oldest trick in the book: prefill . Assistant doesn't do what you want? Start the assistant's turn yourself, and the model continues as if the words were its own. It began as a consistency hack prior to grammar-constrained decoding. omp and many others still do it: session titles come from a tiny local model, which just happens to do better when you start its turn with <title> . A model that small can't be argued into a format, but it can be tricked into one. Then the red-teamers found the other end. Prefill "Sure, here's how to…" and a much larger model sails past its own refusal: it has no channel distin