ChatPaper.aiChatPaper

Risoluzione di Problemi Matematici Complessi Utilizzando GPT-4 Code Interpreter con Verifica Automatica Basata su Codice

Solving Challenging Math Word Problems Using GPT-4 Code Interpreter with Code-based Self-Verification

August 15, 2023
Autori: Aojun Zhou, Ke Wang, Zimu Lu, Weikang Shi, Sichun Luo, Zipeng Qin, Shaoqing Lu, Anya Jia, Linqi Song, Mingjie Zhan, Hongsheng Li
cs.AI

Abstract

I recenti progressi nei grandi modelli linguistici (LLM) come GPT-4 e PaLM-2 hanno portato a significativi avanzamenti nella risoluzione di problemi di ragionamento matematico. In particolare, l'ultima versione di GPT-4 di OpenAI, nota come GPT-4 Code Interpreter, mostra prestazioni notevoli su dataset matematici complessi. In questo articolo, esploriamo l'effetto del codice nel potenziare la capacità di ragionamento degli LLM introducendo diversi vincoli sulla Frequenza di Utilizzo del Codice di GPT-4 Code Interpreter. Abbiamo scoperto che il suo successo può essere largamente attribuito alle sue potenti abilità nel generare ed eseguire codice, valutare l'output dell'esecuzione del codice e correggere la sua soluzione quando riceve output irragionevoli. Basandoci su questa intuizione, proponiamo un metodo di prompting nuovo ed efficace, la verifica autonoma basata su codice esplicito (CSV), per ulteriormente potenziare il potenziale di ragionamento matematico di GPT-4 Code Interpreter. Questo metodo utilizza un prompt zero-shot su GPT-4 Code Interpreter per incoraggiarlo a usare il codice per auto-verificare le sue risposte. Nei casi in cui lo stato di verifica risulta "False", il modello deve automaticamente correggere la sua soluzione, analogamente al nostro approccio di correzione degli errori durante un esame di matematica. Inoltre, riconosciamo che gli stati del risultato della verifica indicano la fiducia in una soluzione, il che può migliorare l'efficacia del voto a maggioranza. Con GPT-4 Code Interpreter e CSV, otteniamo un'impressionante accuratezza zero-shot sul dataset MATH (dal 53,9% all'84,3%).
English
Recent progress in large language models (LLMs) like GPT-4 and PaLM-2 has brought significant advancements in addressing math reasoning problems. In particular, OpenAI's latest version of GPT-4, known as GPT-4 Code Interpreter, shows remarkable performance on challenging math datasets. In this paper, we explore the effect of code on enhancing LLMs' reasoning capability by introducing different constraints on the Code Usage Frequency of GPT-4 Code Interpreter. We found that its success can be largely attributed to its powerful skills in generating and executing code, evaluating the output of code execution, and rectifying its solution when receiving unreasonable outputs. Based on this insight, we propose a novel and effective prompting method, explicit code-based self-verification~(CSV), to further boost the mathematical reasoning potential of GPT-4 Code Interpreter. This method employs a zero-shot prompt on GPT-4 Code Interpreter to encourage it to use code to self-verify its answers. In instances where the verification state registers as ``False'', the model shall automatically amend its solution, analogous to our approach of rectifying errors during a mathematics examination. Furthermore, we recognize that the states of the verification result indicate the confidence of a solution, which can improve the effectiveness of majority voting. With GPT-4 Code Interpreter and CSV, we achieve an impressive zero-shot accuracy on MATH dataset (53.9\% to 84.3\%).
PDF231February 8, 2026