GeoCode-GPT: A large language model for geospatial code generation

Shuyang Hou , Zhangxiao Shen , Anqi Zhao , Jianyuan Liang , Zhipeng Gui , Xuefeng Guan , Rui Li , Huayi Wu
{"title":"GeoCode-GPT: A large language model for geospatial code generation","authors":"Shuyang Hou ,&nbsp;Zhangxiao Shen ,&nbsp;Anqi Zhao ,&nbsp;Jianyuan Liang ,&nbsp;Zhipeng Gui ,&nbsp;Xuefeng Guan ,&nbsp;Rui Li ,&nbsp;Huayi Wu","doi":"10.1016/j.jag.2025.104456","DOIUrl":null,"url":null,"abstract":"<div><div>The increasing demand for spatiotemporal data and modeling tasks in geosciences has made geospatial code generation technology a critical factor in enhancing productivity. Although large language models (LLMs) have demonstrated potential in code generation tasks, they often encounter issues such as refusal to code or hallucination in geospatial code generation due to a lack of domain-specific knowledge and code corpora. To address these challenges, this paper presents and open-sources the GeoCode-PT and GeoCode-SFT corpora, along with the GeoCode-Eval evaluation dataset. Additionally, by leveraging QLoRA and LoRA for pretraining and fine-tuning, we introduce GeoCode-GPT-7B, the first LLM focused on geospatial code generation, fine-tuned from Code Llama-7B. Furthermore, we establish a comprehensive geospatial code evaluation framework, incorporating option matching, expert validation, and prompt engineering scoring for LLMs, and systematically evaluate GeoCode-GPT-7B using the GeoCode-Eval dataset. Experimental results reveal that GeoCode-GPT significantly outperforms existing models across multiple tasks. For multiple-choice tasks, its accuracy improves by 9.1% to 32.1%. In code summarization, it achieves superior scores in completeness, accuracy, and readability, with gains ranging from 1.7 to 25.4 points. For code generation, its performance in accuracy, readability, and executability surpasses benchmarks by 1.2 to 25.1 points. Grounded in the fine-tuning paradigm, this study introduces and validates an approach to enhance LLMs in geospatial code generation and associated tasks. These findings extend the application boundaries of such models in geospatial domains and offer a robust foundation for exploring their latent potential.</div></div>","PeriodicalId":73423,"journal":{"name":"International journal of applied earth observation and geoinformation : ITC journal","volume":"138 ","pages":"Article 104456"},"PeriodicalIF":8.6000,"publicationDate":"2025-04-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"International journal of applied earth observation and geoinformation : ITC journal","FirstCategoryId":"1085","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S1569843225001037","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"2025/3/5 0:00:00","PubModel":"Epub","JCR":"Q1","JCRName":"REMOTE SENSING","Score":null,"Total":0}
引用次数: 0

Abstract

The increasing demand for spatiotemporal data and modeling tasks in geosciences has made geospatial code generation technology a critical factor in enhancing productivity. Although large language models (LLMs) have demonstrated potential in code generation tasks, they often encounter issues such as refusal to code or hallucination in geospatial code generation due to a lack of domain-specific knowledge and code corpora. To address these challenges, this paper presents and open-sources the GeoCode-PT and GeoCode-SFT corpora, along with the GeoCode-Eval evaluation dataset. Additionally, by leveraging QLoRA and LoRA for pretraining and fine-tuning, we introduce GeoCode-GPT-7B, the first LLM focused on geospatial code generation, fine-tuned from Code Llama-7B. Furthermore, we establish a comprehensive geospatial code evaluation framework, incorporating option matching, expert validation, and prompt engineering scoring for LLMs, and systematically evaluate GeoCode-GPT-7B using the GeoCode-Eval dataset. Experimental results reveal that GeoCode-GPT significantly outperforms existing models across multiple tasks. For multiple-choice tasks, its accuracy improves by 9.1% to 32.1%. In code summarization, it achieves superior scores in completeness, accuracy, and readability, with gains ranging from 1.7 to 25.4 points. For code generation, its performance in accuracy, readability, and executability surpasses benchmarks by 1.2 to 25.1 points. Grounded in the fine-tuning paradigm, this study introduces and validates an approach to enhance LLMs in geospatial code generation and associated tasks. These findings extend the application boundaries of such models in geospatial domains and offer a robust foundation for exploring their latent potential.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
GeoCode-GPT:用于生成地理空间代码的大型语言模型
地球科学领域对时空数据和建模任务的需求日益增长,使得地理空间代码生成技术成为提高生产力的关键因素。尽管大型语言模型(llm)在代码生成任务中表现出了潜力,但由于缺乏特定领域的知识和代码语料库,它们经常遇到诸如拒绝编码或在地理空间代码生成中产生幻觉之类的问题。为了解决这些挑战,本文提出并开放了GeoCode-PT和GeoCode-SFT语料库,以及GeoCode-Eval评估数据集。此外,通过利用QLoRA和LoRA进行预训练和微调,我们引入了GeoCode-GPT-7B,这是第一个专注于地理空间代码生成的LLM,从代码Llama-7B进行了微调。此外,我们建立了一个综合的地理空间代码评估框架,包括选项匹配、专家验证和法学硕士的快速工程评分,并使用GeoCode-Eval数据集系统地评估GeoCode-GPT-7B。实验结果表明,GeoCode-GPT在多任务上明显优于现有模型。对于多项选择任务,其准确率提高了9.1%至32.1%。在代码总结方面,它在完整性、准确性和可读性方面都取得了优异的成绩,得分范围从1.7到25.4分。对于代码生成,它在准确性、可读性和可执行性方面的性能比基准测试高出1.2到25.1分。在微调范式的基础上,本研究介绍并验证了一种增强地理空间代码生成和相关任务中的法学硕士的方法。这些发现扩展了此类模型在地理空间领域的应用范围,并为探索其潜在潜力提供了坚实的基础。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
International journal of applied earth observation and geoinformation : ITC journal
International journal of applied earth observation and geoinformation : ITC journal Global and Planetary Change, Management, Monitoring, Policy and Law, Earth-Surface Processes, Computers in Earth Sciences
CiteScore
12.00
自引率
0.00%
发文量
0
审稿时长
77 days
期刊介绍: The International Journal of Applied Earth Observation and Geoinformation publishes original papers that utilize earth observation data for natural resource and environmental inventory and management. These data primarily originate from remote sensing platforms, including satellites and aircraft, supplemented by surface and subsurface measurements. Addressing natural resources such as forests, agricultural land, soils, and water, as well as environmental concerns like biodiversity, land degradation, and hazards, the journal explores conceptual and data-driven approaches. It covers geoinformation themes like capturing, databasing, visualization, interpretation, data quality, and spatial uncertainty.
期刊最新文献
Phenology-Aligned multi-task temporal fusion framework for satellite-based triple-seasonal rice yield estimation in Southeast Asia An Arctic underwater terrain matching method integrating template matching and DEM super-resolution MAFNet: A multi-modal adaptive fusion network-based approach for individual building extraction from oblique photogrammetry Seasonal field-scale wheat yield forecasting using XGBoost with radar, optical, and weather data in Morocco Advances in extracting current profiles from X-band radar images with a focus on retrieving subsurface current
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1