The evolution of encoding