טף למה באין, כדי ליתן שכר למביאיהן
The Gemoro asks why were the infants brought for the Mitzvah of Hakhel. The Gemoro answers, to give reward tothe ones who brought them. (the parents)
From this Gemoro it seems, there is no benefit for infants, to listen and absorb the learning. Otherwise, the simple answer would have been they came to listen so to have the Torah absorbed in them.
How do we explain Chazal ( Yerushalmi Yevamos 8b) The mother of Reb Yehoshua brought him in his crib (infant) into the Bais Haknesess so his ears will be attached to Torah?