ChatGPT (generative AI) guidance
Generative AI tools are a form of AI that can generate content based on a prompt that you give it. It’s important to know that they attempt to create content based on data they have seen before, rather than having a database of “answers”. As such, they are not entirely reliable as you’ve no doubt noticed! They can however be useful for us as programmers to act as a pair programmer and personal tutor.
Here is some guidance to bear in mind:
Try Solving Problems Yourself First
Before going directly to a GenAI tool, try solving the problem yourself. This will strengthen your understanding and your learning muscles. Your attempted solution will likely be different from anything GenAI produces which will enhance learning even more if you ask it for an example after you’re finished.
Ask For Explanations, Not Just Solutions
Ask the AI for an explanation of what it has produced rather than just take it at face value. That way, next time you come across the same issue, you will have a better chance of success. You can also ask for explanations of error messages. Sometimes error messages can be a little vague so it can help to get a fuller explanation.
Ask For Some Practice Exercises
If you want to practice a specific skill, ask for 10 exercises (without the solutions!) so you can practice. Once you’ve attempted each exercise, you can ask for a solution. Remember, sometimes it gets it wrong so check the code.
Be Precise With Your Prompt
To get the best results, set the context and be precise. You will get much better results if the tool understands your learning stage and your context.
Good example: “Hi! I’m learning data science using the tidyverse. So far, I’ve learned the basics like x, y, z. Please suggest 2 options with examples for what I should learn next.”
Bad example: “How do you use tidyverse for data science?”
Don’t Just Immediately Ask For a Solution
Ask for some hints rather than a full solution. Tell it what you’re stuck on and the code you’ve tried so far.
Ask For a Code Review
Usually done by a human, code reviews can help you gain a different perspective on your code and give you skills to improve. Paste in your code and ask for a code review. You might discover alternative ways to achieve the same result.
Academic Integrity
Acknowledge your use of GenAI tools in any assessments you submit. Don’t submit any code that your don’t understand or wouldn’t be able to explain to someone. Remember, this is your learning and you’d only be doing yourself a disservice.
Acknowledgment: This document was created based on ideas from ChatGPT
Useful Links:
- As well as ChatGPT, you can access Github Copilot for free as a student: https://education.github.com/discount_requests/application. Make sure the verified email address on your Github account is your University email address.
- You can use Copilot and ChatGPT in RStudio. Watch this video for instructions on setting it up: https://youtu.be/t7NrkAeosog?si=QdY8cxbey_LlEzgz
- University’s policy on GenAI: https://information-services.ed.ac.uk/computing/comms-and-collab/elm/guidance-for-working-with-generative-ai
- Book on how to use GenAI for learning, including coding: https://psyteachr.github.io/AITutoR/