Lookahead bias is a bias that arises when a forecasting model or investment strategy is evaluated on historical data and information that was not available at the decision time leaks into the inputs, making performance appear better than it actually was. It is a long-recognized problem in financial backtesting and is treated in machine learning as a form of data leakage.
Typical examples include using later-revised financial data as if it had been available before release, or including information from the evaluation period in training data. Preventing it requires point-in-time data that reflects only what was actually available at each moment, and an environment that blocks access to data after the evaluation date. When evaluating large language models, the possibility that answers are contained in the model's training data raises the same concern.