<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Deep Learning on Chen Kai Blog</title><link>https://www.chenk.top/en/tags/deep-learning/</link><description>Recent content in Deep Learning on Chen Kai Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 07 Feb 2026 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/en/tags/deep-learning/index.xml" rel="self" type="application/rss+xml"/><item><title>ML Math Derivations (19): Neural Networks and Backpropagation</title><link>https://www.chenk.top/en/ml-math-derivations/19-neural-networks-and-backpropagation/</link><pubDate>Sat, 07 Feb 2026 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/ml-math-derivations/19-neural-networks-and-backpropagation/</guid><description>&lt;p>&lt;figure class="article-figure">
 &lt;img src="https://blog-pic-ck.oss-cn-beijing.aliyuncs.com/posts/en/ml-math-derivations/19-Neural-Networks-and-Backpropagation/illustration_1.png" alt="ML Math Derivations (19): Neural Networks and Backpropagation — Chapter overview" loading="lazy" decoding="async" class="content-image">
 
&lt;/figure>
&lt;/p>
&lt;hr>
&lt;blockquote>
&lt;p>&lt;strong>Hook.&lt;/strong> In 1969 Minsky and Papert proved that a single perceptron could not learn XOR, and connectionist research went into a fifteen-year freeze. The thaw came when Rumelhart, Hinton and Williams realised that &lt;em>stacking&lt;/em> perceptrons makes the problem disappear — and that the same chain rule everyone learns in calculus, applied carefully, computes every gradient in a multilayer network for the cost of a single extra forward pass. That algorithm is backpropagation. Every gradient in every Transformer, every diffusion model, every GPT trained today still runs on it.&lt;/p></description></item><item><title>Recommendation Systems (4): CTR Prediction and Click-Through Rate Modeling</title><link>https://www.chenk.top/en/recommendation-systems/04-ctr-prediction/</link><pubDate>Wed, 10 Dec 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/recommendation-systems/04-ctr-prediction/</guid><description>&lt;p>Every time you scroll through a social-media feed, click a product recommendation, or watch a suggested video, a CTR (click-through rate) model decides what to show you. These models answer one deceptively small question:&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>&amp;ldquo;What is the probability that this specific user will click on this specific item, right now?&amp;rdquo;&lt;/strong>&lt;/p>
&lt;/blockquote>
&lt;p>Behind that question lies one of the most economically valuable problems in machine learning. A 1% lift in CTR translates into millions of dollars at the scale of Google, Amazon, or Alibaba — and the same models also drive video feeds, app stores, news apps, and dating apps. CTR prediction sits at the heart of the &lt;strong>ranking&lt;/strong> stage: candidate generation gives you a few thousand items, and the CTR model decides which dozen actually reach the user.&lt;/p></description></item><item><title>Recommendation Systems (3): Deep Learning Foundations</title><link>https://www.chenk.top/en/recommendation-systems/03-deep-learning-basics/</link><pubDate>Sun, 07 Dec 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/recommendation-systems/03-deep-learning-basics/</guid><description>&lt;p>In June 2016, Google published a one-page paper that quietly redrew the map of recommendation systems. The paper described &lt;strong>Wide &amp;amp; Deep Learning&lt;/strong>, the model then powering app recommendations inside Google Play — a billion-user product. Within a year, every major tech company had a deep model in production. By 2019, the industry standard had shifted: matrix factorization was a baseline, not a system.&lt;/p>
&lt;p>What changed? Multi-layer neural networks brought four capabilities classical methods could not deliver:&lt;/p></description></item><item><title>NLP (6): GPT and Generative Language Models</title><link>https://www.chenk.top/en/nlp/gpt-generative-models/</link><pubDate>Sun, 26 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/gpt-generative-models/</guid><description>&lt;p>When you ask ChatGPT a question and a fluent multi-paragraph answer streams back token by token, you are watching a single deceptively simple loop: feed everything-so-far into a Transformer decoder, look at the probability distribution it produces over the vocabulary, pick one token, append it, repeat. That is &lt;em>all&lt;/em> an autoregressive language model does. The miracle is not the loop — it is what happens when you scale the network behind the loop to hundreds of billions of parameters and train it on most of the internet.&lt;/p></description></item><item><title>NLP (5): BERT and Pretrained Models</title><link>https://www.chenk.top/en/nlp/bert-pretrained-models/</link><pubDate>Tue, 21 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/bert-pretrained-models/</guid><description>&lt;p>In October 2018, Google released BERT and broke eleven NLP benchmarks at once. The recipe is almost embarrassingly simple: take a Transformer encoder, train it to predict words that have been randomly hidden using both left and right context, and then fine-tune the same pretrained model for whatever downstream task you have. Before BERT, every task came with its own from-scratch model. After BERT, &amp;ldquo;pretrain once, fine-tune everywhere&amp;rdquo; became the default mental model for the entire field.&lt;/p></description></item><item><title>NLP (4): Attention Mechanism and Transformer</title><link>https://www.chenk.top/en/nlp/attention-transformer/</link><pubDate>Thu, 16 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/attention-transformer/</guid><description>&lt;p>In June 2017, eight researchers at Google Brain and Google Research published a paper with a deliberately bold title: &lt;em>Attention Is All You Need&lt;/em>. The architecture it introduced, the &lt;strong>Transformer&lt;/strong>, threw away recurrence entirely. There were no LSTMs, no GRUs, no left-to-right scanning of a sentence. Instead, every token in a sequence could look at every other token directly through a single mathematical operation: scaled dot-product attention.&lt;/p>
&lt;p>That one design decision unlocked massive parallelism on GPUs, eliminated the long-range dependency problems that had plagued RNNs for decades, and became the substrate on which BERT, GPT, T5, LLaMA, Claude, and essentially every modern large language model is built. If you understand this article well, the rest of the series is mostly variations on a theme.&lt;/p></description></item><item><title>NLP (3): RNN and Sequence Modeling</title><link>https://www.chenk.top/en/nlp/rnn-sequence-modeling/</link><pubDate>Sat, 11 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/rnn-sequence-modeling/</guid><description>&lt;p>Open Google Translate, swipe-type a message, or dictate a memo to your phone — all these systems consume an ordered stream of tokens and produce another. A feed-forward network processes each input independently, but language is fundamentally &lt;strong>sequential&lt;/strong>: the meaning of &amp;ldquo;mat&amp;rdquo; in &lt;em>the cat sat on the mat&lt;/em> depends on every word that came before. Recurrent Neural Networks (RNNs) handle this by maintaining a &lt;strong>hidden state&lt;/strong> that evolves as they process each token. The hidden state is the network&amp;rsquo;s running summary of the past — its memory.&lt;/p></description></item><item><title>NLP (2): Word Embeddings and Language Models</title><link>https://www.chenk.top/en/nlp/word-embeddings-lm/</link><pubDate>Mon, 06 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/word-embeddings-lm/</guid><description>&lt;span class="math-block">$$\vec{\text{king}} - \vec{\text{man}} &amp;#43; \vec{\text{woman}} \approx \vec{\text{queen}}$$&lt;/span>
&lt;p>
The entire trajectory of NLP shifted toward representation learning. This article walks through that shift—from the failure of one-hot vectors, to Word2Vec&amp;rsquo;s shallow networks, to the global statistics that GloVe exploits, to the subword n-grams that let FastText handle unseen words—and finally connects embeddings to the language models that gave rise to them.&lt;/p></description></item><item><title>NLP (1): Introduction and Text Preprocessing</title><link>https://www.chenk.top/en/nlp/introduction-and-preprocessing/</link><pubDate>Wed, 01 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/introduction-and-preprocessing/</guid><description>&lt;p>Every time you ask Claude a question, autocomplete a sentence in Gmail, or read a Google Translate page, you&amp;rsquo;re using a stack that took seventy years to build. Natural Language Processing (NLP) is the field that taught machines to read, score, transform, and write human language. Surprisingly, much of the modern NLP stack still relies on preprocessing techniques from decades ago.&lt;/p>
&lt;p>This first article in the series does two things. First, it maps out the field&amp;rsquo;s history, current scope, and the reasons behind the tools we use. Second, it builds the foundational layer — cleaning, tokenization, normalization, and feature extraction — with code you can use directly in a project. By the end, you&amp;rsquo;ll have a reusable preprocessing pipeline and, more importantly, an understanding of when each step is helpful and when it can destroy signal.&lt;/p></description></item><item><title>Reparameterization Trick &amp; Gumbel-Softmax: A Deep Dive</title><link>https://www.chenk.top/en/standalone/reparameterization-gumbel-softmax/</link><pubDate>Wed, 30 Jul 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/standalone/reparameterization-gumbel-softmax/</guid><description>&lt;p>The moment your model contains a sampling step, training hits a hard wall: &lt;strong>how do gradients flow through a random node?&lt;/strong>&lt;/p>
&lt;p>The reparameterization trick has a clean answer — rewrite &lt;span class="math-inline">$z\sim p_\theta(z)$&lt;/span>
 as &lt;span class="math-inline">$z=g_\theta(\epsilon)$&lt;/span>
, isolating the randomness in a parameter-free noise variable &lt;span class="math-inline">$\epsilon$&lt;/span>
, so backprop can flow through &lt;span class="math-inline">$g_\theta$&lt;/span>
. The trouble starts with discrete variables: operations like &lt;span class="math-inline">$\arg\max$&lt;/span>
 are not differentiable. &lt;strong>Gumbel-Softmax&lt;/strong> (a.k.a. the Concrete distribution) replaces the discrete sample with a tempered softmax over Gumbel-perturbed logits, giving you a smooth, differentiable surrogate that you can train end-to-end.&lt;/p></description></item><item><title>Transfer Learning (6): Multi-Task Learning</title><link>https://www.chenk.top/en/transfer-learning/06-multi-task-learning/</link><pubDate>Sat, 31 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/06-multi-task-learning/</guid><description>&lt;p>A self-driving car using a single camera needs to do three things simultaneously: detect cars and pedestrians, segment lanes and free space, and estimate the distance of each pixel. Training three separate networks would triple the parameters, require three times as many forward passes at inference, and overlook the fact that all three tasks need the same low-level features (edges, surfaces, occlusion cues).&lt;/p>
&lt;p>Multi-task learning (MTL) is the alternative: one shared backbone, one task-specific head per output, all trained jointly. Done well, you cut parameters by 60% &lt;strong>and&lt;/strong> lift accuracy on every task because each task acts as a regularizer for the others. Done badly, two of your three tasks regress and you waste a week wondering why.&lt;/p></description></item><item><title>Transfer Learning (5): Knowledge Distillation</title><link>https://www.chenk.top/en/transfer-learning/05-knowledge-distillation/</link><pubDate>Sun, 25 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/05-knowledge-distillation/</guid><description>&lt;p>You have a 340M-parameter BERT model that hits 95% accuracy. The product team wants it on a phone that can barely fit 10M parameters. Training a 10M model from scratch lands at 85%. Knowledge distillation closes most of the gap: train the small model on the &lt;em>output distribution&lt;/em> of the large one, not just on the labels, and you can reach 92%.&lt;/p>
&lt;p>The key insight, due to Hinton, is that a teacher&amp;rsquo;s &amp;ldquo;wrong&amp;rdquo; predictions are not noise — they are information. When the teacher classifies a cat image and assigns 0.14 to &amp;ldquo;tiger&amp;rdquo;, 0.07 to &amp;ldquo;dog&amp;rdquo;, and 0.008 to &amp;ldquo;plane&amp;rdquo;, it is telling you that cats look a lot like tigers, somewhat like dogs, and nothing like aeroplanes. That structure — &lt;strong>dark knowledge&lt;/strong> — is invisible in a one-hot label, and learning it is what lets the student punch above its weight.&lt;/p></description></item><item><title>Transfer Learning (4): Few-Shot Learning</title><link>https://www.chenk.top/en/transfer-learning/04-few-shot-learning/</link><pubDate>Mon, 19 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/04-few-shot-learning/</guid><description>&lt;p>Show a child one photograph of a pangolin and they will spot pangolins for life. Show a deep learning model one photograph and it will give you a uniformly random guess. Few-shot learning is the field that closes that gap: building classifiers that work with only one to ten labeled examples per class.&lt;/p>
&lt;p>The trick is not to memorize individual classes harder. It is to learn &lt;em>how to learn&lt;/em> from very few examples, then carry that ability over to brand-new classes at test time. This article covers the two families that dominate the field today: &lt;strong>metric learning&lt;/strong>, which learns a good distance function, and &lt;strong>meta-learning&lt;/strong>, which learns a good initialization.&lt;/p></description></item><item><title>Transfer Learning (3): Domain Adaptation</title><link>https://www.chenk.top/en/transfer-learning/03-domain-adaptation/</link><pubDate>Tue, 13 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/03-domain-adaptation/</guid><description>&lt;p>Your autonomous-driving stack works perfectly on sunny California freeways. Then it rains in Seattle. Top-1 accuracy drops from 95% to 70%. The model did not get worse — the &lt;em>data distribution shifted&lt;/em>, and your training set never told it what wet asphalt looks like at dusk.&lt;/p>
&lt;p>This is the everyday problem of &lt;strong>domain adaptation&lt;/strong>: you have abundant labelled data in one distribution (the &lt;em>source&lt;/em>) and unlabelled data in another (the &lt;em>target&lt;/em>), and you need the model to perform on the target. This article shows you how, from first-principles theory to a working DANN implementation.&lt;/p></description></item><item><title>Transfer Learning (2): Pre-training and Fine-tuning</title><link>https://www.chenk.top/en/transfer-learning/02-pre-training-and-fine-tuning/</link><pubDate>Wed, 07 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/02-pre-training-and-fine-tuning/</guid><description>&lt;p>BERT changed NLP overnight. A model pre-trained on Wikipedia and BookCorpus could be fine-tuned on a few thousand labelled examples and beat task-specific architectures that researchers had spent years hand-crafting. The same pattern repeated in vision (ImageNet pre-training, then SimCLR, MAE), in speech (wav2vec 2.0), and in code (Codex). Today, &amp;ldquo;pre-train once, fine-tune everywhere&amp;rdquo; is the default recipe of modern deep learning.&lt;/p>
&lt;p>But &lt;em>why&lt;/em> does pre-training work? When should you freeze layers, when should you LoRA, and how small does your learning rate need to be? This article unpacks both the theory and the engineering practice behind the most successful transfer paradigm we have.&lt;/p></description></item><item><title>Transfer Learning (1): Fundamentals and Core Concepts</title><link>https://www.chenk.top/en/transfer-learning/01-fundamentals-and-core-concepts/</link><pubDate>Thu, 01 May 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/transfer-learning/01-fundamentals-and-core-concepts/</guid><description>&lt;p>You spent two weeks training an ImageNet classifier on a rack of GPUs. On Monday morning, your team lead asks for a chest X-ray pneumonia model, and the entire labeled dataset is &lt;strong>two hundred images&lt;/strong>. Do you book another two weeks of GPU time and start from scratch?&lt;/p>
&lt;p>Of course not. You use what the ImageNet model already knows about edges, textures, and shapes, swap out the last layer, and fine-tune on the X-rays. Two hours later, you have a model that beats anything you could have trained from random weights with so little data. That&amp;rsquo;s &lt;strong>transfer learning&lt;/strong>, and it&amp;rsquo;s why most real-world deep learning projects ship in days instead of months.&lt;/p></description></item><item><title>Essence of Linear Algebra (16): Linear Algebra in Deep Learning</title><link>https://www.chenk.top/en/linear-algebra/16-linear-algebra-in-deep-learning/</link><pubDate>Wed, 16 Apr 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/16-linear-algebra-in-deep-learning/</guid><description>&lt;p>Strip away the marketing and a deep network is one thing: a long pipeline of matrix multiplications glued together by elementwise nonlinearities. Forward pass, backward pass, convolution, attention, normalization, fine-tuning — every &amp;ldquo;trick&amp;rdquo; is a small twist on the same algebraic theme. Once you see the matrices, the field stops looking like a bag of recipes and starts looking like a single language.&lt;/p>
&lt;p>This chapter rebuilds the modern stack from that single language. We follow one signal — a vector &lt;span class="math-inline">$\mathbf{x}$&lt;/span>
 — as it flows through linear layers, gets convolved, gets attended to, gets normalized, and gets adapted by a low-rank update. At each step we name the matrix that does the work and the property of that matrix (rank, conditioning, transpose) that makes the trick succeed.&lt;/p></description></item><item><title>Essence of Linear Algebra (13): Tensors and Multilinear Algebra</title><link>https://www.chenk.top/en/linear-algebra/13-tensors-and-multilinear-algebra/</link><pubDate>Wed, 26 Mar 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/linear-algebra/13-tensors-and-multilinear-algebra/</guid><description>&lt;p>If you&amp;rsquo;ve used PyTorch or TensorFlow, you&amp;rsquo;ve met the word &amp;ldquo;tensor&amp;rdquo; hundreds of times. PyTorch calls every array &lt;code>torch.Tensor&lt;/code>; TensorFlow puts it in the product name. But what &lt;em>is&lt;/em> a tensor, and why did frameworks borrow this physics-flavored word for what looks like a multi-dimensional array?&lt;/p>
&lt;p>The short answer from this chapter:&lt;/p>
&lt;blockquote>
&lt;p>A tensor is the natural generalization of a scalar, vector, and matrix to &lt;strong>arbitrary&lt;/strong> dimensions. Everything you know about matrices either lifts cleanly to tensors, or breaks in instructive ways.&lt;/p></description></item><item><title>Time Series Forecasting (8): Informer — Efficient Long-Sequence Forecasting</title><link>https://www.chenk.top/en/time-series/informer-long-sequence/</link><pubDate>Sun, 15 Dec 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/informer-long-sequence/</guid><description>&lt;p>&lt;figure class="article-figure">
 &lt;img src="https://blog-pic-ck.oss-cn-beijing.aliyuncs.com/posts/en/time-series/informer-long-sequence/illustration_1.png" alt="Time Series Forecasting (8): Informer — Efficient Long-Sequence Forecasting — Chapter overview" loading="lazy" decoding="async" class="content-image">
 
&lt;/figure>
&lt;/p>
&lt;p>The Transformer is wonderful at sequence modeling — right up to the moment your sequence gets long. Vanilla self-attention costs &lt;span class="math-inline">$\mathcal{O}(L^2)$&lt;/span>
 in both compute and memory, so a one-week hourly window (168 steps) is fine, a one-month window (720 steps) is painful, and a three-month window (2160 steps) is essentially impossible on a single GPU. That is exactly the regime real-world long-horizon forecasting lives in: weather, energy, finance, IoT.&lt;/p></description></item><item><title>Time Series Forecasting (7): N-BEATS — Interpretable Deep Architecture</title><link>https://www.chenk.top/en/time-series/n-beats/</link><pubDate>Sat, 30 Nov 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/n-beats/</guid><description>&lt;p>&lt;figure class="article-figure">
 &lt;img src="https://blog-pic-ck.oss-cn-beijing.aliyuncs.com/posts/en/time-series/n-beats/illustration_1.png" alt="Time Series Forecasting (7): N-BEATS — Interpretable Deep Architecture — Chapter overview" loading="lazy" decoding="async" class="content-image">
 
&lt;/figure>
&lt;/p>
&lt;p>The 2018 M4 forecasting competition served 100,000 series across six frequencies as a single benchmark. The leaderboard was dominated by hand-tuned ensembles built from decades of statistical-forecasting craft. Then a &lt;strong>pure neural network&lt;/strong> with no statistical preprocessing, no feature engineering, and no recurrence won outright. That network was &lt;strong>N-BEATS&lt;/strong> by Oreshkin et al. — a stack of fully-connected blocks with two residual paths. Its interpretable variant additionally split the forecast into a polynomial trend and a Fourier seasonality, so the very thing classical statisticians wanted (a readable decomposition) came for free.&lt;/p></description></item><item><title>Time Series Forecasting (6): Temporal Convolutional Networks (TCN)</title><link>https://www.chenk.top/en/time-series/temporal-convolutional-networks/</link><pubDate>Fri, 15 Nov 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/temporal-convolutional-networks/</guid><description>&lt;p>&lt;figure class="article-figure">
 &lt;img src="https://blog-pic-ck.oss-cn-beijing.aliyuncs.com/posts/en/time-series/temporal-convolutional-networks/illustration_1.png" alt="Time Series Forecasting (6): Temporal Convolutional Networks (TCN) — Chapter overview" loading="lazy" decoding="async" class="content-image">
 
&lt;/figure>
&lt;/p>
&lt;p>For most of the 2010s, saying &amp;ldquo;deep learning for time series&amp;rdquo; meant using LSTM. The story changed in 2018 when Bai, Kolter, and Koltun published &lt;em>An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling&lt;/em>. Their result was surprisingly simple: use a stack of 1-D convolutions, make them causal (no peeking at the future), space the filter taps exponentially (dilation), wrap the whole thing in residual connections, and train. Task after task, the resulting &lt;strong>Temporal Convolutional Network&lt;/strong> (TCN) matched or beat LSTM/GRU — while training several times faster because every time step in the forward pass runs in parallel.&lt;/p></description></item><item><title>Time Series Forecasting (5): Transformer Architecture for Time Series</title><link>https://www.chenk.top/en/time-series/transformer/</link><pubDate>Thu, 31 Oct 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/transformer/</guid><description>&lt;p>The 2017 &lt;em>Attention Is All You Need&lt;/em> paper took the attention mechanism from the previous chapter to its logical extreme: &lt;strong>drop the RNN entirely&lt;/strong>. Transformers stack pure attention into a full sequence model — no recurrence, no hidden state propagating over time. Originally designed for machine translation, the architecture was quickly adapted to every other sequence task, time series included.&lt;/p>
&lt;p>Dropping a vanilla NLP Transformer onto a time-series problem runs into two immediate complications. The first is &lt;strong>position&lt;/strong>. Attention is a set operation — shuffle the input order and the output is unchanged. For a time series, order is everything: a temperature curve that goes up-then-down and one that goes down-then-up are entirely different signals. NLP solves this with sinusoidal position encodings; do those still make sense for time series, or should we use learned encodings, or just concatenate calendar features (hour-of-day, day-of-week) directly into the input?&lt;/p></description></item><item><title>Time Series Forecasting (4): Attention Mechanisms — Direct Long-Range Dependencies</title><link>https://www.chenk.top/en/time-series/attention-mechanism/</link><pubDate>Wed, 16 Oct 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/attention-mechanism/</guid><description>&lt;p>RNNs and LSTMs handled &amp;ldquo;too many time steps&amp;rdquo; but left a subtler limitation in place: information has to travel &lt;strong>step by step&lt;/strong>. For step 100 to see what happened at step 1, the signal has to ride the hidden state through 99 intermediate stops — and each stop attenuates the signal a little and squashes it through a nonlinearity. Even with LSTM&amp;rsquo;s &amp;ldquo;highway&amp;rdquo; cell state, it&amp;rsquo;s still a single lane in a single direction.&lt;/p></description></item><item><title>Time Series Forecasting (3): GRU — Lightweight Gates and Efficiency Trade-offs</title><link>https://www.chenk.top/en/time-series/gru/</link><pubDate>Tue, 01 Oct 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/gru/</guid><description>&lt;p>After you&amp;rsquo;ve used LSTM for a while, an obvious question shows up: aren&amp;rsquo;t three gates a bit much? The forget and input gates seem to do related work — one decides what to drop, the other decides what to add — couldn&amp;rsquo;t they be merged? And does the cell state really need to be a separate vector from the hidden state, or could the hidden state do double duty?&lt;/p>
&lt;p>That is exactly the question Cho et al. answered in 2014 with the &lt;strong>Gated Recurrent Unit&lt;/strong>. They collapsed three gates into two: an &lt;strong>update gate&lt;/strong> that controls how much of the old state to keep versus how much new content to absorb, and a &lt;strong>reset gate&lt;/strong> that decides whether to ignore the old state entirely when computing a fresh candidate. The cell state is folded back into the hidden state. The result is roughly 25% fewer parameters, training that runs 10-15% faster, and accuracy on most time-series tasks that is statistically indistinguishable from LSTM.&lt;/p></description></item><item><title>Time Series Forecasting (2): LSTM — Gate Mechanisms and Long-Term Dependencies</title><link>https://www.chenk.top/en/time-series/lstm/</link><pubDate>Mon, 16 Sep 2024 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/time-series/lstm/</guid><description>&lt;p>The first RNN I ever trained, back in 2017, was a small sales forecaster: 50 days in, the next day out. The forward pass ran cleanly, the loss went down, and yet the model had near-total amnesia about anything older than three days. The data had a clear monthly cycle. The model couldn&amp;rsquo;t see it. I assumed I needed more data, so I added rows and layers — and watched the training loss jump to NaN halfway through epoch two.&lt;/p></description></item><item><title>Position Encoding Brief: From Sinusoidal to RoPE and ALiBi</title><link>https://www.chenk.top/en/standalone/position-encoding-brief/</link><pubDate>Fri, 30 Jun 2023 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/standalone/position-encoding-brief/</guid><description>&lt;p>Self-attention has a strange property that surprises most people the first time they compute it by hand: it does not know the order of its inputs. Permute the tokens and every attention score is permuted along with them — the function is exactly equivariant. So before we can do anything useful with a Transformer, we have to inject position information from the outside.&lt;/p>
&lt;p>That single design decision — &lt;em>how&lt;/em> to inject it — has spawned a remarkable amount of research. Sinusoidal, learned, relative, T5-style buckets, RoPE, ALiBi, NoPE, and more. This post is a practitioner&amp;rsquo;s brief: enough math to know why each scheme works, enough comparison to choose one, and a clear focus on the property that matters most in the LLM era — &lt;strong>length extrapolation&lt;/strong>, the ability to handle sequences longer than anything seen in training.&lt;/p></description></item><item><title>Variational Autoencoder (VAE): From Intuition to Implementation and Troubleshooting</title><link>https://www.chenk.top/en/standalone/vae-guide/</link><pubDate>Tue, 27 Jun 2023 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/standalone/vae-guide/</guid><description>&lt;p>A plain autoencoder compresses and reconstructs. A variational autoencoder learns something far more useful: a smooth, structured latent space you can &lt;em>sample&lt;/em> from to generate genuinely new data. That single change — making the encoder output a &lt;em>distribution&lt;/em> instead of a vector — turns the network from a fancy compressor into a generative model with a tractable likelihood lower bound.&lt;/p>
&lt;p>This guide walks the full path: why autoencoders fail at generation, how the ELBO derivation gets you to the loss function, why the reparameterization trick is the trick that makes everything trainable, a complete PyTorch implementation, and a tour of every common failure mode with concrete fixes.&lt;/p></description></item><item><title>Optimization (4): Learning Rate and Schedules</title><link>https://www.chenk.top/en/optimization-theory/04-learning-rate-schedules/</link><pubDate>Sun, 18 Sep 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/optimization-theory/04-learning-rate-schedules/</guid><description>&lt;p>Your model diverges. You halve the learning rate. Now it trains, but takes forever. You halve again — now the loss is a flat line. Sound familiar? Of all the knobs you can turn, &lt;strong>learning rate&lt;/strong> is the one that most often decides whether training converges, crawls, or blows up. This guide gives you the intuition, the minimal math, and a practical workflow to get it right — from a 12-layer CNN on your laptop to a 70B-parameter LLM on a thousand GPUs.&lt;/p></description></item><item><title>Optimization (3): The Gradient Descent Family from SGD to AdamW</title><link>https://www.chenk.top/en/optimization-theory/03-gradient-descent-family/</link><pubDate>Fri, 16 Sep 2022 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/optimization-theory/03-gradient-descent-family/</guid><description>&lt;p>Why is &amp;ldquo;tuning the LR is an art&amp;rdquo; a meme for ResNet, while every modern LLM paper just writes &amp;ldquo;AdamW, &lt;span class="math-inline">$\beta_1{=}0.9, \beta_2{=}0.95, \mathrm{wd}{=}0.1$&lt;/span>
&amp;rdquo; and moves on? It is not an accident — it is the &lt;strong>end-point of three decades of optimizer evolution&lt;/strong>.&lt;/p>
&lt;p>This post walks the lineage end-to-end on a single thread: each step exists because of a &lt;strong>specific failure&lt;/strong> of the previous one. We end with the three directions that have actually entered the post-2023 large-model toolkit: Lion, Sophia, and Schedule-Free.&lt;/p></description></item><item><title>Kernel Methods (8): Deep Kernel Learning vs Deep Learning — A Practitioner's Guide</title><link>https://www.chenk.top/en/kernel-methods/08-deep-kernels-vs-dl/</link><pubDate>Thu, 30 Dec 2021 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/kernel-methods/08-deep-kernels-vs-dl/</guid><description>&lt;p>In 2026, why are you still reading about kernel methods? Aren&amp;rsquo;t transformers supposed to have eaten the entire ML stack? Yes and no. Transformers eat the headlines, but kernels still eat the corners — the regimes with 200 samples, the regimes where the model has to publish calibrated error bars, the regimes where a physicist needs to know &lt;em>which&lt;/em> basis function caused the prediction. This final part is the field manual: when kernels actually win, how to debug them when they don&amp;rsquo;t, and how to bolt them on top of a neural network when you want the best of both worlds.&lt;/p></description></item></channel></rss>