Skip to content
Published on

AI Prompt Engineering Complete Guide — Information Retrieval, Image/Video Generation, and Debugging (KR/EN/JA)

Authors
  • Name
    Twitter
AI Prompt Engineering Guide

1. Why Do Prompts Matter?

Even with the same AI model, the quality of results varies dramatically depending on how you ask.

"Prompt engineering is the art of communicating with AI." — IBM, The 2026 Guide to Prompt Engineering

The core principles boil down to just three:

  1. Be Specific — Eliminate ambiguity
  2. Provide Context — Give AI the basis for judgment
  3. Specify Format — State the desired output form explicitly

2. Information Retrieval Prompts

The most common mistake when seeking information is asking broadly, like "Tell me about ~."

2.1 Key Techniques

TechniqueDescriptionExample
Role AssignmentGive AI an expert role"You are a 10-year DBA"
Chain of ThoughtRequest step-by-step reasoning"Explain step by step"
Few-shotShow examples first"Example: show 3 Q→A pairs"
ConstraintsNarrow the scope"Only sources after 2025, within 3 lines"
Output FormatSpecify JSON, table, code, etc."Answer in JSON format"

2.2 Practical Expressions in Three Languages

Korean

Basic: "PostgreSQL의 인덱스 종류를 비교해줘"

Improved: "너는 10년차 PostgreSQL DBA. B-tree, Hash, GIN, GiST 인덱스의
사용 사례, 성능 차이, 실전 선택 기준을 표로 정리해줘.
프로덕션 환경(1000만 행 이상) 기준으로."

Useful expressions:

ExpressionPurpose
"~의 장단점을 비교해줘"Comparative analysis
"실전에서 자주 쓰는 패턴 위주로"Emphasis on practicality
"초보자도 이해할 수 있게 설명해줘"Difficulty adjustment
"근거와 출처를 함께 알려줘"Establishing credibility
"~와 ~의 차이를 코드 예시로 보여줘"Concrete explanation
"내가 면접에서 설명한다고 가정하고"Context setting
"한 문장으로 핵심만"Concise answer
"최신 트렌드 (2025~2026) 기준으로"Time-scoped

English

Basic: "Tell me about Kubernetes networking"

Improved: "You are a senior Kubernetes platform engineer with CKA/CKS certifications.
Explain the differences between ClusterIP, NodePort, LoadBalancer, and Ingress
with real-world use cases. Include a comparison table and one kubectl example for each.
Focus on production clusters with 50+ nodes."

Useful expressions:

ExpressionPurpose
"Compare X and Y in terms of..."Structured comparison
"Explain like I'm preparing for a job interview"Context setting
"Give me a step-by-step breakdown"Chain of thought
"What are the trade-offs between..."Critical analysis
"Show me a before/after example"Concrete demonstration
"In a production environment with..."Real-world grounding
"Summarize in 3 bullet points"Concise output
"What would a senior engineer do differently?"Expert-level insight

Japanese

Basic: "Dockerについて教えて"

Improved: "あなたは経験豊富なDevOpsエンジニアです。
DockerとPodmanの違いを、セキュリティ、パフォーマンス、
エコシステムの3つの観点から比較表でまとめてください。
本番環境での選択基準も含めてください。"

Useful expressions:

ExpressionPurpose
〜を比較してくださいComparative analysis
実務で使える例を挙げてPractical focus
初心者でも分かるようにLevel adjustment
ステップバイステップで説明してStep-by-step explanation
メリットとデメリットを教えてPros/cons comparison
具体的なコード例付きでCode-accompanied explanation
一言でまとめるとSummary
面接で聞かれたらInterview preparation

3. Image Generation Prompts

For AI image generation (Gemini, Midjourney, DALL-E, Stable Diffusion, etc.), the key is to include all five elements without exception.

3.1 Image Prompt Formula

[Subject] + [Style] + [Composition/Camera] + [Lighting] + [Mood/Color]
ElementExample Keywords
Subjecta samurai warrior, a futuristic city, a cozy cafe
Stylephotorealistic, anime, oil painting, flat design, cyberpunk
Composition/Cameraclose-up, bird's eye view, wide-angle lens, macro shot, rule of thirds
Lightinggolden hour, Rembrandt lighting, neon glow, soft diffused light, rim light
Mood/Colorwarm tones, dark moody, pastel, vibrant, high contrast

3.2 Practical Expressions in Three Languages

Korean

Bad example: "고양이 그려줘"

Good example: "창가에 앉아 있는 흰색 페르시안 고양이, 따뜻한 오후 햇살이 비치는
카페 안, 얕은 피사계 심도(shallow depth of field), 따뜻한 톤,
35mm 필름 느낌의 사진, 부드러운 자연광"

Image prompt expressions:

ExpressionEffect
"시네마틱 조명으로"Cinematic mood
"클로즈업 / 와이드 앵글"Composition
"~스타일로 그려줘"Style selection
"배경은 ~으로 해줘"Environment setup
"높은 해상도, 디테일하게"Quality boost
"어두운/밝은 분위기로"Tone control
"네온 조명 / 골든아워"Lighting effect
"텍스트 '~'를 포함해줘"Text insertion

English

Bad: "Draw a robot"

Good: "A humanoid robot sitting in a library reading a book,
surrounded by floating holographic screens, warm ambient lighting,
cinematic composition, shot with 85mm lens, shallow depth of field,
cyberpunk aesthetic with warm orange and cool blue color palette, 8K detail"

Image prompt expressions:

ExpressionEffect
"cinematic lighting, dramatic shadows"Film-quality atmosphere
"close-up portrait / bird's eye view"Camera angle
"in the style of [artist/genre]"Style reference
"shallow depth of field, bokeh"Focus control
"8K, ultra-detailed, photorealistic"Quality boost
"golden hour / blue hour / neon-lit"Lighting mood
"rule of thirds composition"Balanced framing
"negative space, minimalist"Clean design
"hyper-detailed texture, pores visible"Extreme detail

Japanese

Bad example: "猫を描いて"

Good example: "桜の木の下で昼寝している三毛猫、水彩画風、
柔らかい春の日差し、パステルカラー、温かい雰囲気"

Image prompt expressions:

ExpressionEffect
〜風に描いてStyle specification
アップ / 俯瞰でComposition
映画のような照明でCinematic
高解像度で詳細にQuality boost
暖色系 / 寒色系Tone adjustment
〜を背景にしてEnvironment setting

4. Video Generation Prompts

AI video generation (Sora, Veo, LTX-2, etc.) adds time and movement to image prompts.

4.1 Video Prompt Formula

[Camera Movement] + [Subject's Action] + [Environment/Background] + [Time/Lighting Changes] + [Mood]

4.2 Practical Expressions in Three Languages

Korean

"카메라가 천천히 줌인하면서, 네온 불빛이 가득한 도쿄 골목길을
걸어가는 사이보그 여성. 비가 내리고 있고, 물웅덩이에
네온 불빛이 반사된다. 시네마틱, 슬로우 모션, 블레이드 러너 스타일."
ExpressionEffect
"카메라가 ~하면서"Camera work
"천천히 / 빠르게 움직이는"Speed control
"~에서 ~으로 전환"Scene transition
"슬로우 모션으로"Time distortion
"시간이 흘러가면서 ~이 변한다"Time-lapse

English

"Slow dolly shot through a misty bamboo forest at dawn,
camera gradually rising to reveal a hidden temple,
volumetric light rays through the canopy, gentle fog rolling,
ethereal and peaceful, Studio Ghibli aesthetic, 4K cinematic."
ExpressionEffect
"dolly in / tracking shot / crane shot"Camera movement
"slow motion / time-lapse / speed ramp"Time manipulation
"transition from X to Y"Scene change
"camera orbits around the subject"360 degree movement
"parallax scrolling effect"Depth illusion

Japanese

"カメラがゆっくりとドリーインしながら、桜吹雪の中を
歩く着物姿の女性。夕暮れの柔らかい光、
スローモーション、映画的な雰囲気。"
ExpressionEffect
カメラが〜しながらCamera work
ゆっくり / 素早くSpeed control
〜から〜に変わるScene transition
タイムラプスでTime progression

5. Debugging Prompts

When using AI for code debugging, the key is to provide error message + code + environment info together.

5.1 Debugging Prompt Formula

[Error Message/Symptoms] + [Related Code] + [Environment Info] + [What You've Tried] + [Expected Result]

5.2 Practical Expressions in Three Languages

Korean

Bad example: "이 코드 안 돼. 고쳐줘."

Good example: "Python 3.12, FastAPI 0.115에서 아래 코드 실행 시
'RuntimeError: Event loop is closed' 에러가 발생합니다.

[code block]

환경: Ubuntu 24.04, uvicorn 0.30
시도한 것: asyncio.new_event_loop() 추가 → 동일 에러
원하는 결과: 비동기 DB 연결이 정상 종료되어야 함"

Debugging expressions:

ExpressionPurpose
"이 에러 메시지의 원인이 뭐야?"Root cause analysis
"단계별로 디버깅 과정을 알려줘"Systematic approach
"이 코드의 잠재적 버그를 찾아줘"Code review
"~했는데도 같은 에러야. 다른 원인은?"Further analysis
"성능 병목이 어디인지 분석해줘"Performance debug
"이 로그에서 문제 원인을 찾아줘"Log analysis
"메모리 릭이 의심돼. 확인해줘"Specific issue
"수정된 코드 전체를 보여줘"Complete fix request

English

Bad: "My code doesn't work, fix it"

Good: "I'm getting a 'CUDA out of memory' error when training a LoRA adapter
on RTX 3090 (24GB). Model: Llama-3.1-8B, batch_size=4, max_seq_len=2048.

[code block]

Env: PyTorch 2.4, CUDA 12.4, transformers 4.44
Tried: gradient_checkpointing=True → still OOM
Expected: Training should fit in 24GB VRAM with LoRA rank=16"
ExpressionPurpose
"What's the root cause of this error?"Root cause analysis
"Walk me through the debugging process"Systematic approach
"What are the potential issues in this code?"Code review
"I've already tried X. What else could cause this?"Narrowing down
"Profile this code for performance bottlenecks"Performance debug
"Analyze this stack trace"Stack trace analysis
"Show me the corrected code with comments"Fix with explanation
"What's the minimal reproducible example?"Isolation

Japanese

Bad example: "動かない。直して"

Good example: "Go 1.22で以下のコードを実行すると、
'goroutine leak detected' という警告が出ます。

[code block]

環境: macOS, Go 1.22, goleak v1.3
試したこと: defer cancel() 追加 → 変わらず
期待する結果: goroutineが正常に終了すること"
ExpressionPurpose
このエラーの原因は何ですかRoot cause analysis
デバッグの手順を教えてSystematic approach
このコードの問題点を指摘してCode review
〜を試しましたがダメでしたSharing attempts
パフォーマンスのボトルネックはどこですかPerformance analysis
修正後のコード全体を見せてComplete fix

6. Prompt Improvement Checklist

Use this checklist to review your prompts in any situation:

  • Did you assign a role/expertise?
  • Did you provide specific context?
  • Did you specify the output format? (table, JSON, code, list, etc.)
  • Did you state constraints? (length, scope, time period, etc.)
  • Did you include examples? (Few-shot)
  • Did you use negative instructions? ("Don't ~", "Exclude ~")
  • For images/video, do you have all 5 elements (subject, style, composition, lighting, mood)?
  • For debugging, do you have all of error + code + environment + attempts + expectations?

7. Advanced Techniques — Situational Templates

7.1 Information Retrieval Template

You are a [role].
Explain [topic] from the perspective of [criteria/viewpoint].
Organize in [output format] and follow [constraints].
Include [N] practical examples.

7.2 Image Generation Template

[Detailed subject description], [action/pose],
[detailed environment/background], [camera angle] shot,
[lighting type], [color palette/mood],
[style], [quality keywords]

7.3 Debugging Template

Environment: [OS, language version, framework version]
Error: [exact error message]
Code: [relevant code block]
Tried: [solutions already attempted]
Expected: [expected behavior when working correctly]

8. Before/After Comparisons in Practice

Information Retrieval

BeforeAfter
Tell me about RedisYou are a 10-year backend developer. Compare Cache-Aside vs Write-Through vs Write-Behind patterns for using Redis as a cache. Include data consistency, performance, and implementation complexity in a comparison table. Recommend based on an e-commerce environment.

Image Generation

BeforeAfter
Draw a space photoA lone astronaut floating above Saturn's rings, shot from below looking up, dramatic rim lighting from the planet's reflected glow, deep space darkness with scattered stars, sense of cosmic solitude, cinematic anamorphic lens flare, photorealistic, 8K ultra-detail, color palette: deep blue, gold, white

Debugging

BeforeAfter
How do I fix OOMPyTorch 2.4 + RTX 3090 (24GB): CUDA OOM during Llama-3.1-8B LoRA training. batch_size=4, seq_len=2048, LoRA r=16. gradient_checkpointing=True applied but same error. nvidia-smi shows 22GB/24GB used. List additional VRAM reduction methods by priority.

Comprehension Check Quiz

Q1. What are the three core principles of prompt engineering?
  1. Be Specific
  2. Provide Context
  3. Specify Format
Q2. What are the five essential elements of an image generation prompt?

Subject + Style + Composition/Camera + Lighting + Mood/Color

Q3. What is the formal name and effect of the "step by step" technique?

Chain of Thought (CoT). It makes the AI go through intermediate reasoning steps, increasing accuracy on complex problems.

Q4. What are the five pieces of information that must be included in a debugging prompt?
  1. Error message/symptoms
  2. Related code
  3. Environment info (OS, language version, etc.)
  4. What you've already tried
  5. Expected result (expected behavior)
Q5. What effect does "Rembrandt lighting" create in image prompts?

A classic portrait lighting technique that creates a triangle of light on one side of the subject's face. It produces dramatic, three-dimensional portrait effects.

Q6. What is few-shot prompting?

A technique where you first show the AI 1 to 5 examples of the desired input/output format before asking your actual question. It is effective for controlling output format and quality.

Q7. How do you say "Walk me through the debugging process step by step" in Korean?

"단계별로 디버깅 과정을 알려줘"

Q8. How do you say "Find the potential bugs in this code" in Japanese?

このコードの潜在的なバグを指摘してください。

Q9. What is the effect of "shallow depth of field" and "bokeh" in image prompts?

An effect where only the subject is in focus and the background is softly blurred (out-of-focus). Used to emphasize the subject in portrait or product photography.

Q10. What is the difference between "dolly in" and "zoom in" in video prompts?

Dolly in physically moves the camera closer to the subject, while zoom in changes the focal length of the lens while the camera stays in place. Dolly in creates a more natural and three-dimensional sense of movement.


References