Back

agent-05 · Self-correction has three layers: decoding, workflow, and reasoning

A practical map of AI self-correction: decoding tricks, workflow feedback, and trained reasoning all need real signals, not just reflection.

Also available in these alternate versions: Lee Hung-yi-inspired English teaching-style version, 繁體中文, and 李宏毅老師經典的教學風格版.

Dark campaign cover reading Self-Correction Needs A Signal, with a red technical feedback-system layout.

The fifth lecture asks a question that sounds simple: can AI correct itself?

The answer depends on what we mean by correct itself. A model can revise an answer after a human points out the mistake. That is common. The harder question is whether it can detect and fix its own mistake without a human giving the answer away.

Hung-yi Lee organizes the space into three layers:

  1. change decoding
  2. change the workflow
  3. change the model through reasoning training

That taxonomy is useful because people often collapse all three into one vague phrase: self-correction.

They are not the same thing.

Builder takeaway: self-correction needs a signal. Use tests, verifiers, retrieved evidence, contrastive baselines, or trained rewards before trusting a model's private feeling that it has fixed itself.

Layer 1: decoding

The first family does not change the model weights. It changes how the next token is selected.

Dark blueprint-style diagram explaining Layer 1: decoding, with short English labels and high-contrast technical geometry.
The first self-correction family changes decoding, not model weights.

The core idea is contrastive decoding.

A normal language model produces a distribution over possible next tokens. Contrastive decoding creates another distribution that is supposed to represent a worse or more error-prone state. Then it subtracts the bad distribution from the good one.

In rough terms:

better_answer = normal_distribution - bad_distribution

The trick is how to get the bad distribution.

Early versions used a smaller model. If the big model and small model both assign high probability to a generic continuation, but the big model has more signal for the correct answer, subtracting the small model can help.

DoLa uses layers inside the same model. Earlier layers can be treated as less mature guesses; later layers are more refined. Compare them and push the final output away from the earlier, weaker distribution.

Context-aware decoding does something similar for retrieval. Run the model with the retrieved document and without the retrieved document. The no-document answer is more likely to reflect parametric prior or hallucination. Subtract it to make the model rely more on the retrieved context.

Vision and audio versions degrade the input. Blur the image, remove the image, add noise, or replace audio with silence. The degraded input reveals the model's prior. Subtract that prior from the normal answer.

This is a neat idea. It treats hallucination as a direction you can estimate and move away from.

The cost problem

Contrastive decoding often requires extra inference. You may need to run the model twice, once normally and once in the degraded condition.

Dark blueprint-style diagram explaining The cost problem, with short English labels and high-contrast technical geometry.
Contrastive decoding often buys quality with extra inference cost.

That is expensive.

The lecture discusses minimum test-time intervention, or MTI, as a way to reduce the cost. Do not apply contrastive decoding on every token. Only do it when the model is uncertain, for example when entropy is high.

This makes intuitive sense. Most tokens are not life-changing. Spend extra compute only at decision points.

KV cache reuse can reduce cost further when the normal and contrastive inputs share a prefix. Again, this is the kind of engineering detail that matters in real systems. A clever method that doubles inference cost everywhere may lose to a boring baseline.

Layer 2: workflow

The second family wraps the model in a process.

Dark blueprint-style diagram explaining Layer 2: workflow, with short English labels and high-contrast technical geometry.
The workflow layer wraps the model in a process that can catch errors.

Generate an answer. Then ask the model to check it. Maybe ask it to reflect. Maybe run tests. Maybe use a checklist. Maybe search externally. Maybe send the output to a verifier.

This is the most familiar form of self-correction because it looks like how people use chat models:

Are you sure?
Check your work.
Find the bug.
Revise the answer.

The lecture is careful here. Pure self-reflection is not reliably good.

A model can start wrong and become right. It can also start right and become wrong. Asking the model to reconsider may increase willingness to edit, but that is not the same as increasing correctness.

This is why the lecture distinguishes internal self-reflection from external feedback.

Internal reflection is the model criticizing itself with no new evidence.

External feedback gives it something grounded: a compiler error, a failed test, a retrieved document, a checklist, a human comment, a simulator result.

External feedback is usually the better bet.

Reflection has a compute baseline

One of the best warnings in the lecture is about majority vote.

Dark blueprint-style diagram explaining Reflection has a baseline, with short English labels and high-contrast technical geometry.
Reflection is not free magic; it has to beat ordinary extra-compute baselines.

Suppose your self-reflection workflow costs three model calls: generate, reflect, revise. A fair comparison is not one raw answer. A fair comparison may be sampling three independent answers and taking the majority or best one.

If reflection does not beat that, it may not be worth the compute.

This matters because self-correction papers can accidentally compare against weak baselines. Extra compute often helps. The question is whether the structure of reflection helps more than simply sampling more.

Verification is useful, but it is not free.

The four outcomes of revision

The lecture's breakdown of revision outcomes is simple and clarifying:

Dark blueprint-style diagram explaining Four outcomes of revision, with short English labels and high-contrast technical geometry.
Revision has four outcomes, and two of them are bad.

The dream is wrong to right.

The nightmare is right to wrong.

Two metrics make this concrete:

A model that changes everything has high plasticity but low stability. A model that never changes has stability but cannot correct mistakes.

Different reflection prompts move that tradeoff. Praise can make a model hold its answer. Doubt can make it revise more. This is funny, but also important. The model's "personality" under reflection is partly an artifact of the prompt.

Layer 3: reasoning

The third family tries to internalize correction into the model.

Dark blueprint-style diagram explaining Layer 3: reasoning, with short English labels and high-contrast technical geometry.
The reasoning layer internalizes correction before the final answer.

Instead of bolting on a workflow that says "now reflect," train the model so that checking and revising happen inside its reasoning process.

This is where RL with verifiable rewards becomes relevant. For math or code, the final answer can be checked. The model generates reasoning tokens and an answer. If the answer is right, it gets positive reward. If wrong, negative reward.

The training does not need to label every intermediate thought. It only needs the final verification signal.

A common result is emergent verification: the model starts producing reasoning where it tries a path, notices a mistake, and corrects before answering.

That looks much closer to real self-correction.

Knowing the fact is not enough

The lecture gives an important conceptual warning: having the correct knowledge inside the model is not the same as using it to correct yourself.

Dark blueprint-style diagram explaining Knowing the fact is not enough, with short English labels and high-contrast technical geometry.
Having the fact inside the model is not the same as using it to correct an answer.

A model may know a fact in isolation, but fail to apply it when answering a different question. The knowledge exists somewhere in the weights. The self-correction behavior is about control: when to retrieve the fact, when to doubt the current path, when to revise.

This distinction matters because many people talk about reasoning as if the only issue is whether the model "knows" enough.

Sometimes the knowledge is there. The routing is wrong.

REVISE and the distribution shift problem

The lecture discusses REVISE, which separates error detection from error correction.

Dark blueprint-style diagram explaining REVISE and distribution shift, with short English labels and high-contrast technical geometry.
REVISE separates error detection from correction, exposing a distribution-shift risk.

The model first learns to detect whether an answer needs refinement. If it does, it emits a special refine token. Then it learns to produce the corrected answer.

That decomposition makes sense. Detecting an error and fixing an error are different skills.

But there is a subtle problem. Once you fine-tune the model, the kinds of errors it makes may change. A dataset of old errors may no longer match the new model's failure distribution.

This is a common trap in self-improvement. Training on yesterday's mistakes can help, but it can also chase a moving target.

Did RL learn something new?

The lecture ends with a debate I find very important.

Dark blueprint-style diagram explaining Did RL learn something new?, with short English labels and high-contrast technical geometry.
The open question is whether RL teaches new reasoning or mostly reweights paths.

When RL improves reasoning, what exactly changed?

One view says the base model already had good reasoning paths, but they were low probability. RL just upweighted them. Evidence for this comes from pass@k: if you sample many times from the base model, it may eventually produce a correct path.

Another view says RL can teach genuinely new reasoning behavior, not just reweight old paths. Evidence comes from looking at the reasoning path itself, not only the final answer. If the RL model produces better chains of thought under stricter path evaluation, something deeper may have changed.

The lecture's answer is not dogmatic. Early training may mostly reweight existing paths. Later training may create new capability.

That feels right to me.

My practical takeaway

If I want an agent to correct itself, I would not start with "reflect on your answer."

Dark blueprint-style diagram explaining Practical takeaway, with short English labels and high-contrast technical geometry.
For practical agents, start with tests and feedback, not pure self-reflection.

I would use this ladder:

  1. Can I get an external verifier?
  2. Can I run a test, search, compiler, simulator, or checklist?
  3. Can I compare multiple samples cheaply?
  4. Can I use contrastive decoding where hallucination priors are obvious?
  5. Can I train or choose a model that has stronger reasoning behavior?

Pure self-reflection would be near the bottom of my list unless the model is strong and the task has no external signal.

The main lesson

Self-correction is not one mechanism.

Dark blueprint-style diagram explaining The main lesson, with short English labels and high-contrast technical geometry.
Self-correction is not one mechanism.

At the decoding layer, we steer token probabilities away from estimated error states.

At the workflow layer, we wrap generation in verification and feedback.

At the reasoning layer, we try to train models that check themselves before finalizing an answer.

The deeper lesson is that correction needs a signal. Without a signal, reflection can become style, not truth.

The best self-correcting systems will probably combine all three layers: better decoding, real external feedback, and models trained to use that feedback inside their reasoning.

Concept inventory

The lecture's main self-correction concepts:

Sources and references

Primary source watched for this post: