Therapeutic neuroscience

What is predictive coding?

You do not feel the world. You feel your brain's best guess about the world, corrected by the senses when the guess is wrong. Predictive coding is the theory that describes how that guessing works, and it has become the main scientific framework for understanding why pain can continue long after an injury has healed.

Reviewed by The Karuna Labs clinical teamUpdated Series · part 3 of 15

What is predictive coding?

Predictive coding is a theory that the brain perceives by predicting. Rather than passively receiving signals from the senses, it constantly generates a best guess about what the body and the world are doing, compares that guess with incoming data, and updates when the two disagree. In this framework, pain is a prediction of threat to the body, which is why it can persist after an injury has healed.

It is the framework therapeutic neuroscience draws on to explain why chronic pain can outlast tissue damage, and why retraining the prediction is a legitimate treatment target.

At a glance

Core idea
The brain is a prediction machine that perceives by guessing first and correcting against the senses second
Key terms
Priors (the brain's expectations), prediction error (the gap between expectation and sensory data), precision (how much each is trusted)
Also called
Predictive processing, the Bayesian brain, the predictive brain; closely related to active inference and the free energy principle
Pain in this model
A protective inference about threat to the body, built from tissue signals, context, memory and expectation together
Why pain persists
A high-confidence prior of threat keeps being confirmed, and the evidence that would update it is avoided or discounted
Status
An influential framework with growing but incomplete evidence; a theory, not a settled fact
Related reading
Active inference · Does the brain feel pain? · Neuroplastic pain

Key takeaways

  • Perception runs top-down first. The brain predicts what the senses should report and uses the actual signal mainly to correct the prediction.
  • Pain is a prediction too. It is the brain's inference that the body is under threat, and that inference draws on tissue signals, memory, context and expectation, all of which are real inputs.
  • In chronic pain the prediction of threat can become so confident that the body's own evidence of safety is discounted or never collected, because the feared movements are avoided.
  • Attention sets the volume. Hypervigilance to the body turns up the weight on every small signal, which the threat model then explains as pain.
  • Treatment, in this framework, means giving the brain new evidence it cannot ignore: education that changes the prior, graded movement that supplies prediction errors, and embodiment practice that makes safety visible.

What is predictive coding?

Predictive coding is a theory of how the brain builds perception. Its central claim is that the brain does not wait for the senses to tell it what is happening. It predicts what is happening, sends that prediction down toward the senses, and the senses send back only the part the prediction got wrong. That returned difference is called prediction error, and perception is the ongoing process of driving it down.

Think of a weather forecaster. The forecaster does not stare at the sky and wait. They start with a model built from years of data, issue a forecast, then read the instruments and revise where the forecast missed. The forecast is the brain's prior, the instrument reading is sensory input, and the revision is the update. Most of the time the forecast is close, so very little needs to change.

The brain is thought to do this in layers. Higher regions predict what lower regions should be reporting; lower regions pass up only the surprises. The idea was worked out in detail for the visual cortex in 1999, where it explained several puzzling features of how visual neurons respond, and over the following decade it was generalized into a theory of the whole brain under names like predictive processing, the Bayesian brain, and the free energy principle.

A third term matters as much as the first two. Precision is how much confidence the brain assigns to a prior or to a signal. High-precision signals get to change the model; low-precision ones are quietly ignored. Most of what goes wrong in chronic pain, in this framework, is a precision problem rather than a signal problem. One housekeeping note: in law and e-discovery, 'predictive coding' means software that sorts documents for relevance, which has nothing to do with the brain and is not what this page is about.

Predictive coding is a framework, not a proven mechanism. It fits a great deal of data and has been very productive for research, but how literally the brain implements it is still debated, and some of its claims have not been tested directly. We write about it here because it is the clearest way to understand what the pain system is doing, and because it points at treatments that have evidence of their own.

Is perception a controlled hallucination?

The neuroscientist Anil Seth describes perception as a controlled hallucination, and the phrase is accurate as long as both words are kept. Perception is a hallucination in the sense that it is generated from the inside: what you experience is the brain's model, not a copy of the world. It is controlled in the sense that the model is constantly checked against the senses and corrected when it drifts. Drop the second word and you have a mystical claim that nothing is real. Keep it and you have a description of how a brain can be fast, stable and mostly right.

A simple example is the stability of the room you are in. Your eyes jump to a new position several times every second, and each jump smears the image on the retina. You experience none of this. The room holds still, because what you see is the forecast of a stable room, with the instrument readings used only to confirm or adjust it. The raw feed would be unwatchable; the prediction is calm.

This matters for pain because the same logic applies to the body. The sensation of your lower back, your knee or your hand is not a direct readout from the tissue. It is the brain's model of that body part, informed by signals from the tissue but also by memory, expectation and what the brain believes is at stake. That does not make the sensation less real. Every perception you have ever had was built this way.

It does mean that perception is constrained by the senses, not invented in spite of them. A healthy prediction system cannot make a broken bone feel fine, and it cannot hallucinate pain out of nothing for long without some input to work with. What it can do is weight the inputs differently, which is where the trouble starts in chronic pain. Our guide to whether the brain feels pain takes this question further.

How does predictive coding explain chronic pain?

In this framework, pain is the brain's inference that the body is under threat and needs protecting. The inputs are real: signals from tissue and nerves, inflammation, the memory of what happened last time, the context you are in, and what you expect to happen next. The brain weighs all of them and produces a protective output. When the tissue input is strong and fresh, as in a new injury, the inference is dominated by it, and pain tracks damage reasonably well. Chronic pain is what happens when the other inputs take over the weighting.

Phantom limb pain is the clearest case. After an amputation, most people continue to feel the missing limb, and many feel pain in it. There is no tissue to report damage. What remains is the brain's model of the limb, which still predicts sensation and still predicts threat, and which now receives no sensory input that could correct it. The forecast is issued every morning, and the instrument it would be checked against has been removed. Phantom limb pain is the extreme version of a prediction that can no longer be updated.

When the prediction stops updating

In most chronic pain the limb is still there, and the question becomes why the prediction of threat does not update as the tissue heals. Predictive coding offers a specific answer: the prior has become high-precision. The brain is so confident that this back is fragile, or this movement is dangerous, that evidence to the contrary is assigned low precision and discounted. The person bends, feels pain, and the model is confirmed. The person does not bend, feels relief, and the model is confirmed again. Nothing in the loop produces a prediction error large enough to count.

  • Avoidance removes the data. The feared movement is never performed, so the forecast of harm is never tested. This is the engine of kinesiophobia.
  • Guarding changes the input. Bracing and tension generate their own signals from the muscles, which the threat model reads as confirmation.
  • Context becomes a cue. The chair where it hurt, the time of day, the task that triggered it: each becomes a predictor of pain, and the prediction arrives before the movement does.
  • Expectation sets the baseline. Being told a disc is 'degenerated' or a joint is 'bone on bone' raises the prior of threat, with effects that research on the nocebo effect has measured directly.

Researchers writing in the journal Pain have put this in terms of what the body can do: pain, in their phrase, negotiates the boundaries of possible action. It marks the edge of what the brain believes is safe to attempt, and in chronic pain that edge has been drawn far inside the body's real capacity. This is the same territory our pages on neuroplastic pain and central sensitization describe from the clinical side, and the Lancet review of nociplastic pain covers from the research side.

None of this says the brain is the only cause of pain, or that tissue does not matter. Arthritis, nerve injury, inflammation and disease are real inputs, and they need medical assessment before anyone talks about retraining predictions. The framework explains how pain is assembled from its inputs. It does not pretend the inputs are imaginary.

What do attention and precision have to do with pain?

Attention, in predictive coding, is precision weighting. To attend to something is to tell the brain that signals from that source are reliable and should be allowed to update the model. Looking at your hand raises the precision of visual signals from your hand. Scanning your back for pain raises the precision of every signal from your back, including the ordinary ones that a body produces all day.

This is why hypervigilance makes chronic pain worse without anyone imagining anything. A person who has learned that their back is dangerous checks it constantly. Checking turns up the gain. Small, normal sensations that would once have been filtered out now arrive with high precision, and the threat model has to explain them. Its explanation is pain. The forecaster has started treating every flicker of the instruments as a storm warning. At the same time, the prior of threat holds high precision of its own, so the two settings reinforce each other: the model trusts its expectation of danger and trusts the signals that agree with it. Evidence of safety, such as a movement that went fine, is assigned low precision and fades without changing anything.

Distraction works on this system in the short term. Pulling attention away from the body lowers the precision of bodily signals, and pain often eases while the distraction lasts. The limit is that nothing has been learned. The threat prior is untouched, and when attention returns, so does the pain. This is why a film or a video game can help for an evening and change nothing by the morning.

Retraining aims at the model rather than the volume. It involves attending to the body differently, with curiosity instead of alarm, so that the sensory data contradicting threat is finally given enough precision to count. Somatic tracking in pain reprocessing therapy is built on exactly this move, and our guide to interoception explains how the reading of internal signals can be retrained rather than switched off.

How does predictive coding change the sense of self?

The same machinery that predicts the world predicts the body, and the body model is where the sense of self is thought to come from. Seth and others have argued that the feeling of being a self, of owning this body and being located inside it, is the brain's best model of its own physiological state, maintained by predicting signals from the heart, gut, muscles and skin and keeping them in range. In this view the self is a prediction, continuously regenerated, and like any prediction it can be well or poorly calibrated.

This is the thread that runs through the whole therapeutic neuroscience series: our sense of self is constructed, and chronic pain builds a different self. When the body model has been organized around threat for months or years, that organization is no longer just a belief about the back or the knee. It becomes who the person is. 'I am someone who cannot lift.' 'I am fragile.' 'My body is not safe.' The guarding posture, the shortened stride and the habit of checking are all part of the self-model now, and they generate the sensory evidence that keeps the model in place.

Consider someone who hurt their shoulder at work three years ago. The tear healed. What did not heal is the model: a self that reaches for things with the other arm, that plans the day around what the shoulder will allow, that tenses when a colleague throws a set of keys. The forecast for this shoulder is issued before every movement, and the self has been rebuilt around the forecast.

There is a hopeful side to this. A constructed self can be reconstructed, because the machinery that built it is still running and still responsive to evidence. Our guide to the sense of self in chronic pain goes into the narrative self, the default mode network and what loosening a fixed story of a broken body looks like in practice. The point here is simpler: the pain and the self are made by the same system, so treatments that give that system new evidence about the body can change both.

Saying the self is constructed is not saying the pain is a story someone is telling themselves. The self-model is built from real signals and real experience, and it produces real pain through real physiology. What changes in treatment is the model's confidence about threat, not the reality of the person's experience.

How is predictive coding used in treatment?

If chronic pain is a high-precision prediction of threat that has stopped updating, treatment has a clear job: supply prediction errors the brain can trust. Each of the approaches with the best evidence in chronic pain does this in a different way, and the framework helps explain why they work together better than any one alone.

ApproachWhat it changesHow it supplies the prediction error
Pain neuroscience educationThe prior itselfUnderstanding that hurt does not reliably mean harm lowers the brain's confidence in the threat forecast before any movement is attempted
Graded exposure and sensorimotor retrainingThe evidenceFeared movements are performed in tolerable doses, producing repeated experiences of safety that contradict the prediction
Attention retraining and somatic trackingThe precisionBodily signals are attended to with curiosity rather than alarm, so evidence of safety is finally allowed to count
VR embodiment trainingThe body modelSeeing a virtual body move safely and fully gives the brain first-person visual evidence that disagrees with the forecast of harm

Education changes priors. Explaining how the pain system works has been studied for more than fifteen years, and the pattern of results suggests it does its best work as a preparation for movement rather than as a stand-alone treatment. Our research commentaries on fifteen years of explaining pain and on whether pain neuroscience education works weigh that evidence.

Graded exposure supplies prediction errors. A movement the brain forecast as dangerous is performed and the forecast misses. Done in small enough steps, that miss is tolerable and the model updates a little. Done as 'push through it', the flare that follows confirms the model instead. The trial of graded sensorimotor retraining for back pain is one of the better tests of this principle, and the five-year follow-up of pain reprocessing therapy suggests that when the prior does update, the change can last.

VR embodiment makes the error visible and safe. Vision is given very high precision by the brain, which is why seeing a virtual body move can change what a real body feels. Karuna Virtual Embodiment Training (KVET)™ is built on this: the exercises are designed to create safe prediction errors around movement and to retrain the brain's body map, using what the person sees their body doing as the strongest available evidence. Our commentary on virtual embodiment and pain reviews the research behind it. In practice, Karuna's program runs for 12 weeks at home on a provided headset, with short daily VR sessions, a weekly one-on-one session with a pain coach who teaches the neuroscience behind each exercise, and a clinician who reviews the case before anything begins and oversees it throughout. The structure follows the theory: a prior that took years to build updates through repetition, not a single insight. The full description of the program, including its outcome data and the caveats that go with it, is on its own page.

A caution that belongs next to every claim on this page. Predictive coding explains why these treatments might work; it does not guarantee that they will. Many people improve substantially with this kind of retraining and some do not, and no one can tell in advance which group a given person will be in. The goal is less pain and more function, built on evidence, for appropriately selected patients.

What this means for you

If you have had pain for months or years and been told the scans look fine, predictive coding gives you something better than 'it must be in your head'. Your pain is real. It is produced by a system doing its job of protecting you, using a forecast that has become too confident and stopped checking the instruments. That is a physiological problem with a physiological solution, and it is not a verdict on your character or your sanity.

  • Get the inputs assessed first. Predictions are built from real signals, and some of those signals need medical attention. See a doctor promptly for new weakness or numbness, loss of bowel or bladder control, unexplained weight loss, fever, pain after a major trauma, or chest pain. If you are having thoughts of self-harm, call or text 988 in the US.
  • Notice the forecasts. The pain that arrives before you bend, the tightening when you see the stairs, the dread of the chair where it hurt: these are predictions, and noticing them as predictions is the first step toward testing them.
  • Collect new evidence in small doses. A movement performed within tolerance and found to be fine is a prediction error. Enough of them, repeated over weeks, is how a prior changes. Large flares teach the wrong lesson, so the dose matters more than the courage.
  • Change how you attend, not just whether. Checking the body for danger turns up the gain. Attending to it with curiosity, as a scientist rather than a sentry, lets the ordinary signals be ordinary.
  • Expect the model to resist. A prior with years behind it does not update on the first contradiction. Progress is uneven, and setbacks are part of the learning rather than proof the learning failed.

For clinicians, the framework changes the conversation more than the exercise sheet. Telling a patient their pain is a confident prediction that needs new evidence, rather than a sign of damage or a problem of attitude, gives them a model they can act on and a reason to tolerate the discomfort of graded movement. It also makes the language in the room part of the treatment, since every phrase about fragility or degeneration goes straight into the prior. Our guide to neuroplasticity covers how repeated experience physically reshapes the networks involved.

If you want to talk through whether this kind of retraining fits your pain, Karuna offers a free consultation with a clinician review before anything begins. Part of its purpose is to say plainly when it is not the right fit.

Frequently asked questions

What is the difference between predictive coding and predictive processing?

Predictive coding began as a specific proposal about how neurons in sensory cortex pass messages: higher layers send predictions down, lower layers send only the errors up. Predictive processing is the broader claim that this is how the whole brain works, including perception, action, emotion and the sense of self.

In everyday use the two are close to interchangeable, and this page uses predictive coding as the search term most people know. Active inference extends the same idea to action: the brain can reduce prediction error either by updating its model or by moving the body so the world matches the prediction.

Is predictive coding theory proven?

No, and researchers who work within it generally say so. It is a framework that fits a large amount of evidence from vision, hearing, movement and body perception, and it has generated testable predictions, some of which have held up well. Whether the brain literally implements it, layer by layer, is still open.

For chronic pain the practical question is different: do the treatments the framework points toward work? Education, graded exposure, attention retraining and embodiment approaches each have evidence of their own, which is why we describe predictive coding as a useful explanation rather than a proven mechanism.

What does 'the predictive brain' mean?

It is shorthand for the view that the brain's main job is anticipation: predicting what the senses will report, what the body needs, and what will happen next, then correcting those predictions as reality comes in. The alternative view, that the brain mostly reacts to incoming signals, has fallen out of favor because it cannot explain how perception is so fast and so stable.

In pain science, the predictive brain is the reason an identical signal from the body can be felt as nothing on a good day and as sharp pain in a threatening context. The signal did not change; the prediction did.

Does the brain predict pain before it happens?

Research suggests it does, which is why pain can arrive as you reach for the kettle rather than when you lift it. Once a movement, place or time of day has been paired with pain often enough, it becomes a cue, and the brain issues its protective forecast in advance. People often describe this as pain that 'knows what is coming'.

This anticipation is also what treatment works with. A forecast that arrives before the movement can be tested by the movement, and when the movement goes better than forecast, that is the prediction error retraining depends on.

Does predictive coding mean my pain is imaginary?

No. Every perception you have, including the sight of this page, is built by the same predictive machinery, and no one calls vision imaginary. Chronic pain is produced by real physiology, from real inputs, through a system that has become overconfident about threat. The pain is as real as any other experience your brain generates.

What the framework does say is that tissue damage is one input among several, and that in chronic pain the others, especially expectation and attention, have come to carry more of the weight. That is a reason for hope, because those inputs can be changed, and it is never a reason to dismiss the pain or skip a medical assessment.

Sources & research.

  1. Rao RP, Ballard DH, Nat Neurosci, 1999. Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects
  2. Friston K, Nat Rev Neurosci, 2010. The free-energy principle: a unified brain theory?
  3. Clark A, Behav Brain Sci, 2013. Whatever next? Predictive brains, situated agents, and the future of cognitive science
  4. Seth AK, Trends Cogn Sci, 2013. Interoceptive inference, emotion, and the embodied self
  5. Tabor A et al., Pain, 2017. Embodied pain: negotiating the boundaries of possible action
  6. Ongaro G, Kaptchuk TJ, Pain, 2019. Symptom perception, placebo effects, and the Bayesian brain

Related guides.

Free consultation

Ready to unlearn your pain?

Talk with our care team about your pain, your history, and whether KVET™ is right for you. Free, and from the comfort of home.

Free. No symptom or health details are collected on this form.