Deep Learning Exam Guide
Deep Learning Exam Guide
ChatGPT gpt-5-6
Absolutely. 👍
Send me one Deep Learning topic at a time, and I’ll explain each topic in an exam-oriented + easy-
to-understand way.
2. Easy Explanation
I’ll explain the concept in simple language so you actually understand it.
3. Key Points
Important points that are likely to help in a 3–5 mark answer.
4. Example
A simple real-world or technical example wherever useful.
5. Diagram
I’ll provide a simple exam-friendly diagram wherever possible, which you can reproduce in your
answer sheet.
6. Exam Answer
A concise, properly structured answer that you can write directly in the mid-sem exam.
7. Quick Revision
A few points to memorize before the exam.
ChatGPT gpt-5-6
Definition
Word vector representation is a method of representing a word as a numerical vector of real numbers
so that a machine learning model can process and understand relationships between words.
For example:
text
text
text
2. Word Embedding
Definition
Word embedding is a technique of representing words as dense, low-dimensional numerical vectors
in such a way that words with similar meanings have similar vector representations.
For example:
text
king ●
\
\
● queen
● apple
\
● orange
For example:
Example
Consider:
text
water → 0.75
milk → 0.15
food → 0.05
car → 0.01
...
So, the model learns relationships between words by observing their contexts.
text
Input Words
↓
Word Representations
↓
Neural Network
↓
Output
↓
Probability of
possible words
For example:
text
Main purpose
The neural language model learns:
4. Word2Vec
Definition
Word2Vec is a popular neural-network-based technique used to learn word embeddings from large
amounts of text.
It was introduced by researchers at Google and became popular because it can efficiently learn
meaningful relationships between words.
text
5. Skip-Gram Model
Definition
The Skip-Gram model learns word embeddings by using a target word to predict its surrounding
context words.
For example:
text
text
cat
text
The drinks
\ /
\ /
cat
text
cat → The
cat → drinks
6. Skip-Gram Architecture
Suppose the sentence is:
text
Target Word
│
"cat"
│
▼
┌─────────────┐
│ Word2Vec │
│ Skip-Gram │
└─────────────┘
/ | \
↓ ↓ ↓
"The" "drinks" "..."
Context words
Conceptual flow
text
Input
│
▼
Target
"cat"
│
▼
Word Embedding
│
▼
Neural Network
│
▼
Probability of
Context Words
text
text
(cat, The)
(cat, drinks)
The model learns to predict The and drinks when it receives cat.
Another example
Sentence:
text
Context words:
text
love
learning
Training pairs:
text
So Skip-Gram learns:
text
machine → love
machine → learning
By doing this over a huge amount of text, the model learns useful representations for every word.
Example:
text
text
After training on a large corpus, words that occur in similar contexts tend to obtain similar vectors.
For example:
P (drinks∣cat)
The model tries to make this probability high if cat and drinks commonly occur near each other.
T
max ∑ ∑ log P (wt+j ∣wt )
t=1 −c≤j≤c,j=0
Where:
wt = target word
For example:
text
semantic similarity
syntactic similarity
Applications
Machine Translation
Sentiment Analysis
Text Classification
Information Retrieval
Question Answering
Chatbots
Document Similarity
The Skip-Gram model takes a target word as input and tries to predict the surrounding context words.
For example, in the sentence "The cat drinks milk", if cat is the target word, the model tries to predict
nearby words such as The and drinks.
text
Target Word
"cat"
│
▼
┌─────────────┐
│ Skip-Gram │
└─────────────┘
/ \
↓ ↓
During training, the model adjusts the word vectors using backpropagation and gradient descent.
After training on a large text corpus, words occurring in similar contexts obtain similar vector
representations.
Thus, Skip-Gram is useful for learning semantic and syntactic relationships between words.
🧠 Quick Revision
Remember this chain:
text
Word
↓
Word Embedding
↓
Word2Vec
↓
Skip-Gram
↓
Target Word → Context Words
One-line definitions
Word Embedding: Dense vector representation that captures relationships between words.
Neural Language Model: Neural network that learns language patterns and predicts words.
CBOW:
Context → Target Word
Skip-Gram:
Target Word → Context Words
ChatGPT gpt-5-6
1. Model Architecture
Definition
Model architecture refers to the overall structure of a neural network, including its input layer, hidden
layers, output layer, connections, and activation functions.
text
NEURAL NETWORK
x₁ ───────────► h₁ ───────────┐
x₂ ───────────► h₂ ───────────┼──► y₁
x₃ ───────────► h₃ ───────────┼──► y₂
x₄ ───────────► h₄ ───────────┘ ...
Main components
In a language model
For example:
text
2. Hidden Layer
Definition
A hidden layer is the intermediate layer between the input and output layers that performs
computations and learns useful features or patterns from the input.
It is called hidden because its values are not directly visible as the final output.
Basic working
Each neuron receives inputs, multiplies them by weights, adds a bias, and applies an activation
function.
z = ∑ wi xi + b
Then:
h = f(z)
Where:
xi = input
wi = weight
b = bias
f = activation function
h = hidden-layer output
Diagram
text
x₁ ───────┐
x₂ ───────┼──────► h₁
The hidden layer transforms the input into a representation that is useful for making the final
prediction.
In Word2Vec
In Word2Vec, the hidden layer can be viewed as the layer where the word embedding is obtained.
text
Target Word
↓
Input Layer
↓
Hidden Layer
↓
Word Vector
So, remember:
3. Output Layer
Definition
The output layer is the final layer of a neural network that produces the prediction or result.
For a language model, the output layer gives the probability of possible words.
Example
Suppose the input is:
I love
text
Word Probability
----------------------
you 0.45
coding 0.25
music 0.15
food 0.10
car 0.05
Diagram
text
Hidden Layer
│
▼
┌───────────────┐
│ Output Layer │
└───────────────┘
│ │ │
▼ ▼ ▼
you coding music
0.45 0.25 0.15
ezi
P (yi ) =
∑j ezj
Example:
text
Output Layer
│
Softmax Function
│
┌───────────┼───────────┐
↓ ↓ ↓
cat dog car
0.70 0.20 0.10
Therefore:
text
INPUT
│
▼
Word / Word ID
│
▼
Word Embedding
│
▼
┌───────────┐
│ Hidden │
│ Layer │
└───────────┘
│
▼
┌───────────┐
│ Output │
│ Layer │
└───────────┘
│
▼
Softmax
│
▼
Predicted Word
Simple example
Input:
The cat is
sleeping
text
⭐ Exam-Ready Answer
Model Components in Neural Networks
A neural network model consists mainly of an input layer, hidden layer(s), and output layer. These
layers are connected through weights and biases.
Architecture represents the overall arrangement and connections between these layers.
The hidden layer performs computations on the input and learns useful features or representations.
Each neuron calculates a weighted sum of inputs and applies an activation function.
h = f(W x + b)
The output layer produces the final prediction. In a neural language model, it generates probabilities
for possible words. Softmax is commonly used to convert output scores into probabilities.
text
Thus, the hidden layer learns useful representations, while the output layer produces the final result.
🧠 Quick Revision
Remember:
ChatGPT gpt-5-6
text
Word2Vec
│
┌────────┴────────┐
↓ ↓
CBOW Skip-Gram
│
↓
Subsampling + Negative
Sampling
1. CBOW Model
Definition
CBOW (Continuous Bag of Words) is a Word2Vec model that predicts a target word from its
surrounding context words.
Example
Consider the sentence:
text
CBOW takes:
text
"The" + "drinks"
text
"cat"
Diagram
text
Context Words
┌───────┬───────┐
↓ ↓ ↓
"The" "drinks"
\ /
\ /
▼ ▼
┌──────────┐
│ CBOW │
│ Model │
└──────────┘
│
▼
Target Word
text
CBOW uses:
text
love + learning
to predict:
text
machine
text
CBOW Architecture
text
Context Words
│
┌─────┴─────┐
↓ ↓
Word Vector Word Vector
The context word vectors are combined, commonly by taking their average, and the model uses this
representation to predict the target word.
3. CBOW vs Skip-Gram ⭐
This is very important for exams.
CBOW Skip-Gram
Works well for frequent words Often better for rare words
Uses multiple context words as input Uses one target word as input
Easy trick 🧠
CBOW = Context Before/around → Output Word
Examples:
text
Therefore, Word2Vec can use subsampling to randomly remove some occurrences of very frequent
words.
Example
Sentence:
text
occur frequently.
text
text
Important point
Subsampling does not mean removing all frequent words.
It means:
5. Negative Sampling
Definition
Negative Sampling is a technique used in Word2Vec to make training much faster by training the
model to distinguish between real word-context pairs and randomly selected incorrect pairs.
text
1,000,000 words
If we use a normal Softmax, the model may need to calculate probabilities for all 1,000,000 words.
Negative Sampling solves this problem by considering only a small number of negative examples.
For Skip-Gram:
text
Target = cat
Context = drinks
text
(cat, drinks) → 1
Now randomly select words that are not the actual context:
text
(cat, car) → 0
(cat, computer) → 0
(cat, banana) → 0
Diagram
text
Target
"cat"
│
┌──────────┴──────────┐
↓ ↓
Positive Pair Negative Pairs
(cat, drinks) (cat, car)
│ (cat, banana)
↓ (cat, computer)
1 0
text
text
(cat, drinks)
we create:
text
The model only needs to update these few examples instead of calculating probabilities for the entire
vocabulary.
Flow
text
Target Word
│
▼
"cat"
│
▼
┌──────────────┐
│ Word2Vec │
│ │
└──────────────┘
/ \
↓ ↓
Real Context Random Words
"drinks" "car", "phone"
1
σ(x) =
1 + e−x
Output:
text
For example:
text
Negative Sampling:
⭐ Exam-Ready Answer
CBOW Model
CBOW (Continuous Bag of Words) is a Word2Vec architecture that predicts a target word using its
surrounding context words.
For example, in "The cat drinks milk", the context words "The" and "drinks" can be used to predict
"cat".
text
CBOW is generally faster to train and works well for frequent words.
text
Frequent Words
↓
Randomly discard some occurrences
↓
Reduced Training Data
Negative Sampling
Negative Sampling is a technique that speeds up Word2Vec training by training the model using a
small number of positive and negative word pairs instead of calculating probabilities for the entire
vocabulary.
For example:
text
It significantly reduces computational complexity and makes Word2Vec suitable for large datasets.
🔥 Last-Minute Revision
text
CBOW:
Context → Target
Skip-Gram:
Target → Context
Subsampling:
Remove some frequent words
Negative Sampling:
Use positive + random negative pairs
CBOW predicts a target word from context, subsampling removes some frequent words to
reduce unnecessary training, and negative sampling uses a few incorrect word pairs to make
Word2Vec training faster.
ChatGPT gpt-5-6
When predicting the next word, normal Softmax calculates a probability for every word in the
vocabulary.
Normal Softmax
text
Hidden Layer
│
▼
┌─────────────┐
│ Softmax │
└─────────────┘
/ | | \
↓ ↓ ↓ ↓
word1 word2 ... word1M
This is computationally expensive because the model must calculate scores for a huge number of
words.
Therefore:
Efficient Softmax approximations reduce the computational cost of calculating the Softmax
over a large vocabulary.
1. Hierarchical Softmax
2. Sampling-based methods
Negative Sampling
3. Hierarchical Softmax
Hierarchical Softmax represents the vocabulary using a binary tree.
text
Normal Softmax:
Target
↓
Compare with
all vocabulary words
↓
Very expensive
text
Root
/ \
/ \
Node Node
/ \ / \
/ \ / \
Word Word Word Word
To find the probability of a word, the model follows a path from the root to the target word.
Key idea
Definition
Sampling-based Softmax approximation reduces computation by evaluating only a small subset of
words instead of the entire vocabulary.
text
1,000,000 words
↓
Calculate Softmax for all
↓
Very expensive
we use:
text
1,000,000 words
↓
Sample a small number
↓
Example: 1 positive + 10 negatives
↓
Much faster
5. Negative Sampling
Negative Sampling is one of the most important sampling-based techniques used with Word2Vec.
Suppose:
text
Target = cat
Correct context = drinks
text
(cat, drinks) → 1
text
(cat, car) → 0
(cat, phone) → 0
(cat, table) → 0
Instead of calculating probabilities for the entire vocabulary, the model learns to distinguish:
text
Real pair → 1
Wrong pair → 0
Advantage
It makes training much faster, especially when the vocabulary is very large.
6. GloVe
Full form
GloVe = Global Vectors for Word Representation
Definition
GloVe is an unsupervised word embedding method that learns word vectors using the statistical
information of word co-occurrences in a large corpus.
and
text
apples ●
\
\
● bananas
● car
|
|
vehicle
Suppose we have:
text
The values represent how frequently words occur together within a particular context/window.
text
Important point
Unlike Word2Vec, which primarily learns from local context prediction, GloVe explicitly uses global
word co-occurrence statistics.
GloVe → Count/Co-occurrence
Sentiment analysis
Text classification
Machine translation
Information retrieval
Definition
Cross-lingual word embeddings represent words from different languages in a shared vector space.
For example:
text
English Hindi
Words with similar meanings in different languages are mapped to similar locations.
text
king ● राजा ●
queen ● रानी ●
text
king ● ● राजा
queen ● ● रानी
house ● ● घर
text
text
English Hindi
king ↔ राजा
water ↔ पानी
house ↔ घर
text
Machine Translation
Multilingual Search
Question Answering
For example, a model trained using large amounts of English data can potentially transfer some
knowledge to a language with less training data.
⭐ Exam-Ready Answer
Efficient Softmax Approximations
In language models, the Softmax function becomes computationally expensive when the vocabulary
is very large. Efficient Softmax approximations reduce this cost by avoiding computation over the
complete vocabulary. Important techniques include Hierarchical Softmax and sampling-based
methods such as Negative Sampling.
Hierarchical Softmax represents words using a binary tree and calculates the probability by following
a path from the root to the target word.
text
Root
/ \
Node Node
/ \ / \
Word Word Word Word
Thus, the computation can be reduced from approximately O(V) to O(log V).
GloVe
GloVe (Global Vectors for Word Representation) is an unsupervised word embedding method that
learns word vectors using global word-word co-occurrence statistics from a large corpus.
text
Corpus
↓
Co-occurrence Matrix
↓
GloVe Training
↓
Word Vectors
GloVe produces vectors in which words with similar meanings or similar contexts are located close to
each other.
For example:
text
English Hindi
They are useful in machine translation, multilingual information retrieval, sentiment analysis, and
multilingual NLP applications.
🧠 Last-Minute Revision
text
Efficient Softmax
↓
Reduce Softmax computation
Hierarchical Softmax
↓
Binary Tree
↓
O(log V)
Negative Sampling
↓
Positive + Negative samples
GloVe
↓
Global word co-occurrence
↓
Word vectors
Cross-Lingual Embedding
↓
Different languages
↓
Shared vector space