Geo-FuB: A Method for Constructing an Operator-Function Knowledge Base for Geospatial Code Generation Tasks Using Large Language Models
arXiv:2410.20975 · doi:10.1016/j.knosys.2025.113624
Abstract
The rise of spatiotemporal data and the need for efficient geospatial modeling have spurred interest in automating these tasks with large language models (LLMs). However, general LLMs often generate errors in geospatial code due to a lack of domain-specific knowledge on functions and operators. To address this, a retrieval-augmented generation (RAG) approach, utilizing an external knowledge base of geospatial functions and operators, is proposed. This study introduces a framework to construct such a knowledge base, leveraging geospatial script semantics. The framework includes: Function Semantic Framework Construction (Geo-FuSE), Frequent Operator Combination Statistics (Geo-FuST), and Semantic Mapping (Geo-FuM). Techniques like Chain-of-Thought, TF-IDF, and the APRIORI algorithm are utilized to derive and align geospatial functions. An example knowledge base, Geo-FuB, built from 154,075 Google Earth Engine scripts, is available on GitHub. Evaluation metrics show a high accuracy, reaching 88.89% overall, with structural and semantic accuracies of 92.03% and 86.79% respectively. Geo-FuB's potential to optimize geospatial code generation through the RAG and fine-tuning paradigms is highlighted.
References in corpus (27)
- A Survey of Large Language Models
- BioGPT: Generative Pre-trained Transformer for Biomedical Text Generation and Mining
- Retrieval-Augmented Generation for Large Language Models: A Survey
- Code Llama: Open Foundation Models for Code
- A Comprehensive Overview of Large Language Models
- BloombergGPT: A Large Language Model for Finance
- Automatic Chain of Thought Prompting in Large Language Models
- FinBERT: A Pretrained Language Model for Financial Communications
- Domain Specialization as the Key to Make Large Language Models Disruptive: A Comprehensive Survey
- LEVA: Using Large Language Models to Enhance Visual Analytics
- Beyond Functional Correctness: Exploring Hallucinations in LLM-Generated Code
- A Short Survey of Viewing Large Language Models in Legal Aspect
- GeoCode-GPT: A Large Language Model for Geospatial Code Generation Tasks
- A Critical Review of Large Language Model on Software Engineering: An Example from ChatGPT and Automated Program Repair
- Evaluation of Code LLMs on Geospatial Code Generation
- Contrastive Preference Optimization: Pushing the Boundaries of LLM Performance in Machine Translation
- Planning with Large Language Models for Code Generation
- BioRAG: A RAG-LLM Framework for Biological Question Reasoning
- Large Language Models in Cybersecurity: State-of-the-Art
- PCAE: A Framework of Plug-in Conditional Auto-Encoder for Controllable Text Generation
- Non-Autoregressive Text Generation with Pre-trained Language Models
- Simulating Classroom Education with LLM-Empowered Agents
- Abstract Syntax Tree for Programming Language Understanding and Representation: How Far Are We?
- Knowledge Overshadowing Causes Amalgamated Hallucination in Large Language Models
- Augmenting Pre-trained Language Models with QA-Memory for Open-Domain Question Answering
- Better Language Models of Code through Self-Improvement
- Fixing Function-Level Code Generation Errors for Foundation Large Language Models