微调大模型可显著提升自动算法设计能力,且具备跨任务泛化潜力。
Fine-tuning Large Language Model for Automated Algorithm Design
- 采用多样性感知的采样策略与直接偏好优化,提升模型对算法设计任务的适配性。
- 小模型经微调后性能超越未微调的大模型,在特定任务上表现更优。
- 微调模型在相关任务间展现良好泛化能力,适合算法自动化研究者使用。
将大语言模型(LLM)融入自动算法设计展现出巨大潜力。现有方法多依赖通用编程训练的现成模型,但关键问题仍未解决:是否需要为算法设计专门定制的模型?如何有效获取并实现跨任务泛化?本文初步探索了针对算法设计的微调方法,提出一种多样性感知的基于排名(DAR)采样策略以平衡数据多样性和质量,并采用直接偏好优化(DPO)高效对齐模型输出与任务目标。实验在Llama-3.2-1B-Instruct和Llama-3.1-8B-Instruct上进行,涵盖三个不同算法设计任务,另以openPangu-Embedded模型在可接受集问题上作辅助比较。结果表明,微调后的模型在小模型(Llama-3.2-1B-Instruct)上显著优于原生模型,且在可接受集问题上达到与大模型(Llama-3.1-8B-Instruct)相当的性能。此外,微调模型在相关任务中表现出良好泛化能力。这些发现凸显了任务专用适配对算法设计中大模型的价值,为后续研究开辟新路径。代码已开源:https://github.com/RayZhhh/dpo-aad。
原文摘要 · Abstract (English)
The integration of large language models (LLMs) into automated algorithm design has shown promising potential. A prevalent approach embeds LLMs within search routines to iteratively generate and refine candidate algorithms. However, most existing methods rely on off-the-shelf LLMs trained for general coding tasks, leaving a key question open: Do we need LLMs specifically tailored for algorithm design? If so, how can such LLMs be effectively obtained and how well can they generalize across different algorithm design tasks? In this paper, we take a preliminary step toward answering these questions by exploring fine-tuning of LLMs for algorithm design. We introduce a Diversity-Aware Rank-based (DAR) sampling strategy to balance training data diversity and quality, then we leverage direct preference optimization to efficiently align LLM outputs with task objectives. Our experiments are primarily conducted on Llama-3.2-1B-Instruct and Llama-3.1-8BInstruct across three distinct algorithm design tasks, with openPangu-Embedded models additionally included as auxiliary comparisons on the admissible set problem. Results suggest that fine-tuned LLMs can significantly outperform their off-the-shelf counterparts with the smaller Llama-3.2-1B-Instruct and match the larger Llama-3.1-8B-Instruct on the admissible set problem. Moreover, we observe promising generalization: LLMs fine-tuned on specific algorithm design tasks also improve performance on related tasks with varying settings. These findings highlight the value of task-specific adaptation for LLMs in algorithm design and open new avenues for future research. Our code is publicly available at https://github.com/RayZhhh/dpo-aad.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。