<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Information-Theory on k4i's blog</title><link>https://k4i.top/tags/information-theory/</link><description>Recent content in Information-Theory on k4i's blog</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>sky_io@outlook.com (K4i)</managingEditor><webMaster>sky_io@outlook.com (K4i)</webMaster><copyright>All content is subject to the license of &lt;a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"&gt;CC BY-NC-SA 4.0&lt;/a&gt; .</copyright><lastBuildDate>Tue, 14 Jul 2026 10:00:00 +0800</lastBuildDate><atom:link href="https://k4i.top/tags/information-theory/index.xml" rel="self" type="application/rss+xml"/><item><title>Entropy, Cross Entropy, And KL Divergence: A Coding-Cost View</title><link>https://k4i.top/posts/entropy-cross-entropy-kl/</link><pubDate>Tue, 14 Jul 2026 10:00:00 +0800</pubDate><author>sky_io@outlook.com (K4i)</author><atom:modified>Tue, 14 Jul 2026 10:00:00 +0800</atom:modified><guid>https://k4i.top/posts/entropy-cross-entropy-kl/</guid><description>&lt;p&gt;Entropy, cross entropy, and KL divergence often look like three separate formulas:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;entropy: \(H(P)\)&lt;/li&gt;
&lt;li&gt;cross entropy: \(H(P,Q)\)&lt;/li&gt;
&lt;li&gt;KL divergence: \(D_{\mathrm{KL}}(P\Vert Q)\)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These letters are conventions rather than variables derived from the formulas. Shannon used \(H\) for entropy in his foundational information-theory paper;&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref"&gt;1&lt;/a&gt;&lt;/sup&gt; there is no single agreed explanation for why he chose that letter, so it is safest to treat it as historical notation. Cross entropy still measures an average coding cost and generalizes entropy, hence \(H(P,Q)\): the first argument is the true distribution and the second is the coding distribution. KL uses \(D\) to emphasize &lt;strong&gt;divergence&lt;/strong&gt; between distributions. A divergence is not necessarily a metric: KL is asymmetric and does not satisfy the triangle inequality.&lt;/p&gt;</description><dc:creator>K4i</dc:creator><media:content url="https://k4i.top//images/icons/math-operators.png" medium="image"><media:title type="html">featured image</media:title></media:content><category>deep-learning</category><category>information-theory</category><category>cross-entropy</category><category>kl-divergence</category><category>loss-function</category><category>AI</category></item><item><title>Why KL Divergence Is Not A Distance: Direction Changes The Question</title><link>https://k4i.top/posts/kl-divergence-not-a-distance/</link><pubDate>Tue, 07 Jul 2026 10:00:00 +0800</pubDate><author>sky_io@outlook.com (K4i)</author><atom:modified>Tue, 07 Jul 2026 10:00:00 +0800</atom:modified><guid>https://k4i.top/posts/kl-divergence-not-a-distance/</guid><description>&lt;p&gt;KL divergence is often described as a distance between two distributions. That is half useful and half dangerous. It compares two distributions, but &lt;strong&gt;it is not a distance because direction matters&lt;/strong&gt;. More precisely, KL is nonnegative and vanishes only when \(P=Q\), but it fails the symmetry and triangle-inequality requirements of a metric.&lt;/p&gt;
&lt;p&gt;The formula is:&lt;/p&gt;
&lt;p&gt;$$D_{\mathrm{KL}}(P\Vert Q)=\sum_x P(x)\log\frac{P(x)}{Q(x)}$$&lt;/p&gt;
&lt;p&gt;Do not read this as &amp;ldquo;the distance between P and Q.&amp;rdquo; A better reading is:&lt;/p&gt;</description><dc:creator>K4i</dc:creator><media:content url="https://k4i.top//images/icons/math-operators.png" medium="image"><media:title type="html">featured image</media:title></media:content><category>deep-learning</category><category>kl-divergence</category><category>cross-entropy</category><category>rlhf</category><category>information-theory</category><category>AI</category></item></channel></rss>