ABC's of Prompt Engineering

Prompt?


Prompt: A "prompt" is a set of instructions to do some task. It can contain instruction or question and may include details such as context, inputs or examples.

Prompt Engineering: is a relatively new discipline for developing and optimizing prompts to efficiently use language models (LMs).  A new Skill in Demand(2024!) to make use of large language models (LLMs).
PE Parameters: 
Temparture:  In short, the lower the temperature, the more deterministic the results in the sense that the highest probable next token is always picked. Values ranfge between 0..1. Increasing temperature could lead to more randomness, which encourages more diverse or creative outputs. For QA it should be less and for creative like poem writing, it should be more.  
Top P:  A sampling technique with temperature, called nucleus sampling, where you can control how deterministic the model is. If you are looking for exact and factual answers keep this low. If you are looking for more diverse responses, increase to a higher value.
Max Length: You can manage the number of tokens the model generates by adjusting the max length. Specifying a max length helps you prevent long or irrelevant responses and control costs.
Stop Sequences: A stop sequence is a string that stops the model from generating tokens.  For example, you can tell the model to generate lists that have no more than 10 items by adding "11" as a stop sequence.
Frequency Penalty: The frequency penalty applies a penalty on the next token proportional to how many times that token already appeared in the response and prompt. Higher means the word less likely appear. 
Presence Penalty: The presence penalty also applies a penalty on repeated tokens but, unlike the frequency penalty, the penalty is the same for all repeated tokens. A token that appears twice and a token that appears 10 times are penalized the same. This setting prevents the model from repeating phrases too often in its response.

Tips:
The general recommendation is to alter temperature or Top P but not both. Alter either one penaly at a time. Not Both at a Time.

Let us play in the playground https://platform.openai.com/playground

You can see screen similar to this:

Click Documentation in the sidebar menu to see as shown here: Just play around so that to become familiar with p;ayground.


See Right side bar menu. You can see Model like gpt-3.5-turbo, temperature slide bar, stop sequence text box, Top P slide bar, Frequency Penaly and Presence Penalty slide bars. 


So many things you can do with this.

Now let use go to our simple chatbot Interface: https://chat.openai.com/auth/login. Click Login. Continue with your google account to see the page as below:

You can see the text box with meesage chatGPT appear. In this text box, try the following PROMPTS examples and see the responses to learn and have fun!.

  1. Good day?
  2. What is your name?
  3. How old are you?
  4. I am a student? How you can help me?
  5. Can you help me to find out 5 best books for "Prompt Engineering"
  6. Can you give me 5 MCQ in the topic "Prompt Engineering" with 4 choices and 1 answer
  7. Can you write a essay on " Fine Tuning of Prompts in Chat GPT"
  8. Can you Summarize the above essay in 5 bullet points
  9. Can you give 5 English words and their equivalent in Tamil in table format|
  10. Who is the Super Star Actor in Tamil Nadu, India?
  11. I am a Kinder Garden Student. Can you say one popular nursery rhyme?
  12. Can you give mathematical table for 13?
  13. I am kinder Garden Student. Can you list any 5 class room activities?
  14. Can you teach me English Alphabets with simple words and emojis for those words?.
  15. Can you teach me English Vowels with simple words and emojis for those words?.
  16. Can you teach me English Consonants with simple words and emojis for those words?
  17. Can you teach me Tamil Language Vowels with simple words and emojis for those words?.
  18. Can you teach me all Tamil Language Consonants with simple words and emojis for those words?
  19. Can you give me numbers from 1 to 10 and their words?
  20. Can you tell me popular moral story within 5 lines in ENGLISH for kinder garden students?
  21. If YOU are the Prime Minister of India , What good schemes you will announce. List in bullet points.
  22. Can you write a leave letter for two days to attend friends marriage?
  23. Assume you are Kinder Garden student. Explain what do you mean by Algorithm?
  24. Assume you are Child. Explain what do you mean by Algorithm in 3 bullet points ?
  25. Assume you are Teen. What do you mean by Algorithm in 3 bullet points ?
  26. Assume you are Under Grad. What do you mean by Algorithm in 3 bullet points ?
  27. Assume you are Grad. What do you mean by Algorithm in 3 bullet points ?
  28. Assume you are Computer Expert. What do you mean by Algorithm in 3 bullet points ?
  29. Fill in the blanks. Capital of India _____________
  30. Fill I ______ foot ball.
  31. Fill 25 * 25 = ________
  32. Solve this quadratic equation: x*x - x - 6 =9. Explain steps
  33. Prove: SIN(A)/COS(A)=TAN(A)
  34. What is the difference between NPR and NCR?
  35. Can you help me to write a love letter to my class mate "Nayanthara" who is beautiful and Gorgeous in concise form?
  36. Can you write a love song for my lover in 5 lines.
  37. I am student just finished my B.Tech. Course. I am proficient in C#, Java and Python. I know SQL. I want to apply to Micro Soft for suitable post. Can you prepare a Resume for me.
  38. What skills i require to apply for Machine Learning Engineer?
  39. I am BTech Student. Can you prepare a Road Map for me to become a Generative AI Expert
  40. What are salary packages available in top 5 companies for ML Engineer?
  41. Can you give me coding for Depth first search in Python?
  42. Can you give me optimied code for the Depth First Search in python?
  43. Can you create a personal blog with demography, educational qualification, hobbies, extra curricular activities, skills, projects done, languages known, research publications, .
  44. Can you give me engaging resume template for a final year student who wants to apply for fresher jobs.
  45. Can you develop web site in HTML, CSS and Java Script
  46. Can you give code to generate a flutter based Mobile App for Booking a smart class room in your college. Assume there are 2 slots each 1 hour in the morning and one slot each 1 hour available in the evening. Front end should support login, reserve, view, cancel booking.
  47. I want to buy a smart phone. Please help me by tabulating any three phones with features and prices as columns
  48. I want to buy a smart phone. Please help me by tabulating any three phones with features and prices as columns. Can you give in JSON format.
  49. What are top 5 Tamil movies popular now?
  50. Which is the best pop song sang by Celion Deon?
  51. What Writing styles are supported by ChatGPT LLM?  Formal/Serious/Humorous/Authorartive/Sympathetic/Assertive/Informal/ Casual/Neutral
  52. Can you talk about "Gandhiji" in Humorous  style in 5 bulleted lines
  53. Can you talk about "Gandhiji" in Formal style in 5 bulleted lines.
  54. Can you teach me  the syntax of "SELECT" statement in SQL with 2 examples
  55. Assume there  is 1 table with  2 columns.  Which SQL  is efficient  select * from table1, select colum1, column2 from table1
  56. ACT LIKE Albert Einstein and explain the theory of relativity.
  57. Photosynthesis is a process by which plants convert sunlight into energy. [INCLUDE: Chlorophyll, Carbon dioxide, and Water]
  58. Can you solve H2O+NAOH?
  59. What is Pythagoras theorem? 
  60. What is Kirchhoff's current Law?
  61. Explain e=mc2
  62. What is the definition of AI?
  63. Convert 10 Acres miles to cents.
  64. Calculate 10**3+10*2+10+1?
  65. Can you create a list of must-read books in Tamil?
  66. What could be the causes of boring?
  67. Can you recommend solutions for reducing e-waste?
  68. Can you recommend solutions for reducing air pollution in NEWDELHI?
  69. Can you outline the steps to fry potatoes?
  70. Can you describe the benefits of doing YOGA?
  71. Can you explain the drawbacks of using mobile phones excessively?
  72. Please provide a creative survey response for the question: "What is your favorite movie?
  73. Can you analyze our teaching and learning in indian universities and provide recommendations for improvement?
  74. Design a feedback process for Indian Universities teachers.
  75. Analyze students' behavior for our new workshop on prompt engineering?
  76. Create a content strategy for a university admission blog?
  77. We are hiring a software engineer. Can you suggest some screening questions to assess their coding skills?
  78. Can you calculate the current ratio for a company with current assets of $500,000 and current liabilities of $250,000?
  79. We receive many inquiries about our university admission policy. Can you suggest some 5-10 prompts to handle these questions?
  80. We have to create compelling ad copy for our upcoming campaign. Can you help us with ad copy prompts?
  81. We need captivating copy for our social media posts. Can you provide some copywriting prompts? 
  82. Recommend a good restaurant in Chidambaram?
  83. As a technology expert, explain the concept of Quantum Computing in simple terms
  84. Compare the advantages and disadvantages of electric cars and traditional gasoline cars
  85. Please evaluate CAS promotion scams in Annamalai University and provide constructive feedback
  86. Inquire about the future of artificial intelligence and its impact on society.
  87. Tree of Thoughts. Imagine three different experts are answering this question.All experts will write down 1 step of their thinking,then share it with the group.Then all experts will go on to the next step, etc.If any expert realizes they're wrong at any point then they leave.The question is...How to solve a employment problem?
  88. Create video making script for pictory.ai for the topic " Fine Tuning Prompts in LLM"
  89. Can you give me recipe for making chidambaram kothusu?
  90. Can you prepare a shopping list for the above recipe for 5 persons
  91. Can you translate 'Hello, how are you? How is your day going?' to Tamil?
Python Code to do this:
=====================================================================
import openai
# Set your API key here
openai.api_key = 'YOUR_API_KEY'
def generate_chat_response(prompt):
   response = openai.Completion.create(
      engine="text-davinci-003",
      prompt=prompt,
      max_tokens=100,
      temperature=0.7,
      n=1,
      stop=None
   )
   return response
user_prompt = "User: Can you translate 'Hello, how are you? How is your day going?' to TAMIL?\n"
chat_prompt = user_prompt + "[TRANSLATE: TAMIL]"
response = generate_chat_response(chat_prompt)
print(response)
======================================================================
Use Gemini https://gemini.google.com/  to try these prompts
Use Perplexity to try https://www.perplexity.ai/  to try these prompts

Gemini = T2T | ITT |STT Real Multi Modal 
  1. Can you compare chatGPT and Gemini? 
  2. Recommend a good restaurant in Chidambaram?
  3. Give me list of free tutorial resources for the topic "Prompt Engineering"
  4. Give me best Git hub Tutorials for "Prompt Engineering"
  5. Give me best kaggle Tutorials for "Prompt Engineering"
  6. Give me best 10 web site tutorials for Prompt Engineering
  7. Give me the simple prompts for Gemini for teaching kids 
  8. Tell me moral story in 5 lines
  9. Tell me a story about thirsty crow in 5 lines
  10. Act like a Poet. Tell me a story about thirsty crow in 5 lines
  11. List down 5 simple tongue twisters
  12. Give me Current News Digest today?
  13. What do mean by 143
  14. What do you mean by 420?
  15. What do you mean by 100?
  16. What do you mean by 80/20 Paradigm?
  17. What do you mean by LoL?
  18. Write a love letter to beautiful in five lines?
  19. What do you mean by 1️⃣❤️U?
  20. "Play a game of 'Would you rather?' with me.
  21. Who is the leading actor in "Leo"?
  22. Write a love letter to Actress "Trisha" admiring her beauty in 5 lines.

Resources :

For Beginners

For Intermediate Learners

For Specific Tasks


For Creative Applications


More Resources:








to be continued ...... Until then Happy Prompting ?😊😊😊😊😊🎈

No comments:

Post a Comment

Making Prompts for Profile Web Site

  Prompt: Can you create prompt to craft better draft in a given topic. Response: Sure! Could you please specify the topic for which you...