SO, HOW DOES CHAT GPT WORK? Text is generated through a sequence-to-sequence model with attention This means it has an encoder that processes the input text and converts it into a compact representation, and a decoder that generates the output text based on this representation.