7 Downloads Updated 4 weeks ago
ollama run SuhasDevmane55/geollm-qwen3-4b-v2
A Qwen3-4B fine-tune that answers undergraduate geotechnical engineering questions from facts supplied to it at runtime, citing the textbook and page each claim came from.
Built for the QAA-funded GeoLLM project (Cardiff, Manchester, Surrey, Glasgow), which is developing a source-grounded alternative to general-purpose chatbots for engineering students.
It was trained on RAG-shaped examples — the user turn contains the question plus a block of knowledge-graph facts, each ending with its source and page. It learned how to use supplied evidence, not to recall soil mechanics from memory.
Ask it a bare question and it will still answer, but the citation and refusal behaviour it was trained for only appears when you supply facts. The expected prompt shape:
What are the steps of the cone penetrometer liquid limit test?
## Knowledge-graph facts (retrieved subgraph)
- cone penetrometer procedure -HAS_STEP-> Prepare a cup of very moist soil (ProcedureStep) [order=1] (Barnes p.60)
- cone penetrometer procedure -HAS_STEP-> Allow the cone to fall freely into the cup (ProcedureStep) [order=2] (Barnes p.60)
- liquid limit cone method -GOVERNED_BY-> BS 5930:1999 (Standard) (Barnes p.62)
## Sources available
- [Barnes] Graham Barnes — Soil Mechanics: Principles and Practice (2016)
The full retrieval stack that produces this — knowledge graph, hybrid search, grounding checks and a student-facing web UI — is open source and runs with one command:
https://github.com/suhasdevmane/QAA-CEP-GeoLLM
git clone https://github.com/suhasdevmane/QAA-CEP-GeoLLM
cd QAA-CEP-GeoLLM/kg && cp .env.example .env # set NEO4J_PASSWORD
docker compose up -d # GUI at http://localhost:8008
[Barnes p.60], taken from the fact it used| Base | Qwen/Qwen3-4B |
| Method | QLoRA (4-bit, rank 16), ~35 min on a single 16 GB laptop GPU |
| Data | 456 instruction examples generated from a curated geotechnical knowledge graph (40.6k facts from 8 textbooks, every fact carrying source + page), balanced across five question types, plus synthetic refusal examples |
| Contamination guard | Every generated question was similarity-checked against the project’s 300-question evaluation benchmark and dropped if close — the benchmark stays a clean held-out test |
Measured on the project’s 300-question EN3300 benchmark (six soil-mechanics lab tests × five question types), with identical retrieval for every model compared:
| Metric | Result |
|---|---|
| Semantic similarity vs gold answers | 0.726 (300 questions) |
| Strongest category | Negative testing — 0.774 |
| Citation accuracy | 87.5% of citations name a book+page pair that genuinely exists in the retrieved context |
| Blind paired review vs the experimental v3 | preferred in 9 of 10 decided pairs |
Full methodology and the head-to-head analysis:
training/BAKEOFF_RESULTS.md
Base model Qwen3-4B (Apache 2.0). Training data was generated from a knowledge graph distilled from copyrighted geotechnical textbooks; content reaches the model only as re-expressed facts with provenance attached, consistent with the project’s IP position. Released as a research artifact for education and evaluation.
Part of a QAA Collaborative Enhancement Project across Cardiff, Manchester, Surrey and Glasgow.
Companion model: SuhasDevmane55/geollm-qwen3-1.7b-v2.