Han's Generative AI Quest

LLM Architecture Refresh [8]: Learning from Rewards

What happens when we train a language model using rewards instead of correct answers? In this post, I implement Group Relative Policy Optimization (GRPO) from scratch using Qwen2.5-0.5B-Instruct and LoRA. The model generates multiple solutions to multiplication problems, receives rewards from a programmatic verifier, and learns by comparing its attempts. I train it from three random seeds, and three more times with each group's rewards shuffled, to separate what the reward taught from what the training loop does on its own, and look at how RLHF runs the same loop with a learned judge in place of a program.

Agentic Workflows [1]: Honeyguide: who maintains the understanding when agents write the code?

Coding agents make code easier to write and change, but what an agent works out about a repository usually stays in one private conversation. Honeyguide keeps that understanding as a checkable map meant to be shared: every claim cites its source lines, a separate Checker reads those lines against the claim, and a refresh keeps the map current as the code changes. On the repo I tested, the map didn't measurably help an agent answer more accurately. This post shows how the checking and the upkeep work and what they cost. The shared team workflow isn't built yet, and whether it saves engineering time is open.

Pepper & Carrot AI-powered flipbook · Part 20 — Rebuilding the Red-Teamer on LangGraph Deep Agents: Same Rules, a Batteries-Included Harness

Part 20 of the Pepper & Carrot AI flipbook series. Post 19 built an AI agent that attacks my own reading app, hand-rolled from scratch. This post rebuilds it on LangChain's Deep Agents, which hands you planning, subagents, and human-in-the-loop for free. But the project lives by one rule: the attacker never grades its own attack. A framework makes that rule easy to break, since the obvious move is to give the model a tool for everything — including the judge. The fix takes one line: compute the verdict inside the tool the agent calls, so it can read a pass/fail but never produce one. Then we make the attacker much smarter, without letting it become its own scorekeeper.