<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>NLP on Chen Kai Blog</title><link>https://www.chenk.top/en/nlp/</link><description>Recent content in NLP on Chen Kai Blog</description><generator>Hugo</generator><language>en</language><lastBuildDate>Tue, 25 Nov 2025 09:00:00 +0000</lastBuildDate><atom:link href="https://www.chenk.top/en/nlp/index.xml" rel="self" type="application/rss+xml"/><item><title>NLP (12): Frontiers and Practical Applications</title><link>https://www.chenk.top/en/nlp/frontiers-applications/</link><pubDate>Tue, 25 Nov 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/frontiers-applications/</guid><description>&lt;p>We have spent eleven chapters climbing from raw text to multimodal foundation models. This twelfth and final chapter sits at the frontier and at the runway. It is where research stops being a paper and starts being a service: an LLM that calls tools, writes and debugs code, reasons through hundred-step problems, ingests a 200K-token contract, and serves a thousand concurrent users behind a FastAPI endpoint with p95 latency under 300 ms.&lt;/p></description></item><item><title>NLP (11): Multimodal Large Language Models</title><link>https://www.chenk.top/en/nlp/multimodal-nlp/</link><pubDate>Thu, 20 Nov 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/multimodal-nlp/</guid><description>&lt;p>Humans never perceive the world in one channel at a time. We watch a chart while reading the caption, hear a tone of voice while reading a face, glance at a screenshot while debating a bug. Pure-text language models are deaf and blind to all of that. &lt;strong>Multimodal Large Language Models (MLLMs)&lt;/strong> close the gap by aligning images, audio, and video into the same representation space the language model already speaks.&lt;/p></description></item><item><title>NLP (10): RAG and Knowledge Enhancement Systems</title><link>https://www.chenk.top/en/nlp/rag-knowledge-enhancement/</link><pubDate>Sat, 15 Nov 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/rag-knowledge-enhancement/</guid><description>&lt;p>A frozen language model is a confident liar. It cannot read yesterday&amp;rsquo;s incident report, your company wiki, or the patch notes that shipped this morning, so when you ask, it confabulates an answer that is grammatically perfect and factually wrong. &lt;strong>Retrieval-Augmented Generation (RAG)&lt;/strong> breaks the deadlock by separating &lt;em>memory&lt;/em> from &lt;em>reasoning&lt;/em>: keep the LLM small and stable, and put the volatile knowledge in an external store that you can update at any time. Before generating, retrieve the relevant evidence and condition the model on it.&lt;/p></description></item><item><title>NLP (9): Deep Dive into LLM Architecture</title><link>https://www.chenk.top/en/nlp/llm-architecture-deep-dive/</link><pubDate>Mon, 10 Nov 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/llm-architecture-deep-dive/</guid><description>&lt;p>The 2017 Transformer paper drew one block. Every production LLM today still uses that diagram as a silhouette, but almost every internal piece has been replaced. Pre-norm replaced post-norm. RMSNorm replaced LayerNorm. SwiGLU replaced GELU. Rotary embeddings replaced sinusoids. Multi-head attention became grouped-query attention. The dense FFN sometimes became a sparse mixture of experts. And the inference loop is dominated by a data structure that doesn&amp;rsquo;t appear in the original paper at all: the KV cache.&lt;/p></description></item><item><title>NLP (8): Model Fine-tuning and PEFT</title><link>https://www.chenk.top/en/nlp/fine-tuning-peft/</link><pubDate>Wed, 05 Nov 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/fine-tuning-peft/</guid><description>&lt;p>In 2020, fine-tuning a 7-billion-parameter language model was a project budget item: eight A100s, several days, and an engineer who knew how to babysit gradient checkpointing. In 2024, a graduate student does it on a laptop. The distance between those two worlds is almost entirely covered by one paper — Hu et al.&amp;rsquo;s LoRA (ICLR 2022) — and one follow-up — Dettmers et al.&amp;rsquo;s QLoRA (NeurIPS 2023).&lt;/p>
&lt;p>The shift is not just engineering. Parameter-Efficient Fine-Tuning (PEFT) reframes what it means to &amp;ldquo;have a model.&amp;rdquo; Instead of one binary blob per task, you keep a single frozen base model and a directory of small adapter files, each a few tens of megabytes. Switching tasks becomes loading a new adapter; serving N domains becomes O(1) base + N · ε.&lt;/p></description></item><item><title>NLP (7): Prompt Engineering and In-Context Learning</title><link>https://www.chenk.top/en/nlp/prompt-engineering-icl/</link><pubDate>Fri, 31 Oct 2025 09:00:00 +0000</pubDate><guid>https://www.chenk.top/en/nlp/prompt-engineering-icl/</guid><description>&lt;p>The same model can produce a sharp answer or a confident hallucination. The difference is rarely the weights &amp;ndash; it is the framing. A vague request like &lt;em>&amp;ldquo;analyze this text&amp;rdquo;&lt;/em> gets you a generic summary; a prompt with a role, two clean examples, and a strict output schema gets you something a parser can consume. &lt;strong>Prompt engineering is the discipline of turning that gap into a repeatable system instead of a lucky shot.&lt;/strong>&lt;/p></description></item><item><title>NLP Part 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 &amp;ndash; 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 Part 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 Part 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 Part 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, dictate a memo to your phone — every one of these systems must consume an ordered stream of tokens and produce another. A feed-forward network treats 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 consume 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 Part 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;p>For decades, machines treated &amp;ldquo;king&amp;rdquo; and &amp;ldquo;queen&amp;rdquo; as unrelated symbols &amp;ndash; nothing more than two distinct slots in a vocabulary list. Then a single idea changed everything: what if every word lived in a continuous space, and meaning was just a &lt;em>direction&lt;/em>? Once that idea took hold, models could compute&lt;/p>
$$\vec{\text{king}} - \vec{\text{man}} + \vec{\text{woman}} \approx \vec{\text{queen}}$$&lt;p>and the entire trajectory of NLP turned toward representation learning. This article walks through that turn &amp;ndash; 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 words it has never seen &amp;ndash; and finally connects embeddings to the language models that gave rise to them.&lt;/p></description></item><item><title>NLP Part 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 are touching a stack that took seventy years to assemble. Natural Language Processing is the discipline that taught machines to read, score, transform, and write human language &amp;ndash; and the surprising thing is how much of the modern stack still rests on a small set of preprocessing primitives invented decades ago.&lt;/p></description></item></channel></rss>