They do learn to a degree, but I have found that they not only learn a few good things and get faster, but they also learn some really bad lines that cost them tons of time. They also insist on lifting off the throttle on some of the faster sections when they really don't need to.
I think that bobvanvliet is correct on setting the levels.
My suggestion is to let each AI hotlap by themselves on a track. They will get some faster then. If they go in a big group, they usually end up wrecking themselves and then they seem to learn bad behaviors.
I do use the AI some for training for a race. Yes, online is better, but that is not always an option. It makes it a bit more interesting to use the AI. Yes, it is still really annoying when they ram you off the track, but it does teach you to use alternate lines
.
Some people like to practice with other cars on the track, so there is nothing wrong with that.