What follows is possibly the first reference to AI/robotic recursive self-improvement in fiction, from all the way back in 1935. Quote from Technovelgy:
In this story of a future Earth, humanity had all of its needs met by a device – an intelligent machine.
“You have forgotten your history, and you have forgotten the history of the Machine, humans…”
“On the planet Dwranl, of the star you know as Sirius, a great race lived, and they were not too unlike you humans. …they attained their goal of the machine that could think. And because it could think, they made several and put them to work, largely on scientific problems, and one of the obvious problems was how to make a better machine which could think.
The machines had logic, and they could think constantly, and because of their construction never forgot anything they thought it well to remember. So the machine which had been set the task of making a better machine advanced slowly, and as it improved itself, it advanced more and more rapidly. The Machine which …