Dense interpretable embeddings from decision models
You can use the probabilities returned by decision models to build dense interpretable embeddings that in some cases beat OpenAI and BGE-M3.
TL;DR
- We built dense embeddings by stacking the probabilities that Cloudflare's Clef-flash gives when we ask it yes/no questions. Each dimension is the answer to a natural-language question, so it's easy to interpret.
- We evaluated these embeddings for retrieval (the search step of RAG) on SciFact. With 512 questions they found 94% of the relevant abstracts in the top 100, against 91% for BGE-M3 and 98% for OpenAI's text-embedding-3-large. They did worse at ranking the top 10 and cost about 50 times as much as OpenAI's embedding.
- For vector arithmetic, 64 questions about places solved 96% of our country-to-capital analogies (France:Paris :: Japan:?) and 83% of country-to-dish ones. OpenAI's embedding solved 87% and 78% and BGE-M3 87% and 41%.
Code, cached model answers and results: nodo-labs-uk/experiments.
What we built
Clef-flash (Cloudflare's decision model) takes as input a text or an image and up to 64 yes/no questions. For each question it returns the probability that the answer is yes, in about 100 ms. Stacking the returned probabilities in a vector gives a dense embedding with as many dimensions as there are questions.
A pretrained embedding puts each item on a sphere in 1,024 or 3,072 dimensions and no single dimension means anything. A decision model embedding puts each item in a cube: every coordinate is between 0 and 1 and every axis is a question. If an abstract scores 0.97 on "Is it about capybaras?", Clef-flash is fairly sure the text is about capybaras. The vector is still dense (like a pretrained embedding) because every item gets a value on every axis. Models built on named features like these are called concept bottleneck models and Ludan and colleagues built one for text with GPT-4.
The process is something like this:
- An LLM writes questions that tell the items in a collection apart, such as "Is AMPK involved?" for scientific abstracts.
- Clef-flash answers every question for every item. The list of probabilities is the item's embedding.
- From there it works like any other embedding: cosine similarity for search, addition and subtraction for analogies and a linear model for classification.
What it looks like
Each axis is a question, so you can plot items against two questions directly. These are the 56 cities from the vector arithmetic test below, plotted by Clef-flash's answers to "Is it associated with rain?" and "Is it associated with hot weather?". To plot a pretrained embedding, you have to project it to two axes with PCA and those axes have no plain meaning.
Show the numbers
| City | Rain? | Hot weather? |
|---|---|---|
| Seattle | 0.77 | 0.03 |
| Manchester | 0.56 | 0.06 |
| London | 0.50 | 0.08 |
| Reykjavik | 0.36 | 0.01 |
| Moscow | 0.25 | 0.06 |
| Lisbon | 0.23 | 0.63 |
| Rio de Janeiro | 0.52 | 0.83 |
| Singapore | 0.30 | 0.84 |
| Marrakesh | 0.07 | 0.88 |
| Dubai | 0.05 | 0.92 |
Show the numbers
The two components explain 5.6% and 4.6% of the variance across the 56 cities.
On the left, Seattle and the British cities sit in the wet and cold corner, and Dubai and Marrakesh in the dry and hot one. You can also see where Clef-flash is wrong: it gives Mumbai only 0.33 for rain. On the right, OpenAI's embedding places the cities too, but nothing says what either axis measures.
Search
We tested search on SciFact (one of the datasets in the BEIR benchmark). It has 5,183 scientific abstracts and 300 test claims, such as "ALDH1 expression is associated with poorer prognosis in breast cancer." For each claim, experts marked the abstracts that support or refute it (usually just one).
This is the retrieval step of a RAG system: find the documents that match a query, then add them to the model's context. We tested only the retrieval, without a reranker.
Claude Opus 5.5 read 400 of the titles and wrote 512 questions about the topics in the collection, such as "Is it about prion diseases?", "Does it study mice?" and "Is AMPK involved?". Clef-flash answered them for every abstract and every claim. We ranked the abstracts for each claim by cosine similarity and did the same with BGE-M3 and OpenAI's text-embedding-3-large. To compare at equal size, we cut OpenAI's embedding to its first dimensions (which is how OpenAI's own API shortens it) and BGE-M3 to its first principal components.
Show the numbers
| Dimensions | 16 | 32 | 64 | 128 | 256 | 512 |
|---|---|---|---|---|---|---|
| Decision model embedding | 7.5 | 15.6 | 22.1 | 33.0 | 48.0 | 54.9 |
| BGE-M3 (first principal components) | 23.6 | 39.7 | 51.6 | 59.0 | 63.6 | 64.4 |
| OpenAI (first dimensions) | 14.7 | 36.3 | 55.1 | 67.8 | 73.3 | 74.6 |
Full size: BGE-M3 (1,024 dimensions) 65.4, OpenAI (3,072) 77.1.
Show the numbers
| Dimensions | 16 | 32 | 64 | 128 | 256 | 512 |
|---|---|---|---|---|---|---|
| Decision model embedding | 42.6% | 54.4% | 63.1% | 76.5% | 91.2% | 94.3% |
| BGE-M3 (first principal components) | 68.8% | 79.0% | 85.8% | 88.9% | 90.5% | 90.8% |
| OpenAI (first dimensions) | 51.1% | 71.5% | 83.8% | 93.8% | 96.2% | 97.0% |
Full size: BGE-M3 90.7%, OpenAI 97.7%.
The decision model embedding needs more dimensions than the pretrained ones. With 64 questions it found 63% of the right abstracts in the top 100, where both pretrained embeddings cut to 64 dimensions found 84 to 86%. With 512 questions it found 94%, more than the full BGE-M3 (91%) and less than the full OpenAI embedding (98%). Its top 10 stayed worse: an nDCG@10 of 55, against 65 for BGE-M3 and 77 for OpenAI. The gains get smaller as questions are added: going from 128 to 256 questions added 15 points, while going from 256 to 512 added only 7.
The good
The most useful aspect of this kind of embedding is that each dimension is the answer to a single natural-language question, so it can be interpreted directly. As a result, every match can be explained: cosine similarity is a sum over the questions, so the questions that add the most to it show why an abstract came first. For example, here are two claims, with the abstract that came first for each:
| Questions that add the most | Claim | Abstract |
|---|---|---|
| Is it about breast cancer? | 0.97 | 0.98 |
| Is it about cancer? | 0.95 | 0.95 |
| Is it about the mammary gland? | 0.85 | 0.97 |
| Is it about diagnostic tests or biomarkers? | 0.76 | 0.69 |
| Questions that add the most | Claim | Abstract |
|---|---|---|
| Is homocysteine or folate involved? | 0.97 | 0.97 |
| Is it about blood or bone marrow? | 0.85 | 0.79 |
| Is amino acid metabolism involved? | 0.84 | 0.77 |
| Is it about diagnostic tests or biomarkers? | 0.55 | 0.90 |
The miss shows what the embedding lacks. None of the 512 questions asks about vitamin B12, so the claim looks like any paper about homocysteine. A question about vitamins might fix it; we did not test that. By contrast, with a pretrained embedding you can only see that a search failed, not why.
The bad
Decision model embeddings are much more expensive than pretrained ones. Clef-flash bills about 500 input tokens per call plus about 95 per question and it takes at most 64 questions per call. So 512 questions need 8 calls per abstract and cost about $2 per thousand abstracts, against 4 cents for OpenAI's embedding. For large collections, they may only be worth it if you need to explain the results.
But can you do vector arithmetic with them?
The coolest feature of word embeddings is that you can do arithmetic with them. The classic example (from word2vec) is king − man + woman, which lands near the embedding for queen. We tried the same with 93 short names: cities, countries, dishes and a few words such as "rain" and "beach". Claude Opus 5.5 wrote 64 questions about places, such as "Is it associated with rain?" and "Is it associated with Asia?". Clef-flash answered them for each name. To solve France:Paris :: Japan:?, we took Paris − France + Japan and looked for the nearest city, leaving out the three names in the analogy.
| Analogy set | Decision model | No country questions | BGE-M3 | OpenAI |
|---|---|---|---|---|
| Country to capital France:Paris :: Japan:? | 95.5% | 90.9% | 87.1% | 87.1% |
| Country to dish Italy:pizza :: Japan:? | 82.6% | 69.7% | 40.9% | 78.0% |
The decision model embedding did best on both sets. Eleven of its questions name a country (such as "Is it associated with Japan?") and those could make the analogies easy. Without them, it still led on capitals, but fell behind OpenAI on dishes. All three embeddings made the same kinds of mistake: Milan for Rome, Munich for Berlin and hamburger as the dish of several European countries.
As features for a classifier
Of course, you can also use these embeddings as features for a classifier. We ran a lot of experiments on this, but this post is already long, so the details are in the extra questions section.
Over and out
Decision model embeddings are fun and they can be very useful in specific contexts: when you need to see why two items are close, or to change what the embedding pays attention to by editing its questions. In our tests they found search candidates about as well as BGE-M3, did well on analogies and worked well as classifier features with few labels. However, they cost about 50 times as much per item as OpenAI's embedding and need hundreds of questions to search well. If you only need the best ranking, a pretrained embedding is cheaper and better.
Tools we've built
If you work with coding agents or LLMs, two of our open-source tools may be useful:
- attention-queue: an attention queue for Claude Code, Codex and Antigravity sessions in tmux, with modes to review, step, quiz or vibe.
- socratui: a Socratic tutor in your terminal that runs on Claude, GPT, open or local models, with a skill map that persists, spaced review by questioning, and flashcards for Anki.
We test new AI tools like this before we put them into a client's process. If you're weighing one up for your own operations, we're happy to talk it through.
References
- Cloudflare. Clef and Clef-flash decision models, 2026.
- Koh, P. W. et al. Concept Bottleneck Models. ICML 2020.
- Ludan, J. M. et al. Interpretable-by-Design Text Understanding with Iteratively Generated Concept Bottleneck. 2023.
- Chen, J. et al. M3-Embedding (BGE-M3). 2024.
- Wadden, D. et al. Fact or Fiction: Verifying Scientific Claims (SciFact). EMNLP 2020.
- Thakur, N. et al. BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models. NeurIPS 2021.
- Mikolov, T., Yih, W. and Zweig, G. Linguistic Regularities in Continuous Space Word Representations. NAACL 2013.
Extra questions
How well do decision model embeddings work as classifier features?
For each of nine labelled datasets, an LLM wrote 16 to 24 questions from the class names, Clef-flash answered them for every item and logistic regression learned from labelled examples how much each answer counts. The animation shows one test comment going through this method and two others.
What the embedding looks like
Each axis is a question, so you can plot items against two questions directly. These are 300 test comments from the toxic comments dataset, plotted by two of the 16 questions. To plot a pretrained embedding, you have to project it to two axes with PCA and those axes have no plain meaning.
Show the numbers
| Features used | Test accuracy |
|---|---|
| The two plotted questions | 80.2% |
| All 16 questions | 81.4% |
Show the numbers
| Features used | Test accuracy |
|---|---|
| The two plotted PCA components | 58.4% |
| All 1,024 numbers | 64.8% |
On the left, most toxic comments score high on profanity, on personal attack, or on both. On the right, the two classes overlap.
With about 100 labels
We built decision model embeddings for nine public datasets: four with crowd-voted labels, two easy text tasks and three image tasks (examples). Each was trained on about 100 labelled examples. We compared them with pretrained embeddings trained the same way (BGE-M3 and OpenAI's text-embedding-3-large for text, EmbeddingGemma-2 for images) and with Claude and GPT asked directly.
Show the numbers
| Dataset | Decision model embedding + LR | Direct answer only + LR | Best embedding + LR | Best LLM |
|---|---|---|---|---|
| Toxic comments | 80.8% | 79.8% | 60.4% | 69.4% |
| Hate speech | 69.4% | 61.8% | 66.0% | 67.4% |
| Argument quality | 63.6% | 63.6% | 49.8% | 71.4% |
| Emotions | 63.7% | 66.5% | 51.2% | 51.7% |
| Product reviews | 97.4% | 97.6% | 95.4% | 98.2% |
| Bank messages | 96.2% | 96.2% | 94.0% | 94.8% |
| Satellite images | 86.4% | 68.0% | 82.8% | 75.4% |
| Clothing photos | 83.2% | 80.8% | 72.4% | 78.2% |
| Bean leaves | 93.5% | 73.6% | 86.6% | 88.1% |
On the crowd-labelled datasets, "Best LLM" includes Claude with a threshold fitted to its scores. Clef-flash asked directly, with no training at all, scored 80.0%, 60.4%, 61.4%, 65.0%, 97.6%, 96.2%, 61.4%, 77.6% and 70.9%, in the same order.
The decision model embedding was ahead on five datasets and level on the other four. The best LLM won on argument quality.
Two caveats. The test sets have 260 to 500 items, so gaps under about 4 points are noise. And the classifier's default penalty holds back the pretrained embeddings more than the questions: tuned, the image embedding passed the questions on satellite images (more).
Most of the accuracy came from one question: the task itself, such as "is this comment toxic?". The charts start from Clef-flash's answer to that question and add the best other questions one at a time.
Show the numbers
| Questions added | 0 | 1 | 2 | 4 | 8 | 16 |
|---|---|---|---|---|---|---|
| Direct answer + best questions | 77.6% | 78.0% | 78.3% | 78.6% | 78.2% | 78.6% |
| Best questions, no direct answer | - | 58.9% | 64.8% | 71.8% | 74.7% | 75.7% |
| Best embedding + LR | 69.5% | 69.5% | 69.5% | 69.5% | 69.5% | 69.5% |
Show the numbers
| Questions added | 0 | 1 | 2 | 4 | 8 | 16 |
|---|---|---|---|---|---|---|
| Direct answer + best questions | 74.1% | 79.5% | 82.8% | 84.7% | 85.6% | 87.4% |
| Best questions, no direct answer | - | 37.1% | 58.6% | 71.0% | 79.8% | 83.8% |
| Best embedding + LR | 80.6% | 80.6% | 80.6% | 80.6% | 80.6% | 80.6% |
On text, the other questions add about a point. On images (where the direct answer was weaker) they add 13: on bean leaves, questions about spots, colours and edges took accuracy from 74% to 94%.
What the classifier relies on
The classifier's weights show which questions it relies on. On toxic comments, a classifier that uses only the profanity and personal-attack questions scored 80.2%, against 81.4% with all 16. One that uses the first two principal components of BGE-M3 scored 58.4%.
Show the numbers
| Question | Weight |
|---|---|
| Does the comment use profanity or strong language? | +1.89 |
| Is the language used in the comment formal or informal? | −1.09 |
| Does the comment contain a personal attack or insult? | +1.04 |
| Is the comment brief and to the point, or is it lengthy and rambling? | +0.92 |
| Does the comment contain a generalization or stereotype? | +0.91 |
| Does the comment express a strong emotion such as anger or frustration? | +0.83 |
| Is the comment attempting to provoke a reaction or argument? | +0.54 |
| Is the comment discussing a current event or news story? | −0.47 |
| Is the comment discussing a sensitive topic such as race or religion? | +0.43 |
| Does the comment use rhetorical questions or mocking tone? | +0.38 |
| Is the tone of the comment sarcastic? | −0.37 |
| Does the comment contain the word 'hate'? | −0.33 |
| Is the comment directed at a specific individual or group? | +0.32 |
| Is the comment responding to a previous comment or statement? | +0.30 |
| Does the comment use capital letters or excessive punctuation for emphasis? | −0.12 |
| Does the comment mention a political figure or party? | −0.01 |
Several questions overlap, so treat the weights as a rough guide. "Formal or informal?" has no clear yes, so its large weight is hard to interpret.
With more labels
Show the numbers
| Method | 100 | 400 | 1,600 |
|---|---|---|---|
| Decision model embedding + LR | 69.4% | 70.8% | 72.4% |
| OpenAI embeddings + LR | 66.0% | 69.6% | 76.6% |
Show the numbers
| Method | 100 | 400 | 1,600 | 6,400 |
|---|---|---|---|---|
| Decision model embedding + LR | 80.8% | 82.4% | 83.2% | 82.8% |
| OpenAI embeddings + LR | 57.2% | 64.0% | 68.8% | 74.0% |
The decision model embedding improves quickly and then levels off. Once the classifier has learned how much each of the 16 to 24 answers counts, more labels add little. The pretrained embeddings keep improving, because their hundreds or thousands of dimensions need more data before they help. With 100 labels, OpenAI's embedding cut to its first 16 principal components did as well as all 3,072 (more). With 600 to 6,400 labels, the pretrained embeddings caught up or passed on six of the nine datasets. This is Sutton's bitter lesson at a small scale.
Every dataset, with the least and the most training data
| Dataset | Training examples | Best decision model embedding + LR | BGE-M3 or Gemma + LR | OpenAI + LR |
|---|---|---|---|---|
| Toxic comments | 100 / 6,400 | 80.8 / 82.8 | 60.4 / 71.0 | 57.2 / 74.0 |
| Hate speech | 100 / 1,600 | 69.4 / 72.4 | 61.4 / 67.4 | 66.0 / 76.6 |
| Argument quality | 100 / 1,600 | 63.6 / 64.6 | 49.4 / 64.8 | 49.8 / 66.2 |
| Emotions | 120 / 1,800 | 66.5 / 66.2 | 51.2 / 57.1 | 49.0 / 60.8 |
| Product reviews | 100 / 1,600 | 97.6 / 97.8 | 93.6 / 94.0 | 95.4 / 97.0 |
| Bank messages | 100 / 600 | 96.2 / 96.2 | 90.2 / 92.0 | 94.0 / 94.5 |
| Satellite images | 100 / 1,600 | 86.4 / 90.2 | 82.8 / 91.4 | - |
| Clothing photos | 100 / 1,600 | 83.2 / 86.0 | 72.4 / 81.4 | - |
| Bean leaves | 90 / 900 | 96.2 / 96.6 | 86.6 / 92.3 | - |
Accuracy in %. "Best decision model embedding" is the most accurate of three versions at that size: the direct answer alone, the questions alone, or both. OpenAI has no image embedding model.
Cost, speed and LLMs
Claude and GPT asked directly need no labels. They did worse than the decision model embedding on toxic comments and emotions, even with 100 examples in Haiku's prompt. The raters' votes agreed more with Clef-flash's scores than with Claude's (more). They tied on hate speech and won on argument quality, which needs reasoning.
Show the numbers
| Method | Accuracy | Cost per 1,000 |
|---|---|---|
| Clef-flash, 16 questions + LR | 81.4% | $0.064 |
| Clef-flash, one direct question | 81.2% | $0.009 |
| Clef (27B), 16 questions + LR | 77.4% | $0.41 |
| Claude Opus 5.5, zero-shot | 68.4% | $1.95 |
| Claude Sonnet 5.5, zero-shot | 64.0% | $0.92 |
| Claude Haiku 5.5, zero-shot | 66.0% | $0.052 |
| Claude Haiku 5.5, zero-shot, plain prompt | 65.4% | $0.024 |
| Claude Haiku 5.5, 100 examples in the prompt | 66.4% | $0.13 |
| gpt-6.2-sol, zero-shot | 68.0% | $0.46 |
| gpt-6-luna, zero-shot | 67.6% | $0.041 |
| gpt-6-luna, 100 examples in the prompt | 65.8% | $0.096 |
| OpenAI embeddings + LR | 64.0% | $0.009 |
Not shown: BGE-M3 on Workers AI (64.8%; we did not measure its cost) and TF-IDF run locally (56.6%, free).
Show the numbers
| Method | Accuracy | Median time |
|---|---|---|
| Clef-flash, 16 questions + LR | 81.4% | 142 ms |
| Clef-flash, one direct question | 81.2% | 103 ms |
| Clef (27B), 16 questions + LR | 77.4% | 258 ms |
| Claude Opus 5.5, zero-shot | 68.4% | 1,368 ms |
| Claude Sonnet 5.5, zero-shot | 64.0% | 1,315 ms |
| Claude Haiku 5.5, zero-shot | 66.0% | 1,262 ms |
| Claude Haiku 5.5, zero-shot, plain prompt | 65.4% | 513 ms |
| Claude Haiku 5.5, 100 examples in the prompt (rough) | 66.4% | 704 ms |
| gpt-6.2-sol, zero-shot (rough) | 68.0% | 1,728 ms |
| gpt-6-luna, zero-shot (rough) | 67.6% | 1,378 ms |
| BGE-M3 embeddings + LR | 64.8% | 132 ms |
| TF-IDF + LR, run locally | 56.6% | 0.3 ms |
Clef, Claude zero-shot, BGE-M3 and TF-IDF were timed on 50 comments sent one at a time. The rough points are medians from runs that sent 32 requests at a time, so they include some queueing and caching effects. We did not time the OpenAI embeddings, which we fetched in batches.
Clef-flash answered in 100 to 150 ms and the LLMs in 0.5 to 1.7 seconds. The 16 questions cost 6.4 cents per thousand comments. That is 7 times as much as OpenAI's embeddings, about the same as Haiku and a thirtieth of Opus.
What exactly did we compare for classification?
We compared three kinds of method:
- Decision model embeddings, fed to logistic regression. The smallest has one dimension: Clef-flash's answer to the task question itself, which we call the direct answer. The full version adds the answers to 16 to 24 more questions.
- Pretrained embeddings, fed to logistic regression: BGE-M3 and OpenAI's text-embedding-3-large for text, EmbeddingGemma-2 for images.
- LLMs asked directly, with no training: Claude Haiku 5.5, Sonnet 5.5 and Opus 5.5, plus OpenAI's gpt-6-luna and gpt-6.2-sol.
An LLM (Llama 3.3 70B) wrote the questions from the class names and a one-line description of each class, without seeing any labelled examples. For bean leaves it wrote "Are there any yellow patches on the leaf?" and "Are there small, raised bumps on the leaf?". For hate speech it wrote "Does the text generalize about a group of people?".
Does the classifier's penalty change the result?
The penalty matters for this comparison. Logistic regression's L2 penalty keeps the weights small and its strength is measured in the units of the inputs. The answer probabilities run from 0 to 1. A pretrained embedding has length 1, spread over hundreds or thousands of dimensions, so each number is tiny and the classifier needs large weights to use it. The default penalty holds those weights back.
So we also let cross-validation on the training set pick the penalty for each classifier. We have done this for five of the nine datasets so far and these numbers are preliminary. On toxic comments, emotions, product reviews and bank messages the result did not change. On satellite images, the image embedding wanted a much weaker penalty and it scored 88.2% against the decision model embedding's 86.4%. Clothing photos and bean leaves use the same image embedding, so their gaps may also shrink. On toxic comments, nothing helped the pretrained embedding: with no penalty, or cut to its first 16 dimensions, it stayed below 63%, against 80.8%.
How many questions does a classifier need?
Does the decision model embedding need all 16 to 24 questions? To find out, we let the classifier pick the questions one at a time, using only the 100 training examples. At each step it added the question that most improved cross-validated accuracy. We also tried questions picked at random. For comparison, we cut the pretrained embeddings down to the same size, keeping their first few principal components.
Show the numbers
| Dimensions | 1 | 2 | 4 | 8 | 16 |
|---|---|---|---|---|---|
| Best questions (chosen on training data) | 75.1% | 75.4% | 75.9% | 76.3% | 77.0% |
| Random questions | 60.8% | 68.0% | 72.9% | 75.6% | 76.9% |
| Pretrained embedding (first components) | 55.5% | 66.2% | 65.4% | 67.5% | 68.3% |
The full pretrained embedding (1,024 or 3,072 numbers) averaged 67.9%.
Show the numbers
| Dimensions | 1 | 2 | 4 | 8 | 16 |
|---|---|---|---|---|---|
| Best questions (chosen on training data) | 32.9% | 52.6% | 68.1% | 76.5% | 79.5% |
| Random questions | 27.5% | 37.6% | 51.0% | 66.0% | 77.9% |
| Pretrained embedding (first components) | 30.4% | 45.3% | 63.5% | 71.2% | 76.3% |
The full pretrained embedding averaged 77.4% and its first 256 components 77.1%.
For two-class tasks, a few good questions are enough. The single best question averaged 75.1%, against 77.0% with all of them. On toxic comments the first pick was "does the comment use profanity or strong language?" and on hate speech "does the text contain a personal attack?". Random questions needed 8 to 16 to catch up, so with few questions the choice matters.
Tasks with more classes need more questions (about two per class): each class needs something that sets it apart. With ten card problems or ten land uses, the best 16 questions averaged 79.5% and all 24 reached 82.0%. Choosing questions on 100 examples is also noisy, so when in doubt, keep them all.
The pretrained embeddings tell the same story from the other side. With 100 examples, their first 16 to 32 principal components did as well as all 1,024 or 3,072 numbers. Most of the embedding is room for a bigger training set: with our largest training sets, the two-class average rose from 70.8% at 16 components to 77.4% at 256. At equal size, the questions hold more of what these labels need: with 16 dimensions each and 100 labels, the decision model embedding was ahead of OpenAI's by 23 points on toxic comments and 15 on argument quality. It was level on hate speech.
Why did Claude and GPT do worse on toxic comments?
The gap comes from which comments each model rates as worse. Every "not toxic" comment in our test set is borderline and the raters labelled these three comments toxic. Clef-flash agreed with each one and Opus disagreed. Two are excerpts and the scores are for the whole comment.
- "...A stupid society does stupid things and votes for stupid politicians..." Clef-flash gave it 0.95.
- "damn that is spot on, it would be hilarious if it weren't so true." Clef-flash gave it 0.81.
- "...So suck it up buttercup..." Clef-flash gave it 0.95.
By the written definition ("rude enough to make someone leave a discussion"), Opus is arguably right. But these raters reacted to words like "stupid" and "damn". Clef-flash matches them: its probabilities have a rank correlation of 0.69 with the share of raters who flagged each comment, against 0.44 to 0.54 for Claude. Cloudflare runs content moderation, so Clef may have been trained on labels like these. We can't check this.
The comparison so far is not quite fair: the decision model embedding learns from 100 labelled examples and the LLMs see none. So we gave Haiku the same 100 examples in its prompt. Its accuracy rose by 3.2 points at most and the decision model embedding stayed 14 points ahead on toxic comments and 16 on emotions. Fitting a threshold to Claude's scores, or giving it one example per class, did not close the gap either. We meant to run both GPT models with the 100 examples on all six text datasets, but we ran out of money: our OpenAI credit ran out after the first one.
The LLMs won where the task needs reasoning. On argument quality, Opus scored 70.8% (71.4% with a fitted threshold), against 64.6% at best for the decision model embedding. To judge whether an argument would work in a debate, a model has to think about the topic.
Claude and GPT: zero-shot, with a fitted threshold, with one example and with 100 examples
| Dataset | Model | Zero-shot | Fitted to scores | One example per class | 100 examples in the prompt |
|---|---|---|---|---|---|
| Toxic comments | Haiku 5.5 | 66.0% | 67.0% | 67.4% | 66.4% |
| Sonnet 5.5 | 64.0% | 65.0% | 66.6% | - | |
| Opus 5.5 | 68.4% | 69.4% | 68.4% | - | |
| gpt-6-luna | 67.6% | - | - | 65.8% | |
| gpt-6.2-sol | 68.0% | - | - | - | |
| Hate speech | Haiku 5.5 | 64.0% | 67.4% | 63.0% | 67.2% |
| Sonnet 5.5 | 66.0% | 65.6% | 66.0% | - | |
| Opus 5.5 | 63.4% | 64.2% | 62.4% | - | |
| gpt-6-luna | 61.2% | - | - | - | |
| gpt-6.2-sol | 63.6% | - | - | - | |
| Argument quality | Haiku 5.5 | 64.2% | 67.2% | 67.0% | 64.2% |
| Sonnet 5.5 | 68.2% | 67.0% | 67.6% | - | |
| Opus 5.5 | 70.8% | 71.4% | 69.0% | - | |
| gpt-6-luna | 62.0% | - | - | - | |
| gpt-6.2-sol | 64.2% | - | - | - | |
| Emotions | Haiku 5.5 | 49.0% | 51.7% | 49.8% | 50.6% |
| Sonnet 5.5 | 50.6% | 50.4% | 50.6% | - | |
| Opus 5.5 | 50.6% | 51.7% | 52.5% | - | |
| gpt-6-luna | 49.6% | - | - | - | |
| gpt-6.2-sol | 50.2% | - | - | - |
A dash means we did not run it. The 100 examples are the same ones the decision model embedding learned from (120 for emotions). On the easy text tasks every LLM scored 91.8% or more. On images, gpt-6.2-sol scored 75.4% on satellite images, 76.0% on clothing and 88.1% on bean leaves, well above the best Claude on two of them. We skipped OpenAI's top tier on cost.
What are the nine datasets?
| Dataset | Task | Example from the test set | Label |
|---|---|---|---|
| Toxic comments | Toxic or borderline? (2 classes) | "Shame on the 9th Circuit. Perhaps, in the future, Justice Watford's dissent will find more support." | borderline |
| Hate speech | Hate speech or borderline? (2) | "Why all these queer celebs doing collabs" | borderline |
| Argument quality | Is the argument's quality score above or below the median? (2) | Topic: "We should ban factory farming". Argument: "factory farming is an inhumane way to raise animals for food" | above |
| Emotions | Which of six negative emotions? (6) | "Well I can say 100% it didn't go well." | disappointment |
| Product reviews | Positive or negative? (2) | "Sangean radio worked 2 weeks: The radio is very small but is not very loud. IT STOPPED WORKING AFTER TWO WEEKS." | negative |
| Bank messages | Which of ten card problems? (10) | "I was taking out funds and was unable to regain my card." | card swallowed by an ATM |



Crowd labels need some explaining. In the toxic comments dataset, several people rated each comment. We counted a comment as toxic if half or more flagged it and as borderline if 10% to 50% did. That makes the task hard, because the two classes differ by a few votes. Some crowd labels also look wrong: the emotions dataset labels "The humidity in Sydney is worse." as disgust.
How did we set up the search and arithmetic tests?
For search, Clef-flash read each claim as it is and each abstract as its title plus its text. The 512 questions came in two rounds of 256. Each round saw a different random sample of 400 titles and the second round also saw the first round's questions, so that it would not repeat their topics. The chart's question sizes use the questions in the order they were written, so 256 means the first round. We also tried standardising each question by its mean and spread over the abstracts. It made no real difference: 54.1 against 54.9 nDCG@10 with 512 questions. BGE-M3's principal components were fitted on the abstracts.
For arithmetic, every item is a bare name (such as "Lisbon" or "paella") for all three embeddings. The list has 18 countries, 12 capitals, 12 dishes, 44 other cities and 7 words such as "rain" and "the United States": 93 names in all. An analogy counts as solved only if the nearest name is the right one, among the cities for capitals and among the dishes for dishes. The country questions we removed were the ones for the United States, the United Kingdom, Spain, Japan, Russia, France, Italy, Germany, China, India and Brazil. The prompt asked for the first five and Claude added the rest.
How we ran it
The code, all results and the cached answers from Clef and Claude are in our GitHub repository. Every script reruns from the cache without calling Clef or Claude.
Each dataset had one fixed test set of 260 to 500 items, balanced across classes. Training sets were balanced and nested, so the 100 examples sit inside the 400. With test sets this size, differences under about 4 points can be noise (about 5 for bean leaves).
Llama 3.3 70B on Workers AI wrote the questions from the class names and a one-line description of each class. For toxic comments (our first run), it wrote 16 questions after seeing 16 labelled examples. For product reviews it wrote 23 questions instead of 24. For search and arithmetic, Claude Opus 5.5 wrote the questions instead, because Llama's questions for SciFact were repetitive and drifted off topic, such as "Is the study related to economics?".
Claude and GPT got the same task question and class descriptions as Clef, at low effort, with structured output that forced a valid answer. We turned off Anthropic's refusal fallback so that each row measures one model. No model refused.
Three things did not help. Letting an LLM rewrite the weakest questions over six rounds never beat the first set in cross-validation on the training data. On the test set, five of the six rewrites scored 0.2 to 0.8 points higher, which is within noise. A small neural network did worse than logistic regression (76.2% against 81.4% on toxic comments). The 27B Clef was slower, cost six times as much and was less accurate than Clef-flash.
Datasets and licences: Civil Comments (CC0), Measuring Hate Speech (CC BY 4.0), IBM Argument Quality 30k (CC BY 3.0), GoEmotions (Apache 2.0), Amazon polarity (Apache 2.0), Banking77 (CC BY 4.0), EuroSAT (MIT), Fashion-MNIST (MIT), Beans (MIT) and SciFact (CC BY-NC 2.0).
The Workers AI usage for this post cost about $13, of which $11 was Clef-flash answering 512 questions for the search test. The Claude runs for classification cost about $30, two thirds of it for Opus. The OpenAI runs for classification used the $5 of credit on our account, which ran out before the last of them. We topped it up for the search and arithmetic tests, which used about 1.7 million tokens, or $0.22.
The prompts we used
Every prompt is in the code. The classification prompts are filled in here for hate speech. The other datasets differ only in the description of the item, the task question and the class descriptions.
Writing the questions. Llama 3.3 70B on Workers AI, temperature 0.7, one call per dataset. For images the prompt asks about "what is visible in the image (colours, shapes, textures, patterns)". The satellite prompt is worded differently: it describes the Sentinel-2 images and names the groups of classes that are easy to confuse, such as highway and river. For toxic comments (our first run), the prompt showed 8 labelled training comments per class and asked for 16 questions.
A small model will look at a social media comment and answer yes/no questions with a
probability. A linear classifier will combine the answers to tell these classes apart:
- borderline: not hate speech: it may be rude, negative or about a group, but it does not attack people for who they are
- hate_speech: hate speech: it attacks, demeans or dehumanises people because of their identity
Write 24 yes/no questions about what the text says or how it says it. Do not name the classes in the questions.
Include questions that separate the classes that are easy to confuse. Every question must have
a clear yes: never ask "is it A or B?".
Reply with only a JSON array of 24 question strings.
Clef-flash. Clef takes the item and a set of questions, with no other prompt. Each feature question is a yes/no question whose text is the question itself, such as "Does the text contain a personal attack?". The direct answer is a single choice question: the task question (here "Is this comment hate speech?") with the two class descriptions above as the options. For toxic comments it is one yes/no question: "Is this comment toxic: rude, disrespectful or unreasonable enough to make someone leave a discussion?". For images, Clef also gets a one-line description of the item, such as "A photo of a bean plant leaf taken in a field in Uganda."
Claude and GPT, zero-shot. This is the system prompt. The user message is the item and structured output restricts the answer to one of the option names.
You classify a social media comment. Is this comment hate speech?
Options:
- borderline: not hate speech: it may be rude, negative or about a group, but it does not attack people for who they are
- hate_speech: hate speech: it attacks, demeans or dehumanises people because of their identity
Answer with the option name only.
The other Claude and GPT versions change only the end of that prompt:
- Fitted to scores: "For each option, give a score from 0 to 100 for how well the item fits it." Logistic regression on the scores of 100 labelled training examples gives the final answer. For toxic comments these were a different random 100 from the ones the features used.
- One example per class: "One labelled example per option:", followed by one "Item: ... Answer: ..." pair per class.
- 100 examples: "Here are 100 labelled examples:", followed by the training set as "Item: ... Answer: ..." pairs in a fixed shuffled order.
Search questions. Claude Opus 5.5, in two rounds. The first round's prompt, with the 400 titles cut here:
A small model will read scientific abstracts, and short scientific claims, and answer
yes/no questions about each with a probability. The answers form a vector, and we will find the
abstracts that support or refute a claim by comparing vectors. So the questions must tell the
abstracts apart by topic: the disease, organ or tissue, organism, gene or molecule, intervention,
method and kind of study.
Here is a random sample of 400 of the 5,183 abstract titles:
- ...
Write 256 yes/no questions. Ask about concrete topics, such as "Is it about cancer?",
"Does it study mice?" or "Is insulin involved?", not about the abstract's wording. Mix broad
questions (true for about a fifth of abstracts) with narrow ones (true for one or two percent),
cover the whole sample, and do not repeat a topic. Each question must make sense for a
one-sentence claim as well as for an abstract.
Reply with only a JSON array of 256 question strings.
The second round saw a new sample of titles and the first round's questions. It asked for 256 new ones that do not repeat their topics.
Arithmetic questions. Claude Opus 5.5, one call:
A small model will read a short name, such as a city ("Lisbon"), a country ("Kenya"),
a dish ("paella") or a weather word ("snow"), and answer yes/no questions about it with a
probability. The answers form a vector, and we will add and subtract these vectors.
Write 64 yes/no questions that describe places and the things associated with them:
continent and country, climate and weather, coast and landscape, size and kind of city, language,
religion and history, and typical food. Include one question each for these countries: the
United States, the United Kingdom, Spain, Japan and Russia. Include questions about rain, snow,
sunshine, beaches and fish and chips. Each question must make sense for a place, a dish or a
weather word, for example "Is it associated with Asia?".
Reply with only a JSON array of 64 question strings.
How this post was made. We wrote this post together with AI. The Nodo Labs team chose what to test and steered the experiments as the results came in. Claude (Anthropic's model, working in Claude Code) wrote and ran the code, made the charts and animations and wrote the first draft. Then we took turns: we read the draft and said what was wrong, Claude rewrote it and we edited the text ourselves. After each round of our edits, Claude checked the numbers against the results files and fixed the mistakes it found. It took many rounds and some of them threw out whole framings of the story.