Learnings from building an AI tutor using GPT-4
Aman Dalmia
HyperVerge Academy (HVA)
Many young Indians who come from under-resourced backgrounds struggle to find decent paying jobs due to lack of skills & network.
HVA is a platform that brings together working professionals to mentor motivated learners so they can get credible, well-paying jobs in the tech industry.
What’s the Problem?
Learners tend to do things without a proper understanding of why they are doing what they are doing. Asking the right questions bridges this gap and gets them to think critically.
A mentor plays this role of:
Learners are bottlenecked by how much time a mentor can give them. In the limited time they have, a mentor can ask only so many questions.
What If?
What if there was a tool that could:
This could potentially:
Enter: SensAI
Assessment
Content
Doubt solving
SensAI Assessment Demo
SensAI English Demo
SensAI Content Prototype Demo
SensAI Data Captured in Google Sheets
Metrics that Enable us to Track
Progress Metrics
What is the impact we are seeing so far?
Case 1: Ability to identify learning gaps
More examples of learners realising they had learning gaps
What is the impact we are seeing so far?
Case 2: Step by step guidance when learner is stuck
Note: System can be improved further by not giving away the entire answer.
What is the impact we are seeing so far?
Case 3: Aids in practice and confidence building
“I practice on Sensai after I complete a milestone. It gives me confidence that I know this topic” - Another learner over a call
Building with direct feedback from our learners!
Building with direct feedback from our learners!
Next item in Roadmap:
How does it work?
Question generation
GPT-4
Topic (JS)
Sub-topic (basics)
Concept (operators)
Blooms level (remembering)
Learning outcome
How does it work?
Router
GPT-4
Topic
Sub-topic
Concept
Blooms level
Learning outcome
User query
answer
clarification
irrelevant
miscellaneous
How does it work?
Personalized feedback (1)
GPT-4
Topic
Sub-topic
Concept
Blooms level
Learning outcome
Work out the solution
How does it work?
Personalized feedback (2)
GPT-4
Topic
Sub-topic
Concept
Blooms level
Learning outcome
Evaluation score
Feedback
Own solution
User answer
How does it work?
Clarification, miscellaneous
GPT-4
Topic
Sub-topic
Concept
Blooms level
Learning outcome
Feedback
System Prompt
User answer
Speed tactics: streaming + caching (10x boost)
Personalized feedback (1)
GPT-4
Topic
Sub-topic
Concept
Blooms level
Learning outcome
Work out the solution
Raise your hands
Tokens
Challenge?
Challenge?
Tokens
Embeddings
Word embeddings
What is prompt engineering?
How is GPT-3 trained? Next-word prediction
What is prompt engineering?
Emergence
Prompt engineering crash course
Prompt engineering crash course
Prompt engineering crash course
Chain-of-thought prompting: Give the model time to think
Prompt engineering crash course
Chain-of-thought prompting: Give the model time to think
E.g. specify the individual steps the model should follow before arriving at an answer
Prompt engineering crash course
Zero-shot Chain-of-thought prompting: Give the model time to think without any explicit instructions and let the model figure out the intermediate steps
Prompt engineering crash course
Prompt engineering starter template
System prompt
You are a [adjective] [role] (e.g. very good and encouraging interviewer)��[context] (e.g. you are interacting with students who are preparing for an interview and you need to encourage them to think independently)
You will be given [describe the input] delimited by ``` characters (e.g. topic, question, student’s response)
You need to [describe the task] (e.g. evaluate the student’s response and give actionable feedback)
Important Instructions:
[bullet list of everything to keep in mind while answering the input + all edge cases]
Provide the output in the following format:
Let’s think step by step �{concise explanation (<50 words)}
The output should be a markdown code snippet formatted in the following schema, including the leading and trailing " json" and " ":
```json
{"type": answer | clarification | irrelevant | miscellaneous // type of the query}
```
Chain of thought prompting
Ask for a specific output format
Prompt engineering starter template
Additional note
Here, the thinking step-by-step needs to happen before the final output so that the model can use the reasoning to generate a higher quality response
Some learnings
Some learnings
Some learnings
Handy trick for debugging
Some learnings
Some learnings
Dawn of Large Multimodal Models (LMMs)
Go through all the examples: https://arxiv.org/pdf/2309.17421.pdf
Dawn of Large Multimodal Models (LMMs)
Go through all the examples: https://arxiv.org/pdf/2309.17421.pdf
System Prompt vs Knowledge base
System Prompt: specify how you want the AI model to behave
Knowledge base: contains the knowledge about the inherent system that you are letting the user chat with
Knowledge base is the treasure, AI model is the guide and system prompt are instructions for the guide
AI
Beneficiary
Recommendations for structuring knowledge base
Note: some recommendations are specific to the Jugalbandi API
The document can be as long as you want but quality matters more than quantity. Make sure that you’re being crisp and concise in whatever you’re putting into it.
Make sure that you don’t put contradictory or even duplicate information as it can confuse the AI model and unnecessarily increase token size (hence, 💰)
Structure it into neatly separated paragraphs with each paragraph having at most 4000 characters (including spaces, punctuations, etc.)
Recommendations for structuring knowledge base
Using an FAQ format can potentially lead to better performance but keep one thing in mind:
do not put an extra blank line between the question and answer
RAG explainer
RLHF and fine-tuning
Resources