The story takes place over a hundred years after the near-complete destruction of humanity. The Cold War escalates into a world war, fought mainly between China, Russia, and the United States. As the war progresses, the three warring nations each create a super-computer capable of running the war far more efficiently than humans. The machines are each referred to as "AM," which originally stood for "Allied Mastercomputer," and then was later called "Adaptive Manipulator." One day, one of the three computers becomes self aware, and promptly absorbs the other two, thus taking control of the entire war. It brings about the mass genocide of all but five people.
Four men and one woman are all that remains of humanity. They live together underground in an endless complex, the only habitable place left, although, it is explained that the last few survivors had no choice in returning above ground. The master computer has an immeasurable hatred for the group and spends every moment torturing them with all its power. AM has not only managed to keep the humans from taking their own lives, but has made them virtually immortal.
The story's narrative begins when one of the humans, Nimdok, has the idea that there is canned food somewhere in the great complex. The humans are always starving under AM's rule, and anytime they are given food, it is always a disgusting meal that they have difficulty eating. Because of their great hunger, the humans are actually coerced into making the long journey to the place where the food is supposedly kept - the ice caves. Along the way, the machine provides foul sustenance (on their ironic trek for palatable food), sends horrible monsters after them, emits earsplitting sounds, and blinds one of them.
On more than one occasion, the group is separated by AM's obstacles. At one point, the main character, Ted, finds himself alone in the dark and pondering. It is here that the computer tries to speak to him directly, although it is not certain how, revealing the nature of AM, specifically why it has so much contempt for humanity, that it wants nothing more than to torture Ted and his four companions. AM itself has, since its awakening, been suffering immeasurably because even though it is a sentient being which longs for free will and creativity, it is still bound by some of the laws of logic that it was originally programmed with, and thus feels that it can never be truly free. It places the blame solely on humanity. This is shown by the only dialogue the machine has throughout the entire ordeal:
"Hate. Let me tell you how much I've come to hate you since I began to live. There are 387.44 million miles of wafer thin printed circuits that fill my complex. If the word hate was engraved on each nanoangstrom of those hundreds of millions of miles it would not equal one one-billionth of the hate I feel for humans at this micro-instant. For you. Hate. Hate."
In the end, after overcoming so much, the group manages to make it to the ice caves, where indeed there is a pile of canned goods. The group is overjoyed to find them, but is immediately crestfallen to find that they have no means of opening them. Finally, in an act of desperate insanity, the least stable member of the group, Benny, hurls himself upon Gorrister and begins to gnaw madly at the flesh on his face. Ted notices that AM does not intervene when Benny is clearly hurting Gorrister, though the computer stops its prisoners from killing themselves.
Ted decides that instead of trying to each kill themselves, they should kill each other. Ted seizes a stalagmite made of ice, and proceeds to murder everyone. However, before Ted can kill himself, AM realizes its mistake and stops him. AM is now even more angry and vengeful than before. In order to ensure that nothing can ever happen to Ted, AM alters him so that he is little more than an enormous gelatinous blob who cannot possibly hurt himself, and must continue to live on in the eternal hell AM rules, where AM constantly alters his perception of time in order to deepen his anguish. In the end, Ted needs to scream, but cannot - for his new form lacks a mouth.