Sentences as directions
An embedding model turns text into a list of numbers, 1,024 here. Read the list as an arrow and texts that mean similar things point in similar directions, even when the words differ. The score used everywhere below is cosine similarity: 1 when two arrows point the same way, lower as they spread apart.
A sliding window
One sentence is a noisy sample, so each step embeds a window: the scored sentence plus a few before it. That window is compared with the previous step's window. A low score means the new sentence pulled the text somewhere else.
Bigger windows smooth out sentence-to-sentence noise, so only real changes of subject stand out, like the jump to Darwin at a window of 8. Windows restart at each paragraph. The shading in the examples above is this score, rescaled within each text.
Show the numbers
Try Moby-Dick then Darwin at a window of 1, then 8. At 1 the grid is noise. At 8 the two books split into two blocks, and the step from one to the other is the dot that lands in the dark gap between them.