Learning accurate beliefs about the world is computationally demanding but critical for adaptive behavior across the lifespan. Here, we build on an established framework formalizing learning as predictive inference and examine the possibility that age differences in learning emerge from efficient computations that consider available cognitive resources differing across the lifespan. In our resource-rational model, beliefs are updated through a sampling process that stops after reaching a criterion level of accuracy. The sampling process navigates a trade-off between belief accuracy and computational cost, with more samples favoring belief accuracy and fewer samples minimizing costs. When cognitive resources are limited or costly, a maximization of the accuracy–cost ratio requires a more frugal sampling policy, which leads to systematically biased beliefs. Data from two lifespan studies (N = 129 and N = 90) and one study in younger adults (N = 94) show that children and older adults display biases characteristic of a more frugal sampling policy. This is reflected in (a) more frequent perseveration when participants are required to update from previous beliefs and (b) a stronger anchoring bias when updating beliefs from an externally generated value. These results are qualitatively consistent with simulated predictions of our resource-rational model, corroborating the assumption that the identified biases originate from sampling. Our model and results provide a unifying perspective on perseverative and anchoring biases, show that they can jointly emerge from efficient belief-updating computations, and suggest that resource-rational adjustments of sampling computations can explain age-related changes in adaptive learning.