The benefit of using virtual threads in Java 21 and Spring boot 3.2 when working with AI is that it allows the waiting thread to be parked and relinquish the actual thread, reducing the cost of waiting for a response from the AI to almost nil. This makes it an amazing time to be a Java and Spring developer, according to the speaker in the video.