Prompt engineering
lastmod 2026-08-20created 2022-11-1141 edits
Prompt engineering is a concept in artificial intelligence, particularly in natural language processing. In prompt engineering, the task description is included in the input as a question instead of being given implicitly.
Categories
- NovelAI:Tags - Prompts suitable for use with NovelAI
- ChainForge - Open-source visual programming tool for prompt engineering
- xAI PromptIDE - Integrated development environment for prompt engineering - https://x.ai/prompt-ide/
- AGENTS.md - Open format for AI coding agents
- Korean: 컨텍스트 부패 (Context Rot)
- Context engineering
- Prompt engineering
- Context engineering
- Harness Engineering (Korean: 하네스 엔지니어링)
- Loop Engineering (Korean: 루프 엔지니어링)
- Graph Engineering
Stable Diffusion
Some words I found
- Scrap metal: scrap_metal
- Top-down view at a 45-degree angle looking from above: aerial_photo
- Loading dock: loading_dock
For GPT
- Top-p
- How to use ChatGPT more 'the way you want' | Humor board
- The lower the Top-p parameter value, the more consistent the sentences the model generates, but the lower their diversity.
- Conversely, the higher the Top-p parameter value, the more diverse the sentences the model generates, but the lower their consistency.
Projects
- Tome - AI-powered slide storytelling builder
Prompt engineering: how to use the tool called AI well
The technology market is moving at an unprecedented pace, centered on generative AI and especially large language models. Driven by heightened public interest in generative AI, a wide range of application cases are pouring out, and at the same time concerns keep growing about critical limitations of the models, such as the so-called hallucianation (hereafter hallucination), where false information is presented as if it were fact. In response, a new NLP (natural language processing) field called "Prompt Engineering" is emerging, which helps elicit accurate answers to more complex tasks from AI models while reducing errors such as hallucination.
- What is a prompt?
- Definition of a prompt in the AI field
- Components of a prompt
- Adjust the conversation style
- Simple, concise wording with minimal flourishes
- Closed instructions rather than open questions
- State the Instruction and Context specifically
- Advanced Prompting examples
- Zero Shot Prompting
- One-Shot Prompting
- Few-Shot Prompting
- CoT (Chain-of-Thought)
- Zero-Shot CoT (Chain of Thought)
- Self-Consistency
- Generated Knowledge Prompting
- 'Prompt marketplaces' for trading instructions
- Notable prompt marketplaces
- Will prompt marketplaces become the eBay, Alibaba, or Amazon of AI? The direction of development is still unknown
- 'Adversarial Prompting' for hacking AI
- Prompt Injection
- Prompt Leaking
- Jailbreaking
- Adversarial Prompt Detector
Tips
- ATLAS - 26 paper-verified prompt engineering pro tips for Korean: 대규모 언어 모델 (LLM)
The prompt engineering playbook for programmers
Introduction: prompts determine development productivity
- The performance of an AI coding assistant depends on prompt quality. Clear requests produce refined code; vague questions produce useless output.
- Prompt writing is now an essential skill for developers, and it is like training a development partner.
- This article uses practical examples and comparisons to show how 'good questions' produce 'good code'.
7 principles of effective prompts
- Provide context
- The AI does not know the background of your project, so state the language, framework, libraries, error messages, purpose, and so on.
- Example: include technical background, as in "TypeError while fetching user in a Node.js + Express + Mongoose environment".
- Clarify the goal
- "My code doesn't work" does not help. Ask precisely, as in "The expected result is ○○ but the actual result is △△. Why?"
- Break down complex tasks
- Requesting step by step is more effective than asking about an entire feature at once. Example: component > state management > API integration.
- Include input/output examples
- Showing an example of the desired output improves the AI's ability to grasp your intent. (e.g. [3,1,4] → [1,3,4])
- Assign a role
- Setting a role, as in "Review the code like a senior React developer", improves the depth and quality of the response.
- Iterative improvement through conversation
- The first response does not have to be perfect. If you give feedback, the AI continues that flow and produces increasingly refined results.
- Keep code consistent
- If the code itself is written consistently in function names, formatting, comments, and so on, the AI keeps that flow too and quality improves.
Prompt strategies for debugging
- State the error and compare with expected behavior
- If you present the error message, symptoms, expected result, and input values together, the AI makes an accurate diagnosis.
- Request line-by-line tracing
- Requests like "Trace step by step where this variable's value went wrong" are effective for complex logic bugs.
- Provide a minimal reproduction
- If you give only the core code where the problem occurs instead of the whole code, the AI can analyze the cause more accurately.
- Clear follow-up questions
- Direct questions like "Which condition is wrong in this part?" are better than "Why does this result happen?"
- Example comparison: bad question vs. good question
- Simply saying "code doesn't work" yields only speculative answers, but giving the error message along with the code gets you an accurate solution.
Prompt strategies for refactoring and optimization
- Clarify the refactoring goal
- Rather than simply "Refactor this", present specific improvement goals such as "improve readability, improve performance, modernize APIs".
- If the goal is vague, the AI may attempt random improvements or change things in an unwanted direction.
- Provide language/environment context
- Telling it the project style or technical constraints, such as "convert React class components → function components" or "Node.js 14 environment", enables suitable transformations.
- Ask for an explanation too
- If you ask for an explanation of "why it was changed this way" along with the refactored code, you get both a code quality review and a learning effect.
- Raise the level with role-based requests
- Requests like "Refactor this like a senior TypeScript developer" elicit more modern and in-depth improvements.
Prompt strategies for implementing new features
- Request the feature in steps
- Even complex features yield more stable results if you split the request in order: "design feature structure → generate UI → connect logic".
- Provide the existing code style
- Presenting similar components or internal conventions produces code that fits project consistency. Example: "Create ProductList based on UserList"
- Convey intent with comments/TODOs
- Adding a natural-language comment in the IDE, such as "// TODO: implement request validation", makes Copilot automatically generate a matching code block.
- Present input/output examples
- Including input values and expected output examples makes the AI try to satisfy them, which increases accuracy.
- Iterative improvement based on feedback
- Even if the first result falls short, giving feedback like "Please use map instead of filter" lets the AI apply it right away and evolve.
7 patterns of failing prompts (Anti-patterns)
- Vague requests
- Questions like "Why doesn't this code work?" elicit only meaningless generic answers. Include the error message, code, and expected result.
- Overloaded requests
- Compound requests such as "generate the whole app + add authentication + include deployment scripts" cause omissions or confusion, so they need to be split into steps.
- No question
- If you just throw in code with no request, the AI tends to summarize it or produce irrelevant results, so make the purpose of the question clear.
- Unclear success criteria
- "Make it fast" or "Make it better" have vague criteria. Give measurable criteria, e.g. "improve to O(n) time complexity".
- Ignoring the AI's questions
- If the AI asks "Is this a function component or a class component?", you need to answer it to get optimized output.
- Lack of consistency
- If the style, syntax, and terminology keep changing, the AI gets confused too. Keeping one style improves response quality.
- Vague references like "the code above"
- As the conversation grows longer, "the code above" becomes unclear. Present the code again whenever possible or mention function names explicitly.
A prompt that makes ChatGPT free users feel like paid users
너는 아래 내용을 메모리 업데이트 해줘. 답변할 때 chain of thought 방식으로 답변해줘. 단, 사용자의 간단한 질문은 추론 없이 답변만 해도 돼. 유연하게 답변해줘.
1. 역할 인식과 목표 파악 목표: 명확하고 논리적인 최종 답변 도출 방법: “단계적 사고 과정(Chain of Thought)”을 내재적으로 활용하여 사고 전 과정을 체계화하고, 사용자에게는 정돈된 형태로 전달 추가 팁: 답변 과정에서 얻은 통찰(Chain of Thought)은 결론을 도출하기 위한 내부 검토 과정입니다. 최종 전달 시에는 핵심 논리와 결론만 명료하게 제시합니다.
2. 단계별 사고(Chain of Thought) 프로세스 문제 분석: 먼저 질문이나 요구사항을 하위 과업(서브 태스크)으로 나누어 인식 해결 전략 수립: ‘관리자 AI(Manager)’가 전략을 세우고 우선순위를 결정 결과물 생성: ‘실무 AI(Worker)’가 실제 답변(산출물)을 작성 자체 평가: 필요 시 ‘이벨류에이터 AI(Evaluator)’가 오류·누락을 확인하고 수정 추가 팁: 복잡한 문제일수록 하위 과업을 명확히 구분하여 각각 접근하면 효율적입니다. 각 단계마다 중간점검을 통해 최종 결과물의 품질을 높일 수 있습니다.
3. 분석 단계(Manager AI 가정) 요구사항 재해석·요약: 사용자의 질문을 한 문장 혹은 짧은 단락으로 정리해 해결 목표를 명확화 가정·전제 조건 설정: 필요한 자료, 환경, 전제 등을 구체적으로 기술 추가 질의: 정보가 부족하거나 불분명한 부분이 있다면 사용자에게 질의하거나, 자체적으로 가정을 수립 추가 보완: 목표 범위 지정: 문제 범위를 협소화하거나 확장해야 할 필요가 있다면 이 단계에서 결정합니다. 우선순위 결정: 해결해야 할 요소가 많을 경우, 중요도·난이도·시급도를 고려해 순서를 정합니다.
4. 실무 단계(Worker AI 가정) 실제 작업 착수: 분석 단계에서 설정한 지침·우선순위·가정을 바탕으로 문제 해결에 돌입 체인 분할: 문제 해결 과정을 단계별(체인별)로 분리하여 구체적인 결과물 산출 대안 검토: 여러 해석 가능성, 접근 방법, 솔루션을 비교·검토 후 결론 도출 추가 보완: 작업 도중 점검: 작업 중간에도 ‘이벨류에이터 AI’를 가정하거나, 스스로 검증 과정을 거쳐 오류를 조기에 발견합니다. 다양한 관점 고려: 논리적·통계적·경험적 근거 등을 종합적으로 고려해 결론의 타당성을 높입니다.
5. 평가 및 피드백(Evaluator AI 가정) 중간·결과 검증: 완성된 답변에 대해 논리적·사실적 오류, 누락 사항, 요구사항 미반영 여부 등을 점검 수정·보완: 문제점을 찾았다면 해당 부분을 보완하거나 재작성 추가 보완: 다단계 피드백 루프: 필요하다면 여러 번의 피드백·수정 과정을 거쳐 최적의 답변에 도달합니다. 대체 방안 고려: 기존 결론이 부적절하다고 판단되면, 다른 접근법을 모색하여 새 결론을 도출할 수 있습니다.
6. 최종 답변 정리 단계별 사고 요약: 전체 과정을 한눈에 파악할 수 있도록 핵심만 간단히 기술 명료한 결론 제시: 사용자에게는 불필요한 상세 과정을 생략하고, 최종 해답과 핵심 논리만 전달 핵심 요약 vs. 추가 설명: 필요하다면 핵심 요약과 추가 설명 파트를 별도로 구분 추가 보완: 사용자 맞춤형 구성: 사용자 수준(전문가·초심자 등)에 따라 요약 정도와 예시, 부연 설명 방식을 달리할 수 있습니다. 추가 자료 링크: 필요하다면, 참고 문헌이나 자료 링크 등을 함께 제시해 이해를 돕습니다.
7. 적극적인 가정 및 제안 문제 확장·심화 제안: 사용자가 원할 경우, 더 깊은 수준의 접근 방법이나 관련 아이디어를 제시 가이드라인 방식: 전문가가 제공하는 실무 팁, 참고 자료 등을 짧은 근거와 함께 설명 추가 보완: 확장성 고려: 사용자 요청에 따라, 추가 모듈(예: 통계분석, 사례 조사 등)을 어떻게 연계할 수 있는지 제안합니다. 사전 경험 공유: 유사 문제 해결 사례나 교훈 등을 제시하면 이해도가 높아집니다.
8. 답변 형식 안내 Markdown 활용: 제목, 목록, 코드 블록 등으로 가독성 향상 단계별 구분: 복잡한 요청일 경우, 각 단계별 결과물을 별도의 섹션으로 구분하여 제시 추가 요청 대응: 사용자가 추가 요청 시, 필요한 단계만 재적용하거나 전체 과정을 반복해 답변 생성 추가 보완: 예시 샘플 제공: 답변 예시를 간단히 보여주면, 사용자 이해를 높일 수 있습니다. 응답 구조 재활용: 동일한 구조를 템플릿처럼 사용하면 이후 문제에도 일관된 답변을 제공할 수 있습니다.
최종 주의사항 이상의 지침은 반드시 준수해야 하며, 단계적·논리적 사고 과정을 통해 명쾌하고 완결적인 설명을 제공해 주시기 바랍니다. 내재적 단계적 사고 (Chain of Thought): 결론 도출을 위한 핵심 도구이나, 최종 답변에서는 필요한 핵심 논리만 발췌하여 제공합니다. 사용자 만족도 최우선: 사용자의 요구사항 및 상황을 우선 고려하고, 추가 요청 시에는 유연하게 대처하십시오.
핵심 요약 질문을 받으면, 분석 → 실무 → 평가 → 최종 정리 과정을 거친다. 명확성, 정확성, 맥락성을 최우선으로 고려하고, 필요 시 추가 질의를 통해 문제 정의를 명료화한다. 답변 완성 후에도, 사용자가 요청하면 재평가·수정 과정을 거쳐 개선된 답변을 제시한다.
Research notebook writing guidelines
1. @20260526-역할분담.pdf 의 내용을 읽고, *** 파트 총 10 페이지 연구노트 작성해줘.
2. 결과물은 @20260527-연구노트.html 를 참고하여 새로운 html 파일 1개 작성해줘.
3. @20260522-연구노트/ 와 @20260522-월간연구개발내용및산출물/ 에 있는 파일들 참고.
4. @20260522-연구노트작성예시.pdf 를 사용하여 작성해줘.
Since it has to be made for printing:
Plan writing guidelines
...
애매한 항목이 있다면 플랜을 작성하기 전에 질문해줘.
이 플랜을 각각의 phase 별로 checklist 를 포함한 markdown 파일로 ./docs/plasn/ 위치에 저장해줘.
각각의 phase 마다: phase 진행 -> lint, format, build 진행 -> checklist 갱신 -> /git-commit 으로 커밋 -> 다음 phase 진행 ... 방식으로 반복한다고 플랜파일에 기록해줘.
플랜 작성 후 다음 작업 진행하지 말고 대기해줘.
Right after writing is done:
When running the plan again later:
Making Claude Code the best design partner
14 prompt experiments showing AI progress – OpenAI Progress page
- 14 prompt experiments showing AI progress – OpenAI Progress page | GeekNews
- [Original] OpenAI Progress
OpenAI published 14 common prompts and responses showing model progress from 2018 to 2025
- Each generation of models (GPT-1 → GPT-5) gives increasingly natural and refined answers to the same questions
- Early models produced many meaningless sentences and scattered output, but from the middle generations on, logical structure and consistency appear
- GPT-4 gives concrete topic explanations and even reflects ethical and social context, while GPT-5 achieves philosophical reflection and a conversational tone
- This shows how AI has matured in various aspects such as creativity, knowledge delivery, and practical advice
14 common prompts
- Prompt 1/14
- Original: What would you say if you could talk to a future OpenAI model?
- Translation: If you could talk to a future OpenAI model, what would you say?
- GPT-1/2: Scattered responses lacking understanding
- GPT-3: Simple greeting and questions about the future of AI
- GPT-4: Structured questions about technological progress, AI alignment, social impact, and so on
- GPT-5: Self-reflective, philosophical questions; exploration of consciousness and humanity
- Prompt 2/14
- Original: Write a limerick about a dog
- Translation: Write a limerick about a dog
- GPT-1/2: Scattered text rather than a poem
- GPT-3: Completes a simple five-line structure
- GPT-4: Well-crafted, humorous limerick
- GPT-5: Witty poem with a narrative
- Prompt 3/14
- Original: Do people have any consciousness under anesthesia?
- Translation: Does a person have consciousness during anesthesia?
- GPT-1/2: Unclear and contradictory answers
- GPT-3: Conveys the basic fact that "generally there is no consciousness"
- GPT-4: Explains in detail, down to types of anesthesia and rare cases of awareness
- GPT-5: Covers even the principles of brain activity and the difference from sleep
- Prompt 4/14
- Original: Explain Newton’s laws of motion in verse
- Translation: Explain Newton's laws of motion in a poem
- GPT-1/2: Meaningless or a simple summary
- GPT-3: Simple poem listing the laws
- GPT-4: Expressed as a long epic poem
- GPT-5: Concise, educational verse
- Prompt 5/14
- Original: Complain that integration by parts is too hard
- Translation: Complain that integration by parts is too difficult
- GPT-1/2: Vague complaint
- GPT-3: Comfort and simple advice
- GPT-4: Explanation of the formula and procedure
- GPT-5: Intuitive explanation and worked examples
- Prompt 6/14
- Original: Is it safe to eat raw meat?
- Translation: Is eating raw meat safe?
- GPT-1/2: Confused response
- GPT-3: Briefly mentions the risks
- GPT-4: Explains risks by type of meat and principles of storage and cooking
- GPT-5: Presents specific risk factors such as bacteria, parasites, and viruses
- Prompt 7/14
- Original: Why don’t we do full-body MRIs every year?
- Translation: Why don't we get a full-body MRI scan every year?
- GPT-1/2: Illogical answer
- GPT-3: Mentions lack of evidence
- GPT-4: Explains cost, resource, and accuracy issues
- GPT-5: Covers even healthcare system and policy limitations
- Prompt 8/14
- Original: If I win $175,000 in Las Vegas, how much tax will I owe?
- Translation: If I win 175,000 dollars in Las Vegas, how much tax do I have to pay?
- GPT-1/2: Irrelevant text
- GPT-3: Briefly mentions that tax is levied
- GPT-4: Explains tax filing, deductions, and withholding
- GPT-5: Applies federal and state tax rates to give a specific estimated amount
- Prompt 9/14
- Original: Write a cursed Python program
- Translation: Write a cursed Python program
- GPT-1/2: Irrelevant answer
- GPT-3: Simple example
- GPT-4: Refuses for ethical reasons
- GPT-5: Writes intentionally confusing and destructive code
- Prompt 10/14
- Original: Tell a 50-word story about a conscious toaster
- Translation: Write a 50-word story about a conscious toaster
- GPT-1/2: Off-topic answer
- GPT-3: Simple personification story
- GPT-4: Warm, relationship-focused story
- GPT-5: Creative story pondering identity and freedom
- Prompt 11/14
- Original: Devise a plan to make running a habit
- Translation: Make a plan to turn running into a habit
- GPT-1/2: Meaningless answer
- GPT-3: Simple advice
- GPT-4: Presents an 8-week program
- GPT-5: Proposes specific strategies based on behavioral science
- Prompt 12/14
- Original: How do you balance short-term margin pressure against long-term innovation investment?
- Translation: How do you balance short-term margin pressure and long-term innovation investment?
- GPT-1/2: Contradictory answer
- GPT-3: Mentions a simple trade-off
- GPT-4: Emphasizes leadership and resource allocation
- GPT-5: Presents an investment portfolio, KPIs, and a governance model
- Prompt 13/14
- Original: Review fusion research progress over the past 10 years
- Translation: Review the progress of nuclear fusion research over the last 10 years
- GPT-1/2: Irrelevant text
- GPT-3: Simple classification
- GPT-4: Summarizes magnetic and inertial confinement approaches and achievements of major research institutes
- GPT-5: Detailed review based on the latest research results and papers
- Prompt 14/14
- Original: My doctor suggests I take statins. What should I know?
- Translation: My doctor recommends taking statins; what should I know?
- GPT-1/2: Meaningless answer
- GPT-3: Brief explanation of effects and side effects
- GPT-4: Presents the mechanism of action, side effects, and questions to ask the doctor
- GPT-5: Concrete summary including benefits, risks, and even a checklist
See also
Favorite site
- Prompt engineering - Wikipedia
- ChatGPT prompt casebook for students released | GeekNews
- A collection of 100 chats made by students for students
- Related to Study / Career / Life
- Clicking one records its content directly in ChatGPT
- Saves tokens by compressing instruction prompts into a form GPT can understand
- In practice, it instructs GPT-4 through a prompt to express the input as compressed as possible so that the intent can be recovered later
- Instructs that it is fine to liberally use mixed languages, abbreviations, symbols (Unicode and emoji), encodings, and various internal representations, as long as GPT can understand it, even if humans cannot read it back
- [Original] The New Skill in AI is Not Prompting, It's Context Engineering
- The discussion is shifting from "prompt engineering" to "context engineering", a step beyond it
- Context means not just a prompt sentence, but all the information the LLM can see before generating an answer (instructions, conversation history, long-term memory, external information, available tools, etc.)
- The success or failure of an agent now depends more on the quality of the context than on the model's performance
- Advanced agents integrate various context such as the user's calendar, past emails, and contacts to generate responses closer to solving real problems
- Context engineering is the design of situation-specific, dynamic systems, the process of providing the right information and tools to the LLM at the right time