Getting creative with embeddings by Amelia Wattenberger
AI developer platformsThis article introduces a method for creating custom scales (such as concrete-abstract, sad-happy) for text using OpenAI embedding models (embeddings). While developing the writing assistance application PenPal, the author Amelia Wattenberger explored how to quantify the degree of abstraction of sentences to help writers identify the middle levels of the "ladder of abstraction." This method works by selecting example words or phrases at the two ends of a scale, averaging their embedding vectors to serve as anchors, and then mapping the embedding vector of a new sample onto the line between these two anchors, thereby obtaining an interpretable score (between 0 and 1). Compared with directly asking GPT or fine-tuning a model, this method is low-cost, simple to create, produces interpretable results, and allows users to easily customize scales. The article also discusses the limitations of this method, such as it working better for some scales and possibly being affected by sentence length.