Incarceron by Catherine Fisher
Incarceron is a prison so vast that it contains not only cells and corridors, but metal forests, dilapidated cities, and wilderness. It has been sealed for centuries, and only one man has ever escaped. Finn has always been a prisoner here. Although he has no memory of his childhood, he is sure he came from Outside. His link to the Outside, his chance to break free, is Claudia, the warden's daughter, herself determined to escape an arranged marriage. They are up against impossible odds, but one thing looms above all: Incarceron itself is alive . . .