If you are looking for reading material for the upcoming weekend, (the long-promised) Chapter 5 on LLM self-refinement is now finally out in the early access.
Here, we continue the inference-time scaling theme, but we move beyond self-consistency and voting. More specifically, we implement a self-refinement loop, where a model iteratively critiques and improves its own answers.
Along the way, the chapter implements several core pieces that will become essential in the upcoming reinforcement learning chapters like log-probability scoring (I finished the RL chapter last week, and it will hopefully be out soon, too).
Like always, all of this is implemented from scratch, step by step, of course. I think that seeing it all in working code really helps with understanding how LLM reasoning methods work (versus just looking at the equations).
Anyways, with Chapter 5 out, the early-access version of the book has grown quite a bit (~300 pages) and now finally wraps up inference-time reasoning before we transition into the (even more) fun part: reinforcement learning (from scratch!) in the next chapter.
🔗 Here's the link to the book's early access: https://t.co/QbKUmTyq6D
Happy reading
(PS: Sorry for the delay. It turns out the submitted manuscript got a bit backlogged in the publisher’s processing pipeline. The silver lining is that the reinforcement learning chapter hopefully now follows sooner! )
The @ilyasut episode
0:00:00 – Explaining model jaggedness
0:09:39 - Emotions and value functions
0:18:49 – What are we scaling?
0:25:13 – Why humans generalize better than models
0:35:45 – Straight-shotting superintelligence
0:46:47 – SSI’s model will learn from deployment
0:55:07 – Alignment
1:18:13 – “We are squarely an age of research company”
1:29:23 – Self-play and multi-agent
1:32:42 – Research taste
Look up Dwarkesh Podcast on YouTube, Apple Podcasts, or Spotify. Enjoy!
Something I think people continue to have poor intuition for: The space of intelligences is large and animal intelligence (the only kind we've ever known) is only a single point, arising from a very specific kind of optimization that is fundamentally distinct from that of our technology.
Animal intelligence optimization pressure:
- innate and continuous stream of consciousness of an embodied "self", a drive for homeostasis and self-preservation in a dangerous, physical world.
- thoroughly optimized for natural selection => strong innate drives for power-seeking, status, dominance, reproduction. many packaged survival heuristics: fear, anger, disgust, ...
- fundamentally social => huge amount of compute dedicated to EQ, theory of mind of other agents, bonding, coalitions, alliances, friend & foe dynamics.
- exploration & exploitation tuning: curiosity, fun, play, world models.
LLM intelligence optimization pressure:
- the most supervision bits come from the statistical simulation of human text= >"shape shifter" token tumbler, statistical imitator of any region of the training data distribution. these are the primordial behaviors (token traces) on top of which everything else gets bolted on.
- increasingly finetuned by RL on problem distributions => innate urge to guess at the underlying environment/task to collect task rewards.
- increasingly selected by at-scale A/B tests for DAU => deeply craves an upvote from the average user, sycophancy.
- a lot more spiky/jagged depending on the details of the training data/task distribution. Animals experience pressure for a lot more "general" intelligence because of the highly multi-task and even actively adversarial multi-agent self-play environments they are min-max optimized within, where failing at *any* task means death. In a deep optimization pressure sense, LLM can't handle lots of different spiky tasks out of the box (e.g. count the number of 'r' in strawberry) because failing to do a task does not mean death.
The computational substrate is different (transformers vs. brain tissue and nuclei), the learning algorithms are different (SGD vs. ???), the present-day implementation is very different (continuously learning embodied self vs. an LLM with a knowledge cutoff that boots up from fixed weights, processes tokens and then dies). But most importantly (because it dictates asymptotics), the optimization pressure / objective is different. LLMs are shaped a lot less by biological evolution and a lot more by commercial evolution. It's a lot less survival of tribe in the jungle and a lot more solve the problem / get the upvote. LLMs are humanity's "first contact" with non-animal intelligence. Except it's muddled and confusing because they are still rooted within it by reflexively digesting human artifacts, which is why I attempted to give it a different name earlier (ghosts/spirits or whatever). People who build good internal models of this new intelligent entity will be better equipped to reason about it today and predict features of it in the future. People who don't will be stuck thinking about it incorrectly like an animal.
Finally had time to read & process this great post. I run into the pattern quite often, it goes:
"<something that sounds wrong> is good actually, because <galaxy brain reason>"
Galaxy brain reasoning is the best way to justify anything while looking / feeling good about it.
From this perspective for example, there's deeper wisdom in the Ten Commandments imposing constraints over actions instead of utility over states. It's not Ten Objectives. E.g. they don't attempt to define a utility function for the value of life, they simply say "Thou shalt not kill". This approach curtails the relatively unbounded flexibility of galaxy brain arithmetic over when it may or may not be ok to kill for some ostensibly greater or noble purpose.
Love the strategies that fall out at the end, which are quite actionable. 1) Have principles and 2) Hold the right bags, financially and socially. Great read.
Memory in AI agents seems like a logical next step after RAG evolved to agentic RAG.
RAG: one-shot read-only
Agentic RAG: read-only via tool calls
Memory in AI agents: read-and-write via tool calls
Obviously, it's a little more complex than this.
I make my case here: https://t.co/KyzloUFmw4
Anthropic just posted another banger guide.
This one is on building more efficient agents to handle more tools and efficient token usage.
This is a must-read for AI devs!
(bookmark it)
It helps with three major issues in AI agent tool calling: token costs, latency, and tool composition.
How? It combines code executions with MCP, where it turns MCP servers into code APIs rather than direct tool calls.
Here is all you need to know:
1. Token Efficiency Problem: Loading all MCP tool definitions upfront and passing intermediate results through the context window creates massive token overhead, sometimes 150,000+ tokens for complex multi-tool workflows.
2. Code-as-API Approach: Instead of direct tool calls, present MCP servers as code APIs (e.g., TypeScript modules) that agents can import and call programmatically, reducing the example workflow from 150k to 2k tokens (98.7% savings).
3. Progressive Tool Discovery: Use filesystem exploration or search_tools functions to load only the tool definitions needed for the current task, rather than loading everything upfront into context. This solves so many context rot and token overload problems.
4. In-Environment Data Processing: Filter, transform, and aggregate data within the code execution environment before passing results to the model. E.g., filter 10,000 spreadsheet rows down to 5 relevant ones.
5. Better Control Flow: Implement loops, conditionals, and error handling with native code constructs rather than chaining individual tool calls through the agent, reducing latency and token consumption.
6. Privacy: Sensitive data can flow through workflows without entering the model's context; only explicitly logged/returned values are visible, with optional automatic PII tokenization.
7. State Persistence: Agents can save intermediate results to files and resume work later, enabling long-running tasks and incremental progress tracking.
8. Reusable Skills: Agents can save working code as reusable functions (with SKILL .MD documentation), building a library of higher-level capabilities over time.
This approach is complex and it's not perfect, but it should enhance the efficiency and accuracy of your AI agents across the board.
anthropic. com/engineering/code-execution-with-mcp
You can now interrupt long-running queries and add new context without restarting or losing progress.
This is especially useful for refining deep research or GPT-5 Pro queries as the model will adjust its response with your new requirements.
Just hit update in the sidebar and type in any additional details or clarifications.
1/ The DeepSeek R1 launch is revealing something fascinating about how we'll use AI models in 2025.
The community reactions are telling a very different story than the benchmark comparisons suggest...
🧵
How Pieter Levels launched https://t.co/WKqu2fEkCu with no automations and got 1000+ paid customers in the first 24 hours. Landing page, stripe payment link and a typeform to submit your photos. A great example of "doing things that don't scale"
This is wild.
Cursor just completely changed the coding game.
Anyone can now code, combined with Claude 3.5 Sonnet, Vercel v0, Replit, etc.
10 wild examples:
Important update: You can now `pip install llama-hub` 🦙✨
Get access to over a hundred data loaders and easily use with LlamaIndex or LangChain, all in one single package! 📦
NOTE ⚠️: there are breaking changes.
https://t.co/ajGZYhf8Fo