Exploring Effective Prompting Techniques for GenAI

Prompt Engineering and Generative AI interface
Udaya Dharshini S Avatar

Introduction

Artificial Intelligence (AI) is becoming an important part of modern technology. Generative AI systems can create text, answer questions, summarize information, and perform many other tasks. However, the quality of their responses depends significantly on how instructions are provided. This is where Prompt Engineering becomes important.

Prompt Engineering is the process of designing and improving instructions, known as prompts, to guide AI models towards useful and relevant outputs. During my internship at Valentius Kryptix, I explored different prompting techniques through practical experiments to understand how prompt structure influences AI-generated responses.

Understanding Prompt Engineering

A prompt is an instruction or question given to an AI model. A clear and specific prompt helps the model understand the expected task and output.

For example, instead of asking an AI model to simply analyse customer feedback, we can provide clear instructions to classify the feedback as Positive, Negative, or Neutral.

Prompt Engineering helps improve clarity, consistency, and the usefulness of AI-generated responses.

Experiment 1: Zero-shot and Few-shot Prompting

The first experiment focused on comparing Zero-shot and Few-shot prompting for sentiment classification.

Zero-shot prompting means asking an AI model to complete a task without providing examples. The model uses its existing knowledge to generate an answer.

Few-shot prompting provides a small number of examples before asking the model to perform the task. These examples help demonstrate the expected pattern.

I tested sentiment classification using customer feedback. One example was: “Late delivery, but the product quality was excellent.”

The experiment helped me understand how providing examples can influence the model’s interpretation and classification of customer feedback.

Experiment 2: Direct and Step-by-step Prompting

The second experiment explored two approaches to mathematical problem-solving.

In Direct prompting, the model receives a question and is asked to provide the answer directly.

In Step-by-step prompting, the model is instructed to explain the calculation in stages.

For example, the experiment involved calculating the original price of a product after a 20% discount when the discounted price was ₹800.

The calculation is:

Discounted Price = Original Price × 0.80

Original Price = 800 ÷ 0.80 = ₹1,000.

This experiment demonstrated the importance of clear instructions and showing intermediate calculations when working with numerical problems. The calculation can also be independently checked.

Experiment 3: Structured JSON Prompting

The third experiment focused on extracting information into a structured JSON format.

The prompt instructed the AI model to identify specific fields such as name, date, and amount and return them in JSON format.

Structured output is useful when AI-generated information needs to be processed by software applications or APIs.

I also explored how the prompt should handle missing information and maintain a consistent output structure.

This experiment helped me understand why specifying the expected format is important when integrating AI models into applications.

Key Learnings

Through these experiments, I learned three important concepts:

  1. Examples in Few-shot prompting can guide an AI model towards the expected response pattern.
  2. Step-by-step instructions can make calculations easier to understand and verify.
  3. Structured prompts help generate outputs in formats such as JSON, which are useful for software integration.

I also understood that prompt design requires testing and refinement. A prompt that works for one input may not always produce the expected result for another input.

Conclusion

Prompt Engineering is an important skill in the development and use of Generative AI applications. Through these practical experiments during my internship at Valentius Kryptix, I gained an understanding of different prompting techniques and how they influence AI-generated outputs.

These activities strengthened my understanding of prompt design, output evaluation, and structured information extraction. I look forward to exploring more advanced prompting methods and applying them in practical AI projects.

Testing and Limitations

Testing different prompts is an important part of Prompt Engineering. The same prompt may produce different responses depending on the input and AI model. Therefore, outputs should be checked for accuracy, clarity, and consistency rather than accepted without verification.

Structured formats such as JSON should also be validated before being used in applications. These experiments provided a practical introduction to evaluating AI responses and improving instructions through experimentation.

Project report: https://github.com/Udayadharshini/ai-memory-chatbot/blob/main/prompt-engineering-report.md

Tagged in :

Udaya Dharshini S Avatar

Leave a Reply

You May Love