逆向思考:MetaMath新數學推理語言模型訓練大型模型
複雜數學推理是評估大語言模型推理能力的重要指標,目前常用的數學推理資料集樣本量有限且問題多樣性不足,導致大語言模型存在[逆轉詛咒] 的現象,即一個訓練於「A 是B」的語言模式無法推廣到「B 是A」[1]。此現像在數學推理任務中的具體形式是:即給定一個數學問題,語言模型擅於用正向推理解答問題但缺乏逆向推理解決問題的能力。逆向推理在數學問題中十分常見,如下 2 個例子。
1. 經典問題- 雞兔同籠
- 正向推理:籠子裡有23 隻雞和12 隻兔,問籠子裡有幾個頭和多少隻腳?
- 逆向推理:有若干隻雞兔同在一個籠子裡,從上面數,有 35 個頭,從下面數,有 94 隻腳。問籠中各有幾隻雞和兔子?
2. GSM8K 問題
- 正向推理: James buys 5 packs of beef that are 4 pounds each. The price of beef is $5.50 per pound. How much did he pay?
- 逆向推理: James buys x packs of beef that are 4 pounds each. The price of beef is $5.50 per pound . How much did he pay? If we know the answer to the above question is 110, what is the value of unknown variable x?
#為了提升模型的正向和逆向推理能力,劍橋、港科大、華為的研究者基於兩個常用的數學資料集(GSM8K 和MATH)提出了MetaMathQA 資料集:一個覆蓋面廣、品質高的數學推理資料集。 MetaMathQA 由 395K 個大語言模型產生的正向逆向數學問答對組成。他們在 MetaMathQA 資料集上基於 LLaMA-2 微調得到專注於數學推理 (正向和逆向) 的大語言模型 MetaMath,在數學推理資料集上達到了 SOTA。 MetaMathQA 資料集和不同規模的 MetaMath 模型已開源供研究人員使用。
- 計畫網址:https://meta-math.github.io/
- 論文網址:https://arxiv.org/abs/2309.12284
- 資料位址:https://huggingface.co/datasets/meta-math/MetaMathQA
- 模型位址:https://huggingface.co/meta-math
- #程式碼位址:https://github.com/meta-math/MetaMath
在GSM8K-Backward資料集中,我們建構了一個逆向推理的實驗。實驗結果顯示,與SFT、RFT和WizardMath等方法相比,目前的方法在逆向推理問題上表現較差。與之相反,MetaMath模型在正向和反向推理方面都取得了出色的性能
方法
#MetaMathQA 包含了四種資料增強的方法:
1. Answer Augmentation (答案增強):給定問題,透過大語言模型產生能得到正確結果的思維鏈作為資料增廣。
- Question: James buys 5 packs of beef that are 4 pounds each. The price of beef is $5.50 per pound. How much did he pay?
######################################################################### ######Answer: James buys 5 packs of beef that are 4 pounds each, so he buys a total of 5 * 4 = 20 pounds of beef. The price of beef is $5.50 per pound, pay he 5020 * = $110. The answer is: 110.###################2. Rephrasing Question (問題改寫增強):##########給定元問題,透過大語言模型重寫問題並產生正確結果的思維鏈作為資料增廣。 ######
- Question: What is the total amount that James paid when he purchased 5 packs of beef, each weighing 4 pounds, at a price of $5.50 per pound?
#Answer: Each pack of beef weighs 4 pounds, so 5 packs weigh 4 * 5 = 20 pounds in total. The price per pound of beef is $5.50, so the total cost for 20 pounds is 20 * $5.50, so the total cost 為 20 pounds is 20 * $1.50. James paid a total of $110. The answer is: 110.
3. FOBAR Question (FOBAR 逆向問題增強):######### #給定元問題,透過遮罩條件中的數字為x,給定原有答案並反推x 來產生逆向問題,並基於該逆向問題生成正確的思維鏈過程來進行資料增廣(反推樣例:「If we know the answer to the above question is 110, what is the value of unknown variable x?」)。 ###############Question: James buys x packs of beef that are 4 pounds each. The price of beef is $5.50 per pound. How much did he pay? If we know the answer to the above question is 110, what is the value of unknown variable x?###########Answer: James buys x packs of beef that are 4 pounds each, so he buys a total of 4x pounds of beef. The price of beef is $5.50 per pound, so the total cost of the beef is 5.50 * 4x = 22x. We are given that the total cost is $110, so we can write: 222x = 10. we get: x = 5. The value of x is 5.##################4. Self-Verification Question (Self-Verification 逆向問題增強):### ######在FOBAR 的基礎上,透過大語言模型改寫逆向問題部分為陳述的語句來進行資料增廣(改寫樣例:「How much did he pay?」 (with the answer 110) 被改寫成“He paid 110”)。 ###############Question: James buys x packs of beef that are 4 pounds each. The price of beef is $5.50 per pound. He paid 110. What is the value of unknown variable x ?############Answer: To solve this problem, we need to determine the value of x, which represents the number of packs of beef that James bought. Each pack of beef weighs 4 pounds and costs $5.50 per pound. The total amount James paid is $110. We can set up the equation as follows: Number of packs of beef * Weight per pack * Price per pound = Total amount paid; x * 4 * $5.50 = $110; solve for x: 4x * $5.50 = $110; 22x = $110; To isolate x, we divide both sides of the equation by 22: 22x / 22 = $110 / 22; x = $5; The value of x is 5.##is 5; The value of x 是 5. ############實驗結果###############################在兩個常見的數學推理資料集(GSM8K和MATH)的實驗結果表明,MetaMath在效能上顯著優於現有的開源LLM模型,而且不需要藉助外部工具(例如程式碼解釋器)。其中,我們的MetaMath-7B模型在GSM8K上達到了66.5%的準確率,在MATH上達到了19.8%的準確率,分別比相同規模的最先進模型高出11.6%和9.1%。特別值得一提的是,MetaMath-70B在GSM8K上達到了82.3%的準確率,超過了GPT-3.5-Turbo############根據《表面對齊假設》[2],大型語言模型的能力來自於預訓練,而來自下游任務的資料則會啟動預訓練期間所學習到的語言模型的內在能力。因此,這引發了兩個重要問題:(一)哪種類型的資料可以最有效地激活潛在知識,以及(二)為什麼一個資料集在這種活化中比另一個資料集更好? ###############為什麼 MetaMathQA 有用?提高了思維鏈資料的品質(Perplexity)###############################根據上圖所示,研究人員計算了LLaMA-2-7B 模型在僅答案資料、GSM8K CoT 和MetaMathQA 資料集的各個部分上的困惑度。 MetaMathQA 資料集的困惑度明顯低於其他兩個資料集,這表明它具有較高的易學性,可能更有助於揭示模型的潛在知識###############為什麼MetaMathQA 有用?增加了思維鏈資料的多樣性 (Diversity)#########
通过比较数据的多样性增益和模型的准确率增益,研究人员发现,重新表述、FOBAR和SV的引入相同数量的增广数据都带来了明显的多样性增益,并显著提高了模型的准确率。相比之下,仅仅使用答案增强会导致准确率明显饱和。在准确率达到饱和后,增加AnsAug数据只会带来有限的性能提升
以上是逆向思考:MetaMath新數學推理語言模型訓練大型模型的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

您想了解如何在WordPress網站上使用cookie嗎? Cookie是在用戶瀏覽器中存儲臨時信息的有用工具。您可以使用此信息通過個性化和行為定位來增強用戶體驗。在本終極指南中,我們將向您展示如何像專業人士一樣設置、獲取和刪除WordPresscookie。注意:這是一個高級教程。它要求您精通HTML、CSS、WordPress網站和PHP。什麼是Cookie? Cookie是用戶訪問網站時創建並存儲在用戶瀏覽

火幣APKV10.50.0下載指南:1、點擊文中直達鏈接;2、選擇正確的下載包;3、填寫註冊信息;4、開始火幣交易流程。

火幣APKV10.50.0下載指南:1、點擊文中直達鏈接;2、選擇正確的下載包;3、填寫註冊信息;4、開始火幣交易流程。

火幣APKV10.50.0下載指南:1、點擊文中直達鏈接;2、選擇正確的下載包;3、填寫註冊信息;4、開始火幣交易流程。

火幣APKV10.50.0下載指南:1、點擊文中直達鏈接;2、選擇正確的下載包;3、填寫註冊信息;4、開始火幣交易流程。

2025年十大虛擬幣交易所APP排名如下:1. OKX,2. Binance,3. Huobi,4. Coinbase,5. Kraken,6. KuCoin,7. Bybit,8. FTX,9. Bitfinex,10. Gate.io。這些交易所根據用戶體驗、安全性和交易量等維度進行評選,每個平台都提供了獨特的功能和服務,以滿足不同用戶的需求。

十大數字幣交易所app最新排名依次為:1. OKX,2. Binance,3. Huobi,4. Coinbase,5. Kraken,6. KuCoin,7. Bitfinex,8. Gemini,9. Bitstamp,10. Poloniex。使用這些app的步驟包括:下載並安裝app,註冊賬戶,完成KYC認證,充值並開始交易。

火幣APKV10.50.0下載指南:1、點擊文中直達鏈接;2、選擇正確的下載包;3、填寫註冊信息;4、開始火幣交易流程。
