# Dynamic Branch Prediction **Entity class:** Processor mechanism **Domain:** Computer architecture / online prediction **As of:** November 17, 2026 ## Definition **Dynamic branch prediction** estimates whether a conditional branch will be taken, and sometimes where an indirect branch will go, using information acquired while code runs. A processor encountering an unresolved fork need not wait for its condition to become known: the predictor selects a likely successor, and the processor fetches or [[wiki/Speculative Execution|speculatively executes]] instructions on that path. Once the condition resolves, correct work can continue toward retirement; work dependent on a wrong guess is squashed and execution is redirected. Several unresolved branches may be in flight, so a predicted path can extend through successive forks, but the processor generally pursues selected speculative paths rather than calculating every branch of an entire tree. ## Learning in the Processor Predictors vary by generation. Simple designs keep a small state such as a saturating counter for a branch; later designs use correlations among recent branch outcomes and histories of different lengths. [[wiki/Perceptron Branch Predictor|Jiménez and Lin's perceptron design]] uses a weighted sum of earlier outcomes to predict a branch and updates weights after the actual outcome is known. The authors explicitly described it as a machine-learning technique implemented in hardware. AMD publicly described its Zen “Neural Net Prediction” as learning a future application pathway from previous runs, and its Zen 2 documentation identifies a TAGE predictor; that vendor language does not establish that every branch predictor is a perceptron or that all implementations retain the same state across runs. ## Historical Markers Intel's architecture manual records an on-chip branch table in the 1993 Pentium and the combination of superior prediction, out-of-order execution and speculative execution in the 1995 Pentium Pro. The 2001 perceptron paper reported a 10.1 percent reduction in misprediction rate against gshare at a 4 KB hardware budget on its SPEC 2000 integer benchmarks. AMD's December 2016 Zen announcement explicitly marketed an artificial-intelligence neural network for predicting a program's future path, with the first Ryzen products reaching market in 2017. These markers establish a long hardware lineage without projecting one particular predictor onto every CPU ever sold. ## Scale and Evidence The relevant unit is **a prediction per encountered branch per active execution stream**, with extra speculative activity that may never retire. For an illustrative 4 GHz core retiring two instructions per cycle with one branch in eight retired instructions, the arithmetic is one billion retired branches per second; a million equally busy cores would imply one quadrillion such branches per second. This is a conditional workload model, not a measurement of a real population or proof that every device sustains that rate. The 2019 SPEC CPU2017 characterization of an Intel Core i7-8700K measured retired instructions, branches and misses on actual benchmark runs, showing the proper method for empirical counts; any planetary aggregate requires comparable workload, core and time denominators rather than a device-shipment total. ## Security Consequence **Spectre** demonstrates that predictor state can be influenced and mispredictions can leave observable microarchitectural traces. The original researchers described mistraining branch predictors so a victim transiently executes an attacker-chosen path, with cache timing used to infer information after architectural results are discarded. The attack exploits prediction and speculation in a security boundary; it is evidence of learned or history-dependent state with real operational effect, not a claim that a CPU predictor has a language-level intention or independent agency. ## Relationships - **mechanism of:** [[wiki/Predictive Engines|Predictive Engines]] and [[wiki/Speculative Execution|Speculative Execution]]. - **neural variant:** [[wiki/Perceptron Branch Predictor|Perceptron Branch Predictor]]. - **corpus interpretation:** [[wiki/The Voice Comes Late|The Voice Comes Late]] and [[blog/2026-10-05 - Predictive AI vs. Generative AI|Predictive AI vs. Generative AI]]. - **historical framework:** [[wiki/Machine Intelligence Continuum|Machine Intelligence Continuum]]. ## Sources - [Intel, *Intel 64 and IA-32 Architectures Software Developer's Manual*, volume 1, §2.1.5–2.1.6](https://cdrdv2-public.intel.com/812392/325462-sdm-vol-1-2abcd-3abcd-4.pdf). - [Jiménez and Lin, *Dynamic Branch Prediction with Perceptrons*](https://www.cs.utexas.edu/~lin/papers/hpca01.pdf). - [AMD, *AMD Takes Computing to a New Horizon with Ryzen Processors*](https://ir.amd.com/news-events/press-releases/detail/741/amd-takes-computing-to-a-new-horizon-with-ryzentm-processors). - [AMD, *Zen Core Architecture*](https://www.amd.com/en/technologies/zen-core.html). - [Intel, *Introduction to Speculative Execution Side Channel Methods*](https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/technical-documentation/introduction-speculative-side-channel-methods.html). - [Kocher et al., *Spectre Attacks: Exploiting Speculative Execution*](https://spectreattack.com/spectre.pdf). - [Hebbar and Milenković, *SPEC CPU2017: Performance, Event, and Energy Characterization on the Core i7-8700K*](https://research.spec.org/icpe_proceedings/2019/proceedings/p111.pdf).