Home › Blog › AI & Generative AI
How to Implement Prompt Engineering | Prompt Engineering Guide

Prompt engineering is a relatively new field for effectively building, developing, and optimizing large language models (LLMs) for a variety of use cases. It is the technique and process of instructing synthetic AI software programs to generate desired results accurately and efficiently.
This task is not easy, given the huge range of outputs produced by the advanced algorithms found in common AI programs. What's more, the massive data pools behind large language models (corpora that grow larger every day) allow AI-generation programs to deliver an even wider range of outputs.
Achieving effective prompting therefore requires a holistic understanding of prompting techniques, the key tips for crafting well-designed prompts, and awareness of the major use cases for effective AI prompts. This article explains the Prompt Engineering Guide needed to master prompt engineering.
1. Quickly Understanding Prompt Engineering Techniques
Creative artificial intelligence is gaining popularity, and a wide range of innovative applications and tools have emerged for both professional and personal use. This is largely thanks to the success and popularity of ChatGPT, Google Bard, and other AI chatbots that make heavy use of language modeling.
The output of today's common AI programs spans every kind of multimedia, and combined with the speed of getting an answer within seconds, it promises to be a huge help in completing our everyday work.
- Image generators: Image generators such as Open AI's Dall-E and Midjourney are ideal for creating 3D content and AI artwork.
- Code generators: Code generators such as Copilot are used to generate code snippets and help developers with their coding tasks.
- Sound generators: Speech synthesis models such as DeepMind's WaveNet are used to create realistic, human-like voices.
Because such large language models can synthesize and generate answers based on massive amounts of data, users often find it hard to get the best answer from common AI applications. It's a common misconception that "users type random word prompts into common AI programs as if doing a simple Google search." This does not produce the best results.
In other words, awareness of how to use synthetic AI tools is growing — the output is only as good as the prompt. A prompt should also be built to include elements based not only on the core concept, but also on the type of media (photo, video) used to build the content.
AI programs are highly creative, but they cannot predict a user's intent. Users need to tell the AI program exactly what they want. That's why prompt engineering skills for crafting specific, effective prompts are becoming increasingly important.
2. How to Implement Prompt Engineering | Prompt Engineering Guide
2.1. Fundamentals of Prompt Engineering
2.1.1. Standard Definitions in Prompt Engineering
Before going into more detail on prompt engineering, let's establish a few standard definitions.
- Label: a specific category or task the language model should focus on, such as sentiment analysis, summarization, or question answering.
- Logic: the underlying rules, constraints, or instructions that guide the language model's behavior within a given prompt.
- Model parameters (LLM parameters): specific settings or configurations of the language model — such as temperature, top-k, and top-p sampling — that affect the generation process.
2.1.2. Prompt Basics and Prompt Formatting
When designing a prompt, it is essential to understand basic structure and formatting techniques. Prompts often consist of instructions and placeholders that guide the model's response. For example, in sentiment analysis, a prompt might include an instruction such as "Analyze the sentiment of the following text," along with a placeholder for the text to be analyzed. Providing clear, specific instructions helps focus the model and produce more accurate results.
Elements of a prompt:
A well-designed prompt should include several key elements.
- Context: provide relevant background and context so the model can reliably understand the task or query.
- Task specification: clearly define the task or objective the model should focus on, such as generating a summary or answering a specific question.
- Constraints: limits or restrictions that guide the model's behavior, such as word count limits or specific content requirements.
2.1.3. Use Cases for Prompt Engineering
If you're wondering about the possible use cases for prompt engineering, keep in mind that this number isn't fixed — the number of potential use cases keeps growing.
As shown below, current use cases range widely, from writing blog posts to creating full content outlines. As common AI tools are developed and the technology advances rapidly, the number of use cases will expand across finance, manufacturing, healthcare, and more.
The table below shows some of Miichisoft's current use cases for prompt engineering.

2.2. General Tips for Designing Prompts
- Experiment extensively:Creating an effective prompt is a process that requires a lot of experimentation to achieve the best results. Start with a simple prompt, then gradually add elements and context to improve the output.
- Break tasks into smaller steps:For a large task made up of multiple subtasks, it's important to build the task up gradually rather than trying to generate all the output at once. Splitting the task into smaller pieces produces more accurate results.
- Use direct commands:In the instructions you give the language model, using commands such as "write," "classify," "summarize," "translate," and "reorder" can guide the model toward a specific output.
- Provide context:To get closer to the optimal result, you need to provide different keywords, context, and data. In general, providing specific, relevant context related to the task tends to produce better results.
- Use delimiters:It is recommended to place instructions at the start of the prompt and use delimiters such as "###" to separate the instructions from the context.
2.3. How to Implement Prompt Engineering | Prompt Engineering Guide
A well-designed prompt requires the skill to understand the model's capabilities and limitations, and to adjust the prompt so as to optimize the quality and relevance of the generated output.
A carefully crafted prompt should include several core elements, such as the following.
2.3.1. Provide Context
This is the most important part. Using appropriate context in a prompt means including all relevant background information, from key details to necessary instructions. Are you writing a prompt in a medical, financial, or software-coding context? Include that context. Likewise, is the prompt designed to reference past documents or provide forward-looking feedback? Include all time-sensitive context that matters in the prompt.
For example, suppose you want to create information about the scientific process of photosynthesis. If you're used to Google, you might simply type "photosynthesis" into the prompt.
Even a vague one-word prompt will produce some results.

However, let's look at the results of a suggestion that includes fuller, deeper context, for a more complete and detailed understanding of the biological basis of photosynthesis.

Clearly define the task or question you want the AI model to solve. Be very specific about the information or results you expect — add more detail than you think you need.
For example, by specifying whether you're looking for data or a calculation in the output, and including the entire array of data relevant to the project, you help the LLM find the needle it's looking for in the haystack.
2.3.2. Add All Constraints
If there are limits or constraints the AI model needs to take into account — such as word count, time frame, or specific criteria — state them clearly in the prompt. Keep in mind that all common AI software has access to a sea of data. Without very strict constraints built into the prompt, you'll end up asking for more than you actually want.
2.3.3. Experimenting with Temperature, Top-K, and Top-P
Adjusting parameters such as temperature, top-k, and top-p lets you control the randomness and creativity of the model's output. When crafting a prompt, experiment with these parameters to fine-tune the generated output to your preference.
Temperature Value
The temperature value refers to the randomness or creativity of the generated response. A higher temperature value, such as 0.8 or 1.0, makes the output more random and unpredictable, while a lower value, such as 0.2 or 0.5, makes the output more focused and deterministic. You'll probably want a more formal response for business projects, and a more random approach for recreational projects.
Temperature values and their meaning:

Top-K Value
The top-K value is a parameter that determines how many of the most likely next tokens are considered during text generation. Simply put, a higher top-K value means more alternative tokens are considered, allowing for more diverse and creative output. Conversely, a lower top-K value produces more conservative, predictable responses.
Top-K values and their meaning:

Top-P Value
The top-P value is an alternative way to control the diversity of responses generated during text generation.
Instead of considering a fixed number of the most likely tokens as in top-K, top-P sampling considers tokens until their cumulative probability reaches a certain threshold or percentage. This threshold is dynamic and can change at each token-generation step.
For example, if the top-P value is set to 0.8, the model considers tokens until their cumulative probability reaches 80%.
Top-P values and their meaning:

2.3.4. Test and Iterate on Prompts
You can also try a variety of prompts to get the desired result more effectively. This is not only an effective approach — it's also one of the most effective strategies possible for quickly honing your technique.
So don't hesitate — try many different prompts, evaluate the results they generate, and refine and improve your prompting technique. As agile experts have learned, you cannot become a top-level agile engineer without this kind of extensive iteration.
Key point: even if you feel you've already achieved the result you want, don't hesitate to dig deeper and try again. There's no downside to continued effort.
2.3.5. Understand the Model's Limitations
This is a hard reality that many engineers come to accept quickly: a given common AI model may contain an excellent large language model, but that model still cannot answer every question. For example, a large language model built to serve the healthcare market may not be able to handle most of the top-level finance-related queries an MBA might type in.
It's therefore important to design the optimal prompt within the limits and capabilities of the specific AI model you're using. This helps you design prompts suited to the model's strengths and minimizes potential pitfalls from the output's limitations.
2.4. Prompt Engineering Techniques
Several advanced techniques can be used to further enhance the capabilities of prompt engineering.
N-shot Prompting:
N-shot prompting involves fine-tuning a model with limited labeled data, or no labeled data at all, for a specific task. By providing a small number of labeled examples, the language model can learn to generalize and perform the task accurately. N-shot prompting encompasses both the zero-shot and few-shot prompting approaches.
Zero-shot Prompting:
In zero-shot prompting, the model is prompted to perform a task it was not explicitly trained on. Instead, the prompt provides a clear task specification with no labeled examples. For example:

Few-shot Prompting:
In few-shot prompting, the model is trained with a small number of labeled samples to perform a specific task. This approach lets the model learn and generalize by leveraging a limited amount of labeled data. For example:

Chain-of-Thought (CoT) Prompting
CoT prompting involves breaking a complex task down into a series of simple questions or steps. By guiding the model through a coherent chain of prompts, you can ensure context-aware responses and improve the overall quality of the generated text.

Generated Knowledge Prompting
Generated knowledge prompting involves leveraging an external knowledge base or generated content to enhance the model's response. By incorporating relevant information into the prompt, the model can provide more detailed, accurate answers or generate content based on the retrieved knowledge.
Self-Consistency
The self-consistency technique focuses on maintaining coherence and consistency in the language model's responses. By comparing generated outputs and checking that they align with previously generated content or instructions, you can improve the overall quality and consistency of the model's responses.

These examples show how prompt engineering techniques such as N-shot prompting, CoT prompting, generated knowledge prompting, and self-consistency can be applied to guide language models toward more accurate, contextually relevant, and coherent responses. Leveraging these techniques can enhance the performance and control of language models across a range of NLP tasks.
Applying prompt engineering best practices reminds users of prompt engineering that AI can help solve many problems in areas such as customer experience (CX) and healthcare. If you're interested, Miichisoft offers two articles on this topic — please refer to them here:
https://miichisoft.com/application-of-prompt-engineering-medical-field/
3. Conclusion | Optimize Your Prompts Through Hands-on Practice
This Prompt Engineering Guide covers everything from foundational knowledge about prompts sent to LLMs to how to actually write prompts. Because the right prompting approach depends on the task you're trying to solve, try instructing the language model directly and find the optimal prompting approach for yourself.
Building on the techniques introduced in this article, it's important to go through the process of repeatedly having generative AI produce output. We also offer an article on the role and future of prompt engineering, so please use it as a reference to deepen your understanding.
Miichisoft is a Vietnamese technology company with numerous successful track records in cross-platform development for Japan. Through more than 150 successful projects, we have built up a strong track record. We are confident in our ability to lead IT projects, and we take pride in contributing to our clients' business success.
Furthermore, Miichisoft itself recently completed and released dxGAI Business | Enterprise, a comprehensive future AI solution built on ChatGPT. As a company ourselves, we understand the challenges of using AI solutions, and we can support you whether you're just starting to use Prompt Engineering technology in your business activities or want to use it effectively without worrying about safety.
If you're interested in AI technologies such as prompt engineering, please feel free to contact us — let's explore business collaboration opportunities together.




