Williams interrupted his education to serve in the Second World War. He enlisted in the British Army in late 1940, but stayed at Cambridge to take his exams in June 1941, the month when Germany invaded Russia. Joining the military was against the Communist party line at the time. According to Williams, his Communist Party membership lapsed without him formally resigning.