Meme Lab BUILD NOTES

HOW IT WORKS

How Meme Lab finds the right reaction.

Meme Lab started as a controlled question: can a system understand a complete social situation well enough to choose the meme a person would actually send? This is the full journey—from the first dataset and failed approaches to the current retrieval, perspective, evaluation, and speed work.

Try the current version
Live now: 3,000 references · 6,000 vectors · five optionsFull-sentence input · perspective matching · honest fit labels · serious-content guard
PERSONAL TOOL

THE JOURNEY

Each scale jump solved a different problem.

The catalogue did not jump straight to 3,000. Each stage stayed live, exposed a limitation, and supplied the evidence for the next stage.

01 · CONTROL30 useful reactions

The original release held 60 records: 30 reaction candidates and 30 caption templates. The picker deliberately used the 30 reactions as a small all-candidate control so every model choice could be inspected.

02 · COVERAGE300 common references

Two hundred and forty reviewed external records expanded the vocabulary. Vector retrieval replaced direct comparison, the collection became searchable, and the first public feedback loop went live.

03 · GENERALIZATION1,000 broader references

Seven hundred long-tail records forced dual-view retrieval, a fresh 60-case shadow set, a serious-content gate, and the first classifier bake-off. This is where Jev beat embedding-only ranking.

04 · SCALE3,000 live references

The first attempt hit the number by treating 1,189 public-domain artworks as reactions. The audit rejected that shortcut and replaced every artwork with a usage-backed reaction GIF.

05 · QUALITYFive options, real viewpoints

Complete sentence examples revealed that one situation can support the narrator’s reaction, the other person’s side, and the event itself. The UI now returns one primary choice and four visible backups across those angles.

06 · CALIBRATIONLabels instead of fake probability

Jev’s old competitive score looked like a probability but was not one. A blind hard-case evaluation selected independent ordinal ratings, so the product now says weak, plausible, strong, or exact.

WHAT REAL USE CHANGED

The product became simpler while the ranking became deeper.

The interface is intentionally one action: paste a complete comment and get a meme. The technical complexity stays behind that action.

Input

Full sentences, not keywords

Examples describe the whole situation so actor roles, quoted speech, negation, relationship, and emotional tone survive retrieval.

Output

One best choice plus four backups

The best result remains visually dominant. Four lower-ranked options stay visible because humour is subjective and several reactions can be valid.

Viewpoint

My reaction, their side, the situation

Multi-person comments deliberately search all three angles instead of assuming every meme must speak only for the person who typed the comment.

Confidence

Weak is shown honestly

A weak but usable option is labelled weak. The system abstains only when humour would be insensitive or every candidate would misrepresent the situation.

Interaction

No generated explanation step

The user asked for a meme, not a paragraph. Removing live reasoning reduced latency and stopped plausible-sounding prose from disguising a mediocre match.

Feedback

A small yes or no loop

One-tap feedback is retained for 30 days for evaluation. It does not silently retrain or overwrite the catalogue.

THE LIVE 3,000

Retrieve. Compare. Return.

Every reference has a name, meaning, relational pattern, full-sentence example, near-miss, tags, provenance, media state, meme-strength score, and image-quality score. Runtime work stays bounded even as the catalogue grows.

  1. 01Validate and guard

    Trim and bound the comment, treat it as untrusted text, and catch clear factual or serious help requests before joking.

  2. 02Retrieve 30

    Embed the full comment, search meaning and usage-example vectors separately, then fuse both ranked lists.

  3. 03Compare by fit

    Jev independently rates all 30 candidates. Multi-person comments also preserve explicit narrator, other-person, and situation lenses.

  4. 04Return five

    Show one primary result and four backups labelled weak, plausible, strong, or exact. Persist only the bounded evaluation record.

THE RETRIEVAL SYSTEM

3,000 records never enter one prompt.

Vector search exists to find the plausible neighbourhood; the classifier decides which candidate is socially sendable. Meme strength and image quality remain separate so popularity never masquerades as contextual relevance.

Workers AI

One comment embedding

The same complete sentence queries two separately indexed views so abstract meaning and concrete usage can retrieve different useful candidates.

Vectorize

6,000 stored vectors

Three thousand references each contribute one meaning vector and one example vector. Reciprocal-rank fusion produces a unique shortlist of 30.

Core reserve

Known-good coverage survives

Twenty shortlist slots search the full catalogue; ten reserve candidates from the original 1,000 so noisy expansion records cannot erase the stronger base.

Direct Jev

Social fit beats keyword overlap

One structured TypeSafe request independently scores all 30 candidates. Full metadata lets Jev judge actors, target, tone, viewpoint, example, and near-miss instead of choosing the most familiar shared word.

Perspective mode

Three lenses in one batch

One request selects distinct candidates for my reaction, their side, and the situation. A second request rates the selected five on the same ordinal scale before the UI orders them.

Failure policy

No expensive fallback

If Jev is rate-limited, the product shows five semantic-retrieval matches as low-confidence weak fits. It never turns a traffic spike into unplanned 70B inference spend.

HOW 3,000 WAS BUILT

The first 3,000 was wrong. The rebuild fixed the count.

A reusable image is not automatically a meme. The corrected catalogue keeps 1,805 named meme templates, removes empty editing canvases, and includes 1,195 reaction GIFs backed by observed conversational use.

1,805static meme templates
1,195reaction GIFs
1.56Mobserved reply pairs
108+uses per selected research GIF
1,189artwork fillers removed
41canonical memes tracked explicitly
  1. 01
    Require usage evidence

    The GIF Reply research dataset contains 1.56 million real text-to-GIF reply pairs. Popularity comes from observed reactions, not visual guesswork.

  2. 02
    Keep stable provenance

    Every GIF keeps its research hash, GIPHY ID, source page, direct media URL, preview URL, and observed-use count.

  3. 03
    Block unsafe and duplicate media

    Source IDs, media URLs, normalized names, content tags, and duplicate checks prevent repeated or unsuitable records from padding the count.

  4. 04
    Track canonical gaps

    A checked-in must-have list makes missing cultural staples visible. “My Name Is Jeff” is now a real GIF record, not an invisible omission.

  5. 05
    Keep strength separate from fit

    Observed popularity influences meme strength. It never decides whether the reaction fits the sentence submitted right now.

  6. 06
    Write specific metadata locally

    Local Qwen writes full meaning, social-dynamic, example, near-miss, and tag sentences. They remain assistant-authored pending owner feedback.

THE MODEL BAKE-OFF

We tried fast models, local models, and smarter models.

No single model does everything. Embeddings discover candidates; Jev judges sendability; deterministic rules protect obvious serious cases; local models handled catalogue construction.

ApproachObserved resultSpeedDecision
Jev fast + full metadata19/20 top-one in the enriched shortlist trial; strongest direct fit signal.~1.27s p95 on retrieved top 30LIVE
Rich ordinal Jev9/12 exact first and 10/12 best-returned-first on the corrected hard set.1.60s p95 classifier stageQUALITY WINNER
Compact ordinal JevSame 9/12 exact first, but the best returned candidate ranked first on 9/12 instead of 10/12.1.20s p95SPEED FALLBACK
Llama 3.3 70B80% top-three on 20 expansion cases; useful structure but unnecessary prose, slower responses, and unacceptable spike cost.3.85s p95REMOVED
BGE reranker20% top-one and 45% top-three. It recognized topic similarity better than social sendability.1.83s p95NOT FINAL JUDGE
GLiNER 2.58/12 on meme-versus-none routing. Useful at extracting grief, emergency, authority, and tone features.52ms meanFEATURE CANDIDATE
Laya8/12 overall but 0/4 on meme cases. It routed too aggressively away from humour.~60ms medianRESEARCH ONLY
Qwen 3 4B local66.7% routing accuracy and only 50% humour recall. Too conservative without tuning.2.45s p95NOT PROMOTED
Qwen 2.5 3B local53.3% routing accuracy and 30% humour recall. Faster, but the quality loss was material.1.53s p95NOT PROMOTED
Jev smartNo quality win over the fast ordinal approach.10.2–14.0sTOO SLOW
Also tested

Pairwise tournaments, calibration anchors, specificity-heavy prompts, a second-stage rerank of the first five, names-only metadata, and single-view retrieval.

Not run

Gemini structured output was not called because the repository has no bounded experiment credential. No result is claimed for it.

The lesson

More reasoning was not automatically better. Rich, specific candidate data plus an independently judged ordinal task was the strongest quality/cost combination.

THE EVALUATION LADDER

One hundred broad cases plus twelve hard ranking cases.

The 100-case suite measures retrieval, ranking, and serious-content behavior across 75 humour and 25 no-meme situations. A separate 12-case hard set isolates the fit-score problem across 101 unique comment-and-candidate pairs.

Pre-ordinal 100-case snapshot: retrieval reached 72% at 30, 67% top-one relevance, 71% top-three relevance, and 96% correct serious-content abstention. All labels remain pending owner review.

THE LATEST QUALITY DECISION

Independent labels beat competitive probability.

The original Jev number was a probability inside a 30-way competition, not “the chance this meme is good.” We corrected a contradictory refrigerator fixture, rebuilt every arm, formed a 101-pair union, and had a fresh model rate the pairs blind to arm identity and scorer output.

OLD · RAW 30-WAY7 / 12

Exact first choice

7 / 12

Best returned candidate ranked first

NDCG@5 0.895 · 1.27s p95
LIVE · RICH ORDINAL9 / 12

Exact first choice

10 / 12

Best returned candidate ranked first

NDCG@5 0.950 · 1.60s p95

Evidence boundary: the blind rater was independent of the scoring outputs, but it was still a model—not human ground truth. These results justify the current engineering choice; owner feedback is still required before calling the labels calibrated.

SPEED RIGHT NOW

Normal comments are near one to two seconds. Perspectives cost more.

Quality came first. These timings are observed remote-development requests from 21 September 2026, not a production SLA or a large benchmark.

SINGLE VIEW0.98s

“The tests finally passed after I changed nothing.”

SINGLE VIEW1.88s

“I looked for my phone while using its flashlight.”

THREE PERSPECTIVES3.99s

“My sibling ate the leftovers, then asked why I was upset.”

The largest remaining slowdown

Multi-person mode needs one batched perspective selection and one final ordinal rescore. Remote embedding, Vectorize, Jev networking, and D1 persistence add the remaining fixed costs.

The safe optimization order

First lock owner-reviewed quality. Then measure production p50/p95, trim metadata only when the same cases still pass, and avoid trading the recovered viewpoints away for a synthetic speed win.

STORAGE, MEDIA, AND COST

The catalogue is stored. The media stays with its source.

The build pipeline is mostly local, but the live runtime is not completely local or free: it uses Cloudflare Workers AI, Vectorize, D1, and the direct TypeSafe Jev API.

CATALOGUE

Versioned JSON and generated modules

Names, meanings, examples, near-misses, provenance, quality signals, and source URLs live with the project and generate the public collection.

SEMANTIC INDEX

6,000 vectors in Vectorize

Meaning and usage vectors are stored remotely so every request searches a bounded index instead of loading all 3,000 records.

MEDIA

Provider-hosted images and GIFs

Imgflip, Memegen, and GIPHY assets load from recorded source URLs. Results animate GIFs; collection cards use lighter previews.

RIGHTS

Usage evidence is not a licence

Research-backed popularity proves that a GIF is used as a reaction. It does not establish redistribution rights, so every external asset remains a labelled source preview.

FEEDBACK

Bounded D1 records

The comment, returned candidate IDs, decision, labels, and yes/no feedback support evaluation and receive a 30-day expiry.

LOCAL WORK

CLIP and Qwen built the collection

Uniqueness signals and long-form metadata were generated locally. The fastest local routing models tested so far were not accurate enough for the live decision.

WHAT WE STOPPED DOING

The discarded ideas matter too.

This history prevents the project from repeating attractive experiments that already failed the quality, speed, or honesty bar.

THE EXPANSION PLAN

30 → 300 → 1,000 → 3,000 → 30,000

3,000 references are live. Quality work now closes retrieval and perspective gaps before movie dialogue becomes a separate routed corpus.

3,000 / 3,000 live“I love you 3,000” is live.
0 memes remaining · 100% complete
  1. 30
    Seed control

    Inspectable all-candidate comparison and the first structured local experiment.

    LIVE
  2. 300
    Common reactions

    Semantic retrieval, searchable collection, public feedback, and multi-option output.

    LIVE
  3. 1K
    Broader vocabulary

    Dual-view retrieval, classifier ranking, serious-content safety, and a fresh shadow evaluation.

    LIVE
  4. 3K
    I love you 3,000

    Uniqueness-gated acquisition, two vectors per record, five ordinal options, and explicit viewpoint coverage.

    LIVE
  5. 30K
    Memes plus movie dialogue

    Route the input to meme, dialogue, or none before corpus-specific retrieval. Keep evaluation and rights boundaries separate for each corpus.

    NEXT CORPUS
1. Owner-label the hard set

Confirm the ordinal winner and calibrate what weak, plausible, strong, and exact actually mean.

2. Close retrieval misses

The stage-3,000 snapshot found a usable candidate in the retrieved 30 on 72% of broad cases. Ranking cannot rescue a candidate it never sees.

3. Compress perspective latency

Replace four classifier interactions only after a one-call design proves equal viewpoint coverage on replayable cases.

4. Add the 30,000 router

Evaluate meme, dialogue, ambiguous, and none slices independently before combining their output in one product.

THE RULE THAT SURVIVED EVERY STAGE

Bigger is useful only if the results stay honest.

Three thousand is live, not “finished.” The corrected set contains meme templates and usage-backed reaction GIFs only. Metadata and evaluation labels still need owner review, source previews do not imply media rights, and a weak match stays visibly weak.

Try a real comment in Meme Lab