One way to detect AI-written content is by using the perplexity score of the content. Perplexity measures how well a language model can predict a sequence of words. AI-generated content may have a lower perplexity score than human-written content.