A search engine for Yu-Gi-Oh! card effects, and how I evaluated the one place
it uses a language model. No code here yet. This page gives the method and
the numbers, with what each number shows and what it does not. The eval data
is in data/, as card ids only.
In short. I compile the open-source simulator’s 13,439 Lua card scripts into 31,069 structured effects and answer a query with set logic over them. Turning English into that logic is the next step. Where a script is silent on a detail, a small model (Gemma 4 E2B) fine-tuned on my laptop fills it. On held-out cards it reproduces the labels as well as Gemini 3.8 Flash does (80% of the values it fills in are right, as are 80% of Gemini’s). But every choice, this model included, was made on those same test cards, so this is not yet confirmed on fresh ones.
Yu-Gi-Oh! has about 14,000 cards, each with a short rules text. Players search for cards that do one precise thing, for example “a Normal Trap that Special Summons a monster from your Deck”. Every part must hold together: the Summoned monster must come from the Deck.

Keyword search reads the words, not how they link. For that query, with a
Normal Trap filter applied first, BM25 and a neural retriever (ColBERT) both
rank first a Normal Trap whose text says “Deck” and “Special Summon”: it sends
a Trap from the Deck to the Graveyard, and Special Summons only itself, from
the Graveyard. A reranker (bge-reranker-v2-m3) moves it to second. The card
the query was written from is #190 in BM25, outside the reranker’s top 100,
and #370 in ColBERT. The query has 100 right cards; of their top 20, BM25,
ColBERT and the reranker get 3, 3 and 9 right. One query, picked because it
shows the failure.
The card the query above was written from, as the compiler reads it:
Vampire Awakening, effect 1
kind activated, from the Spell & Trap Zone, at any time
limit once per turn, by card name
action 1 Special Summon Deck -> Monster Zone exactly 1
a "Vampire" monster (its "can be Special Summoned" check:
dropped, and marked)
action 2 search Deck -> hand count: unknown, card: unknown
action 3 destroy a delayed effect it sets up on resolving
(marked as such; its details are not read)
Action 2 is a compiler error, kept here because it is real. The script declares a search category that its operation never performs, and the compiler reads verbs from those declarations. I found it while writing this page. Of the 3,274 effects that declare adding a card to the hand, 4 are in a script with no hand-adding call at all; all 4 frames carry the wrong action. 4 is a lower bound on such errors, not an error rate.
The query, as translated into the filter’s language (by a Claude session, see the caveat below):
card a Trap, not Continuous, not Counter
action Special Summon, from the Deck, a monster
The card answers: its action 1 meets every part.
Share of each field that is known or absent, at the pins below: over the 31,069 effects, and for the action’s verb, where it takes cards from, which cards and how many, over their 38,514 actions. 97 cards compile to no effect.
| field | known or absent |
|---|---|
| kind of effect | 99.9% |
| trigger event | 99.5% |
| use limit | 99.4% |
| the action’s verb | 97.5% |
| the effect has at least one action read | 78.9% |
| where it is activated | 72.5% |
| phase restriction | 64.4% |
| where the action takes cards from | 63.7% |
| which cards the action applies to | 55.9% |
| how many cards | 55.5% |
| conditions stated only in the printed text | 0%, left to the model by design |
“Which cards” counts a filter as known even when one of its conjuncts was dropped and marked: 10,318 of the 21,534 known filters are. Read in full, with nothing dropped: 11,216 of the 38,514 actions, 29.1%. Most dropped conjuncts (9,792 of 12,865) are engine legality checks such as “can be Special Summoned”, which a player’s query does not state either. A dropped conjunct can only widen the answer.
20 queries, written by a Claude agent from 20 randomly drawn cards. Each was meant to have 5 to 60 answers; the right cards found run from 1 to 100 per query (S05, the query above, has 100 where its writer expected 5 to 20). Every card in BM25’s and ColBERT’s top 100, and every card the filter returned, was judged against its printed text. One Claude (Sonnet) judge per query; a second blind judge on every yes and unsure, and on every no whose text matched all of the query’s loose keyword patterns; then a Claude session ruled each disagreement and re-read every yes. Not exhaustive: a right card that no method returned is not counted. Every ranker ran after the query’s printed filter (S05’s: Normal Traps only).
The caveat that matters. The filter does not read English yet. Each query
was translated into its query language by a Claude session, which had first
printed the 20 source cards’ compiled frames to see which fields the compiler
fills. It wrote every translation before seeing any score and changed none
after. It also decided which queries it could express in full
(fully_mapped), which sets the 10/10 split below. The rankers read the raw
English. So this compares a translated query run through a filter with a
ranker reading English, and the translation step had seen the answer cards’
structure.
| mean F1 over 20 queries | |
|---|---|
| Filter, one answer set, no cut-off | 0.45 |
| BM25, best rank cut-off per query, chosen with the answers known | 0.41 |
BM25 + bge-reranker-v2-m3 over its top 100, same |
0.46 |
| BM25, one rank cut-off k chosen on 10 queries, scored on the other 10 | 0.18 |
| BM25 + reranker, same | 0.22 |
| BM25 + reranker, one score threshold chosen on 10, scored on 10 | 0.23 |
| BM25’s top 100, each card read by a local LLM (yes or no), no cut-off | 0.59 |
data/retrieval/timings.txt.That split is the main lesson: a dropped constraint must be shown to the user, not silently removed.
My first gap-filling model, a fine-tuned LFM2.5-1.2B, was scored on every field: F1 0.85 against Gemini’s 0.78, on 215 held-out cards. But most fields are ones the script already answers, and the model is only ever used where the script is silent.

Scored only where the script is silent, the 1.2B was right on 30% of its fills (51/168) and Gemini on 73% (274/374).
The model now sees the printed card, the script’s frames with each gap marked, and the list of gaps, and fills only those.
| precision on filled gaps | right value found, of the gaps that state one | |
|---|---|---|
| Gemma 4 E2B, fine-tuned (5 seeds) | 0.80 | 0.860 |
| Gemini 3.8 Flash (2 runs) | 0.80 | 0.831 |
| Gemma 4 E2B, untuned, with Gemini’s prompt and examples | 0.473 | 0.505 |
| No model: the commonest training label per field | 0.454 | 0.526 |
Gemma minus Gemini, bootstrap over cards: in precision −0.004 [−0.043, +0.035]; in the right value found, +0.028 [−0.006, +0.063]. Both intervals include 0. The fine-tune does the work: untuned, and given the rules and 8 worked examples the fine-tuned model never saw, Gemma’s precision barely beats a predictor that never reads the card, which finds more right values.
A Gemini 3.8 Flash pass over every card with a gap would cost about $160: 11,498 cards, at about $2.5 for each run over 179 cards (about 2.2 million input and 0.2 million output tokens), at low reasoning and November 2026 prices, about twice that from 2027. It is due again at each new card set or schema change. But the honest reason is that I wanted to know whether a laptop could do it.
data/ holds what the numbers above were computed from, with cards
as ids (passcodes): no card text. Card names appear where a label names a
card (a card named X), in the labelling rules’ list of values (80 names)
and in two notes, one in the labelling rules and one in a query’s notes.
retrieval/: the 20 queries with their translations, every verdict,
BM25’s and ColBERT’s full rankings and the reranker’s top 100, the filter’s
answers by tier, the LLM judge’s answers, the reranker’s scores and the
run times.gapfill/: the 439 held-out gaps with their gold labels, every run’s
answers, the labelling rules and the system prompt. The 8 worked examples
are left out because they quote card text.The files are in the GitHub repository.
data/README.md gives the scoring rule and how each label
was reached, and lists the figures these files cannot reproduce, such as the
gate over the 591 served gaps, the first comparison and the compiler
coverage. Not included: the compiled
frames, which derive from the AGPL-licensed scripts, and the compiler. A gap
is named by card id, effect index and field, so reading it needs the frames.
Card scripts:
Project Ignis / EDOPro, the
open-source simulator (AGPL-3.0). Thank you. The scripts are not
redistributed here. Measurements at scripts commit 2a569dcd and a card
database of 2026-08-03. The gaps scored and the gate come from frames
compiled at this project’s commit 37bf094 (2026-11-19; not published);
tuned Gemma and Gemini 3.8 Flash ran on 2026-11-18, on the frames before
it. Tools: bm25s, GTE-ModernColBERT,
BAAI/bge-reranker-v2-m3, Qwen3.6-35B-A3B on MLX, Gemma 4 E2B on MLX,
Gemini 3.8 Flash and Gemini 4 Hydrogen, Claude for labelling, judging, and
help drafting these pages and the figures.
Yu-Gi-Oh! is a trademark of Konami. This is an unaffiliated fan project.
The text, the figures and the eval data are licensed under CC BY 4.0: reuse them with credit to Stanislas Boiton Ledenko. Card names and quoted card text, such as the excerpts in figure 1, are Konami’s and are not covered. Neither is the compiled effect under “One compiled effect”, which derives from an AGPL-3.0 script.
Stanislas Boiton Ledenko, LinkedIn. Written 2026-11-26, last updated 2026-11-29.