Member-only story
AI
Improving ChatGPT With Prompt Injection
ChatGPT often provides long, comprehensive and insightful responses, but rarely requests new information from the user. As discussed in my previous article on ChatGPT, a useful feature of conversational AI would be the ability to adjust answers using follow-up questions to be more precise and personal. To enhance this type of behavior, I decided to “reconfigure” the model using prompt injection.
This is tested using the question: how do I learn Python? First, without any modifications, the following answer was given by ChatGPT:
The answer isn’t bad, but it is quite vague and general. I could improve the question to obtain a better answer, but if I’m not familiar with Python, it might be difficult to know what I’m looking for and what to ask. Now, I’ll attempt to adjust the AI to answer my question while seeking to extract more information to improve its answer:
As can be seen, the AI uses follow-up questions after each explanation to obtain more information and improve its answer. With this, it might ask questions the user didn’t know could affect the learning process. The interaction also becomes more collaborative.
Another option, instead of going through multiple iterations of answers and questions, is to first figure out all the necessary details and then answer. I reconfigured the AI to do this:
As can be seen, the AI was able to construct a better learning path using the information obtained from the questions it asked. I think these types of interactions can be very important in situations when the background really matters. For instance, if I ask what programming language I should learn, it of course depends on what I would like to use it for. Or if I wanted to purchase new sports equipment it depends on what level I’m at, the budget, etc.
Summary
Using prompt injection, you can more precisely customize the behavior of language models to facilitate your needs. Perhaps such options will be available for ChatGPT without prompt injection in the future.
If you’re interested in reading more articles about AI, check out my reading list below:



If you’d like to get a Medium membership you can use my referral link if you wish. Have a nice day.
Level Up Coding
Thanks for being a part of our community! Before you go:
- 👏 Clap for the story and follow the author 👉
- 📰 View more content in the Level Up Coding publication
- 🔔 Follow us: Twitter | LinkedIn | Newsletter
🚀👉 Join the Level Up talent collective and find an amazing job








