In order to acquire grammar, infants need to extract regularities from the linguistic input. From birth, infants can detect regularities in speech based on identity relations, and show strong neural activation to syllable sequences containing adjacent repetitions of identical syllables (e.g. ABB: mubaba). Meanwhile, newborns' neural responses to sequences of different syllables (e.g. ABC: mubage, i.e. diversity-based relations) do not differ from baseline. However, this latter ability needs to emerge during development, as most linguistic units, such as words, are composed of highly variable sequences. As infants begin to learn their first word forms at 6 months, we hypothesize that the ability to represent sequences of different syllables might become important for them at this age. Using near-infrared spectroscopy (NIRS), we measured 6-month-old infants' brain responses to repetition- and diversity-based sequences in the bilateral temporal, parietal and frontal areas. We found that 6-month-olds discriminated the repetition- and diversity-based structures in frontal and parietal regions, and exhibited equally strong activation to both grammars as compared to baseline. These results show that by 6 months of age, infants encode sequences with diversity-based structures. They thus provide the earliest evidence that prelexical infants represent difference in speech stimuli, which behavioral studies first attest at 11 months of age.