Geological Modelling with LLMs:


A few weeks ago, I came across a fascinating blog article by Meta showcasing the winners of their recently hosted LLamaCon Hackathon. One of the winning projects that stood out involved generating 3D geological models using a combination of Meta AI and GemPy. This concept immediately caught my attention and I was eager to experiment with a similar approach using Google’s Gemini instead.
This week’s blog outlines a workflow that can automatically convert descriptive geological reports into 3D models. With further refining and experimentation, this could be beneficial for geologists, researchers or students looking to modernize their interpretation workflows.
The Problem
Interpreting geological descriptions from PDF reports and converting them into 3D models is typically a labor-intensive process. These reports often contain complex, domain-specific narratives describing stratigraphy, structural features, geochronological relationships and much more. Manually translating this information into a modelling tool like GemPy requires geological expertise and time which becomes unscalable when dealing with large datasets.
The Core Idea
The idea is to use an LLM to read and interpret geological text and convert it into structured tabular data compatible with GemPy. The model is guided using prompt engineering and tailored DSL (Domain-Specific Language) templates to ensure geologically meaningful output.
The Workflow
PDF Ingestion and Parsing
- Geological reports are parsed to extract only relevant descriptive sections such as those that describe rock types, stratigraphic sequences, and structural features.
DSL Generation
The summarised text is transformed into a custom DSL capturing:
Rock units
Depositional and intrusive events
Relative and absolute geochronology
CSV Data Generation
Based on the DSL, the LLM is instructed to generate:
Surface Points (X, Y, Z coordinates)
Orientations (dip, azimuth)
Structural Relationships
These are then saved in CSV format for to be used with GemPy.
GemPy Model Initialization
- The structured data is used to initialize and compute a full 3D model in GemPy, visualizing stratigraphic surfaces and geological structures.
Technologies Utilized
Technology | Purpose |
Google Gemini | Summarization, DSL and CSV generation |
GemPy | 3D Geological Modelling and Visualization |
Potential extensions and limitations I’ve come across:
Extensions:
Ability to plot and visualise borehole data accurately
Deploy as a web-based service or batch-processing tool
Swap the DSL and CSV generation with a single structured JSON output from the LLM which can be read by GemPy for modelling
Limitations:
Not always an accurate or uniform output
Has the potential to hallucinate certain details since the data generation relies heavily on on an LLM
The approach may need to be tailored for different kinds of reporting styles and standards that different geological surveys or companies may follow
Conclusion
This was a fun project that explored a potential use case of LLMs apart from asking them to refine your emails or summarise a textbook. Though the approach is not exactly production-ready, it offers a promising foundation for automating geological interpretation workflows. With further development, it could serve as a valuable tool for geoscientists seeking to convert static reports into interactive geological models.
Big thanks to William Davis for the original Geo-LM concept, the inspiration behind my own weekend project. His work shows how AI has the potential to help out geologists and spark creativity in the world of computational geology.
Subscribe to my newsletter
Read articles from Jason D'souza directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Jason D'souza
Jason D'souza
As a student geologist with a passion for tech, I love building with code and turning ideas into real-world projects.