BeastxD/text2cypher_lora_v4_balanced
The BeastxD/text2cypher_lora_v4_balanced is a 4 billion parameter Qwen3-4B-Instruct-2507 fine-tuned model, specifically designed to convert natural language questions and graph schema descriptions into Cypher queries. This LoRA-merged 16-bit model excels at generating accurate Cypher queries for Neo4j graph databases, requiring the graph schema to be provided in the system prompt. It was trained on a complexity-balanced dataset of 2,252 rows, making it particularly adept at handling diverse query complexities.
Loading preview...
Overview
BeastxD/text2cypher_lora_v4_balanced is a specialized 4-billion parameter model, fine-tuned from Qwen3-4B-Instruct-2507 using LoRA (merged 16-bit). Its core function is to translate natural language questions and a provided graph schema description into Cypher queries for Neo4j graph databases.
Key Capabilities
- Cypher Query Generation: Converts user questions into executable Cypher queries based on a given graph schema.
- Schema-Agnostic: Designed to work with arbitrary graph schemas provided dynamically in the system prompt, rather than being limited to a pre-baked schema.
- Complexity-Balanced Training: Trained on a 2,252-row dataset, carefully balanced across easy, medium, and complex query types (44.3% easy, 11.5% medium, 44.2% complex) to improve robustness across different query difficulties.
- Strict Schema Adherence: Generates queries that strictly adhere to the provided schema, avoiding invention of non-existent labels, relationship types, or properties.
- Detailed Query Rules: Incorporates specific rules for query generation, including handling aggregations, distinct values, relationship directions, and property matching.
Usage and Differentiators
This model requires a specific prompt format where the graph schema is passed within the system prompt. It will not function correctly with bare natural language questions without the schema context. This approach allows the model to be highly adaptable to various graph database domains and schemas. The balanced training dataset, a trimmed version of the v4 dataset, aims to improve performance on more complex queries by reducing the dominance of simpler examples, a key differentiator from its v4_raw counterpart. Evaluation results for semantic accuracy are pending but will be available in the training repository.