跳到主要导航 跳到搜索 跳到主要内容

How Do Humans Write Code? Large Models Do It the Same Way Too

  • East China Normal University
  • Central Conservatory of Music
  • Ltd.

科研成果: 书/报告/会议事项章节会议稿件同行评审

摘要

Program-of-Thought (PoT) replaces natural language-based Chain-of-Thought (CoT) as the most popular method in Large Language Models (LLMs) mathematical reasoning tasks by utilizing external tool calls to circumvent computational errors. However, our evaluation of the GPT-4 and Llama series reveals that using PoT introduces more reasoning errors, such as incorrect formulas or flawed logic, compared to CoT. To address this issue, we propose Human-Think Language (HTL), which leverages a suite of strategies that help integrate PoT and CoT, encompassing: (1) a new generation paradigm that uses full CoT reasoning to control code generation. (2) Focus Attention, that directs model attention to the CoT reasoning during PoT to generate more logical code. (3) reinforcement learning that utilizes the accuracy of both CoT and PoT responses as rewards to prevent repetitive reasoning steps in LLMs when solving difficult math problems. Our method achieves an average improvement of 6.5% on the Llama-Base model and 4.3% on the Mistral-Base model across 8 mathematical calculation datasets. It also shows significant effectiveness on five out-of-domain datasets by controlling the model's information flow, exhibiting strong transferability. Additionally, HTL shows the most significant improvement in non-mathematical natural language inference task, contributing to a unified reasoning task framework.

源语言英语
主期刊名EMNLP 2024 - 2024 Conference on Empirical Methods in Natural Language Processing, Proceedings of the Conference
编辑Yaser Al-Onaizan, Mohit Bansal, Yun-Nung Chen
出版商Association for Computational Linguistics (ACL)
4638-4649
页数12
ISBN(电子版)9798891761643
DOI
出版状态已出版 - 2024
活动2024 Conference on Empirical Methods in Natural Language Processing, EMNLP 2024 - Hybrid, Miami, 美国
期限: 12 11月 202416 11月 2024

出版系列

姓名EMNLP 2024 - 2024 Conference on Empirical Methods in Natural Language Processing, Proceedings of the Conference

会议

会议2024 Conference on Empirical Methods in Natural Language Processing, EMNLP 2024
国家/地区美国
Hybrid, Miami
时期12/11/2416/11/24

指纹

探究 'How Do Humans Write Code? Large Models Do It the Same Way Too' 的科研主题。它们共同构成独一无二的指纹。

引用此