LeGo-Code: 模块化课程学习能否推进复杂代码生成?来自文本到SQL的见解
LeGo-Code: Can Modular Curriculum Learning Advance Complex Code Generation? Insights from Text-to-SQL
AI总结:
本文探讨模块化课程学习是否能提升代码生成模型在文本到SQL任务中的表现,提出模块化适配器策略,通过分层训练提升复杂查询性能,展示结构化模块化学习优于传统微调。
摘要:
近年来,面向代码的大型语言模型(LLMs)在将自然语言转换为可执行代码方面表现出强大能力。文本到SQL是这一能力的重要应用,使非技术用户能够通过自然语言与关系数据库交互。然而,最先进的模型仍难以处理高度复杂的逻辑,特别是涉及多重连接和条件的深度嵌套语句,以及噪声或结构不佳的现实数据库模式。本文研究课程学习是否能提升代码基LLMs在文本到SQL任务中的性能。通过Spider和BIRD等基准测试,我们采用不同的课程策略对模型进行微调。实验表明,简单的按复杂度排序训练样本的朴素课程策略在单个周期内无法超越标准微调,因为空间遗忘。为克服此问题,我们提出模块化适配器组合(MAC)策略。通过依次在逐步增加的复杂度层级上训练特定层级的适配器(易到超难),我们创建了一个阶梯式学习环境,提高了复杂查询的性能。我们的方法不仅在Spider和BIRD基准测试中产生了可衡量的性能提升,还提供了一个灵活的、
英文摘要:
Recently, code-oriented large language models (LLMs) have demonstrated strong capabilities in translating natural language into executable code. Text-to-SQL is a significant application of this ability, enabling non-technical users to interact with relational databases using natural language. However, state-of-the-art models continue to struggle with highly complex logic, particularly deeply nested statements involving multiple joins and conditions, as well as with real-world database schemas that are noisy or poorly structured. In this paper, we investigate whether curriculum learning can improve the performance of code-based LLMs on Text-to-SQL tasks. Employing benchmarks including Spider and BIRD, we fine-tune models under different curriculum strategies. Our experiments show that naive curriculum, simply ordering training samples by complexity in a single epoch, fails to surpass standard fine-tuning due to catastrophic forgetting. To overcome this, we propose a Modular Adapter Composition (MAC) strategy. By sequentially training tier-specific adapters on incremental complexity levels (Easy to Extra-Hard), we create a scaffolded learning environment that improves performance on complex queries. Our approach not only produces measurable performance gains on the Spider and BIRD benchmarks but also provides a flexible, "Lego-like" architecture, allowing models to be composed and deployed based on specific schema difficulty requirements. These findings demonstrate that structured, modular learning is a superior alternative to monolithic fine-tuning for mastering the syntax and logic of complex code generation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。