Explain the architecture of a Transformer model and how you would optimize its memory footprint for inference on edge devices.