Zero Labs
Industry News / AI

Recurrent Neural Networks (RNN) From Scratch: The First Step Toward Modern LLMs

Source · Towards AI By Alok Ranjan Singh

From the publisher’s feed, collected in the ZeroLabs newsroom.

A complete derivation of Backpropagation Through Time (BPTT), gradient flow, truncation, and full training mechanics.Why RNNs MatterTraditional Neural Networks treat inputs and outputs as independent.This means they have no built-in way to remember what came before.But real-world sequential data — like text, time series, and speech — comes in order, and the order matters.The word “bank” means something different depending on whether it appears in “river bank” or “savings bank.”A model that sees each word independently cannot resolve this ambiguity.Monday’s temperature helps us predict what the weather will be like on Tuesday.A model without memory must ignore this dependency.Recurrent Neural Networks were designed specifically to address this limitation.Unlike normal neural networks (feedforward networks), RNNs have a kind of memory.This memory changes and keeps important information from earlier steps while processing the current input.Because of this, RNNs work surprisingly well with sequences.This simple idea of carrying information forward makes RNNs useful in many real-world tasks.Machine translation (Google Translate)Voice assistants (Siri, Alexa)Early text generation modelsTime series forecasting (stock prices, weather)RNNs are not easy to work with.They have serious problems during training, but researchers have found smart solutions to fix them. These ideas are now a big part of how modern deep learning works.In this article, we will build an RNN step by step — from intuition, to equations, to full backpropagation through time.RNN Intuition: Processing Sequences One Step at a TimeUnlike feedforward networks, which process the entire input at once, a Recurrent Neural Network processes a sequence one element at a time. At each time step, the network receives the current input and also carries forward information from everything it has seen so far.This carried-forward information is what allows the network to understand context in a sequence. For example, when reading a sentence word by word, the meaning of the current word often depends on the words that came before it.The Hidden State: The Memory of an RNNThe information from previous time steps is stored in an internal representation called the hidden state. The hidden state summarizes what the network has learned from the sequence up to the current time step.You can think of the hidden state as the network’s evolving memory. As new inputs arrive, this memory is updated, refined, and passed forward to the next step.Importantly, the hidden state is not fixed. It changes at every time step based on:the current input (Xₜ)the previous hidden state (hₜ₋₁)Recurrence and Weight SharingThe term recurrent comes from the fact that the same computation is repeated at every time step. The network does not learn a new set of parameters for each position in the sequence.Instead, the same weights are reused across all time steps. What changes over time is:the input at the current stepthe hidden state carrying past informationThis weight sharing is what allows RNNs to handle sequences of different lengths and generalize patterns across time.Why Share Weights Across Time?Weight sharing is not just a design choice — it is essential.1. Fewer ParametersIf the RNN used different weights at each time step:longer sequences would require more parameterstraining would become slower and memory-intensiveBy sharing weights, one set of parameters works for all time steps.2. Variable-Length SequencesBecause the same weights are reused, RNNs can process:short sequenceslong sequencessequences of different lengthsThis makes them suitable for text, speech, and time series data.3. Learning Consistent PatternsSharing weights allows the RNN to learn a single rule and apply it repeatedly across time.Just like humans use the same grammar rules for every sentence, the RNN applies the same transformation at each step.Initial Hidden State: Starting the MemoryBefore an RNN starts processing a sequence, it needs an initial memory. This starting memory is called the initial hidden state.We usually initialize the initial hidden state as:h₀ = 0This means the network starts with no prior information. It is similar to reading a sentence with a clean slate.Why Initialize with Zeros?Zero initialization is simple and neutral. It does not bias the network toward any particular pattern.During training, the RNN quickly learns how to build useful memory from the actual inputs, so starting from zero works well in practice.Batch-wise InterpretationWhen processing a batch of sequences:each sequence gets its own hidden statehidden states do not share information across sequencesall hidden states start from zero independentlyThis prevents information leakage between different samples.Shape IntuitionIf:batch size = Bhidden size = HThen: h₀ has shape (B, H)The hidden size controls how much information the RNN can store at each time step.Hidden State Update EquationNow that we understand the intuition, we can write the hidden state update mathematically.At time step t, the hidden state is computed as:Here:Xₜ is the input at time step thₜ₋₁​ is the hidden state from the previous time stepWₓₕ​ maps the input to the hidden stateWₕₕ​ maps the previous hidden state to the current onebₕ​ is a bias termtanh introduces nonlinearity and keeps values boundedThis equation shows that the current hidden state depends both on the current input and on the memory of the past.Because each hidden state depends on the previous one, information — and later, errors — can flow backward through time during training.Producing Outputs from an RNNSo far, we have seen how an RNN processes a sequence and maintains an evolving hidden state that summarizes past information. However, the hidden state by itself is not usually the final goal.In most tasks, we want the network to produce outputs or predictions based on what it has learned from the sequence.For example:predicting the next word in a sentenceclassifying each word in a sentenceforecasting the next value in a time seriesTo do this, we must define how the hidden state is converted into an output.Why We Need a Separate Output LayerThe hidden state is designed to store information useful for the task, but it is not constrained to represent a valid prediction. Its values can be any real numbers and do not directly correspond to probabilities or target labels.To turn the hidden state into a usable prediction, we introduce a separate output layer.This separation has an important advantage:the hidden state focuses on representing context and memorythe output layer focuses on producing task-specific predictionsOutput Computation at Each Time StepAt each time step t, the RNN produces an output ŷₜ based on the current hidden state hₜ​.This is done using a simple linear transformation followed by an optional activation function:Here:hₜ​ is the hidden state at time step tWₕₒ maps the hidden state to the output spacebₒ​ is a bias termZₒ⁽ᵗ⁾ is called the output logitsThe logits are then passed through an activation function that depends on the task.From Logits to PredictionsThe choice of output activation depends on the problem we are solving.Classification (e.g., next-word prediction)When predicting a categorical label, we apply the softmax function:This converts the logits into a probability distribution over possible classes.Regression (e.g., time series forecasting)When predicting a real value, we often use no activation or a linear activation:In both cases, the prediction at time step t depends only on the hidden state at that step, which already contains information from all previous inputs.One Output vs. Many OutputsRNNs are flexible in how outputs are produced:Many-to-many: an output at every time step (e.g., sequence labeling)Many-to-one: only the final hidden state produces an output (e.g., sentiment analysis)One-to-many: a single input produces a sequence of outputs (e.g., text generation)Mathematically, the mechanism is the same. The difference lies only in which hidden states we choose to connect to the output layer.Defining the Loss FunctionTo train the RNN, we must measure how good its predictions are. This is done using a loss function.When outputs are produced at every time step, we compute a loss at each step:where:yₜ is the true targetŷₜ is the predicted outputℓ(⋅) is a task-specific loss functionFor example:cross-entropy loss for classificationmean squared error for regressionThe total loss over the sequence is then defined as the sum of losses across time:This definition is crucial, because it makes explicit that errors at all time steps contribute to learning.Why This Matters for TrainingNotice an important detail:each loss Lₜ depends on hₜeach hidden state hₜ depends on hₜ₋₁This means that the total loss depends on every hidden state in the sequence, which in turn depends on all previous ones.As a result, when we compute gradients during training, we cannot treat each time step independently. Gradients must flow backward through time, following the same dependencies that were used during the forward pass.A Minimal Code Example (Forward Pass Only)Below is a minimal example showing the forward computation of an RNN producing outputs at each time step.import numpy as np# ---------- helper functions ----------def tanh(x): return np.tanh(x)def dtanh_from_h(h): # derivative of tanh given h = tanh(z) => 1 - h^2 return 1.0 - h**2def softmax(z): z = z - np.max(z) # numeric stability exp_z = np.exp(z) return exp_z / np.sum(exp_z, axis=0, keepdims=True)def cross_entropy(y_true, y_pred): # y_true: one-hot column vector (output_dim,1) # y_pred: probabilities column vector eps = 1e-12 return -np.sum(y_true * np.log(y_pred + eps))def clip_gradients(grads, threshold, eps=1e-6): # grads: list of numpy arrays (in-place scaling) total_norm = np.sqrt(sum(np.sum(g**2) for g in grads)) if total_norm > threshold: scale = threshold / (total_norm + eps) for g in grads: g *= scale# ---------- model hyperparams ----------input_dim = 4hidden_dim = 8output_dim = 3T = 5 # sequence lengthlearning_rate = 1e-2num_epochs = 200clip_threshold = 5.0truncation_M = None # set to int for TBPTT, or None for full BPTT# ---------- initialize parameters ----------rng = np.random.RandomState(123)W_xh = rng.randn(hidden_dim, input_dim) * 0.1W_hh = rng.randn(hidden_dim, hidden_dim) * 0.1W_ho = rng.randn(output_dim, hidden_dim) * 0.1b_h = np.zeros((hidden_dim, 1))b_o = np.zeros((output_dim, 1))params = {'W_xh': W_xh, 'W_hh': W_hh, 'W_ho': W_ho, 'b_h': b_h, 'b_o': b_o}# ---------- dummy data (single sequence) ----------X = [rng.randn(input_dim, 1) for _ in range(T)]# example: random one-hot targetsy_true = [np.zeros((output_dim, 1)) for _ in range(T)]y_true[0][0,0] = 1 # just an example; replace with real targets# ---------- forward pass loop ----------for epoch in range(1, num_epochs+1): # Forward pass hs = {} # activated hidden states h_t zs_h = {} # pre-activation z_h zs_o = {} # output logits z_o ys = {} # predictions hs[-1] = np.zeros((hidden_dim, 1)) # h_0 = 0 total_loss = 0.0 for t in range(T): x_t = X[t] z_h = W_xh @ x_t + W_hh @ hs[t-1] + b_h # z_h^{(t)} h_t = tanh(z_h) # h_t z_o = W_ho @ h_t + b_o # z_o^{(t)} y_hat = softmax(z_o) # y_hat_t zs_h[t] = z_h hs[t] = h_t zs_o[t] = z_o ys[t] = y_hat total_loss += cross_entropy(y_true[t], y_hat)This code mirrors the equations exactly and will serve as the foundation for deriving gradients in the next section.A Concrete Forward-Pass ExampleTo make the forward pass more intuitive, let’s walk through a simple example.Suppose we are training a character-level RNN to predict the next character in the word “cat”.Time Step 0 (Initialization)Before reading any character: h₀ = 0The network has no memory.Time Step 1Input: ‘c’The RNN:reads ‘c’updates its hidden state to h₁produces a probability distribution for the next characterAt this point, the memory represents information about ‘c’.Time Step 2Input: ‘a’The RNN:uses h₁ to remember ‘c’reads ‘a’updates memory to h₂Now the hidden state represents information about “ca”.Time Step 3Input: ‘t’The RNN:remembers ‘c’ and ‘a’reads ‘t’updates memory to h₃At this point, the hidden state encodes the entire word “cat”.Key IdeaThe hidden state compresses everything seen so far into a fixed-size memory.So:h₁ remembers “c”h₂ remembers “ca”h₃ remembers “cat”This compressed memory is what allows the RNN to predict what comes next.Backpropagation Through Time (BPTT): The Core Training AlgorithmUp to this point, we have described how an RNN processes a sequence in the forward direction:inputs flow forward in timehidden states accumulate informationoutputs and losses are computed at each stepTraining the model requires adjusting its parameters so that the total loss over the sequence is minimized. To do this, we must compute gradients of the loss with respect to the parameters.This is where Backpropagation Through Time (BPTT) comes in.Why Ordinary Backpropagation Is Not EnoughIn a feedforward neural network, each layer is used exactly once in the forward pass. Gradients flow backward layer by layer, following the same structure.An RNN is different.The same parameters:WₓₕWₕₕWₕₒare reused at every time step.At the same time:each hidden state depends on the previous hidden stateeach loss depends on the hidden state at that time stepAs a result, the computation graph is no longer a simple chain of layers. It is a graph that stretches across time.Unrolling the RNN in TimeAt a conceptual level, unrolling an RNN does not create a new model.It simply exposes the hidden dependencies that already exist.Each unrolled block represents the same computation applied at a different time step.The parameters are shared, but the hidden states are different.Unrolling makes it possible to see how a loss at a later time step depends on hidden states and inputs from much earlier in the sequence.This explicit dependency is what allows us to apply the chain rule correctly.To make gradient computation possible, we conceptually unroll the RNN across time.Instead of viewing the RNN as a loop, we represent it as a sequence of identical copies — one for each time step.Each copy:has its own hidden statereceives its own inputproduces its own output and lossBut all copies share the same parameters.Unrolling does not change the model. It simply makes the dependencies explicit so that we can apply the chain rule.The Total Loss Over TimeRecall that the total loss is defined as:Lₜ depends on:the prediction yₜthe hidden state hₜAnd each hidden state depends recursively on all previous hidden states.This means that a parameter used at time step k influences:the loss at time kthe loss at time k+1…the loss at timeThis is the key idea behind BPTT.Gradient Flow Through TimeLet us focus on the hidden state h_t.The total loss depends on hₜ​ in two ways:Directly, through the loss LₜIndirectly, through future hidden states hₜ₊₁, hₜ₊₂, …Therefore, the gradient of the loss with respect to hₜ​ must include both effects.Why Each Hidden State Has Two Gradient PathsA hidden state affects the loss in two different ways.1. Direct Path (Same Time Step)The hidden state hₜ directly influences:the output at time tthe loss LₜSo part of the gradient comes from the same time step.2. Recurrent Path (Future Time Steps)The hidden state hₜ also influences:hₜ₊₁hₜ₊₂all future outputs and lossesThis means errors from future time steps also flow backward to hₜ.Total Hidden State ErrorThe total gradient with respect to hₜ is the sum of both effects:direct contributionaccumulated future contributionsh_t ───▶ Z_o^t ─▶ ŷ_t ─▶ output loss L_t │ │ └──▶ Z_h^{t+1} ─▶ h_{t+1} ─▶ ... ─▶future lossesThis is why gradient flow in RNNs is fundamentally different from feedforward networks.So, we define the total hidden-state error as:∂ (partial derivative): measures how a function changes with respect to one variable while others are fixed.δ (delta): denotes the backpropagated error signal, i.e., the total gradient accumulated at that variable.① Direct path (same time step)Since,Using the chain rule:② Recurrent path (future time steps)Since,andUsing the chain rule:Combine both paths (total hidden error)This equation is the mathematical heart of BPTT.It shows explicitly that:error flows backward from future time stepseach hidden state accumulates gradient contributions from the futurePre-Activation and the Source of NonlinearityRecall the hidden state update:To compute gradients, it is convenient to separate:the pre-activation Zₕ⁽ᵗ⁾the activation hₜSince,Using the chain rule:This step is critical:the derivative of tanh controls how gradients propagaterepeated multiplication by this term is what leads to vanishing gradientsGradients with Respect to ParametersNow we compute gradients for each parameter by summing contributions across time.Input-to-Hidden WeightsSince,Using the chain rule:Each time step contributes because the same matrix is reused.Hidden-to-Hidden WeightsSince,Using the chain rule:This term captures how errors propagate through time, not just across layers.Hidden BiasSince,Using the chain rule:Hidden-to-Output WeightsSince,From the output layer- Using the chain rule:Why Gradients Can Vanish or ExplodeTo understand why gradients vanish or explode, let’s expand the backward recurrence for the hidden state gradient.We start with the backpropagation equation:Now expand δhₜ₊₁:Substitute this back:Distribute:Expand again:If we keep expanding until the final time step T, we get:Now the Problem Becomes ClearNotice what keeps appearing:The same matrix Wₕₕ​ is multiplied again and again for every time step backward.That means the gradient contains powers of Wₕₕ.What Happens When We Raise a Matrix to a Power?If the values inside Wₕₕ​ are:Less than 1 in magnitude Each multiplication makes the result smaller. Repeating this many times makes the gradient shrink toward zero. → Gradients vanishGreater than 1 in magnitude Each multiplication makes the result larger. Repeating this many times makes the gradient grow rapidly. → Gradients explodeAnd because this multiplication happens once per time step, the effect grows exponentially with sequence length.Important InsightThis is not a bug. It is not a numerical accident.It happens because the same matrix is multiplied repeatedly through time.The recurrence itself creates powers of Wₕₕ, and powers naturally shrink or grow exponentially.Training diverges.That is the true reason RNNs struggle with long-term dependencies.What the Math Is Really Saying (Intuitively)At its core, training a recurrent network is about measuring responsibility.When we update a weight, we are asking: How much did this weight contribute to the final prediction?In a recurrent network, a weight can influence the output multiple times as information flows through the sequence. That influence accumulates across time.Because of this accumulation:Contributions from early steps can become extremely smallOr they can become disproportionately largeThis is why learning long-term dependencies can be difficult.The behavior is not accidental — it follows naturally from how recurrent models reuse the same parameters across time.Minimal Code: Backward Pass SkeletonBelow is a simplified backward-pass sketch to connect the math to code.dh_next = np.zeros((hidden_dim, 1))for t in reversed(range(T)): dy = y_hat[t] - y_true[t] # dL/dz_o dW_ho += dy @ h_t[t].T db_o += dy dh = W_ho.T @ dy + dh_next dz_h = dh * (1 - h_t[t] ** 2) dW_xh += dz_h @ X[t].T dW_hh += dz_h @ h_t[t-1].T db_h += dz_h dh_next = W_hh.T @ dz_hThis loop is BPTT — nothing more, nothing less.Truncated Backpropagation Through Time (TBPTT)From the previous section, we saw that computing exact gradients for an RNN requires propagating error signals backward through the entire sequence.In theory, this means that for a sequence of length T, gradients must flow through T time steps. In practice, this quickly becomes infeasible for long sequences.This leads to two fundamental problems:Computational cost grows linearly with sequence lengthNumerical instability causes gradients to vanish or explodeTruncated Backpropagation Through Time (TBPTT) is a practical solution to both.Why Truncation Makes SenseAlthough hidden states theoretically depend on the entire past, in many real-world tasks:very distant past information contributes littlelocal temporal dependencies dominateThis observation motivates a simple idea:Instead of backpropagating through the entire sequence, we backpropagate through only a fixed number of recent time steps.This does not change the forward computation. It only limits how far gradients are allowed to flow backward.How Truncation Works ConceptuallySuppose we choose a truncation length K.The RNN still processes the full sequence forwardThe hidden state is carried forward continuouslyDuring backpropagation, gradients are allowed to flow back only K stepsAfter K steps, the gradient is explicitly stopped.This transforms exact BPTT into an approximation, but one that is far more stable and efficient.Mathematical View of TruncationRecall the recursive gradient:Under Truncated Backpropagation Through Time (TBPTT), the recursion is stopped after m steps. This means we stop the gradient propagation at t-m, and set:Thus, the gradient at time t becomes:This means that we intentionally ignore gradient contributions from time steps earlier than t−mThe key point is that truncation modifies the gradient, not the model.Why This Is Still Valid LearningTBPTT works because learning in neural networks is inherently approximate.Stochastic gradient descent already uses noisy gradientsMini-batches approximate the true data distributionTruncation approximates long-range temporal dependenciesAs long as m is chosen reasonably, the model can still learn useful representations.Minimal Code Example: TBPTT in PracticeBelow is a simple example showing how truncation appears in code.M = 5 # truncation lengthdh_next = np.zeros_like(h)for t in reversed(range(T)): if t break # stop gradient flow dy = y_hat[t] - y_true[t] dW_ho += dy @ h[t].T db_o += dy dh = W_ho.T @ dy + dh_next dz_h = dh * (1 - h[t] ** 2) dW_xh += dz_h @ X[t].T dW_hh += dz_h @ h[t-1].T db_h += dz_h dh_next = W_hh.T @ dz_hThis single break statement is the essence of TBPTT.Gradient Clipping: Controlling ExplosionsTruncation helps limit depth, but it does not fully prevent exploding gradients.To address this, we introduce gradient clipping.Instead of modifying the model or the loss, gradient clipping modifies the update step.Clipping by NormThe most common approach is global norm clipping.Given a gradient vector g:where:τ is a predefined clipping threshold∥g∥ = norm (magnitude) of the gradientgradients are rescaled, not discardedThis preserves direction while limiting magnitude.Case 1: Gradient norm is smallIfthenSo:Thus:✅ No change to the gradient.Case 2: Gradient norm is largeIfthenSo:Thus:Now compute the new norm:✅ The gradient is rescaled so its norm becomes exactly τ\tauτ.Final InterpretationThis operation:Keeps the gradient unchanged if it’s small.Rescales it to have norm τ if it’s too large.Preserves direction (only magnitude changes).Minimal Code Example: Gradient Clippingdef clip_gradients(grads, threshold, eps=1e-6): total_norm = np.sqrt(sum(np.sum(g**2) for g in grads)) if total_norm > threshold: scale = threshold / (total_norm + eps) # eps=1e-6 avoids division by zero for g in grads: g *= scaleThis small function prevents catastrophic updates.The Complete Vanilla RNN: Putting Everything TogetherAt this point, we have derived every component of a vanilla Recurrent Neural Network from first principles:the forward passthe hidden state recurrencethe output computationthe loss over timegradient flow through timepractical training adjustmentsNow we step back and view the RNN as a single, complete learning system.The Full Forward ComputationGiven an input sequenceHidden State RecurrenceOutput Computationwhere g(⋅) is task-dependent (e.g., softmax or identity).Special Note on g:Softmax: Used for classification, where you want probabilities for each class.Identity: For tasks like regression or when you don’t need to squish the output.The Training ObjectiveThe goal of training is to minimize the total loss over the sequence:This single scalar objective drives all learning.Every parameter update is computed by asking:How does changing this parameter affect the total loss?The Backward Computation (BPTT)Using Backpropagation Through Time, gradients are computed by:Unrolling the recurrence across time (expanding the RNN through all time steps t=1 to t=T).Applying the chain rule backward from t=T to t=1, accumulating gradients.Accumulating gradient contributions from every time step to update the parameters.For the hidden state:For parameters, gradients are summed across time:This weight sharing across time is what makes RNN learning both powerful and challenging.End-to-End Training Loop (Minimal Implementation)Below is a compact but complete training sketch for a vanilla RNN.for epoch in range(num_epochs): hs = {-1: np.zeros((hidden_dim, 1))} total_loss = 0 # Forward pass hs, zs, ys = {}, {}, {} for t in range(T): zs[t] = W_xh @ X[t] + W_hh @ hs[t-1] + b_h h_t = np.tanh(zs[t]) hs[t] = h_t z_o = W_ho @ h_t + b_o ys[t] = softmax(z_o) total_loss += cross_entropy(y_true[t], ys[t]) dW_xh = np.zeros_like(W_xh) dW_hh = np.zeros_like(W_hh) dW_ho = np.zeros_like(W_ho) db_h = np.zeros_like(b_h) db_o = np.zeros_like(b_o) # Backward pass (BPTT) dh_next = np.zeros_like(h_t) for t in reversed(range(T)): dy = ys[t] - y_true[t] dW_ho += dy @ hs[t].T db_o += dy dh = W_ho.T @ dy + dh_next dz_h = dh * (1 - hs[t] ** 2) dW_xh += dz_h @ X[t].T dW_hh += dz_h @ hs[t-1].T db_h += dz_h dh_next = W_hh.T @ dz_h # Gradient clipping clip_gradients([dW_xh, dW_hh, dW_ho, db_h, db_o], threshold=5.0) # Parameter update W_xh -= learning_rate * dW_xh W_hh -= learning_rate * dW_hh W_ho -= learning_rate * dW_ho b_h -= learning_rate * db_h b_o -= learning_rate * db_oThis loop contains everything:recurrenceoutput generationloss accumulationgradient flow through timepractical stabilizationNo abstractions are hiding anything.What Vanilla RNNs Can and Cannot DoVanilla RNNs are well suited for:short-range dependenciessmall to medium sequence lengthseducational and conceptual understanding of sequence modelingHowever, due to repeated multiplication of Jacobians across time:long-range dependencies are difficult to learngradients tend to vanish or explodeThese are structural limitations, not implementation mistakes.Later architectures introduce additional mechanisms to address these issues, but the core ideas of recurrence, weight sharing, and temporal gradient flow all originate here.Closing ThoughtsRecurrent Neural Networks are no longer the dominant architecture behind large-scale language models.But they were the first serious step toward machines that could understand sequences.Before attention mechanisms.Before transformers.Before billion-parameter LLMs.RNNs introduced a powerful idea:carry information forward through time — and train it by propagating gradients backward.If you understand RNNs deeply, you understand why modern architectures evolved the way they did.Vanishing gradients.Exploding gradients.Long-term dependencies.Training instability.These are not historical artifacts — they are the engineering pressures that shaped today’s AI systems.And they still matter.About the AuthorI’m Alok — I write about AI from first principles.My focus is on understanding how things work under the hood: training dynamics, architecture design, and the mathematical ideas behind modern systems — from RNNs to RAG to multi-agent protocols.If you enjoy rigorous, step-by-step explanations of AI systems:🔗 Read more on Medium: Medium Profile LinkI also share technical insights and discussions on LinkedIn: 🔗 LinkedIn Profile LinkMore deep dives coming.Recurrent Neural Networks (RNN) From Scratch: The First Step Toward Modern LLMs was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.