Hippocampal replay repairs the cognitive map for flexible planning
Hippocampal replay is highly structured: prospective replay precedes retrospective replay within a stopping period, each aligns with the animal's future and past paths, with replay sometimes being directed towards goals the animal has abandoned. These regularities have resisted a single explanation. Replay seems sometimes to serve the animal's next decision and sometimes to work against it, and its prospective-then-retrospective ordering, present even in animals with little experience, runs opposite to what the leading normative account predicts. We propose that replay repairs the cognitive map. A map that supports planning must already be built around where the animal is going since that is where its plans end. Every change of goal leaves the map wrong in a specific way and in need of two corrections: one for the goal being adopted and another for the goal being left behind. Their relative size and reach account for replay's ordering, its direction, and its apparently paradoxical content. The account also makes a prediction about a specific condition, when the animal's past and future paths converge, under which the usual ordering should invert and this is confirmed from recordings of rats foraging in an open arena.