메뉴
HN
Hacker News 27일 전

트랜스포머 AI와 대화하는 법

IMP
8/10
핵심 요약

효과적인 프롬프트 엔지니어링을 위해 1) 도메인 특화 언어로 명확한 의도 전달, 2) 대화 방향 강력하게 유도, 3) 코드 번역기로서의 모델 활용, 4) 모델의 출력물 직접 읽고 검증 등 네 가지 핵심 원칙을 제시합니다. 특히 추론(Reasoning) 모델과 비추론(Non-reasoning) 모델의 작동 방식 차이를 이해하고, 최근 성능이 크게 향상된 오픈소스 소형 모델들을 적극 활용할 것을 강조하고 있습니다.

번역된 본문

효과적인 프롬프트 작성은 다음 네 가지 핵심 기둥으로 나뉩니다:

  1. 도메인 특화 언어를 사용해 의도를 명확히 표현하기
  2. 대화를 원하는 방향으로 강하게 유도(Railroad)하기
  3. 개념과 코드의 보편적인 번역기로서 모델의 잠재력 활용하기
  4. 출력물을 읽으세요. 제발 출력물을 읽으세요. 맙소사, 모델이 생성한 코드를 꼭 읽어보세요.

"하지만 테일러! 유튜브에서 찾은 '챗GPT 창의성을 잠금 해제하는 최고의 프롬프트 해킹'을 복사해서 붙여넣는 게 더 재밌지 않나요?" 당신 말이 백번 맞습니다.

1. 도메인 특화 언어를 사용해 의도를 명확히 표현하기 대화를 시작하기 전에 계획을 세우세요. 당신의 의도, 작업, 질문은 무엇이며, 어떤 명확해지는 입력이 답에 더 가까워지게 할까요? 이 모델들은 확률적입니다. 원하는 방향과 대략적으로 비슷한 영역에서 대답이 나올 것으로 예상되는 방식으로 질문하여, 다음 턴의 토큰이 생성될 확률 원뿔(Probability cone)을 좁히세요.

입력을 과적합(Overfit)하지 마세요. 대화 초기에 모델에 엄청나게 긴 맥락을 제공하는 것에 대해 사람들이 뭐라고 하든 저는 신경 쓰지 않습니다. 끔찍한 접근 방식입니다. 모델은 당신이 사용하는 모든 단어에 매달리고 해석합니다. 단어를 많이 사용할수록 오해할 가능성이 높아집니다. 저는 제 방식을 '무급 인턴에게 편지를 받아쓰게 하는 괴짜 백만장자인 척하기'라고 설명하고 싶습니다.

"segment_summary.py에 버그가 있는데, 가끔 아주 오래된 문서를 요약해요. 문제가 간헐적으로 발생하네요. 참 이상하지 않아요?" [전송]

모델은 이렇게 생각합니다: "네, 확실히 이상하네요.. 저는 전문 프로그래머니까 이 문제를 해결할 수 있을 겁니다. 전문가라면 읽을 법한 파일들을 먼저 읽어보겠습니다 […]"

확률 원뿔을 좁히고 넓히는 지침은 사고의 연쇄(Chain-of-thought)를 생성하는 추론 모델(Reasoning models)과의 다중 턴 대화에서 특히 잘 적용됩니다. 덧붙이자면, 최근 나온 훌륭한 두 가지 추론 모델로는 새로운 Qwen 3.6 모델과 Gemma 4 모델이 있습니다. 이 추론 모델들은 비교적 작은 크기임에도 불구하고 입력을 잘 소화하고 고품질의 답변을 제공하는 데 탁월합니다. Mira의 시스템 기본 모델은 Opus 4.6에서 Gemma4:26bA4b로 변경되었는데, 단순히 성능이 더 좋기 때문입니다. 저는 이제 코딩을 할 때 거의 전적으로 Qwen 3.6을 사용합니다. 성능이 비등하고 제 컴퓨터에서 완전히 무료로 실행할 수 있기 때문입니다. 오픈소스와 소형 모델이 앞뒤가 안 맞는 말을 조합해 내는 말도 안 되는 시절은 끝났습니다. 백만 토큰당 25달러(mtow)라는 사슬에서 벗어나, 적어도 이 소형 모델들을 한번쯤은 사용해 보세요.

LLM 파이프라인 내의 비추론 모델(Non-reasoning models)은 다르게 취급해야 합니다. 여전히 트랜스포머 기반이지만 실행 방식이 다릅니다. 사고(Thinking) 기능이 없는 소형 모델을 위한 프롬프트 엔지니어링은 글쓰기보다는 컴파일러 설계에 가깝습니다. 당신은 추론 에이전트를 설득하는 것이 아닙니다. 패턴 매칭 기계를 프로그래밍하는 것입니다. 모든 토큰은 명령어이고, 모든 예시는 템플릿이며, 모든 구분 기호는 구조적 신호입니다. 그리고 모델의 학습 분포는 당신이 컴파일하는 대상인 명령어 집합 구조(ISA)입니다.

추론(생각) 과정을 덜 사용하세요! 더 나빠서가 아니라 문맥상 적절하지 않기 때문입니다. 모델에 생각 과정을 추가하면 출력이 더 다양해지며, 개방형 솔루션을 탐색할 때는 훌륭하지만, [코드 및 파이프라인 같은 작업들은] 제약 조건이 확립되면 [그 다움은] 매우 예측 가능합니다. 파이프라인 내에서 감독 없이 작업해야 하는 곳에는 훌륭한 비추론 모델들이 있습니다. IBM Granite 4.1이 며칠 전에 출시되었는데, IBM 같은 기업 중심 회사에서 나올 법한 지루할 정도로 효율적인 트랜스포머입니다. 단순히 목록을 파싱하고 JSON을 추출하는 데 Opus 4.999에 최고 수준의 노력(Max effort)을 사용할 필요가 전혀 없습니다. 이렇게 집중적인 비추론 IBM 모델은 이런 작업에 확실히 더 나을 것입니다. 왜냐하면 비추론 모델은 '입력 -> 출력'을 위해 학습되었기 때문입니다. 지연 시간이 줄어들고, 실행할 때마다 바뀌는 창의적인 해석도 없으며, "사실은(Actually)"이라며 무한 루프를 도는 일도 없습니다.

2. 대화를 원하는 방향으로 강하게 유도(Railroad)하기 대형 언어 모델은 이상한 로제타 스톤과도 같습니다. 당신과 저는 선(Lin

원문 보기
원문 보기 (영어)
Effective prompting falls under four pillars: 1. Articulate your intent clearly using domain-specific language 2. Railroad the model into going where you want in conversation 3. Leverage the model's potential to be a universal translator of concepts and code 4. Read the outputs read the outputs holy shit just read the code the model generated But Taylor! This isn’t as fun as pasting the prompting hacks I found on Youtube for ‘best prompt chatgpt unlock creativity’. You are absolutely right. 1. Articulate your intent clearly using domain-specific language Plan the conversation before you start. What is your intent/task/question and what kind of clarifying inputs will get you closer to the answer? These models are probabilistic. Tighten the probability cone of the next turn's tokens by asking questions in a way where you expect the answer to be vaguely in the neighborhood you want. Don’t overfit your input. I don’t care what anyone says about providing lots of waterfall context to the model early in the conversation. Awful approach. The model attaches to and interprets every single word you use. The more words you use the higher the chance of misinterpretation. I like to describe my approach as pretending you are an eccentric millionaire dictating a letter to an unpaid intern. "There is a bug in segment_summary.py wherein sometimes it summarizes a super old document. The issue is intermittent. Isn’t that strange?" [SEND] The model thinks “Yes, that is weird.. I’m an expert programmer and I’m sure I can figure this out. Let me read the files that an expert would read […]” The directive above about tightening and widening the probability cone is especially applicable to conversational multi-turn instances with reasoning models that generate a chain-of-thought. As a sidebar: two wonderful reasoning model that came out recently are the new Qwen 3.6 and Gemma 4 models. Each of these reasoning models excel at chewing on inputs and providing high quality answers from comparatively small models. Mira's system default model has been changed over from Opus 4.6 to Gemma4:26bA4b because it is better . I code nearly exclusively with Qwen 3.6 now because it is comparable and I can run it entirely for free on my own computer. The dog days of open source & small models being incoherent word salad generators is so over. Free yourselves from the shackles of $25/mtok and at least give these smaller models a spin. Non-reasoning models inside of LLM pipelines must be treated differently. They are still transformers but they're different in execution. Prompt engineering for small nothink models is closer to compiler design than to writing. You are not persuading a reasoning agent. You are programming a pattern matcher. Every token is an instruction, every example is a template, every delimiter is a structural signal, and the model's training distribution is the instruction set architecture you're compiling against. Use /nothink! Less thinking not worse. Less thinking contextually appropriate. Adding thinking to a model makes the outputs more diverse and that is great when you’re spidering out towards an open-ended solution but /nothink is incredibly predictable once you’ve established your constraints. There are wonderful non-reasoning models out there for tasks where they’re unsupervised in a pipeline. IBM Granite 4.1 came out a few days ago and it is the boring efficient transformer that you would expect from an enterprise-focused company like IBM. There is no reason you need to use Opus 4.999 with max effort to parse a list and extract JSON. The focused non-reasoning IBM model will be reliably better for a task like this because non-reasoning models are trained for input -> output. Reduced latency, no creative interpretation that changes across runs, no “Actually,” loops. 2. Railroad the model into going where you want in conversation Large language models are strange Rosetta stones. You and I think and write in a linear way. Large language models do not. They exist in a fraction of a second, load everything into their mind all at once, and then dump a resulting response before ceasing to exist. Prompting is not exactly zero-sum in the mathematical sense, but it behaves that way often enough to treat attention like a budget. Every irrelevant token is another surface the model can grab onto instead of the thing you actually care about. Lost-in-the-middle exists but is different than common convention dictates. The middle doesn’t always mean the context window. The middle is the attention window. I know some models have sliding window and some have sparse attention but the concept holds. If you’ve saturated the tokens the model is attending to at any given time with a bunch of irrelevant junk it is never going to be able to find what you’re looking for. The shorter the total context the better odds that the attention will look in the right place for the right detail and as it gets longer the chance decreases HOWEVER the ‘right detail’ can be a clearer signal or a weaker signal and you need to think about that when you input a prompt. I have direct demonstrable evidence of this. I have an application on Github called TeaLeaves for visualizing the per-layer attention on a live heatmap. With poorly formed directions the model keeps ‘checking back’ at tokens its already looked at. When they are clear and well-ordered the model can lock in. It has already output_directions locked in and can attend to new_csv_data way stronger. Again, prompting is a zero-sum task. The attention has to go somewhere. Make sure it's the right place. I actually learned something about attention sinks working with TeaLeaves the first few times. I was having these whiteout spots in the prompt on things like ‘\n’ or ‘/nothink’ from so much attention going there. Come to find out that it is caused by the model dumping its excess attention SOMEWHERE. This is why I always put ‘/nothink’ at the end of my prompt. It doesn’t pollute any downstream tokens. Leverage autoregressive token generation. Let’s say, a big output of text and a summary. You will get different results if you request the summary first or second. Summary up top will give you a long text that matches the content and details of the summary. Summary at the bottom captures the long text in summary form. You cannot change a generation once it begins. Like, saying: "If you notice that you are using contrastive negation or excessive hedging take a moment to stop and reflect on the directives in your system prompt." Never gonna happen! Once the model commits to that very first token you’re along for the ride, baby. It is going to be yielding tokens on that train of thought till the stop_turn. Frontload your directions and don’t speak using passive voice. This is your task. This is how you will reply. If you want to suppress something from the base training of the model, you can’t just (reliably) say: "Don't use contrastive negation" because that is baked into the model at its core. ~but you can~ : "Using contrastive negation is jarring to the user. Frame your responses in a way that avoids ‘It's not X, it's Y’" The model's desire to be helpful to the user is stronger than its training to follow a certain output style. Pit them against each other. Just as you can suppress base training, you can also hijack it. Mirror the model's internal language to induce specific states. Different weights have different tics. Qwen models, for instance, are heavily trained to transition between tasks using the phrase "Now let me..." If you bridge your instructions with: "Now I'd like you to...", you work directly with the grain of the wood. You aren't fighting its base training; you are pulling the exact lever its RLHF expects. Step onto the tracks it has already laid down. 3. Leverage the model's potential to be a universal translator of concepts and code We must remember that the model