A good night's sleep helps young birds master the art of singing, but only after a rather groggy start, Nature magazine has reported.
The slowest starters turn out to be the best singers
When adolescent zebra finches first wake up in the morning, their singing voices are decidedly rusty.
But, strangely, the most tuneless early birds go on to become the best singers.
Scientists believe the birds practise songs in their dreams, which pays dividends in the end, despite causing a temporary "loss of direction".
"In the short-term it looks like a deterioration but in the long term, the birds that show this phenomenon become the best singers - they are the best learners," co-author Sebastien Deregnaucourt, of City University, New York, US, told the BBC News website.
Ripe for learning
Zebra finches - like many song birds - go through a critical developmental period of "brain plasticity" when their brains are ripe for song learning.
During this time, the youngsters listen carefully to adult song before copying it - and practising religiously - to perfect their one version of the tune.
Vocal learning in songbirds bears a resemblance to human speech development: novice birds go through a period of "screeching" before learning to imitate songs accurately, much as babies babble before grasping words.
Zebra finches only engage in singing lessons during the day - at night they sleep. But researchers have noticed that, for juvenile birds, something interesting happens during slumber.
Firstly, their song practice does not seem to pick up where it left off the night before. To begin with it is worse, and then it improves.
Secondly, the rustiest starters turn out to be the best singers in the end.
This mystery has not been entirely solved yet, but researchers are beginning to piece together an explanation.
An important clue is that brain areas involved in singing are active during the night.
"Neurons which are activated when the bird is singing are activated when the bird is sleeping," explained Dr Deregnaucourt. "So it is possible that the bird is dreaming about his song during the night."
If a bird has been practising in his dreams, it might seem strange that he has deteriorated in the morning.
But Dr Deregnaucourt believes this could be because the juvenile is practicing without any crucial feedback.
"The bird doesn't actually hear his song when he is sleeping, because he is not producing any sound," said Dr Deregnaucourt. "And that is a problem for him because he needs auditory feedback.
"It is very important for the bird to hear himself to learn his song."
It has already been proved that deaf birds, who cannot hear their own voices, soon develop a distorted song. The same principle could apply to young dreaming birds - they invent bad habits because they cannot hear themselves straying from the proper tune.
The birds that "deteriorate" most during the night turn out to be the best singers because, Dr Deregnaucourt believes, they have the most flexible brains.
In other words, they are more inclined to practise - and develop distortions - while dreaming; but they are also quick to catch up - and overtake - during daylight practice.
He said: "These birds have the most plasticity in their brains - they have a greater ability to learn in the morning - because they are more flexible."