the four types of agent loops.
loop engineering keeps getting talked about as one thing. it's actually a choice between four structures, and each one fits a different kind of task.
it means designing the system that steers the agent, instead of steering it yourself move by move.
that system always answers two questions. what starts a run, and what decides the work is done.
in a hand-run session you answer both yourself, every single time. each loop type moves more of that into the system.
here's each type, what triggers it, and when to reach for it.
1) turn-based.
triggered by a user prompt. the agent gathers context, acts, and checks its work inside a single turn, then a human reviews the output and writes the next prompt.
use this when requirements are still forming and every output changes what you'd ask for next.
2) goal-based.
triggered by a /goal command carrying success criteria and a budget, like "get the homepage Lighthouse score to 90, stop after 5 tries." when the agent tries to stop, an evaluator model checks whether the goal is met, and a no sends it back to work.
use this when the outcome is measurable but the path there isn't worth your attention.
3) time-based.
triggered by a clock. an interval fires, the agent runs a fixed prompt like "check the PR, fix CI," then waits for the next tick. /loop runs on your machine, /schedule moves it to the cloud so it survives a closed laptop.
use this for recurring work where the task is known in advance and only the timing repeats.
4) proactive.
triggered by an event or schedule with no human present. a routine watches a channel, and when something needs handling it spawns a workflow with a triage agent, a fix agent, and a reviewer that adversarially judges the work before the task closes.
use this for standing responsibilities where you can't predict what will come in, only that something will.
each type hands off one more job than the last. turn-based keeps both with the human, goal-based automates the checking, time-based automates the trigger, and proactive automates both while deciding the workflow shape at runtime.
so the mapping question isn't which loop is most advanced. it's whether your task is exploratory, measurable, recurring, or standing.
the more you hand off, the less you babysit.
I wrote the full breakdown on loop engineering. the article is quoted below.
LLM fine-tuning techniques I'd learn if I were to customize them:
Bookmark this.
1. LoRA
2. QLoRA
3. Prefix Tuning
4. Adapter Tuning
5. Instruction Tuning
6. P-Tuning
7. BitFit
8. Soft Prompts
9. RLHF
10. RLAIF
11. DPO (Direct Preference Optimization)
12. GRPO (Group Relative Policy Optimization)
13. RLAIF (RL with AI Feedback)
14. Multi-Task Fine-Tuning
15. Federated Fine-Tuning
Since we're talking about fine-tuning, I wrote a full breakdown on fine-tuning LLMs with RL in 2026. Including how to skip manual reward engineering with automatic LLM-graded rewards.
And this is done using a 100% open-source solution: https://t.co/w1KJD7LZWe
The article is quoted below.
PEOPLE ARE PAYING FOR AI ENGINEERING BOOTCAMPS BUILT FROM THIS EXACT MATERIAL.
Andrew Ng gave 3 hours of it away free.
00:00 Building agentic AI systems
04:25 Where AI engineering is actually headed
23:38 The full prompting course
2:52:17 Building an app with AI in 30 minutes
The man who taught 8 million people AI just handed you the 2026 curriculum for free.
Watch it, then read the self improving system guide below.
Follow @cyrilXBT
Andrej Karpathy just exposed how LLMs actually thinks:
"LLMs don't want to succeed. They want to imitate."
It has 80 transformer layers and spends the SAME compute on every single token as your brain
In a 45-minute talk at Microsoft Build, Karpathy reveals the full psychology of LLMs.
Worth more than any $500 prompting course you've seen on your timeline.
I can't believe that Dario Amodei Anthropic CEO of a $965B AI company said that:
"We already wrote Claude a 75-page constitution.
And Claude reads it every single training loop."
100 million genius-level AIs - Each running a different experiment.
"At Anthropic, we might have a country of geniuses in a data center in 1-2 years.
That's Dario's actual prediction for the next 24 months.
This one video replaces 100 YouTube tutorials on agent loops and building
$HIMS sweeping previous high
Very good sign and what we talked about in last nights video
If this holds, we might not see a bull back before the cycle starts 🚀
Finally started a position in $ONDS.
In today’s video I break down exactly why I took it, where my targets are, and more importantly where my stop is.
If you want to see how I structure risk on new positions step by step, watch this.
Last time this signal flashed on $HIMS , it ran +450% in 18 months. 🚨
It just triggered again.
In this video I walk through:
• My long‑term target
• Exactly where I plan to enter and scale the position
• My 12‑month outlook and key invalidation levels
A tricky LLM interview question:
You're serving a reasoning model on vLLM, and it keeps running out of GPU memory on long traces.
So you add KV cache compression and evict 90% of the cached tokens.
VRAM usage stays as is and GPU still runs out of memory.
Why?
(answer below)
Evicting 90% of the KV cache can free almost none of the memory it was using.
This sounds counterintuitive, but it follows directly from how production servers store the cache today.
The KV cache grows with every token a model generates. Each token appends its key and value vectors across every layer, and nothing is freed while generation continues.
This is the dominant memory cost for reasoning models.
If a 32K-token CoT caches ~32K tokens of KV vectors, a Qwen3-32B with 4-bit weights will run out-of-memory around 24K tokens on a 24GB GPU.
One obvious solution is to keep the important tokens and drop the rest, since attention is sparse enough to allow it.
But this does not solve the memory problem yet.
The reason is paged attention, which is the memory manager behind vLLM and most production servers.
Under the hood, it splits GPU memory into fixed physical blocks, each one holds the KV for about 16 tokens.
This block returns to the allocator only when every slot inside it is empty.
Since the eviction logic selects tokens by importance, and such tokens are scattered across blocks...
...so despite eviction, almost every block is left with at least some survivor tokens.
For instance, if the logic evicts 14k of 16k tokens across 1,000 blocks, most likely every block will still have a token.
This means the allocator frees almost nothing.
Placing the new tokens into those freed slots is not ideal because it breaks the cache's layout.
Say token 16,001 arrives, and it's placed in the slot the 40th token used to hold. The cache now reads position 38, then 16,001, then 41, so the cache is no longer in token order.
Attention can still compute the right answer from that, but only if every slot now carries a separate note recording which position it actually holds.
This introduces another bookkeeping cost that an in-order layout inherently avoids.
So the cache is logically 90% smaller and still physically the same size. Many compression results miss this because they measure on pre-allocated contiguous tensors rather than a paged server.
There's another problem.
Eviction methods pick which tokens to keep by looking at the attention scores themselves (as expected).
But fast attention kernels used in production, like FlashAttention, never save those scores.
They compute attention in small pieces and throw the full score grid away as they go, which is also why they're fast.
So the exact signal eviction methods need isn't available in memory. The workaround is to fall back to eager attention and build the full matrix, which gives up the speed FlashAttention was there to provide.
NVIDIA published a method called TriAttention to solve both these problems.
It never needs attention scores. Instead, it scores tokens from the geometry of the model's key and query vectors before RoPE is applied, where those vectors sit in stable clusters.
For the memory problem, it runs a compaction pass every 128 decoded tokens.
The surviving tokens slide forward to close the holes eviction creates, so whole blocks empty out and return to the allocator while the cache stays in token order.
On long reasoning traces, the approach matches full-attention accuracy while decoding 2.5x faster and using 10.7x less KV memory.
KV cache compression is a big infrastructure problem. The number that decides whether it works is the count of freed blocks, not the count of evicted tokens.
You can find the NVIDIA write-up here: https://t.co/ZwXv7VezVu
I wrote a first-principles breakdown of how the KV cache works. It walks through why the model stores keys and values at all, why the cache grows with every token, and a comparison of LLM generation speed with and without KV caching.
Read it below.
Top 12 Stocks to BUY now according to Leopold Aschenbrenner
1) Applied Digital $APLD
2) Bloom Energy $BE
3)CleanSpark $CLSK
4)CoreWeave $CRWV
5)Intel $INTC
6) IREN $IREN
7) Keel Infrastructure $KEEL
8) Micron $MU
9) Riot $RIOT
10) Sandisk $SNDK
11) T1 Energy $TE
12) Taiwan Semiconductor $TSM
Claude Tag is a Trojan horse. Not because Anthropic is doing anything evil. Because the incentives are obvious.
Day one, this looks like a great feature: tag Claude in Slack, let it follow the thread, remember context, connect to tools, break down tasks, chase work, and act like a teammate.
But that is exactly the problem. The moment your AI vendor becomes a shared coworker, it stops being just a model provider. It starts becoming the place where work is interpreted, remembered, routed, and eventually executed.
That is not model lock-in. That is context lock-in. You are now renting your company back from them.
Models can be swapped. Agents can be copied. But the memory of how your company actually works is much harder, maybe impossible, to move: the Slack scar tissue, the exception paths, the customer promises, the unfinished threads, the weird workflows, the implicit owners, the “we tried that in Q2 and it failed” knowledge.
Once that lives inside one vendor’s agent layer, you are not renting intelligence anymore. You are renting your company’s operating memory.
And the pricing model makes it even more dangerous. A human coworker has a salary. Claude has unbounded tokenized activity. The more work moves through it, the more the vendor captures not just IT spend, but labor spend.
This is the enterprise bargain people will regret: Convenience now, and rapid decent into dependency.
The right architecture is simple: rent the best intelligence from whoever is best this month. OpenAI, Anthropic, Gemini, open source, whatever. But own the context layer.
Your company memory should be inspectable, permissioned, portable, and model-neutral. It should not be buried inside the same vendor that sells you the intelligence and the workflow surface.
Claude Tag is useful. That is why it is dangerous. Rent the intelligence, but own the context. Or, regret later.
I'm joining OpenAI next week!🥹 The job search turned out to be really challenging but also super rewarding, so I wrote a small blog to share what I learned along the way and hopefully make the process a little less mysterious for the next person. https://t.co/6FigSBdenD
Anthropic pays $750,000+ a year for engineers who can build LLM architectures from scratch. Stanford taught the entire thing in 1 hour lecture & released it for free.
Bookmark & watch this today before someone takes it down and read this article below
HarnessX: a harness that compiles itself.
every harness improvement so far has come from a human editing code by hand.
Anthropic strips planning steps out of Claude Code when a stronger model ships. Manus rebuilt its agent five times in six months, removing complexity each round.
the craft runs on human judgment about what to change and when. HarnessX is what happens when a system makes those edits itself.
the trick is to treat the harness as a first-class object, the way we already treat model weights.
once it's a typed, editable artifact, it can be optimized from its own execution traces.
the framing they use is an operational mirror. evolving a harness maps cleanly onto reinforcement learning.
the harness is the state. an edit is the action. the trace plus a score is the feedback. a new version is the update.
once you see it that way, the failure modes come for free. reward hacking, catastrophic forgetting, under-exploration.
the same problems that break model training show up when a system edits its own scaffolding.
so edits never ship blind. each round, a loop reads the traces, plans a change, writes the edit, then critiques it.
a gate keeps the new version only if it beats the current one on tasks it hasn't seen.
what makes this safe is the structure underneath. the harness is built from typed components the system can swap without breaking the rest.
that is what compiles really means here. every candidate harness is type-checked before it runs.
here is the result that matters. the weakest model improved the most. the strongest barely moved.
an evolved harness closes the gaps a weak model cannot fix on its own. the weights never changed. the environment around them got smarter.
this is the natural next phase of harness engineering. we moved from weights, to context, to hand-built harnesses.
the harness was the last piece we still tuned by hand.
i wrote a deep dive on agent harness engineering a while back, covering the orchestration loop, tools, memory, context management, and everything that turns a stateless LLM into a capable agent. the article is below.
paper: HarnessX: A Composable, Adaptive, and Evolvable Agent Harness Foundry: https://t.co/L0GeUKCgef
Google CEO, Sundar Pichai:
"Every engineer should have a team of agents. The skill isn't writing code anymore, it's orchestrating."
The devs who learn to run agent teams now have a huge privilege.
Watch the interview, then bookmark the exact setup below 👇
This change is actually going to change humanity. A small mistake can impact millions of other humans, it’s not like if one thing goes wrong we can pivot. The cost of pivot will also be very huge. So every company needs to have a think tank that is not just optimistic, but…