CONCEPT Cited by 1 source
LLM icon hallucination¶
Definition¶
LLM icon hallucination is a specific code-generation failure mode where a language model references icons from an icon library "that no longer exist or never existed." The hallucination is linguistically plausible (the emitted symbol is a grammatical React component import, spelled like other icon names) but references a symbol the library doesn't actually export — so the generated code fails to compile.
Canonical Vercel framing¶
"By default, v0 uses the lucide-react icon library. It updates weekly, adding and removing icons. This means the LLM will often reference icons that no longer exist or never existed."
(Source: sources/2026-01-08-vercel-how-we-made-v0-an-effective-coding-agent)
Why icon libraries are the paradigmatic case¶
Icon hallucination is a sharply-defined instance of a broader class (library-API hallucination) because three properties cluster:
- Namespace churn velocity — icon libraries release weekly, far faster than any retrain. (concepts/training-cutoff-dynamism-gap at its most extreme.)
- Large symbol space — thousands of icons → high hallucination probability per emitted import.
- Semantic neighbourhood — icon names like
VercelLogohave close embedding-space neighbours (Triangle) that are often visually acceptable substitutes, so a repair mechanism (not just detection) is feasible.
The Vercel mitigation¶
v0 treats icon hallucination with a deterministic embedding-resolution pipeline inside LLM Suspense:
- Embed every icon name from the live library in a vector DB (re-indexed on library updates).
- Analyse actual lucide-react exports at runtime.
- If the emitted icon exists → pass through.
- If it doesn't exist → embedding-search for the nearest real export.
- Rewrite the
importline during streaming so the user never sees the broken intermediate.
Completes in <100 ms per substitution with no further model calls — the fix is purely deterministic nearest-neighbour over a pre-embedded corpus.
Worked example: a "Vercel logo icon" generation produces
which gets rewritten to — triangle is the nearest real icon; aliased toVercelLogo so the downstream JSX doesn't need to be
rewritten.
Generalisation beyond icons¶
The pattern — "library with churning symbol namespace + large number of symbols + meaningful embedding neighbourhood" — applies to:
- Emoji libraries — shortcodes churn, semantic neighbours usually acceptable.
- Component libraries with many similarly-named components (e.g. Material UI, Chakra UI) where the model may emit a non-existent-but-plausible component name.
- Tailwind class names (at arbitrary-value cutoffs) where the semantic neighbour is often usable.
Seen in¶
- sources/2026-01-08-vercel-how-we-made-v0-an-effective-coding-agent — canonical disclosure; weekly lucide-react churn; five-step embedding-resolution pipeline; Triangle-as- VercelLogo worked example; <100 ms per substitution.
Related¶
- concepts/llm-hallucination — parent failure-mode category.
- concepts/training-cutoff-dynamism-gap — the underlying driver (library-namespace churn outpaces model-retrain cadence).
- systems/lucide-react — canonical target library.
- systems/vercel-v0 — canonical consumer.
- patterns/embedding-based-name-resolution — generalised pattern.
- patterns/streaming-output-rewrite — enclosing mechanism (LLM Suspense).