Frugal Knowledge Graph Construction with Local LLMs: A Zero-Shot Pipeline, Self-Consistency and Wisdom of Artificial Crowds
Organizations: LIA · Avignon Université, Laboratoire d’Informatique d’Avignon (LIA)
Abstract
This paper presents an empirical study of a multi-model zero-shot pipeline for knowledge graph construction and exploitation, executed entirely through local inference on consumer-grade hardware. We propose a reproducible evaluation framework integrating two external benchmarks (DocRED, HotpotQA), WebQuestionsSP-style synthetic data, and the RAGAS evaluation framework in an automated pipeline. On 500 document-level relations, our system achieves an F1 of 0.70 0.041 in zero-shot, compared to 0.80 for supervised DREEAM. Text-to-query achieves an accuracy of 0.80 0.06 on 200 samples. Multi-hop reasoning achieves an Exact Match (EM) of 0.460.04 on 500 HotpotQA questions, with a RAGAS faithfulness of 0.96 0.04 on 50 samples. Beyond the pipeline, we study diversity mechanisms for difficult multi-hop reasoning. On 181 questions unsolvable at zero temperature, self-consistency (k=5, T =0.7) recovers up to 23% EM with a single Mixture-of-Experts (MoE) model, but the cross-model oracle (3 architectures x 5 samples) reaches 46.4%. We highlight an agreement paradox: strong consensus among samples signals collective hallucination rather than a reliable answer, echoing the work of Moussa{ï}d et al. on the wisdom of crowds. Extending to the full pipeline (500 questions), self-consistency (k=3) raises EM from 0.46 to 0.48 0.04. A confidence-routing cascade mechanism (Phi-4 GPT-OSS, k=5) achieves an EM of 0.55 0.04, the best result obtained, with 45.4% of questions rerouted. Finally, we show that V3 prompt engineering applied to other models does not reproduce the gains observed with Gemma-4, confirming the specific prompt/model interaction. The entire system runs in 5 h on a single RTX 3090, without any training, for an estimated carbon footprint of 0.09 kg CO2 eq.
Figures & tables
| Source / Framework | Task | N | Metrics |
| Re-DocRED [ 3 ] | Relation extraction | 500 | P, R, F1 |
| Synthetic ⋆ | Text-to-Query | 200 | Accuracy, Valid Cypher |
| HotpotQA [ 5 ] | Multi-hop reasoning | 500 | EM, Token-F1 |
| Synthetic ⋆ + RAGAS [ 7 ] | Anti-hallucination | 50 | Faithfulness, Relevance, Ctx. Precision |
| ⋆ Questions generated by the LLM from manual seeds (20 for Text-to-Query, 6 for RAG). RAG metrics are computed by the RAGAS framework. See § Evaluation Protocol. | |||
| Task | Model | Parameters | Quant. |
|---|---|---|---|
| Relation extraction | Gemma-4-27B-A4B-it | 27B (4B active) | Q4_K_M |
| Text-to-Query | Qwen3-Deep | 8B | Q4_K_M |
| Multi-hop reasoning | Phi-4 | 14B | Q4_K_M |
| Conversational RAG | Mistral-Small | 24B | Q4_K_M |
| Metric | Value | 95% CI | Target |
|---|---|---|---|
| Precision | 0.7379 | [0.70; 0.77] | — |
| Recall | 0.6700 | [0.63; 0.71] | — |
| F1-Score | 0.7023 | [0.67; 0.74] | 0.85 |
| Model | P | R | F1 | Unparsed samples (%) |
|---|---|---|---|---|
| Mistral-Small | 0.666 | 0.666 | 0.666 | 0.0 |
| GPT-OSS (20B) | 0.823 | 0.550 | 0.659 | 33.2 |
| Phi-4-Reasoning+ | 0.656 | 0.656 | 0.656 | 0.0 |
| Phi-4 | 0.618 | 0.618 | 0.618 | 0.0 |
| Qwen-3 (14B) | 0.917 | 0.176 | 0.295 | 80.8 |
| Gemma-4 (26B, pipeline) | 1.000 | 0.020 | 0.039 | 98.0 |
| System | Paradigm | F1 (%) | Hardware |
| DREEAM [ 9 ] | Supervised (fine-tuned) | 80.2 | Multi-GPU † |
| ATLOP [ 8 ] | Supervised (fine-tuned) | 77.8 | Multi-GPU † |
| GPT-3 few-shot [ 10 ] | Few-shot (cloud API) | 72 ∗ | OpenAI API |
| GPT-3 zero-shot [ 10 ] | Zero-shot (cloud API) | 30 | OpenAI API |
| ChatGPT zero-shot [ 11 ] | Zero-shot (cloud API) | 25 | OpenAI API |
| SYNSYNTH (Gemma-4 Q4) | Zero-shot (local) | 70.2 | 1 RTX 3090 |
| Metric | Value | 95% CI | Target |
|---|---|---|---|
| Accuracy | 0.795 | [0.74; 0.85] | 0.90 |
| Valid Cypher rate | 1.00 | — | — |
| Metric | Value | 95% CI | Target |
|---|---|---|---|
| Exact Match (EM) | 0.458 | [0.42; 0.50] | 0.70 |
| Token-F1 | 0.520 | [0.49; 0.55] | — |
| Mean chain length | 3.24 | — | 3 |
| Metric | Value | 95% CI |
|---|---|---|
| Mean faithfulness | 0.9572 | [0.91; 1.00] |
| Mean relevance | 0.8220 | [0.76; 0.88] |
| Context precision | 0.9480 | [0.90; 0.99] |
| EM V4 | EM V1 | F1 V4 | chain | V4 V1 | |
| 10 | 0.444 | 0.440 | 0.432 | 3.73 | 0.004 |
| 50 | 0.344 | 0.330 | 0.313 | 4.31 | 0.014 |
| 200 | 0.380 | 0.356 | 0.341 | 3.87 | 0.024 |
| 500 | 0.378 | 0.308 | 0.359 | 3.74 | 0.070 |
| 1000 | 0.406 | 0.246 | 0.405 | 3.46 | 0.160 |
| 3000 | 0.406 | 0.190 | 0.387 | 3.80 | 0.216 |
| Model | Size | EM | F1 | chain | JSON% |
|---|---|---|---|---|---|
| GPT-OSS-20B | 20B MoE | 0.177 | 0.201 | 2.25 | 12.2 |
| Phi-4-Reasoning+ | 14B | 0.166 | 0.156 | 10.9 | 23.8 |
| Phi-4 | 14B | 0.133 | 0.165 | 3.39 | 0.0 |
| Magistral-24B | 24B | 0.110 | 0.142 | 4.31 | 0.6 |
| Gemma-4-26B | 26B MoE | 0.083 | 0.066 | 0.86 | 77.3 |
| Qwen3-14B | 14B | 0.072 | 0.088 | 2.13 | 4.4 |
| Phase | N | Duration |
|---|---|---|
| Relation extraction | 500 | 3 h 55 min |
| Text-to-Query | 200 | 3 min |
| Multi-hop reasoning | 500 | 22 min 47 s |
| Conversational RAG | 50 | 10 min |
| Total pipeline | — | 4 h 30 |
| Approach | Hardware | Training | Inference | F1 |
| SYNSYNTH (Gemma-4 Q4) | 1 RTX 3090 | None | 4 h | 0.70 |
| GPT-3 zero-shot [ 10 ] | Cloud API | None | — | 0.30 |
| GPT-3 few-shot [ 10 ] | Cloud API | None | — | 0.72 |
| DREEAM [ 9 ] | Multi-GPU † | 24–48 h | 1 min | 0.80 |
| ATLOP [ 8 ] | Multi-GPU † | 12–24 h | 1 min | 0.78 |
| † Exact resources not reported in the original papers. | ||||
| Version | Extr. F1 | Query | Multi. EM | RAG F. | Duration |
|---|---|---|---|---|---|
| V1 (baseline) | 0.263 | 0.80 | 0.462 | 1.00 | 24 h 10 |
| V2 (+ constrained decoding) | 0.260 | 0.80 | 0.462 | 1.00 | 2 h 53 |
| V3 (+ synonyms + prompt) | 0.702 | 0.80 | 0.458 | 0.94 | 4 h 23 |
| V4 (+ QLoRA multi-hop) | 0.702 | 0.795 | 0.406 ‡ | 0.96 | 5 h |
| V5a (+ SC ) | 0.702 | 0.795 | 0.482 | 0.96 | 6 h |
| V5b (+ Cascade) | 0.702 | 0.795 | 0.552 | 0.96 | 8 h |
| Scenario | EM | 95% CI | #Mod. | VRAM | Rel. cost |
|---|---|---|---|---|---|
| V4 QLoRA only ( ) | 0.406 | — | 1 | 4 GB | 1 |
| V4 + 8 LLM vote | 0.446 | — | 9 | 19 GB | 130 |
| Phi-4 zero-shot (ref.) | 0.462 | 1 | 9 GB | 2.5 | |
| V5a SC ( ) | 0.482 | 1 | 9 GB | 7.5 | |
| V4 + 8-model Oracle (theor.) | 0.520 | — | 9 | 19 GB | 130 |
| Random cascade (45%) | 0.524 | 2 | 14 GB | 12 |
| Model | Type | EM | Oracle k | F1 | vs. 0 |
|---|---|---|---|---|---|
| GPT-OSS 20B | MoE | 0.232 | 0.332 | 0.240 | 23.2 pts |
| Phi-4-Reasoning+ | Reasoner | 0.171 | 0.298 | 0.138 | 17.1 pts |
| Phi-4 | Standard | 0.144 | 0.210 | 0.172 | 14.4 pts |
| Cross-model oracle | 3 | 0.309 | 0.464 | — | 46.4 pts |
| Inter-response agreement | EM | Oracle k | |
|---|---|---|---|
| High ( ) | 84 (46%) | 0.214 | 0.250 |
| Medium | 74 (41%) | 0.311 | 0.459 |
| Low ( ) | 23 (13%) | 0.043 | 0.217 |
| Metric | Value | 95% CI |
| Voted EM | 0.482 | |
| Voted F1 | 0.479 | |
| Oracle ( ) | 0.568 | |
| Mean agreement | 0.738 | — |
| Mean agreement is the average proportion, across all questions, of the responses that match the majority response (e.g., 4 identical responses out of 5 agreement ). | ||
| Metric | Value | 95% CI |
|---|---|---|
| Voted EM | 0.552 | |
| Voted F1 | 0.534 | |
| Oracle ( ) | 0.658 | |
| Mean agreement | 0.837 | — |
| Primary accepted | 54.6% | — |
| Rerouted | 33.6% | — |
| Configuration | EM | Rerouted | % sec. | |
|---|---|---|---|---|
| Agreement cascade | 0.4 | 0.514 | 59 | 11.8% |
| Agreement cascade | 0.6 | 0.544 | 149 | 29.8% |
| Agreement cascade | 0.8 | 0.552 | 227 | 45.4% |
| Phi-4 only ( ) | — | 0.496 | 0 | 0% |
| Random cascade | — | 0.524 0.008 | 227 | 45% |
| Two-model oracle | — | 0.588 | — | — |
| Model | P | R | F1 V3 | Raw F1 | V3 |
|---|---|---|---|---|---|
| Gemma-4 26B (pipeline) | 0.738 | 0.670 | 0.702 | 0.039 | +0.663 |
| Mistral-Small 24B | 0.660 | 0.660 | 0.660 | 0.666 | 0.006 |
| Phi-4-Reasoning+ 14B | 0.660 | 0.660 | 0.660 | 0.656 | 0.004 |
| GPT-OSS 20B | 0.818 | 0.538 | 0.649 | 0.660 | 0.011 |
| Model | Mean EM | Mean Oracle | ||
|---|---|---|---|---|
| GPT-OSS 20B | 0.217 | 0.032 | 0.335 | 0.024 |
| Phi-4-Reasoning+ | 0.167 | 0.011 | 0.309 | 0.008 |
| Phi-4 | 0.130 | 0.008 | 0.223 | 0.008 |
| Metric | Mean | Values | |
|---|---|---|---|
| Voted EM | 0.550 | 0.003 | 0.552 / 0.546 / 0.552 |
| Voted F1 | 0.533 | 0.002 | 0.534 / 0.531 / 0.535 |
| Oracle ( ) | 0.653 | 0.005 | 0.658 / 0.650 / 0.650 |
| Mean agreement | 0.830 | 0.006 | 0.837 / 0.829 / 0.825 |
| % rerouted | 45.5 | 0.1 | 45.4 / 45.6 / 45.6 |
| Category | N | % | Description |
|---|---|---|---|
| Knowledge gap | 64 | 51.6 | Obscure facts absent from pre-training |
| Numerical reasoning | 32 | 25.8 | Dates, populations, exact quantities |
| Format mismatch | 18 | 14.5 | Partial F1 but EM 0 (aliases, granularity) |
| Entity confusion | 10 | 8.1 | Correct semantic type, wrong instance |
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
| Parameter | Extraction | Query | Multi-hop | RAG |
|---|---|---|---|---|
| Temperature | 0.3 | 0.3 | 0.3 | 0.3 |
| Top-p | 0.9 | 0.9 | 0.9 | 0.9 |
| num_ctx | 8192 | 8192 | 8192 | 8192 |
| num_predict | 1024 | 2048 | 4096 | 2048 |
| Output format | JSON | JSON | JSON | Text + JSON |
| Timeout (s) | 600 | 600 | 600 | 600 |
KG Construction
Knowledge graph construction turns text, tables, images, and databases into structured entities and relationships that machines can query and reason over.
See all 195 papers