Yapay Zeka Hızlı Bakış & Çıkarımlar
AI InsightSonuçlar, RAFT yaklaşımı ile eğitilen GPT-4o modelinin %80 EX skoru, %92 tablo benzerliği ve %89 SQL benzerliği ile en yüksek başarıyı sağladığını; Gemini-1.5 modelinin ise %81 EX skoru ve %90+ yapısal benzerlik ile benzer düzeyde bir performans sergilediğini göstermektedir.
📌 3 Maddede Bu Makale
Özet
Doğal dilden veri tabanı sorgusu yapmak, insanların teknik bilgi olmadan verilerle kolayca çalışabilmesini sağlar ve bilgiye ulaşma şeklini önemli ölçüde değiştirir. Bu bağlamda, büyük dil modellerinin (LLM) doğal dil girdilerinden SQL sorguları üretme konusundaki yetkinlikleri giderek daha fazla ilgi çekmektedir. Bu çalışmada, LLM’lerin bu görevdeki başarımı, geleneksel RAG (Retrieval-Augmented Generation) yaklaşımı ile RAFT (Retrieval-Augmented Fine-Tuning) yöntemi kullanılarak karşılaştırmalı olarak analiz edilmiştir. GPT-4o, Gemini-1.5-flash-001 ve Qwen2.5-14B-Instruct modelleri RAFT yöntemiyle ince ayar işlemine tabi tutulmuş; ardından her bir model, 1 ila 4 şemalı veritabanları üzerinde toplam 1.006 SQL sorgusu ile test edilmiştir. Model performansları, Exact Match (EX) skorları ile birlikte Tablo Benzerliği ve SQL Benzerliği ölçütleri üzerinden değerlendirilmiştir. Sonuçlar, RAFT yaklaşımı ile eğitilen GPT-4o modelinin %80 EX skoru, %92 tablo benzerliği ve %89 SQL benzerliği ile en yüksek başarıyı sağladığını; Gemini-1.5 modelinin ise %81 EX skoru ve %90+ yapısal benzerlik ile benzer düzeyde bir performans sergilediğini göstermektedir. Qwen2.5-14B modelinin EX skoru ise %63’te kalmıştır. Ayrıca, tüm modellerin RAFT ile eğitilmiş sürümleri, RAG temelli versiyonlarına kıyasla daha yüksek EX skoru elde etmiştir. Bu sonuçlar, RAFT yönteminin yalnızca bağlamsal doğruluğu değil, aynı zamanda yapısal tutarlılığı da güçlendiren etkili bir strateji olduğunu ortaya koymaktadır.
Abstract
Natural language database querying enables people to easily work with data without technical knowledge and dramatically changes the way information is accessed. In this context, the ability of large language models (LLMs) to generate SQL queries from natural language input is of increasing interest. In this work, the performance of LLMs in this task is analyzed comparatively using the traditional RAG (Retrieval-Augmented Generation) approach and the RAFT (Retrieval-Augmented Fine-Tuning) method. The GPT-4o, Gemini-1.5-pro-001 and Qwen2.5-14B-Instruct-bnb-4bit models were fine-tuned using the RAFT method and then each model was tested with a total of 1,006 SQL queries on databases with 1 to 4 schemas. Model performances were evaluated on Exact Match (EX) scores as well as Table Similarity and SQL Similarity measures. The results show that the GPT-4o model trained with the RAFT approach achieves the highest performance with an EX-score of 80%, 92% table similarity and 89% SQL similarity, while the Gemini-1.5-pro-001 model performs at a similar level with an EX-score of 81% and 90%+ structural similarity. The EX-score of the Qwen2.5-14B-Instruct-bnb-4bit model remained at 63%. Moreover, the RAFT-trained versions of all models achieved higher EX scores compared to the RAG-based versions. These results suggest that RAFT is an effective strategy to improve not only contextual accuracy but also structural consistency.