giangkh19/Qwen3.5-4B-Financial-SQL
giangkh19/Qwen3.5-4B-Financial-SQL is a 4.5 billion parameter Qwen3.5-based language model developed by giangkh19, specifically fine-tuned for Vietnamese Financial Text-to-SQL tasks. It excels at generating ANSI SQLite queries from natural language questions about Vietnamese financial reports, incorporating reasoning about accounting concepts and financial statements. The model features a 32768 token context length and is optimized for accurate and auditable SQL generation.
Loading preview...
Overview
giangkh19/Qwen3.5-4B-Financial-SQL is a specialized language model built upon the Qwen/Qwen3.5-4B base, designed for Vietnamese Financial Text-to-SQL. It was trained on a dataset of 1,847 Gold Standard samples, ensuring 100% execution validity on SQLite databases of listed Vietnamese companies' financial reports (HOSE, HNX, UPCoM).
Key Capabilities
- Chain-of-Thought Reasoning: Before generating SQL, the model automatically analyzes accounting concepts, financial tables (
balance_sheet,income_statement,cash_flow), calculation formulas, and unit conversions (billions, millions, percent) within a<think>block. - ANSI SQLite Compliance: Generates 100% native SQLite queries, supporting complex structures like CTEs, Window functions,
period_labelfiltering, and multi-period queries. - Audit Provenance: All data-returning queries include clear source information such as
raw_value,unit,page_no, andsource_doc. - Full Weights: Provided as a merged 16-bit model, ensuring maximum compatibility with inference frameworks like vLLM, SGLang, Transformers, and Ollama.
Training Details
The model was trained for 3 epochs (627 steps) with an effective batch size of 8, achieving an optimal training loss of 0.0978 and a stable gradient norm of 0.41. It utilizes response-only loss masking, penalizing only the reasoning and SQL generation parts.
Schema Structure
The model operates on a financial_facts schema, which includes fields like ticker, company_name, year, report_type, statement, item_name, value_vnd, and source_doc, among others, to provide detailed financial data.