Overview
Model Overview
pavankumarbalijepalli/phi2-sqlcoder is a 3 billion parameter causal language model, fine-tuned from microsoft/phi-2 specifically for Natural Language to SQL (NL2SQL) tasks. It leverages the b-mc2/sql-create-context dataset to generate SQL queries from natural language questions and database schemas.
Key Capabilities & Performance
This model demonstrates notable efficiency and accuracy for NL2SQL:
- Faster Inference: Achieves 41% faster inference times compared to
defog/sqlcoder-7b-2on CPU machines, averaging 24 seconds per query. - Higher Execution Success: Shows a 29% higher execution success rate than
defog/sqlcoder-7b-2on holdback datasets. - Optimized for CPU: Designed to perform well on CPU machines with limited RAM, making it suitable for deployment on lower-powered devices.
- PostgreSQL Output: Generates SQL queries specifically for PostgreSQL syntax.
Limitations & Considerations
- Context Window: Has a limited context window of 2048 tokens, requiring careful input engineering for complex queries.
- Complexity: While competitive on easy and medium queries, it may face challenges with highly intricate SQL tasks compared to larger models.
- Security Risks: Like other NL2SQL models, it can be susceptible to SQL injection attacks if not properly secured.
- Out-of-Scope Use: Not intended for generating critical production code without human oversight or for SQL dialects other than PostgreSQL.
Use Cases
- Translating natural language questions into SQL queries for database interaction.
- Applications requiring efficient, on-device SQL generation where context length can be managed.
- Educational tools or prototypes for demonstrating NL2SQL capabilities.