Comparison of Prompting Techniques
Zero‑shot prompting asks the model a direct question without any examples. It relies entirely on the model’s pre‑trained knowledge and works best for straightforward queries. Few‑shot prompting supplies a few input‑output pairs inside the prompt, guiding the model toward the desired style or reasoning pattern. Chain‑of‑thought (CoT) prompting explicitly requests the model to reason step‑by‑step, which improves accuracy on complex logical tasks. Role prompting assigns a persona to the model (e.g., "Act as an electronics engineer"), shaping the tone, depth, and domain‑specific vocabulary of the response.
For an electronics student who wants an explanation of a smart‑sensor system, we can combine **few‑shot** and **role** techniques to obtain a concise, technically accurate answer.
Sample Prompt (Few‑shot + Role)
Act as a senior electronics engineer.
Example 1:
Q: Explain the working principle of a thermistor.
A: A thermistor changes its resistance with temperature; the relationship is given by R(T)=R0exp[β(1/T−1/T0)].
Example 2:
Q: Describe the architecture of a basic Arduino‑based temperature logger.
A: The system uses an Arduino Uno, a DS18B20 sensor, and an SD card module. The sensor reads temperature, the Arduino formats the data, and stores it on the SD card.
Now, explain the complete smart‑sensor system used for real‑time air‑quality monitoring, including the sensor types, signal conditioning, wireless transmission, and cloud integration. Provide the explanation in three bullet points, each under 20 words.
This prompt first sets the role, then gives two short examples (few‑shot) that illustrate the expected depth and format. The final request asks for a structured, concise answer, ensuring the model follows the demonstrated pattern.
Result: The AI returns a three‑bullet, technically precise description that matches the student’s learning level.
Tip from Examiner: In 7‑mark answers allocate roughly 30 % to definition/comparison, 40 % to a worked prompt, and 30 % to justification. Avoid overly long examples; two short few‑shot pairs are sufficient.