4.4.5 · D3Alignment, Prompting & RAG

Worked examples — Constitutional AI overview

2,602 words12 min readBack to topic

This is the "grind every case" companion to Constitutional AI overview. The parent built the machinery (self-critique, the Bradley–Terry reward, PPO with a KL leash). Here we torture-test it: every sign of the reward gap, every degenerate input, every limit, plus a word problem and an exam twist.

Before any symbol appears, we re-earn it. If you see , , , or and feel a gap, that's the parent's job — but each example below re-defines what it touches so you never guess.


The scenario matrix

The whole numeric side of CAI lives in two objects: the preference probability and the penalised objective. Everything a problem can throw at you is one cell below.

Cell What varies Concrete question Example
A. Winner clearly better reward gap , large and loss when Ex 1
B. Loser mislabeled / gap negative judge picked worse answer, what's the loss? Ex 2
C. Tie / degenerate two equally safe answers Ex 3
D. Limiting behaviour , what do and loss approach? Ex 4
E. Batch loss many pairs averaged mean loss over a mini-dataset Ex 5
F. KL bites (reward hacking) reward but KL does the objective actually rise? Ex 6
G. Tuning the leash vary find where hack stops paying Ex 7
H. Word problem count human labels saved real-world budget question Ex 8
I. Exam twist swap label source is RLAIF math ≠ RLHF math? Ex 9

Two formulas power cells A–E. First, the sigmoid — the function that turns a score difference into a probability between 0 and 1:

Figure — Constitutional AI overview

Cell A — Winner clearly better (, large)


Cell B — Judge mislabeled, gap negative ()


Cell C — Tie / degenerate input ()


Cell D — Limiting behaviour ()


Cell E — Batch loss over a mini-dataset


Cell F — The KL term bites (reward hacking)

Now the second formula. The policy tries to earn reward but is penalised for drifting from the reference (SL-CAI) model .

The objective the parent wrote, for one prompt, is

Figure — Constitutional AI overview

Cell G — Tuning the leash ()


Cell H — Word problem (labels saved)


Cell I — Exam twist: "is RLAIF's math different from RLHF's?"


Active recall

Recall Ex 1 vs Ex 2: why is the wrong-label loss so much bigger?

Because blows up near : a correct call () costs , a confidently-wrong call () costs . Gradient descent listens loudest to confident mistakes. ::: The sigmoid symmetry ties them together.

Recall What loss does a genuine tie (

) always produce? — the maximum-uncertainty single-label loss.

Recall In Ex 6, reward rose but the objective still let the hack win. What fixed it?

Tightening past (Ex 7): then the KL penalty exceeds the reward gain, so drifting lowers .

Recall Ex 9 punchline in one sentence.

RLAIF and RLHF share the exact same Bradley–Terry + PPO/KL machinery; only the preference-label source (AI judge vs human) differs.