Abstract
Transformer models often exhibit brittle extrapolation, failing on inputs that are longer or structurally more complex than those seen during training. We introduce Counter-Example-Driven Curricula (CEDC), an automated framework that improves model robustness by iteratively focusing on its own failures. At each step, CEDC uses the current model to generate a diverse set of candidate problems, employs a fast, executable verifier to identify incorrect predictions (counter-examples), and then fine-tunes the model on a dataset enriched with these discovered failures. We evaluate CEDC on a suite of algorithmic and natural language tasks, including integer addition, sorting, Dyck-2 language recognition, and three text classification benchmarks. Compared to static training and standard curriculum learning baselines, CEDC achieves up to 30x greater length extrapolation, is 3.75x more computationally efficient than uniform data augmentation, and requires no manual difficulty heuristics. We provide a detailed analysis of the counter-examples, showing how the curriculum naturally adapts to target progressively more complex error modes. Our findings establish verifier-guided, failure-driven learning as a simple, powerful, and efficient paradigm for enhancing the generalization capabilities of Transformer models.
Abstract (translated)
翻译: Transformer 模型常常在面对超出训练数据长度或结构复杂度的输入时表现出脆弱性。我们引入了一种名为“反例驱动课程学习”(CEDC)的自动化框架,通过迭代关注模型自身的错误来提高其鲁棒性。在每一步中,CEDC 使用当前模型生成一系列多样化的候选问题集,使用快速可执行验证器识别出不正确的预测(反例),然后对包含这些发现失败案例的数据集进行微调。 我们在整数加法、排序、Dyck-2 语言识别和三项文本分类基准上评估了 CEDC。与静态训练以及标准课程学习基线相比,CEDC 在长度外推方面取得了高达30倍的进步,其计算效率比均匀数据增强高出3.75倍,并且不需要手动难度启发式方法。 我们提供了对反例的详细分析,展示了该课程如何自然地适应目标并逐渐解决更复杂的错误模式。我们的研究结果确立了由验证器引导、以失败为导向的学习作为一种简单、强大而高效的范式,用于增强 Transformer 模型的一般化能力。
URL
https://arxiv.org/abs/2512.01187