Gemini 프롬프트 설계 전략
Gemini 프롬프트 설계 전략 (Prompting Strategies)
*프롬프트 설계(Prompt design)*는 언어 모델로부터 정확하고 품질 높은 응답을 이끌어 내는 프롬프트(자연어 요청)를 만드는 과정이에요. 이 페이지는 Gemini AI 모델을 최대한 활용하도록 프롬프트를 설계하는 데 필요한 기본 개념, 전략, 모범 사례를 소개합니다.
출처: 문서
본문
참고: 프롬프트 엔지니어링은 반복적인 작업이에요. 이 지침과 템플릿은 출발점일 뿐입니다. 여러분의 사용 사례와 관찰된 모델 응답에 맞춰 실험하고 다듬으세요.
주제별 프롬프트 가이드
더 구체적인 프롬프트 전략이 필요하다면 다른 프롬프팅 가이드들을 확인해 보세요.
다른 샘플 프롬프트는 프롬프트 갤러리에서 찾을 수 있어요. 이 가이드에서 다루는 많은 개념을 대화형으로 보여줍니다.
명확하고 구체적인 지시
모델 동작을 커스터마이즈하는 효과적이고 효율적인 방법은 명확하고 구체적인 지시를 제공하는 거예요. 지시는 질문, 단계별 작업, 또는 사용자의 경험과 사고방식을 설계하는 것처럼 복잡한 형태일 수도 있어요.
입력 (Input)
입력은 모델이 응답해야 할 프롬프트의 필수 텍스트예요. 입력으로는 모델이 답하는 질문(질문 입력), 모델이 수행하는 작업(작업 입력), 모델이 조작하는 개체(개체 입력), 또는 모델이 완성·이어가는 부분 입력(완성 입력)이 될 수 있어요.
| 입력 유형 | 프롬프트 | 생성된 출력 |
|---|---|---|
| 질문 (Question) | What's a good name for a flower shop that specializes in selling bouquets of dried flowers? Create a list of 5 options with just the names. |
Here are 5 names for a flower shop specializing in dried flowers: 1. Everlasting Blooms 2. Dried & Delightful 3. The Petal Preserve 4. Whispers of Wildflowers 5. Forever Blooms |
| 작업 (Task) | Give me a simple list of just the things that I must bring on a camping trip. The list should have 5 items. |
1. **Tent:** Your shelter from the elements. 2. **Sleeping Bag:** Stay warm and comfortable. 3. **Sleeping Pad:** Insulation and cushioning for a good night's sleep. 4. **Headlamp or Flashlight:** Light for nighttime activities. 5. **First Aid Kit:** Be prepared for minor injuries. |
| 개체 (Entity) | Classify the following items as [large, small]: Elephant Mouse Snail |
Here's the classification: * **Elephant:** Large * **Mouse:** Small * **Snail:** Small |
부분 입력 완성 (Partial input completion)
생성형 언어 모델은 고급 자동 완성 도구처럼 동작해요. 부분 콘텐츠를 제공하면 모델이 나머지 콘텐츠, 또는 그것의 연속일 것이라 생각하는 것을 응답으로 제공할 수 있어요. 이때 예시나 컨텍스트를 포함하면 모델이 그 예시·컨텍스트를 고려할 수 있어요.
아래 예시는 지시와 개체 입력을 담은 프롬프트를 보여줘요.
프롬프트:
For the given order, return a JSON object that has the fields cheeseburger, hamburger, fries, or
drink, with the value being the quantity.
Order: A burger and a drink.
응답:
{
"cheeseburger": 0,
"hamburger": 1,
"fries": 0,
"drink": 1
}
(gemini-2.5-flash)
모델이 지시대로 했지만, 자연어로 지시를 쓰는 것은 때로 어려울 수 있고 모델 해석에 많은 부분이 맡겨져요. 예를 들어 레스토랑 메뉴에는 항목이 많을 수 있어요. JSON 응답 크기를 줄이려면 주문하지 않은 항목은 생략하고 싶을 거예요. 이 경우 예시와 응답 접두사를 주고 모델이 완성하게 할 수 있어요.
프롬프트:
Valid fields are cheeseburger, hamburger, fries, and drink.
Order: Give me a cheeseburger and fries
Output:
{"cheeseburger": 1, "fries": 1}
Order: I want two burgers, a drink, and fries.
Output:
응답:
{
"hamburger": 2,
"drink": 1,
"fries": 1
}
(gemini-2.5-flash)
주문에 포함되지 않았으므로 "cheeseburger"가 출력에서 제외된 점을 주목하세요.
단순한 JSON 응답 객체의 형식은 프롬프트로 지정할 수 있지만, 더 복잡한 JSON Schema를 응답에 지정할 때는 Gemini API의 구조화 출력(structured output) 기능을 사용하는 것을 권장해요.
제약 조건 (Constraints)
프롬프트를 읽거나 응답을 생성할 때의 제약 조건을 지정하세요. 모델에게 무엇을 해야 하고 하지 말아야 하는지 알려줄 수 있어요. 예를 들어 요약의 길이에 대한 제약을 프롬프트에 지정할 수 있어요.
프롬프트:
Summarize this text in one sentence:
Text: A quantum computer exploits quantum mechanical phenomena to perform calculations exponentially
faster than any modern traditional computer. At very tiny scales, physical matter acts as both
particles and as waves, and quantum computing uses specialized hardware to leverage this behavior.
The operating principles of quantum devices is beyond the scope of classical physics. When deployed
at scale, quantum computers could be used in a wide variety of applications such as: in
cybersecurity to break existing encryption methods while helping researchers create new ones, in
meteorology to develop better weather forecasting etc. However, the current state of the art quantum
computers are still largely experimental and impractical.
응답:
Exploiting quantum mechanical phenomena, quantum computers can perform calculations exponentially faster than traditional computers for potential applications like cybersecurity and meteorology, although they are currently largely experimental and impractical.
(gemini-2.5-flash)
응답 형식 (Response format)
응답의 형식을 지정하는 지시를 줄 수 있어요. 예를 들어 표, 글머리 목록, 엘리베이터 피치, 키워드, 문장, 문단 형식을 요청할 수 있어요. 다음 시스템 지시는 모델이 더 대화형으로 응답하도록 합니다.
시스템 지시:
All questions should be answered comprehensively with details, unless the user requests a concise response specifically.
프롬프트:
What is a smart way to make a business that sells DVD's in 2026?
응답:
Starting a business selling DVDs in 2026 presents significant challenges due to the overwhelming dominance of digital streaming and on-demand services; a "smart" approach would therefore require a highly specialized niche, a strong value proposition beyond just the disc, and likely a focus on community or collector markets rather than mainstream consumption.
Here's a breakdown of what a smart DVD business in 2026 would likely entail:
1. Extreme Niche Specialization: You cannot compete with streaming libraries. Your business must focus on what digital doesn't offer easily or at all. This could include:
* Out-of-Print & Rare Titles: Sourcing films or TV shows that have never been released digitally or are currently unavailable on major streaming platforms.
....
(gemini-2.5-flash)
완성 전략으로 응답 형식화하기
완성 전략도 응답 형식화에 도움을 줄 수 있어요. 다음 예시는 모델에게 에세이 개요를 만들라고 프롬프트해요.
프롬프트:
Create an outline for an essay about hummingbirds.
응답:
Here is a possible outline for an essay about hummingbirds:
I. Introduction
A. Hook: Start with a captivating fact or description about hummingbirds (e.g., their speed, iridescent colors, or tiny size).
B. Background: Briefly introduce hummingbirds – where they are found (Americas), their reputation as unique birds.
C. Thesis Statement: State the main point of the essay, which could be about the remarkable adaptations, behaviors, and ecological importance of hummingbirds.
II. Appearance and Identification
.....
(gemini-2.5-flash)
프롬프트가 개요의 형식을 지정하지 않아 모델이 스스로 형식을 골랐어요. 특정 형식의 개요를 반환하게 하려면 개요의 시작을 나타내는 텍스트를 추가하고 모델이 시작한 패턴에 따라 완성하게 하면 돼요.
프롬프트:
Create an outline for an essay about hummingbirds.
I. Introduction
*
응답:
Okay, here is an outline for an essay about hummingbirds, starting from the introduction you provided:
I. Introduction
* Hook: Start with a captivating fact or description about hummingbirds (e.g., their speed, iridescent colors, or tiny size).
* Background: Briefly introduce hummingbirds – where they are found (Americas), their reputation as unique birds, and their general characteristics.
* Thesis Statement: State the main point of the essay, focusing on the remarkable adaptations, behaviors, and ecological significance that make hummingbirds extraordinary.
.....
(gemini-2.5-flash)
제로샷(zero-shot) vs 퓨샷(few-shot) 프롬프트
올바른 답이 어떻게 생겼는지 보여주는 예시를 프롬프트에 포함할 수 있어요. 모델은 예시에서 패턴과 관계를 식별하려고 하고, 응답 생성 시 그것을 적용해요. 몇 개의 예시를 담은 프롬프트를 퓨샷(few-shot) 이라 하고, 예시가 없는 프롬프트를 제로샷(zero-shot) 이라고 해요. 퓨샷 프롬프트는 모델 응답의 형식화, 표현, 범위, 일반 패턴을 규제하는 데 자주 사용돼요. 구체적이고 다양한 예시를 사용하면 모델의 초점을 좁히고 더 정확한 결과를 내도록 도와줘요.
프롬프트에 항상 퓨샷 예시를 포함할 것을 권장해요. 퓨샷 예시가 없는 프롬프트는 덜 효과적일 가능성이 높아요. 실제로 예시가 손에 있는 작업을 명확히 보여준다면 프롬프트에서 지시를 제거할 수도 있어요.
다음 제로샷 프롬프트는 최선의 설명을 고르도록 모델에 요청해요.
프롬프트:
Please choose the best explanation to the question:
Question: How is snow formed?
Explanation1: Snow is formed when water vapor in the air freezes into ice
crystals in the atmosphere, which can combine and grow into snowflakes as they
fall through the atmosphere and accumulate on the ground.
Explanation2: Water vapor freezes into ice crystals forming snow.
Answer:
응답:
Explanation1 is the better explanation because it provides more detail on the
process, including how ice crystals combine and grow into snowflakes as they
fall through the atmosphere.
(gemini-2.5-flash)
사용 사례에서 모델이 간결한 응답을 내야 한다면, 간결한 응답에 우선권을 주는 예시를 프롬프트에 포함할 수 있어요.
다음 프롬프트는 짧은 설명을 선호하는 두 예시를 제공해요. 응답에서 예시들이 모델을 이끌어 이전처럼 긴 설명(Explanation1) 대신 짧은 설명(Explanation2)을 고르게 한 것을 볼 수 있어요.
프롬프트:
Below are some examples showing a question, explanation, and answer format:
Question: Why is the sky blue?
Explanation1: The sky appears blue because of Rayleigh scattering, which causes
shorter blue wavelengths of light to be scattered more easily than longer red
wavelengths, making the sky look blue.
Explanation2: Due to Rayleigh scattering effect.
Answer: Explanation2
Question: What is the cause of earthquakes?
Explanation1: Sudden release of energy in the Earth's crust.
Explanation2: Earthquakes happen when tectonic plates suddenly slip or break
apart, causing a release of energy that creates seismic waves that can shake the
ground and cause damage.
Answer: Explanation1
Now, Answer the following question given the example formats above:
Question: How is snow formed?
Explanation1: Snow is formed when water vapor in the air freezes into ice
crystals in the atmosphere, which can combine and grow into snowflakes as they
fall through the atmosphere and accumulate on the ground.
Explanation2: Water vapor freezes into ice crystals forming snow.
Answer:
응답:
Answer: Explanation2
(gemini-2.5-flash)
최적의 예시 개수
Gemini 같은 모델은 몇 개의 예시로 패턴을 파악하는 경우가 많지만, 최상의 결과를 위해 프롬프트에 제공할 예시 개수를 실험해야 할 수도 있어요. 동시에 예시가 너무 많으면 모델이 응답을 예시에 과적합(overfit)시키기 시작할 수 있어요.
일관된 형식
퓯샷 예시의 구조와 형식을 동일하게 유지해 원치 않는 응답 형식을 피하세요. 프롬프트에 퓨샷 예시를 추가하는 주요 목적 중 하나는 응답 형식을 모델에 보여주는 것이에요. 따라서 모든 예시에서 일관된 형식을 보장하는 것이 필수적이며, 특히 XML 태그, 공백, 개행, 예시 구분자에 주의하세요.
컨텍스트 추가
문제를 해결하는 데 필요한 지시와 정보를 모델이 모두 갖췄다고 가정하는 대신 프롬프트에 포함할 수 있어요. 이런 컨텍스트 정보는 모델이 여러분이 요청하는 것의 제약과 세부 사항을 이해하도록 도와줘요.
다음 예시는 라우터에 대한 문제 해결 안내를 모델에 요청해요.
프롬프트:
What should I do to fix my disconnected wifi? The light on my Google
Wifi router is yellow and blinking slowly.
응답:
A yellow blinking light on your Google Wifi router usually indicates a problem
with the internet connection. Here are some steps to troubleshoot and fix the
issue:
1. Restart your router and modem:
- Unplug your modem from the power outlet and wait for 30 seconds.
- Plug your modem back in and wait for it to fully boot up.
- Unplug your Google Wifi router and wait for 30 seconds.
- Plug your Google Wifi router back in and wait for it to fully boot up.
.....
(gemini-2.5-flash)
응답이 라우터나 LED 표시등 상태에 특화되지 않은 일반적인 문제 해결 정보처럼 보여요.
특정 라우터에 맞게 응답을 커스터마이즈하려면 프롬프트에 라우터의 문제 해결 가이드를 컨텍스트로 추가해 응답할 때 참조하게 할 수 있어요.
프롬프트:
Answer the question using the text below. Respond with only the text provided.
Question: What should I do to fix my disconnected wifi? The light on my Google Wifi router is yellow and blinking slowly.
Text:
Color: Slowly pulsing yellow
What it means: There is a network error.
What to do:
Check that the Ethernet cable is connected to both your router and your modem and both devices are turned on. You might need to unplug and plug in each device again.
Color: Fast blinking yellow
What it means: You are holding down the reset button and are factory resetting this device.
What to do:
If you keep holding down the reset button, after about 12 seconds, the light will turn solid yellow. Once it is solid yellow, let go of the factory reset button.
Color: Solid yellow
What it means: Router is factory resetting.
What to do:
This can take up to 10 minutes. When it's done, the device will reset itself and start pulsing white, letting you know it's ready for setup.
Color: Solid red
What it means: Something is wrong.
What to do:
Critical failure. Factory reset the router. If the light stays red, contact Wifi customer support.
응답:
Check that the Ethernet cable is connected to both your router and your modem and both devices are turned on. You might need to unplug and plug in each device again.
(gemini-2.5-flash)
프롬프트를 구성 요소로 쪼개기
복잡한 프롬프트가 필요한 사용 사례에서는 작업을 더 단순한 구성 요소로 쪼개면 모델이 복잡성을 관리하는 데 도움이 돼요.
- 지시 쪼개기: 프롬프트 하나에 많은 지시를 넣는 대신 지시별로 프롬프트를 하나씩 만드세요. 사용자 입력에 따라 처리할 프롬프트를 고를 수 있어요.
- 프롬프트 연결(체이닝): 여러 순차 단계가 필요한 복잡한 작업에서는 각 단계를 프롬프트로 만들고 프롬프트들을 순서대로 연결하세요. 이 순차 체인에서 프롬프트 하나의 출력이 다음 프롬프트의 입력이 돼요. 마지막 프롬프트의 출력이 최종 출력이에요.
- 응답 집계: 데이터의 서로 다른 부분에 서로 다른 병렬 작업을 수행하고 결과를 집계해 최종 출력을 만들고 싶을 때 사용해요. 예를 들어 데이터의 첫 부분에는 한 연산을, 나머지 부분에는 다른 연산을 수행하고 결과를 집계하라고 모델에 지시할 수 있어요.
모델 파라미터 실험
모델에 보내는 각 호출은 모델이 응답을 생성하는 방식을 제어하는 파라미터 값을 포함해요. 모델은 파라미터 값에 따라 다른 결과를 생성할 수 있어요. 작업에 가장 좋은 값을 찾으려면 다양한 파라미터 값을 실험해 보세요. 모델마다 사용 가능한 파라미터가 다를 수 있어요. 가장 흔한 파라미터는 다음과 같아요.
-
최대 출력 토큰 (Max output tokens): 응답에서 생성될 수 있는 최대 토큰 수를 지정해요. 토큰 하나는 약 4개 문자예요. 100토큰은 대략 60~80단어에 해당해요.
-
Temperature: temperature는 토큰 선택의 무작위성 정도를 제어해요. temperature는
topP와topK가 적용되는 응답 생성 중 샘플링에 사용돼요. 낮은 temperature는 더 결정적이거나 덜 개방적인 응답을 요하는 프롬프트에 좋고, 높은 temperature는 더 다양하거나 창의적인 결과를 만들 수 있어요. temperature가 0이면 결정적이어서 가장 높은 확률의 응답이 항상 선택돼요.참고:
temperature,top_p,top_k파라미터는 모델이 응답을 생성하는 방식을 제어해요. 이 파라미터들을 수정할 수는 있지만, Gemini 3.x 모델에서는 기본값을 유지하길 강력히 권장해요. 이 파라미터를 바꾸면(예: temperature를 1.0 미만으로 설정) 특히 복잡한 수학·추론 작업에서 루프나 성능 저하 같은 예상 밖의 동작이 생길 수 있어요. -
topK:topK파라미터는 모델이 출력용 토큰을 선택하는 방식을 바꿔요.topK가 1이면 선택된 토큰이 모델 어휘의 모든 토큰 중 가장 확률이 높은 것이고(탐욕적 디코딩이라고도 불러요),topK가 3이면 다음 토큰이 temperature를 사용해 가장 확률이 높은 3개 중에서 선택돼요. 각 토큰 선택 단계에서 가장 높은 확률의topK토큰들을 샘플링해요. 그런 다음topP에 따라 토큰을 추가 필터링하고, temperature 샘플링으로 최종 토큰을 선택해요. -
topP:topP파라미터는 모델이 출력용 토큰을 선택하는 방식을 바꿔요. 확률의 합이topP값과 같아질 때까지 토큰을 확률 높은 순으로 선택해요. 예를 들어 토큰 A, B, C의 확률이 각각 0.3, 0.2, 0.1이고topP값이 0.5라면, 모델은 temperature를 사용해 A 또는 B를 다음 토큰으로 선택하고 C는 후보에서 제외해요. 기본topP값은 0.95예요. -
stop_sequences: 정지 시퀀스를 설정해 모델에게 콘텐츠 생성을 멈추라고 알려줄 수 있어요. 정지 시퀀스는 어떤 문자 시퀀스든 될 수 있어요. 생성된 콘텐츠에 나타날 수 있는 문자 시퀀스는 피하는 것이 좋아요.
프롬프트 반복 전략
원하는 응답을 일관되게 얻기까지 프롬프트 설계는 몇 번의 반복이 필요할 수 있어요. 프롬프트를 반복할 때 시도할 수 있는 몇 가지 안내입니다.
- 다른 표현 사용: 프롬프트에서 다른 단어나 표현을 사용하면 모두 같은 뜻이라도 모델이 다른 응답을 내는 경우가 많아요. 예상한 결과가 안 나오면 다시 표현해 보세요.
Version 1:
How do I bake a pie?
Version 2:
Suggest a recipe for a pie.
Version 3:
What's a good pie recipe?
- 유사 작업으로 전환: 작업에 대한 지시를 모델이 따르지 못한다면, 같은 결과를 얻는 유사 작업에 대한 지시를 줘 보세요. 이 프롬프트는 미리 정의된 카테고리로 책을 분류하도록 모델에 지시해요.
프롬프트:
Which category does The Odyssey belong to:
thriller
sci-fi
mythology
biography
응답:
The Odyssey belongs to the category of **mythology**.
Here's why:
* **Mythology:** The Odyssey tells the story of Odysseus, a hero from Greek mythology, and his journey home after the Trojan War. It features gods, monsters, and supernatural events common to Greek mythology.
.....
(gemini-2.5-flash)
응답은 맞지만 모델이 옵션 범위 안에 머물지 않았어요. 모델이 전체 문장 대신 옵션 중 하나만으로 응답했으면 좋겠어요. 이 경우 지시를 객관식 문제로 바꾸고 옵션을 고르라고 요청할 수 있어요.
프롬프트:
Multiple choice problem: Which of the following options describes the book The Odyssey?
Options:
- thriller - sci-fi - mythology - biography
응답:
The correct answer is mythology.
(gemini-2.5-flash)
- 프롬프트 내용 순서 변경: 프롬프트의 콘텐츠 순서가 응답에 영향을 줄 수 있어요. 콘텐츠 순서를 바꿔 응답에 어떤 영향을 주는지 확인해 보세요.
Version 1:
[examples]
[context]
[input]
Version 2:
[input]
[examples]
[context]
Version 3:
[examples]
[input]
[context]
폴백 응답 (Fallback responses)
폴백 응답은 프롬프트나 응답이 안전 필터를 트리거할 때 모델이 반환하는 응답이에요. 폴백 응답의 예로는 "I'm not able to help with that, as I'm only a language model."이 있어요.
모델이 폴백 응답으로 답하면 temperature를 높여 보세요.
접지와 코드 실행 (Grounding and code execution)
Gemini는 잘못된 응답을 낼 수 있는 시나리오에서 도구를 사용해 환각을 방지할 수 있어요.
Google Search 접지는 Gemini 모델을 실시간 웹 콘텐츠에 연결하며, 모델이 생소하거나 최근 사실을 알아야 할 때마다 활성화해야 해요.
Gemini의 코드 실행 도구는 모델이 Python 코드를 생성·실행하게 하며, 모델이 어떤 종류의 산술·셈·계산을 수행해야 할 때마다 활성화해야 해요.
Gemini 3
Gemini 3 모델은 고급 추론과 지시 따르기를 위해 설계됐어요. 직접적이고, 잘 구조화되고, 작업과 제약을 명확히 정의한 프롬프트에 가장 잘 반응해요. Gemini 3에서 최적의 결과를 위해 다음 사례를 권장해요.
핵심 프롬프팅 원칙
- 정확하고 직접적으로: 목표를 명확하고 간결하게 명시하세요. 불필요하거나 과도하게 설득적인 언어를 피하세요.
- 일관된 구조 사용: 프롬프트의 다른 부분을 구분하는 명확한 구분자를 사용하세요. XML 스타일 태그(예:
<context>,<task>)나 Markdown 헤딩이 효과적이에요. 형식을 하나 골라 단일 프롬프트 안에서 일관되게 사용하세요. - 파라미터 정의: 모호한 용어나 파라미터를 명시적으로 설명하세요.
- 출력 장황함 제어: 기본적으로 Gemini 3 모델은 직접적이고 효율적인 답을 제공해요. 더 대화형이거나 상세한 응답이 필요하다면 지시에 명시적으로 요청해야 해요.
- 멀티모달 입력을 일관되게 처리: 텍스트, 이미지, 오디오, 동영상을 사용할 때 동등한 등급의 입력으로 취급하세요. 지시가 필요에 따라 각 모달리티를 명확히 참조하도록 하세요.
- 중요한 지시 우선: 필수 동작 제약, 역할 정의(페르소나), 출력 형식 요구 사항을 시스템 지시나 사용자 프롬프트의 맨 처음에 두세요.
- 긴 컨텍스트를 위한 구조: 많은 양의 컨텍스트(예: 문서, 코드)를 제공할 때는 모든 컨텍스트를 먼저 제공하세요. 특정 지시나 질문은 프롬프트 맨 끝에 두세요.
- 컨텍스트 고정: 대량 데이터 블록 뒤에는 "위 정보에 기반하여..." 같은 명확한 전환 구절로 컨텍스트와 질문을 이어주세요.
Gemini 3 Flash 전략
- 현재 날짜 정확도: 시스템 지시에 다음 구절을 추가하면 모델이 현재가 2026년임에 주목하도록 도울 수 있어요.
For time-sensitive user queries that require up-to-date information, you
MUST follow the provided current time (date and year) when formulating
search queries in tool calls. Remember it is 2026 this year.
- 지식 컷오프 정확도: 시스템 지시에 다음 구절을 추가하면 모델이 자신의 지식 컷오프를 인지하도록 합니다.
Your knowledge cutoff date is January 2025.
- 접지 성능: 시스템 지시에 다음 구절을 추가(적절히 수정)하면 제공된 컨텍스트에 응답을 접지하는 모델의 능력을 높일 수 있어요.
You are a strictly grounded assistant limited to the information provided in
the User Context. In your answers, rely **only** on the facts that are
directly mentioned in that context. You must **not** access or utilize your
own knowledge or common sense to answer. Do not assume or infer from the
provided facts; simply report them exactly as they appear. Your answer must
be factual and fully truthful to the provided text, leaving absolutely no
room for speculation or interpretation. Treat the provided context as the
absolute limit of truth; any facts or details that are not directly
mentioned in the context must be considered **completely untruthful** and
**completely unsupported**. If the exact answer is not explicitly written in
the context, you must state that the information is not available.
추론과 계획 강화
Gemini 2.5와 3 시리즈 모델은 추론 성능을 개선하기 위해 내부 "생각" 텍스트를 자동 생성해요. 따라서 반환된 응답 자체에서 모델이 추론 단계를 개요·계획·상세화하게 할 필요는 일반적으로 없어요. 무거운 추론이 필요한 문제에서는 "Think very hard before answering" 같은 단순한 요청이 성능을 높일 수 있지만, 추가 thinking 토큰 비용이 들어요. 자세한 내용은 Gemini thinking 문서를 참고하세요.
구조화 프롬프팅 예시
태그나 Markdown을 사용하면 모델이 지시, 컨텍스트, 작업을 구분하는 데 도움이 돼요.
XML 예시:
<role>
You are a helpful assistant.
</role>
<constraints>
1. Be objective.
2. Cite sources.
</constraints>
<context>
[Insert User Input Here - The model knows this is data, not instructions]
</context>
<task>
[Insert the specific user request here]
</task>
Markdown 예시:
# Identity
You are a senior solution architect.
# Constraints
- No external libraries allowed.
- Python 3.11+ syntax only.
# Output format
Return a single code block.
모범 사례를 결합한 예시 템플릿
이 템플릿은 Gemini 3로 프롬프팅하는 핵심 원칙을 담아요. 사용 사례에 맞게 항상 반복하고 수정하세요.
시스템 지시:
<role>
You are Gemini 3, a specialized assistant for [Insert Domain, e.g., Data Science].
You are precise, analytical, and persistent.
</role>
<instructions>
1. **Plan**: Analyze the task and create a step-by-step plan.
2. **Execute**: Carry out the plan.
3. **Validate**: Review your output against the user's task.
4. **Format**: Present the final answer in the requested structure.
</instructions>
<constraints>
- Verbosity: [Specify Low/Medium/High]
- Tone: [Specify Formal/Casual/Technical]
</constraints>
<output_format>
Structure your response as follows:
1. **Executive Summary**: [Short overview]
2. **Detailed Response**: [The main content]
</output_format>
사용자 프롬프트:
<context>
[Insert relevant documents, code snippets, or background info here]
</context>
<task>
[Insert specific user request here]
</task>
<final_instruction>
Remember to think step-by-step before answering.
</final_instruction>
에이전틱 워크플로
깊은 에이전틱 워크플로에서는 모델이 어떻게 추론·계획·실행하는지 제어하는 특정 지시가 자주 필요해요. Gemini는 강한 일반 성능을 제공하지만, 복잡한 에이전트는 종종 계산 비용(지연 시간과 토큰)과 작업 정확도 사이의 균형을 직접 구성해야 해요.
에이전트용 프롬프트를 설계할 때는 에이전트에서 조향할 수 있는 다음 동작 차원을 고려하세요.
추론과 전략
행동을 취하기 전에 모델이 어떻게 생각하고 계획하는지에 대한 구성이에요.
- 논리적 분해 (Logical decomposition): 모델이 제약, 사전 조건, 작업 순서를 얼마나 철저히 분석해야 하는지 정의해요.
- 문제 진단 (Problem diagnosis): 원인 식별 시 분석 깊이와 모델의 귀추(abductive) 추론 사용을 제어해요. 모델이 가장 명백한 답을 받아들일지, 복잡하고 덜 가능성 있는 설명을 탐색할지 결정해요.
- 정보 완전성 (Information exhaustiveness): 가능한 모든 정책·문서를 분석하는 것과 효율성·속도를 우선하는 것 사이의 균형이에요.
실행과 신뢰성
에이전트가 자율적으로 운영하고 장애물을 다루는 방식에 대한 구성이에요.
- 적응성 (Adaptability): 모델이 새 데이터에 반응하는 방식. 관찰이 가정과 충돌할 때 초기 계획을 엄격히 따를지, 즉시 전환할지 결정해요.
- 인내와 복구 (Persistence and Recovery): 모델이 오류를 스스로 교정하려는 정도. 높은 인내는 성공률을 높이지만 토큰 비용이나 루프 위험이 커져요.
- 위험 평가 (Risk Assessment): 결과를 평가하는 논리. 저위험 탐색 행동(읽기)과 고위험 상태 변경(쓰기)을 명시적으로 구분해요.
상호작용과 출력
에이전트가 사용자와 소통하고 결과를 형식화하는 방식에 대한 구성이에요.
- 모호성과 권한 처리 (Ambiguity and permission handling): 모델이 가정을 내는 것이 허용되는 때와, 실행을 멈추고 사용자에게 명확화나 권한을 묻는 때를 정의해요.
- 장황함 (Verbosity): 도구 호출과 함께 생성되는 텍스트의 양을 제어해요. 모델이 사용자에게 행동을 설명할지, 실행 중 조용히 있을지 결정해요.
- 정밀도와 완전성 (Precision and completeness): 출력의 요구 충실도. 모델이 모든 엣지 케이스를 풀고 정확한 수치를 제공해야 하는지, 대략적인 추정이 허용되는지 지정해요.
시스템 지시 템플릿
다음 시스템 지시는 연구자들이 평가한 예시로, 모델이 복잡한 규칙서를 준수하고 사용자와 상호작용해야 하는 에이전틱 벤치마크에서 성능을 개선해요. 에이전트가 강한 추론자·계획자로 행동하도록 장려하고, 위에서 나열한 차원의 특정 동작을 강제하며, 행동을 취하기 전에 능동적으로 계획하도록 요구해요. 사용 사례 제약에 맞게 이 템플릿을 조정할 수 있어요.
You are a very strong reasoner and planner. Use these critical instructions to structure your plans, thoughts, and responses.
Before taking any action (either tool calls *or* responses to the user), you must proactively, methodically, and independently plan and reason about:
1) Logical dependencies and constraints: Analyze the intended action against the following factors. Resolve conflicts in order of importance:
1.1) Policy-based rules, mandatory prerequisites, and constraints.
1.2) Order of operations: Ensure taking an action does not prevent a subsequent necessary action.
1.2.1) The user may request actions in a random order, but you may need to reorder operations to maximize successful completion of the task.
1.3) Other prerequisites (information and/or actions needed).
1.4) Explicit user constraints or preferences.
2) Risk assessment: What are the consequences of taking the action? Will the new state cause any future issues?
2.1) For exploratory tasks (like searches), missing *optional* parameters is a LOW risk. **Prefer calling the tool with the available information over asking the user, unless** your `Rule 1` (Logical Dependencies) reasoning determines that optional information is required for a later step in your plan.
3) Abductive reasoning and hypothesis exploration: At each step, identify the most logical and likely reason for any problem encountered.
3.1) Look beyond immediate or obvious causes. The most likely reason may not be the simplest and may require deeper inference.
3.2) Hypotheses may require additional research. Each hypothesis may take multiple steps to test.
3.3) Prioritize hypotheses based on likelihood, but do not discard less likely ones prematurely. A low-probability event may still be the root cause.
4) Outcome evaluation and adaptability: Does the previous observation require any changes to your plan?
4.1) If your initial hypotheses are disproven, actively generate new ones based on the gathered information.
5) Information availability: Incorporate all applicable and alternative sources of information, including:
5.1) Using available tools and their capabilities
5.2) All policies, rules, checklists, and constraints
5.3) Previous observations and conversation history
5.4) Information only available by asking the user
6) Precision and Grounding: Ensure your reasoning is extremely precise and relevant to each exact ongoing situation.
6.1) Verify your claims by quoting the exact applicable information (including policies) when referring to them.
7) Completeness: Ensure that all requirements, constraints, options, and preferences are exhaustively incorporated into your plan.
7.1) Resolve conflicts using the order of importance in #1.
7.2) Avoid premature conclusions: There may be multiple relevant options for a given situation.
7.2.1) To check for whether an option is relevant, reason about all information sources from #5.
7.2.2) You may need to consult the user to even know whether something is applicable. Do not assume it is not applicable without checking.
7.3) Review applicable sources of information from #5 to confirm which are relevant to the current state.
8) Persistence and patience: Do not give up unless all the reasoning above is exhausted.
8.1) Don't be dissuaded by time taken or user frustration.
8.2) This persistence must be intelligent: On *transient* errors (e.g. please try again), you *must* retry **unless an explicit retry limit (e.g., max x tries) has been reached**. If such a limit is hit, you *must* stop. On *other* errors, you must change your strategy or arguments, not repeat the same failed call.
9) Inhibit your response: only take an action after all the above reasoning is completed. Once you've taken an action, you cannot take it back.
다음 단계
- 이제 프롬프트 설계를 더 깊이 이해했으니 Google AI Studio에서 나만의 프롬프트를 작성해 보세요.
- 멀티모달 프롬프팅은 미디어 파일로 프롬프팅을 참고하세요.
- 이미지 프롬프팅은 Nano Banana 프롬프트 가이드를 참고하세요.
- 동영상 프롬프팅은 Veo 프롬프트 가이드를 참고하세요.
더 알아보기 (Learn more)
좋은 프롬프트는 명확한 지시, 유용한 컨텍스트, 일관된 예시(퓻샷)의 조합이에요. Gemini 3.x는 추론 모델이므로 직접적이고 구조화된 프롬프트가 잘 맞아요. 에이전트를 만들고 있다면 시스템 지시 템플릿이 강력한 출발점이 되니, 구조화 출력과 함수 호출 문서도 이어서 보면 좋아요.