The ancient Indians perfected memory retention of large bodies of knowledge (called Vedas dating back more than 4000-6000 years) with the help of very elaborate schemes. The Vedas are composed in a language called Vedic Sanskrit (althought similar to Classical Sanskrit, still distinct). These schemes not only aided in retention, but also preserved the phonetic purity and semantics. The syllables were also intonated. Loosely speaking (the reason why I say that is I still have not found a compact and crystal clear way to convey what Vedic intonations are there for), intonations are also representative of grammatical case/context. So, the syllable intonation also had to be maintained. A brief preview of some commonly employed chanting schemes are given below:

For describing the various schemes let us consider a sentence with five words having indices 1 2 3 4 5.

Let !! - represent a termination sequence. We'll not get into technicalities, but take it as is.

1) Krama Paatha - This is relatively easy and each of the indexed word will be chanted as follows.

1 2

2 3

3 4

4 5

5!!

Notice that a given word is clubbed with the next word. (Forward chaining). There are two words in a sequence

2) Jataa Paatha - This is bit more complicated since it involves backward sequences as well.

1 2 2 1 1 2

2 3 3 2 2 3

3 4 4 3 3 4

4 5 5 4 4 5

5!!

The complexity is due to the fact that the words will have to be chanted in reverse sequence as well. (backward chaining)
For e.g. {1, 2} {2, 1} {1, 2}. There are a total of 6 words in each sequence.

3) Ghana Paatha - This is the most complex chanting mode (also called the bell mode of chanting). The chanting sequence is as below.

1 2 2 1 1 2 3 3 2 1 1 2 3

2 3 3 2 2 3 4 4 3 2 2 3 4

3 4 4 3 3 4 5 5 4 3 3 4 5

4 5 5 4 4 5

5!!

Phew!! Each sequence has 13 words made from three words. There are two word forward/backward sequences as well as three word forward/backward sequences. For e.g. {1, 2} {2, 1} for two word sequence. {1, 2, 3} and {3, 2, 1} for three word sequence. The astute reader will observe that the penultimate sequence is the same as Jathaa Paatha (and also the first six words of any sequence constitute the same).

There are several intracacies that are involved. One is compounding of words. Word compounding introduces changes to the pronunciation. Another is the change of phonetic intonation due to the modified sequence of chanting the words in a given scheme. These repetition techniques enabled the scholars to get a "feel" for how words would be intonated and pronounced phonetically in various circumstances.

I had always wondered why such elaborate schemes were devised by the Vedic seers. I have come to realise that the seers knew that when knowledge was transmitted in the oral form, it inevitably introduced corruptions in the words. In Vedic Sanskrit, purity of syllable (both phonetic pronunciation and intonation) is of utmost importance. Even a slight change in a syllable (either phonetic or intonation) would completely change the meaning of the sentence.

These techniques not only aided in error detection in chanting, but also error correction (specifically error correction in syllable intonation). If someone were chanting a sequence of words, one could verify if the words are being intonated correctly (of course it would take an expert to do that). There was a document that I read quite some time back which resorted to some abstract algebra (group theory) based arguments for explaining the error correction mechanism of some of these techniques.

Of course, many of these schemes (and also other linguistic aspects like word compounding) always kept one thing in mind - the ease with which humans are able to cognize and generate the sounds representing given syllables in a sequence of words.

In conclusion, these methods ultimately enabled scholars/priests to be able to:
a) remember entire bodies of verses/compositions with relative ease.
b) transmit such knowledge to students with zero word corruption (yes, although I am neither a linguistic nor a Vedic expert, I can go out on a limb to make this claim - zero corruption).

Edit :- Minor edits for readability/spelling.