two-bit saturating counter
A tiny counter from 0 to 3 that moves up when a branch is taken and down when not; it guesses taken at 2 or 3, so one surprise doesn't flip its guess.
A two-bit saturating counter has states 0-3 (strongly not taken, weakly not taken, weakly taken, strongly taken), increments on taken and decrements on not taken without wrapping, and predicts taken in states 2 and 3; a single anomalous outcome changes the prediction only from a weak state.
Examples
States 0 and 1 predict not taken, 2 and 3 taken. A loop's one exit moves a counter at 3 only to 2, so the next pass is still predicted taken.