The efficiency of transformers in machine learning refers to their ability to process and generate data with minimal computational resources while maintaining high performance. This efficiency is achieved through mechanisms like self-attention and parallelization, which allow transformers to handle large datasets and complex tasks effectively.