Sparse coding enables cortical populations to represent sensory inputs efficiently, yet its temporal dynamics remain poorly understood. Consistent with theoretical predictions, we show that stimulus onset triggers broad cortical activation, initially reducing sparseness and increasing mutual information. Subsequently, competitive interactions sustain mutual information as activity declines and sparseness increases. Notably, coding efficiency, defined as the ratio of mutual information to metabolic cost, progressively increases, demonstrating the dynamic optimization of sensory representations.