<?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 Yang</title><link>/en/tags/nlp/</link><description>Recent content in NLP on Yang</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Fri, 06 Mar 2026 20:00:00 +0800</lastBuildDate><atom:link href="/en/tags/nlp/index.xml" rel="self" type="application/rss+xml"/><item><title>Attention Is All You Need — Deep Dive into the Transformer Architecture</title><link>/en/research/attention-is-all-you-need/</link><pubDate>Fri, 06 Mar 2026 20:00:00 +0800</pubDate><guid>/en/research/attention-is-all-you-need/</guid><description>&lt;h2 id="-background"&gt;&lt;a href="#-background" class="header-anchor"&gt;&lt;/a&gt;📄 Background
&lt;/h2&gt;&lt;p&gt;Before Transformers, sequence-to-sequence tasks relied heavily on &lt;strong&gt;RNN/LSTM&lt;/strong&gt; architectures, which suffered from two major bottlenecks:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Sequential computation&lt;/strong&gt; prevents parallelization&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Long-range dependency degradation&lt;/strong&gt; over long sequences&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Vaswani et al. proposed the &lt;strong&gt;Transformer&lt;/strong&gt; at NeurIPS 2017, relying entirely on attention mechanisms to model global dependencies — no recurrence, no convolution.&lt;/p&gt;
&lt;h2 id="-core-mechanisms"&gt;&lt;a href="#-core-mechanisms" class="header-anchor"&gt;&lt;/a&gt;🔑 Core Mechanisms
&lt;/h2&gt;&lt;h3 id="self-attention"&gt;&lt;a href="#self-attention" class="header-anchor"&gt;&lt;/a&gt;Self-Attention
&lt;/h3&gt;&lt;p&gt;For input $X \in \mathbb{R}^{n \times d}$, we compute Query, Key, Value projections:&lt;/p&gt;
&lt;p&gt;$$Q = XW^Q, \quad K = XW^K, \quad V = XW^V$$&lt;/p&gt;</description></item></channel></rss>