<p>Prompting techniques play a crucial role in enhancing the capabilities of large pretrained language models (LLMs). While chain-of-thought (CoT) prompting, Wei (Adv Neural Inf Process Syst 35:24824–24837, 2022) has achieved remarkable success in improving LLM reasoning capabilities; its underlying mechanism is still not fully understood. Traditional CoT prompting often fails to inform the model adequately about what mistakes to avoid, which can increase the likelihood of reasoning errors. Inspired by human learning through contrastive examples and triplet knowledge enhancement, we propose a triplet-based contrastive chain-of-thought (CoT-TCP) method that provides both valid and invalid reasoning examples. By extracting triplets, this method helps guide models toward more accurate and less erroneous reasoning. The experiments in this paper show that this method improves performance across various reasoning tasks. For instance, using the GPT-3.5 model, the accuracy of the ADDSUB task increased from 29.9 to 90.6%, and the accuracy of the GSM8K task increased from 14.3 to 79.9%. The proposed method not only outperforms traditional zero-shot and few-shot CoT methods, but also integrates seamlessly with existing prompt techniques, yielding excellent results. In conclusion, by introducing contrastive prompts and generating logically consistent triplet examples, our method taps into the reasoning potential of LLMs and enhances their performance in various reasoning tasks.</p>

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Triplet-based contrastive method enhances the reasoning ability of large language models

  • Hongwei Chen,
  • Jiahui Zhu,
  • Wei Wang,
  • Yuan Zhu,
  • Liya Xi

摘要

Prompting techniques play a crucial role in enhancing the capabilities of large pretrained language models (LLMs). While chain-of-thought (CoT) prompting, Wei (Adv Neural Inf Process Syst 35:24824–24837, 2022) has achieved remarkable success in improving LLM reasoning capabilities; its underlying mechanism is still not fully understood. Traditional CoT prompting often fails to inform the model adequately about what mistakes to avoid, which can increase the likelihood of reasoning errors. Inspired by human learning through contrastive examples and triplet knowledge enhancement, we propose a triplet-based contrastive chain-of-thought (CoT-TCP) method that provides both valid and invalid reasoning examples. By extracting triplets, this method helps guide models toward more accurate and less erroneous reasoning. The experiments in this paper show that this method improves performance across various reasoning tasks. For instance, using the GPT-3.5 model, the accuracy of the ADDSUB task increased from 29.9 to 90.6%, and the accuracy of the GSM8K task increased from 14.3 to 79.9%. The proposed method not only outperforms traditional zero-shot and few-shot CoT methods, but also integrates seamlessly with existing prompt techniques, yielding excellent results. In conclusion, by introducing contrastive prompts and generating logically consistent triplet examples, our method taps into the reasoning potential of LLMs and enhances their performance in various reasoning tasks.