arXiv:2601.13695cs.CL2026-01

用图像压缩令牌生成可执行SQL,减少输入量十倍。

OptiSQL: Executable SQL Generation from Optical Tokens

  • 用视觉编码器将表格图像转为少量光学令牌
  • 在Spider 2.0-Snow上保持高执行准确率,输入令牌减少10倍
  • 适合处理网页或文档中的表格图像,无需原始文本

可执行SQL生成通常在文本到SQL任务中研究,表结构和内容以线性化文本形式提供。尽管有效,但该设定依赖结构化文本,产生大量令牌开销,与许多真实场景不符——表格常作为文档或网页中的视觉元素出现。本文探讨紧凑的光学表示能否作为高效语义解析接口。提出OptiSQL,一个基于视觉的框架,直接从表格图像和自然语言问题生成可执行SQL,使用紧凑的光学令牌。OptiSQL采用面向OCR的视觉编码器,将表格结构与内容压缩为少量光学令牌,并微调预训练解码器生成SQL,同时冻结编码器以分离表示充分性。在可视化版Spider 2.0-Snow上的实验表明,OptiSQL在保留强执行准确率的同时,将表格输入令牌减少一个数量级。鲁棒性分析进一步证明,光学令牌在视觉扰动下仍能保留关键结构信息。

原文摘要 · Abstract (English)

Executable SQL generation is typically studied in text-to-SQL settings, where tables are provided as fully linearized textual schemas and contents. While effective, this formulation assumes access to structured text and incurs substantial token overhead, which is misaligned with many real-world scenarios where tables appear as visual artifacts in documents or webpages. We investigate whether compact optical representations can serve as an efficient interface for executable semantic parsing. We present OptiSQL, a vision-driven framework that generates executable SQL directly from table images and natural language questions using compact optical tokens. OptiSQL leverages an OCR-oriented visual encoder to compress table structure and content into a small set of optical tokens and fine-tunes a pretrained decoder for SQL generation while freezing the encoder to isolate representation sufficiency. Experiments on a visualized version of Spider 2.0-Snow show that OptiSQL retains strong execution accuracy while reducing table input tokens by an order of magnitude. Robustness analyses further demonstrate that optical tokens preserve essential structural information under visual perturbations.

文本到SQL视觉编码表格理解轻量化

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。