# Don't classify, hallucinate!

> Hacker News story 49249523 · language: en · submitted 2026-08-10
> Web version: https://zeli.app/story/49249523
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 243 · by [softwaredoug](<https://news.ycombinator.com/user?id=softwaredoug>) · 💬 99
[original](<https://softwaredoug.com/blog/2026/08/10/hypothetical-classifications>) · [HN discussion](<https://news.ycombinator.com/item?id=49249523>)

## Summary

Classifying products or queries with LLMs is standard, but restricting outputs to a fixed taxonomy can be costly and limiting. Instead, let a cheap LLM invent hypothetical classifications, then map them to real ones via embeddings. This approach cuts costs, avoids schema limits, and works surprisingly well.

## Key quote

> Just ask a dumb LLM to invent plausible, fake classifications for your query.

## HN discussion (99 comments)

### [Majromax](<https://news.ycombinator.com/item?id=49298600>)

> \> In the notebook, I compute a MiniLM embedding of every real Wayfair classification. I compute the embedding of the fake, hypothetical embedding from the LLM. I then dot product the fake embedding into the real ones to find the most similar. Producing: [the right answer]
>
> Isn't this begging the question that the hallucinated classification will be more selective with respect to the real schema than the query itself?  What would the dot product of <E(search query), E(schema)> have given?
>
> Even if that is too vague, smaller LLMs are capable rerankers; return the top N matching true categories and ask for a contextual ordering.

### [pu_pe](<https://news.ycombinator.com/item?id=49299011>)

> Nice trick. Couldn't you embed the query though, compare it to the embedding of the categories, then ship only categories that are close to it in the prompt to a smaller model?

### [amitpoonia19xyz](<https://news.ycombinator.com/item?id=49298844>)

> This is basically HyDE (Hypothetical Document Embeddings), no? I had tried this approach in the past, worked with limited success.

### [piterrro](<https://news.ycombinator.com/item?id=49298076>)

> I would propose the following, query vector store for 10 closest categories based on a query, feed it to an LLM, in the prompt ask it to produce a single digit 0-9 representing the number of the most appropriate choice. Use plain text prompt, dont inflate token count with JSON.
>
> There you go, you just drastically reduced the output pricing.
>
> Additionally you could experiment with a reranker instead of an LLM or after reranking take top-3 results and then feed to LLM as input in order to reduce input token costs.

### [ipsod](<https://news.ycombinator.com/item?id=49298489>)

> Just this week I tried doing something similar with a nasty vibe-coded codebase I was trying to organize.  I had Gemini Flash 3.6 classify each function/method in a similar way, giving a few plausible classifications for each (one agent per method).
>
> It didn't end up being very useful - I ran a comparison where I just had a bigger agent do the organization in a more straightforward way, and that had better results.
>
> I did find that Flash 3.6 High was >9x faster than Luna xhigh for this task, and got very similar results, though.

---

## Cite

- Page: https://zeli.app/story/49249523
- Date: 2026-08-10
- Source: softwaredoug.com (https://softwaredoug.com/blog/2026/08/10/hypothetical-classifications)
- Hacker News: https://news.ycombinator.com/item?id=49249523

## Other languages

- zh: https://zeli.app/zh/story/49249523 · markdown: https://zeli.app/zh/story/49249523.md
- ja: https://zeli.app/ja/story/49249523 · markdown: https://zeli.app/ja/story/49249523.md
- ko: https://zeli.app/ko/story/49249523 · markdown: https://zeli.app/ko/story/49249523.md
- de: https://zeli.app/de/story/49249523 · markdown: https://zeli.app/de/story/49249523.md
- es: https://zeli.app/es/story/49249523 · markdown: https://zeli.app/es/story/49249523.md
