liveBook · Manning

Clustering

As explained in How Large Language Models Work

A technique that groups data items according to similarities among their features or representations.

Clustering groups texts or other data items by similarity. With embeddings, each item becomes a numeric vector, so similar meanings land near one another even when the texts use different words. section 8.3.1

A clustering workflow typically does the following:

  • Represent each text as an embedding produced by an embedding model. section 8.3.1
  • Group nearby or otherwise similar embeddings into useful categories, using algorithms such as k-means or HDBSCAN. section 8.3.1
  • Use the groups to inspect patterns, route related cases, or support decisions rather than assuming the LLM must solve the whole problem. section 8.3.1

Support requests while customers wait

A customer describes a problem, an embedding model represents it, and clustering groups the request with similar problems in the queue. Analysts can route those customers together, share a vetted solution for common cases, and let customers talk to a person when automation fails. section 8.3.2

Figure 8.4 LLMs produce numeric vectors known as embeddings as an intrinsic part of their function-ing. The utility of these embeddings is dependent on the fact that these numbers only change a little bit when given similar text. The two example tests here will have similar embeddings, and thus, their plots look similar, even though they don’t share any of the same words. This is a powerful feature that was present in older machine learning techniques.
figure

Use the figure to see why clustering can group texts that share meaning without sharing exact words: similar texts produce similar vectors and nearby plotted positions. section 8.3.1

How How Large Language Models Work covers it

How deep it goes
Explains embeddings, grouping, named algorithms, and a support workflow, but does not provide algorithmic mechanics or parameter guidance.
Examples
Uses market-segment analysis, plotted embedding texts, and grouped customer problems as concrete examples.
What it assumes
Assumes familiarity with text embeddings at a basic level and introduces their use as numeric inputs for clustering.
What you can do after
Apply clustering to embedding-based workflows that organize similar cases and route them toward analysts or vetted solutions.
How it connects
Connects clustering with embeddings, outlier detection, information visualization, classification, regression, and customer support.

Also explained in

Compare how 18 books explain clustering →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Large Language Models Work. The section links point to the parts of the book it draws on.