Neural computational power is determined by neuroenergetics, but how and which energy substrates are allocated to various forms of memory engram is unclear. To solve this question, we asked whether neuronal fueling by glucose or lactate scales differently upon increasing neural computation and cognitive loads. Here, using electrophysiology, two-photon imaging, cognitive tasks, and mathematical modeling, we show that both glucose and lactate are involved in engram formation, with lactate supporting long-term synaptic plasticity evoked by high-stimulation load activity patterns and high attentional load in cognitive tasks and glucose being sufficient for less demanding neural computation and learning tasks. Indeed, we show that lactate is mandatory for demanding neural computation, such as theta-burst stimulation, while glucose is sufficient for lighter forms of activity-dependent long-term potentiation (LTP), such as spike timing–dependent plasticity (STDP). We find that subtle variations of spike number or frequency in STDP are sufficient to shift the on-demand fueling from glucose to lactate. Finally, we demonstrate that lactate is necessary for a cognitive task requiring high attentional load, such as the object-in-place task, and for the corresponding in vivo hippocampal LTP expression but is not needed for a less demanding task, such as a simple novel object recognition. Overall, these results demonstrate that glucose and lactate metabolism are differentially engaged in neuronal fueling depending on the complexity of the activity-dependent plasticity and behavior.