-
- News
- Books
Featured Books
- design007 Magazine
Latest Issues
Current IssueThe Designer of the Future
Our expert contributors peer into their crystal balls and offer their thoughts on the designers and design engineers of tomorrow, and what their jobs will look like.
Advanced Packaging and Stackup Design
This month, our expert contributors discuss the impact of advanced packaging on stackup design—from SI and DFM challenges through the variety of material tradeoffs that designers must contend with in HDI and UHDI.
Rules of Thumb
This month, we delve into rules of thumb—which ones work, which ones should be avoided. Rules of thumb are everywhere, but there may be hundreds of rules of thumb for PCB design. How do we separate the wheat from the chaff, so to speak?
- Articles
- Columns
Search Console
- Links
- Media kit
||| MENU - design007 Magazine
Estimated reading time: 4 minutes
SMT Perspectives and Prospects: Artificial Intelligence, Part 4—Prompt Engineering
The introduction of Generative AI models and ChatGPT-4’s rise to fame has brought about a relatively new term: prompt engineering. What is prompt engineering and what its impact? What prompt engineering techniques, tools, and platforms can optimize the use of Generative AI models, particularly large language models (LLMs)? What tips, pointers, and best practices can be used to hone prompt engineering? The following column addresses these questions.
What Is Prompt Engineering?
Destined to maximize the utility of Generative AI models, prompt engineering develops, designs, and optimizes specific prompts to enhance the output of LLMs or foundation models (FMs). Prompt engineering allows us to use AI models more effectively and achieve more accurate, relevant, and timely responses. It refines LLMs with specific prompts and recommended outputs, along with refining inputs to generate texts or images.
Maximizing the utility of an AI model, particularly for LLMs to achieve their targeted outcomes, often requires experimentation and various iterations. Reducing these attempts is possible by better understanding prompt engineering’s elements and techniques.
What Are the Impacts of Prompt Engineering?
Prompt engineering is an emerging field and a new skill. Prompt engineers program in English instead of computer programming languages such as Python. They use plain words to achieve results, for example, assisting researchers in abstracting essential content from literature, helping businesses analyze large quantities of documents to summarize, pull out key points, and highlight company earnings call transcripts. They also fine-tune prompts that go into an LLM to extract valuable information and can analyze and create prompt tools. Prompt engineers can also determine how to evaluate different models via a given prompt or a series of prompts about applications.
Prompt Engineering vs. Fine-tuning
Fine-tuning is primarily based on supervised learning and requires labeled data with specific datasets to improve model performance. It is an expensive process.
Prompt engineering works similarly to fine-tuning. However, there is no need for labeled data. It uses prompt techniques to guide the pre-trained LLM/FM to give more relevant and accurate answers by interacting with LLM/FM with natural language via a series of instructions, questions, and statements.
Well-curated prompt engineering is a more effective way to fine-tune pre-trained large LLMS and FMs.
Prompt Engineering Techniques and Approaches
One technique is chain-of-thought prompting, which uses a series of well-thought-out questions with logical or strategic sequences to interact with the model. It does this by breaking down questions step-by-step and asking the models to check their work as they go. It works as follows:
Request > Answer > Feedback > Request > Answer > Feedback > Continue Fine-tuning
Another technique is called a “persona prompt,” which tells the model to assume a role. Additionally, one can choose new information prompts by adding new information that the LLM might not know.
Through question-refinement prompts, we can ask the model to suggest improved or alternative questions to achieve more refined answers and write elaborate prompts to achieve the desired output, such as in aesthetic imagery. We can also use Zero-shot or Few-shot techniques. Zero-shot does not give examples, which is usually better for larger LLMs. Few-shot gives contextual output or format information. The technique needs to follow the token limits of LLMs.
Prompt Engineering Tips
To leverage prompt engineering to achieve the desired output, these tips are ranked in ascending order of depth or skills:
Level 1
- Understand the issue at hand.
- Know what questions to ask.
- Understand the desired outcome, then articulate the question.
- Form clear and actionable requests.
- Use clear and direct wording to avoid producing unexpected and undesirable results.
Level 2
- Set a strategy to create and refine effective prompts.
- Think about how to ask the questions effectively.
- Rephrase a question, which can lead the LLM to produce a completely different response.
- Pose open-ended questions or requests.
- Add detail and context.
Level 3
- Break down complex tasks into simpler prompts.
- Iterate and experiment with different prompt structures.
- Know the training dataset.
- Have a working knowledge of underlying model architecture.
- Understand prompt interface mechanics.
Prompt Engineering Tools and Platforms
Several commercially available tools are available for testing and use. Their respective features and strengths vary with applications. To name a few:
- PromptSource: A tool kit that uses an iterative development process to create natural language prompts through PromptSource's API; available on GitHub.
- Prompter: A debugging tool for GPT-3.5 and GPT-4 (4+) that allows users to identify and address issues with their prompts.
- FusionAI: Prompt engineering software that helps improve and expand prompts and is often used for creative writing, idea generation, and brainstorming.
- PromptPerfect: A tool that allows users to input the prompt and adjust the settings (e.g., prompt length, output quality, and the number of iterations); a third-party plugin that works with text generation models (ChatGPT, Claude, DALL-E 2, Midjourney, and Stable Diffusion). This is used with paid versions of ChatGPT.
- PromptLayer: A tool that allows users to monitor and control prompt interactions to see what changes improve results over time.
- OpenAI Playground: A platform to experiment, test, and refine prompts with various GPT models.
Prompt Engineering Cautions
Generative AI models continue to gather information from their interactions with users. They absorb and store information. When prompting, be mindful of information that is private, confidential or proprietary.
Prompt Engineering Best Practices
- Experiment and test different methods of phrasing instructions or questions.
- Create and manipulate the optimal question or input by understanding the underlying model’s algorithmic architecture and dataset constraints.
- Test multiple models for a specific application.
Appearances
Dr. Jennie Hwang will lead two Professional Development Courses, “Artificial Intelligence—Opportunities, Challenges and Possibilities” and “High-reliability Electronics for Harsh Environments,” March 16, 2025, at IPC APEX EXPO 2025. She will also teach IPC webinar courses on “SMT Manufacturing Productivity and Yield—Mitigating Production Defects, Part 1 and Part 2,” Feb. 4–13, 2025.
This column originally appeared in the January 2025 issue of SMT007 Magazine.
More Columns from SMT Perspectives and Prospects
SMT Perspectives and Prospects: The AI Era, Part 3: LLMs, SLMs, and Foundation ModelsSMT Perspectives and Prospects: A Dose of Wisdom
SMT Prospects and Perspectives: AI Opportunities, Challenges, and Possibilities, Part 1
SMT Perspectives and Prospects: Critical Materials—A Compelling Case, Part 3
SMT Prospects and Perspectives: AI—A Prelude to Opportunities, Challenges and Possibilities
SMT Perspectives and Prospects: Pearls of Wisdom
SMT Perspectives and Prospects: The Role of Bismuth (Bi) in Electronics, Part 7: A Case Study in Fillet-Lifting
SMT Perspectives & Prospects: Creating a Better World Through Engineering