markrodrigo/Llama-3.2-3B-Instruct-Spatial-SQL-1.0

TEXT GENERATIONConcurrent Unit Cost:1Model Size:3.2BQuant:BF16Context Size:32kTool Calling:SupportedPublished:Oct 5, 2024License:llama3.2Architecture:Transformer Featherless Exclusive Cold

The markrodrigo/Llama-3.2-3B-Instruct-Spatial-SQL-1.0 model, developed by Mark Rodrigo, is a 3.2 billion parameter instruction-tuned model based on the Llama-3.2 architecture. It is specifically fine-tuned using QLoRA and Supervised Fine Tuning (SFT) for a narrow use case: converting natural language questions and coordinate inputs into PostGIS spatial SQL. This model excels at generating SQL for geographic functions like area, centroid, buffer, and length, making it ideal for spatial data applications.

Loading preview...

Llama-3.2-3B-Instruct-Spatial-SQL-1.0: Spatial SQL Generation

This model, developed by Mark Rodrigo, is a 3.2 billion parameter, instruction-tuned Llama-3.2 variant specifically designed for generating PostGIS spatial SQL from natural language queries and coordinate inputs. It leverages QLoRA and Supervised Fine Tuning (SFT) to achieve its specialized functionality.

Key Capabilities

  • Natural Language to Spatial SQL: Translates English questions combined with geographic coordinate prompts into executable PostGIS SQL.
  • Focused Geographic Functions: Supports four primary spatial functions in version 1.0:
    • Area: Calculates the area of a polygon.
    • Centroid: Determines the center point of a polygon.
    • Buffer: Creates a buffer polygon around a point at a specified distance.
    • Length: Measures the length of a line.
  • Input/Output Format: Expects text input with coordinate prompt injection and outputs PostGIS spatial SQL. Coordinates are handled in meters or WGS 84 geographic decimal degrees.

Training Details

The model was trained on a custom synthetic dataset using specific hyperparameters including a learning rate of 3e-05, a batch size of 10, and 5 epochs. Training results show a decreasing validation loss, indicating effective learning for its specialized task.

Good For

  • Applications requiring automated generation of PostGIS spatial SQL from user queries.
  • Integrating natural language interfaces with geographic information systems (GIS) that utilize PostGIS.
  • Developers building tools for spatial data analysis where specific geographic functions need to be executed via SQL.