
Prompt Engineering Techniques: Few-Shot, CoT & More
A practical cheat sheet of prompt engineering techniques for choosing zero-shot, few-shot, chain-of-thought, role prompting, RAG prompts and more.
Jai Jha· 25 Nov 2026· 10 min read
The main types of learning in AI are supervised learning, unsupervised learning, semi-supervised learning and reinforcement learning. In simple terms, supervised learning learns from labelled examples, unsupervised learning finds patterns without labels, semi-supervised learning uses a small amount of labelled data with a larger amount of unlabelled data, and reinforcement learning learns by taking actions and receiving rewards or penalties.
AI learning is about improving performance from experience. A model sees data or feedback, detects patterns, adjusts its internal parameters and then uses what it has learned on new situations. The important question is not only “which algorithm should I use?” but “what kind of learning signal do I have?”
That learning signal decides the learning type. If you have correct answers attached to past examples, the problem is usually supervised. If you only have raw data and want structure, it is usually unsupervised. If an agent must act in an environment and learn from consequences, it is reinforcement learning.

Think of a student preparing for exams. If a teacher gives questions with answer keys, that is like supervised learning. If the student receives a pile of notes and groups similar topics alone, that is like unsupervised learning. If the student plays a strategy game and improves after winning or losing moves, that is like reinforcement learning.
In practice, modern AI systems often mix these approaches. A recommendation engine may use supervised models to predict clicks, unsupervised models to group users and reinforcement ideas to improve long-term engagement. The categories are still useful because they help you frame the problem clearly before choosing tools.
For students and freshers, this framing is more important than memorising many algorithm names. Once you know the learning setup, the choice of model becomes easier. You can ask: Do I have labels? Do I need prediction, discovery or decision-making? Is feedback immediate or delayed?
Most introductory AI and data science courses teach four broad types of machine learning: supervised, unsupervised, semi-supervised and reinforcement learning. Some books also discuss self-supervised learning, active learning and online learning, but these are often treated as specialised methods or training styles rather than the main beginner categories.
The phrase different types of machine learning is often used interchangeably with different types of learning in AI. Strictly speaking, machine learning is a subfield of AI, while AI is the broader goal of building systems that perform tasks associated with intelligence. For a beginner, the four categories below are the most useful starting point.
Learning type | Main signal | Typical output | Common use |
|---|---|---|---|
Supervised learning | Labelled data | Prediction | Classification, regression |
Unsupervised learning | Unlabelled data | Structure | Clustering, segmentation |
Semi-supervised learning | Few labels, many unlabelled examples | Prediction | Low-label data problems |
Reinforcement learning | Rewards and penalties | Policy or action strategy | Games, robotics, control |
The number is not fixed forever because the field evolves. For example, self-supervised learning has become very important in language and vision models, where the system creates learning tasks from the data itself. Still, if someone asks “how many types of machine learning should I learn first?”, the practical answer is four.
These categories also map to common project decisions. A bank predicting loan default is likely using supervised learning. A retailer grouping customers by purchase behaviour is likely using unsupervised learning. A robot learning to walk through trial and error is closer to reinforcement learning.
The different types of learning in AI are best understood by looking at the data, the training objective and the final output. Below is a beginner-friendly explanation of each major type, with the ideas you should remember for interviews, projects and coursework.
Supervised learning uses labelled data. Each training example has an input and a known correct output. The model learns the relationship between the two, so it can predict the output for future inputs.
For example, an email spam classifier can learn from past emails marked as “spam” or “not spam”. A house price model can learn from data containing house size, location, number of rooms and final sale price. In both cases, the model is guided by correct answers during training.
The training process is similar to solving many practice questions with an answer key. The model makes a prediction, compares it with the true answer and updates itself to reduce future errors. This error-reducing process is central to many supervised algorithms.
Common supervised learning algorithms include linear regression, logistic regression, decision trees, random forests, support vector machines and neural networks. Libraries such as scikit-learn provide widely used implementations and documentation for many of these methods.
There are two main type of supervised learning problems beginners should know: classification and regression. Classification predicts a category. Regression predicts a numeric value.
In classification, the answer belongs to a fixed set of classes. Examples include predicting whether a transaction is fraudulent, whether a patient has a disease risk category or whether a product review is positive, neutral or negative. The output is usually a label.
In regression, the answer is a continuous number. Examples include predicting sales revenue, delivery time, temperature, electricity demand or property price. The output is usually a value on a scale.
Supervised task | Output | Example |
|---|---|---|
Binary classification | Two classes | Fraud or not fraud |
Multiclass classification | More than two classes | Image category |
Regression | Number | Price prediction |
Multi-label classification | Multiple labels | Tags for an article |
Classification and regression can look similar at first because both use labelled data. The difference is the nature of the target variable. If the target is a category, it is classification; if it is a number, it is regression.
Unsupervised learning uses data without labelled answers. The model is not told what the correct output should be. Instead, it searches for hidden patterns, groups, structures or relationships in the data.
A common example is customer segmentation. A business may have purchase history, browsing behaviour and location data, but no predefined customer categories. An unsupervised model can group similar customers, helping the business understand different behaviour patterns.
Another example is dimensionality reduction. High-dimensional data, such as images or user activity logs, may contain many variables. Techniques like principal component analysis can reduce the number of features while preserving useful structure, making the data easier to visualise or model.
Unsupervised learning is powerful for exploration, but it does not automatically tell you what the discovered groups mean. A cluster is not a business insight by itself. A human still needs to interpret it using domain knowledge.
Semi-supervised learning sits between supervised and unsupervised learning. It is useful when you have a small amount of labelled data and a large amount of unlabelled data. The model uses both to improve learning.
This situation is common in real projects because labelling data can be expensive, slow or dependent on experts. For example, medical images may require doctors to label them. Legal documents may require trained reviewers. In such cases, using unlabelled data intelligently can reduce the burden.
A typical semi-supervised approach starts with a model trained on the labelled examples. The model then makes predictions on unlabelled data, and the most confident predictions may be used to continue training. This must be done carefully, because wrong pseudo-labels can reinforce mistakes.
Semi-supervised learning is useful for students to understand because many real datasets are messy and incomplete. In classroom problems, labels often look perfectly prepared. In industry, the bigger challenge is often getting reliable labels in the first place.
Reinforcement learning trains an agent to make decisions through interaction with an environment. The agent takes an action, the environment changes and the agent receives a reward or penalty. Over time, the agent learns a strategy that maximises long-term reward.
The key idea is delayed feedback. In supervised learning, each example usually has a correct answer. In reinforcement learning, an action may look good now but cause problems later. The system must learn from sequences of decisions.
A simple example is a game-playing agent. It does not need a labelled dataset of every correct move. Instead, it plays, receives feedback from wins, losses or scores, and gradually learns better actions. Robotics, resource allocation and control systems can also use this idea.

Important reinforcement learning terms include agent, environment, state, action, reward and policy. The policy is the learned strategy that tells the agent what action to take in a given state. Frameworks such as Gymnasium are commonly used for learning and experimenting with reinforcement learning environments.
The types of learning in artificial intelligence become easier to remember when you connect them to everyday systems. The same AI application may use more than one learning type, but the examples below show the most natural fit.
In supervised learning, a bank can train a model to predict whether a transaction is suspicious. The training data may include past transactions and outcomes from investigation teams. Once trained, the model can flag new transactions for review.
In unsupervised learning, a streaming platform can group users based on viewing behaviour. The model may discover patterns such as users who watch short comedy clips, users who binge long series or users who switch across genres. These groups can support recommendations and content planning.
In semi-supervised learning, an education platform may have a small set of student doubts manually labelled by topic and thousands of unlabelled doubts. A model can learn from the labelled questions and use patterns in the larger unlabelled set to improve topic classification. This can make routing questions to mentors more efficient.
In reinforcement learning, a warehouse robot can learn movement strategies in a simulated environment before being tested in real conditions. It may receive rewards for reaching a destination safely and penalties for collisions or inefficient movement. The main goal is not just prediction, but better action.
Here is another way to compare them:
Scenario | Best fit | Why |
|---|---|---|
Predict exam score from past marks | Supervised | Label is known score |
Group similar customers | Unsupervised | No fixed labels |
Classify documents with few labels | Semi-supervised | Labels are limited |
Train an agent to play a game | Reinforcement | Learns from rewards |
These examples also show why problem framing matters. If you frame a task incorrectly, you may choose the wrong data, wrong metric and wrong model. A good AI practitioner starts by identifying the learning setup before opening a tool or writing code.
Supervised learning is used wherever historical examples can teach future prediction. It appears in credit scoring, demand forecasting, medical risk prediction, churn prediction, image classification, speech recognition and resume screening. The common thread is the availability of examples with known outcomes.
Unsupervised learning is used in exploratory analysis, market segmentation, anomaly detection, topic discovery and data compression. It is especially helpful when teams do not yet know what categories exist. Analysts often use it to generate hypotheses before building predictive models.
Semi-supervised learning is used when labels are scarce but unlabelled data is abundant. This is common in healthcare, legal technology, education, document processing and computer vision. It can be valuable in Indian business contexts too, where organisations may have large operational data but limited labelled datasets.
Reinforcement learning is used in areas where decisions affect future states. Examples include robotics, game AI, recommendation strategy, traffic signal control, energy management and simulation-based planning. It is powerful, but usually harder to apply than standard supervised learning because safe experimentation and reward design are difficult.

For students planning a career, supervised learning is usually the best first deep dive. It teaches core ideas such as train-test split, loss functions, overfitting, evaluation metrics and feature engineering. Those ideas transfer well to other learning types.
If you want a structured learning path, InfraOne’s AI Builder Bootcamp is designed to help learners move from AI foundations to hands-on building. If your interest is more toward statistics, modelling and analytics, explore the Data Science program as a stronger fit.
Every learning type has strengths, but none is magic. The best choice depends on your data quality, label availability, business goal, evaluation method and deployment environment. Beginners often make the mistake of choosing a model because it sounds advanced instead of because it fits the problem.
Supervised learning depends heavily on labelled data. If labels are wrong, biased or outdated, the model will learn those weaknesses. It can also fail when future data looks very different from training data, which is called distribution shift.
Unsupervised learning can find patterns that are mathematically real but not useful. Clusters may change when you change features, scaling or algorithm settings. Since there is no single correct answer, evaluation is less straightforward than in supervised learning.
Semi-supervised learning can be sensitive to incorrect assumptions. If the unlabelled data does not follow the same pattern as the labelled data, performance may suffer. Pseudo-labelling can also amplify early model errors if not monitored carefully.
Reinforcement learning can require many trials and careful reward design. A poorly designed reward can teach the agent unintended behaviour. Real-world experimentation may be unsafe, expensive or slow, so simulation quality becomes very important.
There are also broader AI limitations across all learning types. Models can reflect bias in data, produce confident wrong outputs, struggle with rare cases and become difficult to explain. Responsible AI practice requires testing, monitoring and human oversight, not just high accuracy on a notebook.
The practical lesson is simple: start from the problem, not the algorithm. Ask what decision must be improved, what data exists, what feedback is available and how success will be measured. That discipline matters more than knowing a long list of model names.
If you are just starting, learn supervised learning first, then unsupervised learning, then semi-supervised and reinforcement learning. Build small projects for each one: a classifier, a clustering notebook, a low-label text classifier and a simple game agent.
As you practise, write down the learning type, input data, output, metric and limitation for every project. That habit will make the types of learning in AI feel practical instead of theoretical, and it will help you explain your work clearly in interviews and portfolios.
Deep learning is not usually treated as a separate learning type like supervised or unsupervised learning. It is a family of methods using neural networks, and those methods can be trained in supervised, unsupervised, self-supervised or reinforcement learning settings.
Start with supervised learning because it is easier to evaluate and appears in many beginner projects. It also teaches core concepts such as features, labels, training data, testing data, loss and accuracy.
Yes, many real systems combine learning types. For example, a recommendation product may use supervised learning for prediction, unsupervised learning for user grouping and reinforcement learning ideas for long-term decision optimisation.
Look at the feedback available to the model. Labelled answers suggest supervised learning, unlabelled pattern discovery suggests unsupervised learning and action-based reward feedback suggests reinforcement learning.
It is less common than supervised learning in everyday analytics because it needs sequential decisions, experimentation and reward design. Most business analytics problems begin with supervised prediction, forecasting or segmentation.

A practical cheat sheet of prompt engineering techniques for choosing zero-shot, few-shot, chain-of-thought, role prompting, RAG prompts and more.
Jai Jha· 25 Nov 2026· 10 min read
A free AI course can teach you more than you think, but it stops short in a few costly places. Here is an honest comparison of free vs paid AI learning on certificates, projects, mentorship and jobs.
Aakash Sharma· 24 Nov 2026· 13 min read
Learn how to build a chatbot from idea to testing using beginner-friendly no-code and code options, free tools, and a simple AI workflow.
Aakash Sharma· 20 Nov 2026· 10 min read