Applied Intelligenceindependent · by Arseny Gorokh
ai · 01
applied research note ·2026 · 04 · 28 ·ai-01 ·16 min read ·empirical study

Picking the extraction LLM for knowledge-graph ingestion:breadth beats density, and Gemini 2.5 Flash wins on cost.

If you run a knowledge-graph RAG system, the model that extracts entities at ingest time is the one variable the published benchmarks hold constant, and in production it dominates both your retrieval quality and your ingest bill. This note measures eleven models on one such system, same corpus and the same rubric. Gemini 2.5 Flash cleared every retrieval cell at roughly three percent of the strongest commercial model's ingest cost, and the reason is counter-intuitive: breadth of extraction, not density of relations, is what decides graph-traversal retrieval.

24/24
smoke cells passed by Gemini 2.5 Flash, the only model in the matrix with a strict 24/0/0 score across six queries by four retrieval modes.
11
candidate models measured as the extraction LLM: frontier commercial, mid-tier commercial, and local open-source, on one fixed corpus and rubric.
6 to 9x
cheaper than Claude Sonnet 4.6 on list-priced ingest, the cost Gemini 2.5 Flash pays while clearing every retrieval cell Sonnet loses; the dek's three-percent figure is against the pricier strongest commercial model, a different baseline.
2x
the entity-extraction breadth of Sonnet 4.6 per document, at a lower relation-to-entity ratio of 1.15 against 1.43, yet it wins on traversal.
ithree findings, one model recommendation

The extractor decides retrieval and cost, so measure it directly.

If you are standing up a knowledge-graph RAG system, the extraction LLM is the choice the benchmarks quietly make for you, and it is the one that moves your retrieval quality and your bill the most.

The companion memory substrate report answers the question "which graph substrate." This note answers the question that operationally dominates it for any system in this class: which LLM the substrate should use during ingestion. The choice is not interchangeable. It controls retrieval quality more than the substrate choice does, and it controls cost by an order of magnitude or more. Eleven candidates were evaluated against a fixed twenty-document subset and a twenty-four-cell smoke rubric. One model passed every cell, then was validated on a separate 482-document legal corpus before being recommended for production. The measurements are on LightRAG, the canonical open-source implementation of this class, but the findings are about the class.

The headline

Breadth beats density for graph-traversal retrieval; Gemini 2.5 Flash is the cheapest model that clears every cell.

Gemini 2.5 Flash extracts roughly two times more entities and 1.6 times more relations per document than Claude Sonnet 4.6 on the same chunks, with a lower relation-to-entity ratio, 1.15 against 1.43. Graph-traversal retrieval anchors chunks by the entity index, so the extra entities anchor extra chunks at retrieval time and breadth wins. Sonnet 4.6 scored 22/0/2 on the smoke rubric, two fail cells; Gemini 2.5 Flash scored a clean 24/0/0. The breadth ranking holds across every corpus measured here.

iiwhat ingest actually controls

The extraction LLM is the substrate.

Knowledge-graph RAG systems share one ingest shape. The published benchmarks for these systems hold the extractor constant, the architecture diagrams hide it inside the ingest box, and the ablation tables vary chunk size and retrieval mode but not the extractor. In production it is the variable that decides what your graph looks like. The class includes Microsoft GraphRAG, LightRAG, and the smaller ecosystem of similar pipelines on Neo4j vector-plus-graph storage. They differ in retrieval strategy, graph schema, and configuration surface; they share the same ingest pattern. For each chunk of source text, an LLM extracts entities, an LLM extracts relations among them, an LLM summarises an entity that appears across many chunks, and an LLM gleans a second pass to recover missed extractions. All four are LLM calls. The call dominates wall-clock time, dominates dollar cost, and produces every node and edge in the graph. The graph is what retrieval traverses, so the extractor's biases become permanent properties of the substrate until you re-ingest from scratch.

The published benchmarks rarely specify or vary the extractor. LightRAG's paper names gpt-4o-mini for some runs and reports retrieval scores; it does not study sensitivity to extractor choice. A reader who deploys with the upstream defaults gets gpt-4o-mini as the implicit extractor and inherits its limits without ever seeing the choice. That implicit-default-as-decision pattern is the failure mode this note makes explicit. Three properties of the extractor show up downstream.

  • Entity count per document. Determines how much of the chunk text is reachable from any given query. More entities means more anchor points, means more chunks retrievable when a query lands on any of them.
  • Schema fidelity. LightRAG expects pipe-delimited records. Models that violate the format have their output dropped by the parser. Schema noise looks like missing data in the graph but is actually rejected extraction.
  • Description quality. When LightRAG summarises an entity that appears across many chunks, that summary becomes the canonical description stored in the graph. A weak summary degrades query-time matching even when the entity was extracted correctly.

None of this is what a chat-quality benchmark measures. The extractor's job is structured-text production under a tight schema with no narrative, so the best chat model on Arena leaderboards is not necessarily the best extractor.

iiimethod

The rubric is fixed before any model runs.

Stating the rubric a priori is what makes a benchmark reproducible; stating it post hoc reduces to a justification of whatever happened. Five things held constant across all eleven model rows: the corpus, the chunking, the embedder, the smoke rubric, and the reporting columns. The corpus is twenty documents pinned by explicit file list, not by directory glob, so the same files are ingested for every row; a benchmark that uses "the first twenty files alphabetically" silently drifts as new files land. Chunking uses LightRAG defaults, 1200 tokens per chunk with 100 token overlap, about four chunks per document. The embedder is a local 1024-dimensional model held constant so the variable under study is the extractor only.

The smoke rubric is six canary queries times four retrieval modes, naive, local, global, and hybrid, which equals twenty-four cells per model. Each cell is scored pass, marginal, or fail by the same evaluator against the documented expected references, and the cells and references were written before any model ran. Each row records entities per document, relations per document, the relation-to-entity ratio, the smoke score, and measured cost on the twenty-document subset, with cost taken at the provider's invoice level, not estimated. A separate 482-document legal corpus was used for production-class validation of the winning model.

What this method does not measure

A fast acceptance gate, not a full evaluation harness, scored by one human without an inter-rater check.

The twenty-four-cell smoke rubric is a fast acceptance gate; models that pass it earn a production trial on the larger 482-document corpus, where the production claims live. It does not measure latency or throughput at scale, which would dominate streaming-ingest workloads; this note is for batch ingest. The 264 cells, eleven models by twenty-four, sit inside one person's judgement of pass versus marginal, with no inter-rater check and no LLM-as-judge second pass. The schema in the smoke-rubric artefact includes the inter-rater discipline that would close this gap; a second-scorer pass on the matrix is the single highest-value re-measurement another practitioner could contribute back.

ivthe matrix

Eleven rows, one clean winner.

The full table lives in the model-matrix artefact. The headline rows, sorted by smoke score, show one model with a strict 24/0/0 and a spread of density numbers that, read alone, would mislead. Note that gpt-4o-mini's density columns come from a 150-document full-corpus run rather than the pinned twenty-document subset, so its smoke score is comparable here while its entity and relation counts are not, and Llama 3.2 3B's ratio reflects only the relations that survived schema validation after the parser dropped most as malformed.

Table 1 · the headline rows, by entities and relations per document and smoke score (pass / marginal / fail, out of 24).
modelent / docrel / docratiosmoke
Gemini 2.5 Flash Google82.595.01.1524 / 0 / 0
Gemini 3.1 flash-lite preview Google19.623.31.1922 / 1 / 1
Claude Sonnet 4.6 Anthropic40.858.41.4322 / 0 / 2
Gemini 3 flash preview Google34.040.01.1821 / 3 / 0
OpenAI gpt-4o-mini OpenAIn/an/an/a19 / 3 / 2
Llama 3.2 3B Q4 local Ollama17.46.00.3411 / 13 / 0
Qwen 3.5 4B no-think local Ollama53.334.20.648 / 4 / 12

Three observations the table does not state outright. The two Gemini "newer is better" hypotheses, 3-flash-preview and 3.1-flash-lite-preview, both lost to 2.5 Flash; the 3.x line extracts more conservatively, produces sparser graphs, and loses smoke cells on the queries that need breadth. Newer is not better for this task. The relation-to-entity ratio is misleading on its own: Sonnet 4.6 has the highest ratio, 1.43, and still lost cells to Gemini Flash at 1.15, because a high ratio with a low absolute count is a dense little graph with poor coverage. And small open-source models do not fail gracefully: the 3B Llama row ran to completion while LightRAG's parser silently dropped most of its relation output, a failure invisible without explicit schema-violation counting.

vbreadth versus density

Why the lower ratio wins on traversal.

The counter-intuitive finding sits in two columns of the matrix. Gemini 2.5 Flash produces a graph with two times the entities and 1.6 times the relations per document of Claude Sonnet 4.6, but its relation-to-entity ratio is lower, 1.15 against 1.43. On a chat benchmark you would expect the higher-ratio extractor to win on synthesis because each entity is more richly connected. On this benchmark the opposite happens: the model that produces more loosely connected nodes wins.

The mechanism is in the retrieval shape shared by every system in this class. A query is embedded and matched against entity nodes, the top-k entity neighbourhoods are traversed, and the chunks that originally produced those entities are fetched and returned. Whether the right chunk gets returned depends primarily on whether any entity in that chunk matches the query, not on how densely entities link to each other. Doubling the entity count roughly doubles the surface area the entity index covers, which roughly doubles the probability that a query lands on at least one entity from each chunk that should be returned. Relation density matters too, but only on the smaller class of queries that need multi-hop traversal across the graph; most production queries look like "what does this corpus say about X," and for those, breadth of the entity index dominates density of the relation index.

Figure 1 · breadth against smoke score. Gemini 2.5 Flash sits far right on entity breadth and clears all twenty-four cells; Sonnet 4.6, denser per entity but narrower, loses two.

This generalises across knowledge-graph RAG systems with traversal-then-fetch retrieval: optimise the extractor for entity coverage first, and optimise for relation density only when the query distribution actually rewards it. It does not generalise to systems that score retrieval purely on relation paths, a smaller class than the literature implies, or to pure vector RAG without an entity index.

Honest scope

The breadth ranking holds across corpora; the absolute counts do not.

The 82.5 entities per document is the number from the twenty-document smoke corpus. The same model and chunking on the 482-document legal corpus produced 39.8 entities per document at a higher ratio of 1.43. The breadth advantage over Sonnet 4.6 holds on both, but the absolute breadth varies by roughly a factor of two depending on what is in the chunks. The recommendation that follows, default to Gemini 2.5 Flash and re-validate the smoke rubric on your own corpus, is exactly what this falls out of: the ranking transfers, the magnitudes do not.

viper-100-document cost

Normalised so you can project your own corpus.

The cost table covers the commercial rows measured on the twenty-document smoke corpus plus one local row that finished all twenty documents. Per-100-document figures are derived as documented in the cost-model artefact. This note does not name a total dollar figure because the absolute number depends on document length, chunking, gleaning aggressiveness, and the contract price with whatever gateway sits in front of the model. Each document on this corpus produced about four chunks of 1200 tokens, and LightRAG made about 2.5 LLM calls per chunk on average, with each call consuming roughly 8K input and producing roughly 2K output tokens. That comes to about 80K input plus 20K output tokens per document, or 8M input plus 2M output per 100 documents, before any gleaning overhead.

Table 2 · ingest cost per 100 documents at list price, with cost ratio against Gemini 2.5 Flash and smoke score.
modellist, in / outcost / 100 docsratiosmoke
Gemini 2.5 Flash$0.30 / $2.50~$7 to $101.0x24 / 0 / 0
gpt-4o-mini$0.15 / $0.60~$2 to $3~0.2x to 0.4x19 / 3 / 2
Claude Sonnet 4.6$3.00 / $15.00~$54 to $69~6x to 9x22 / 0 / 2
Llama 3.2 3B local$0$00x11 / 13 / 0

Two caveats live with the Sonnet row. The six-to-nine-times range is the list-price calculator; the measured invoice on the twenty-document smoke corpus ran roughly thirty to thirty-three times Gemini Flash because gleaning fired more aggressively and the model added explanatory text the calculator does not anticipate. Use the list ratio for contract pricing and the invoice ratio for projecting re-ingest cost at the wrong model's rate. The local row shows zero inference cost; the workstation, GPU, power, and wall-clock time it consumes are independent of model choice and not included.

Figure 2 · relative ingest cost per 100 documents, list-priced against Gemini 2.5 Flash at 1.0. Sonnet's six-to-nine-times band is the structural penalty for the cells it still loses.

The ranking conclusion is robust to multiplicative pricing factors below roughly ten times. Gemini 2.5 Flash is cheaper than Sonnet 4.6 on every published rate card surveyed here and is the only model in the matrix with a strict 24/0/0 smoke score. The cheapest model that hits 24/0/0 is the production answer, and nothing in the cost table flips that. An enterprise gateway discount changes the absolute numbers but rarely changes the ratios inside the cluster.

viiopen-source local trials

Hardware is the binding constraint, and reasoning mode is a tax.

The local-extractor question matters separately from cost, because some corpora cannot leave the operator's machine for sensitivity reasons. For those the question is not "is local cheaper," since cloud is so cheap on this workload that the cost argument barely survives, but "is local viable at all." Six local trials ran across two hardware tiers, a consumer-class GPU with 6 GB VRAM and a 32 GB Apple Silicon workstation. The 4B-class models in the 6 GB tier ran end-to-end; mid-size 14B-class models on the Apple Silicon tier ran with partial completion; 26B-class and above did not complete on either tier within the worker-timeout shape. None of the local rows cleared the smoke rubric against Gemini Flash. Qwen 3.5 4B no-think scored highest among the structurally usable local graphs at 8/4/12, and a Qwen 2.5 14B GGUF Q4 build on M1 Max was the best Apple Silicon completion at 5/4/15 on nineteen of twenty documents, not cross-comparable to the full-corpus rows. Neither approaches 24/0/0.

The discipline caveat

Name what local can and cannot do: it is a data-residency choice, and reasoning mode is a tax on extraction.

Schema noise dominates small-model output. The 3B Llama row produced hundreds of schema-violation warnings; LightRAG's parser dropped most of its extraction, so the model "completed" while producing a sparse graph, invisible without explicit violation counting. Thinking-mode models add latency and billable tokens without adding schema-compliant output: a reasoning-style model emits a long internal monologue before the structured record the parser then discards, long enough to blow out the default worker timeout, and on commercial providers those thought tokens count toward output cost. Where a no-think variant or a flag to disable reasoning exists, default to it for structured extraction, and verify the flag actually reaches the model. Some Ollama versions silently ignore think: false on the OpenAI-compatible endpoint and honour it only on the native one, which is the difference between a model that ingests in two hours and one that ingests in twelve. Local is a viability choice driven by data residency, not a quality choice: if the corpus can leave the machine, the cloud is the better answer at every measured price point.

·what to deploy, and where it does not transfer

Default to Gemini 2.5 Flash, and re-run the rubric on your own corpus.

  • Default extractor. Gemini 2.5 Flash via the provider gateway you already use. Re-validate the smoke rubric on a twenty-document subset of your own corpus before locking it in; the rubric file is small enough to keep in your repo.
  • Reject the implicit gpt-4o-mini default. Several systems ship a small-tier model as the implicit extractor. It is three to five times cheaper at list price and loses cells you will care about; if you cannot upgrade it, at least make the choice explicit so future operators see it.
  • Treat the relation-to-entity ratio as diagnostic, not a target. A ratio above ~1.4 with entity count below ~30 per document is a dense small graph that underperforms at scale; a ratio near 1.0 with entity count above ~60 is a wide sparse graph that traverses well.
  • For local-only corpora driven by data residency. A 14B-class GGUF Q4 model on a 32 GB-or-larger Apple Silicon host, or a 4B no-think model on a consumer GPU, are the structurally viable options. Neither clears Gemini Flash; pair either with a separate query-time model for synthesis and accept the trade of retrieval breadth for residency.
  • Where these numbers do not transfer. A corpus dominated by structured data, pure narrative, or specialist vocabularies may rank models differently; absolute breadth varies by roughly two times across corpora; changing chunk size, embedder, or contract pricing shifts magnitudes more than ratios. Each scope claim has a falsification condition in the invalidation artefact.

The takeaway for a delivery team is not the specific model; Gemini 2.5 Flash will be obsolete by the next reading. The thing to take is the discipline: when the substrate's published benchmarks hold a variable constant, that variable is usually the one that decides outcomes in production. Name it, run a smoke rubric on it before locking it in, and instrument the deployment so the documented decision survives day-to-day operations.

About this note

An independent applied-AI engineering note by Arseny Gorokh. Not an official EPAM publication. Where EPAM DIAL appears in companion notes it is the gateway product as a technical reference, not institutional sponsorship; the corpus, rubric, and measurements are the author's own. The limits bound the claim: one stack measured under stated conditions, a single human scorer with no inter-rater check, one knowledge-base corpus shape plus one legal validation corpus, list-price cost models, LightRAG as the representative implementation, and a fast acceptance gate rather than a full retrieval harness. Re-run the smoke rubric on your own corpus before treating any magnitude as portable.

References

  1. LightRAG, the canonical open-source knowledge-graph RAG implementation used here as the representative system; its paper names gpt-4o-mini for some runs but does not study sensitivity to extractor choice.
  2. Microsoft GraphRAG and the Neo4j vector-plus-graph ecosystem, the wider class of traversal-then-fetch systems the findings are claimed to generalise across.
  3. The smoke-rubric artefact, the a-priori twenty-four-cell protocol, schema, and a neutral-domain fixture, re-instantiable on another corpus.
  4. The cost-model artefact, source of the per-100-document derivation and the list-versus-invoice reconciliation for the Sonnet row.
  5. The invalidation artefact, the falsification condition attached to each scope claim, so a re-measurer can decide whether a result invalidates or extends it.
An Applied Intelligence publication · independent · 2026 ai-01 Set in Newsreader & Spline Sans Mono · the Applied Intelligence reading style