<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Posts on Zihe Liu</title>
		<link>https://flowingpurplecrane.com/posts/</link>
		<description>Recent content in Posts on Zihe Liu</description>
		<generator>Hugo</generator>
		<language>en</language>
		
			<managingEditor>zl559@cam.ac.uk (Zihe Liu)</managingEditor>
		
		
			<webMaster>zl559@cam.ac.uk (Zihe Liu)</webMaster>
		
		
			<copyright>© Zihe Liu</copyright>
		
		
			<lastBuildDate>Sat, 14 Mar 2026 15:42:57 +0000</lastBuildDate>
		
			<atom:link href="https://flowingpurplecrane.com/posts/rss.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Critique DPO</title>
				<link>https://flowingpurplecrane.com/posts/cdpo/</link>
				<pubDate>Sat, 14 Mar 2026 15:42:57 +0000</pubDate><author>zl559@cam.ac.uk (Zihe Liu)</author>
				<guid>https://flowingpurplecrane.com/posts/cdpo/</guid>
				<description>&lt;p&gt;I chanced upon a pretty interesting idea proposed by Peter Hayes (now at Anthropic) in 2025, to more efficiently use feedback data in the standard RLHF pipeline to speed up the whole thing. Basically, given external feedback/critique/verification of generated answers, can we incorporate this feedback in an NLL term in addition to the standard DPO loss; trained on the base model? Most previous efforts either used this feedback to train a better verifier, or used other additional NLL terms in the base model training. I spent couple of months reading around the literature, setting up the HPC infra, and running some experiments. Unfortunately experiments (at least on smaller models) resulted in negative findings - the model was extremely prone to &lt;a href=&#34;https://lilianweng.github.io/posts/2024-11-28-reward-hacking/&#34;&gt;reward hacking&lt;/a&gt;&amp;hellip;&lt;/p&gt;</description>
			</item>
			<item>
				<title>The Minority Guessing Game</title>
				<link>https://flowingpurplecrane.com/posts/minority/</link>
				<pubDate>Sat, 14 Feb 2026 23:50:56 +0000</pubDate><author>zl559@cam.ac.uk (Zihe Liu)</author>
				<guid>https://flowingpurplecrane.com/posts/minority/</guid>
				<description>&lt;p&gt;I recently learnt a drinking game where you had 2 cards (red/black) for round, and people use these as answers to questions. The goal of the game is to locate who the minority answers came from, and with that came some interesting questions.&lt;/p&gt;&#xA;&lt;h2 id=&#34;game-rules&#34;&gt;Game Rules&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;$n$ players each hold a red card and a black card.&lt;/li&gt;&#xA;&lt;li&gt;A question is posed each round (e.g., yes/no, would-you-rather, etc.). Each player secretly plays one card to reflect their answer.&lt;/li&gt;&#xA;&lt;li&gt;All played cards are collected and shuffled — the total counts of each red and black are revealed, but not who played what.&lt;/li&gt;&#xA;&lt;li&gt;This reveals a &lt;em&gt;minority&lt;/em&gt; group of size $k$ and a majority of size $n − k$&lt;/li&gt;&#xA;&lt;li&gt;The group is given $g$ guesses to identify members of the minority. The group&amp;rsquo;s score is $C$, the number of correct guesses. This is the only random variable in this question; everything else is given.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;&lt;em&gt;Then I had a question: what&amp;rsquo;s a good number for $g$ so that the game is fun?&lt;/em&gt; &lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; So not too easy $g \approx n$ where we&amp;rsquo;ll definitely guess who the minorities are, but not too hard $g=k$ &lt;sup id=&#34;fnref:2&#34;&gt;&lt;a href=&#34;#fn:2&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;2&lt;/a&gt;&lt;/sup&gt; that we&amp;rsquo;ll never find the minorities. &lt;sup id=&#34;fnref:3&#34;&gt;&lt;a href=&#34;#fn:3&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;</description>
			</item>
			<item>
				<title>On Information</title>
				<link>https://flowingpurplecrane.com/posts/info/</link>
				<pubDate>Sat, 25 Oct 2025 16:34:06 +0000</pubDate><author>zl559@cam.ac.uk (Zihe Liu)</author>
				<guid>https://flowingpurplecrane.com/posts/info/</guid>
				<description>&lt;p&gt;I&amp;rsquo;ve wondered about entropy for a long time. From &lt;a href=&#34;https://en.wikipedia.org/wiki/Entropy_as_an_arrow_of_time&#34;&gt;thermodynamics and the arrow of time&lt;/a&gt;, to &lt;a href=&#34;https://docs.pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html&#34;&gt;cross-entropy loss&lt;/a&gt; in ML cost functions, or KL divergence in stopping intelligence from going batshit crazy in &lt;a href=&#34;https://mbernste.github.io/posts/vae/&#34;&gt;VAE&lt;/a&gt;/&lt;a href=&#34;https://arxiv.org/abs/1707.06347&#34;&gt;PPO&lt;/a&gt;, entropy keeps cropping up. Maybe the universe is playing some kinda trick on us here. Since I&amp;rsquo;m taking &lt;a href=&#34;https://teaching.eng.cam.ac.uk/content/engineering-tripos-part-iia-3f7-information-theory-and-coding-2025-26&#34; class=&#34;external&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;3F7 Information Theory&lt;/a&gt;, I thought it&amp;rsquo;s probably a good time to understand what these ideas &lt;em&gt;really&lt;/em&gt; mean.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Disclaimer: I do not claim this work to be my own; this is merely a synthesis of intuition and math across multiple resources for myself and anyone interested. In particular, we borrow the beautiful figures and analogies from Chris Olah&amp;rsquo;s amazing post&lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; on Information Theory.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
			</item>
			<item>
				<title>The Discrete Fourier Transform and Fast Fourier Transform</title>
				<link>https://flowingpurplecrane.com/posts/dft-fft/</link>
				<pubDate>Fri, 28 Mar 2025 17:05:08 +0000</pubDate><author>zl559@cam.ac.uk (Zihe Liu)</author>
				<guid>https://flowingpurplecrane.com/posts/dft-fft/</guid>
				<description>&lt;p&gt;We analyze &lt;sup id=&#34;fnref:1&#34;&gt;&lt;a href=&#34;#fn:1&#34; class=&#34;footnote-ref&#34; role=&#34;doc-noteref&#34;&gt;1&lt;/a&gt;&lt;/sup&gt; the theoretical properties of both the &lt;em&gt;Discrete Fourier&#xA;Transform&lt;/em&gt; (DFT) and the optimized &lt;em&gt;Fast Fourier Transform&lt;/em&gt; (FFT), and&#xA;estimate their algorithmic complexity.&lt;/p&gt;&#xA;&lt;p&gt;All code available on &lt;a href=&#34;https://github.com/liuzihe02/dft-fft.git&#34;&gt;Github&lt;/a&gt;. Slides available &lt;a href=&#34;https://flowingpurplecrane.com/docs/dft-fft-slides.pdf&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h1 id=&#34;discrete-fourier-transform&#34;&gt;Discrete Fourier Transform&lt;/h1&gt;&#xA;&lt;h2 id=&#34;theory&#34;&gt;Theory&lt;/h2&gt;&#xA;&lt;p&gt;The DFT converts a finite-length time-domain signal into its&#xA;frequency-domain representation. For an input signal $x[n]$ of length&#xA;$N$, where $0 \le n \le N-1$, the DFT is defined as:&lt;/p&gt;&#xA;$$&#xA;X[k] = \sum_{n=0}^{N-1} x[n]\, W_N^{nk}, \quad 0 \le k \le N-1&#xA;\label{eq:DFT}&#xA;$$&lt;p&gt;where $W_N=e^{-j\frac{2\pi}{N}}$ is the $N$-th principal root of unity,&#xA;and $X[k]$ is component at frequency $kf_s/N$ with sampling frequency&#xA;$f_s$. We can rewrite $X[k]$ as an inner product:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Breaking Down DeepSeek R1</title>
				<link>https://flowingpurplecrane.com/posts/r1/</link>
				<pubDate>Mon, 17 Feb 2025 17:05:08 +0000</pubDate><author>zl559@cam.ac.uk (Zihe Liu)</author>
				<guid>https://flowingpurplecrane.com/posts/r1/</guid>
				<description>&lt;p&gt;In this post, I want to explore the key RL architecture and software optimizations DeepSeek made to create Deepseek-R1. I&amp;rsquo;ll provide a brief introduction to the RL setup and explain how GRPO makes traditional algorithims much more efficient. At the end, I&amp;rsquo;ll provide a brief overview of how DeepSeek-R1 was trained. Talk given at Cambridge AI Safety Hub Members Meeting in February, slides available &lt;a href=&#34;https://flowingpurplecrane.com/docs/r1-slides.pdf&#34; class=&#34;external&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h1 id=&#34;preliminaries&#34;&gt;Preliminaries&lt;/h1&gt;&#xA;&lt;h2 id=&#34;transformers&#34;&gt;Transformers&lt;/h2&gt;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;    &#xA;    &#xA;    &#xA;    &#xA;      &#xA;      &#xA;      &#xA;    &#xA;    &#xA;  &#xA;&#xA;&lt;div style=&#34;display: block; width: 100%; margin-top: 15px; margin-bottom: 15px;&#34;&gt;&#xA;  &lt;img src=&#34;https://flowingpurplecrane.com/r1/figures/transformer-overview_hu_fe0829fbfb741b70.png&#34; loading=&#34;lazy&#34; decoding=&#34;async&#34;  width=&#34;700&#34;  &#xA;  style=&#34;display: block; margin: 0 auto;&#34;&gt;&#xA;  &#xA;  &#xA;    &lt;figcaption style=&#34;text-align: center; margin-top: 8px; margin-bottom: 8px; font-style: italic;&#34;&gt;Illustration of autoregressive model of transformers, taken from the ARENA curriculum&lt;/figcaption&gt;&#xA;  &#xA;&lt;/div&gt;&#xA;&#xA;&lt;p&gt;Modern transformers are autoregressive models. They predict the next token (essetially a word) given all the tokens before it:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Breaking Down Monte Carlo Tree Search</title>
				<link>https://flowingpurplecrane.com/posts/mcts/</link>
				<pubDate>Sat, 07 Dec 2024 17:05:08 +0000</pubDate><author>zl559@cam.ac.uk (Zihe Liu)</author>
				<guid>https://flowingpurplecrane.com/posts/mcts/</guid>
				<description>&lt;p&gt;We explain how Monte Carlo Tree Search works and introduce its pseudocode. We borrow notes and figures from &lt;a href=&#34;https://int8.io/monte-carlo-tree-search-beginners-guide/&#34;&gt;int8&amp;rsquo;s website&lt;/a&gt; and the &lt;a href=&#34;https://en.wikipedia.org/wiki/Monte_Carlo_tree_search&#34;&gt;MCTS Wikipedia page&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h1 id=&#34;game-representation&#34;&gt;Game Representation&lt;/h1&gt;&#xA;&lt;p&gt;A game tree is a tree data structure, where every node represents a distinct &lt;em&gt;state&lt;/em&gt; of the game. Given a state $s$, we take an action $a$, and the environment transitions to the new state $s&#39;$ with the transition probability $p_a(s&#39;|s)$. If the transition probablity is $1$ (such as in simple deterministic games like Tic Tac Toe), then each node in the game tree represents a state.&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
