- TOM分?jǐn)?shù) IdentityChain框架使用TOM分?jǐn)?shù)來衡量代碼的語義一致性,實(shí)驗(yàn)證明TOM分?jǐn)?shù)是一種有效的自一致性評估指標(biāo)。 TOM分?jǐn)?shù)是測試輸出匹配度分?jǐn)?shù)(Test Output Match score)的縮寫。它是一種衡量Code LLM生成的程序在執(zhí)行時(shí)輸出是否與期望輸出一致的指標(biāo)。TOM分?jǐn)?shù)為1表示所有的輸出都完全匹配,而分?jǐn)?shù)為0表示沒有匹配。 通過計(jì)算TOM分?jǐn)?shù),我們可以評估模型在自一致性方面的準(zhǔn)確性和可靠性。 # 一個(gè)簡單的例子,理解TOM和IdentityChain : 假設(shè)我們有一個(gè)Code LLM,我們將使用它來生成一個(gè)簡單的程序。我們給出以下的輸入和輸出示例: 輸入(nl0):Calculate the sum of two numbers.
輸出(pl0):num1 + num2
現(xiàn)在,我們將使用生成的程序(pl0)來生成一個(gè)新的描述(nl1): 輸入(pl0):num1 + num2
輸出(nl1):Write a function named sumNumbers that accepts two parameters num1 and num2, and returns their sum.
最后,我們使用生成的描述(nl1)來生成一個(gè)新的程序(pl1): 輸入(nl1):Write a function named sumNumbers that accepts two parameters num1 and num2, and returns their sum.
輸出(pl1):num1 + num2
如果我們發(fā)現(xiàn)pl1的測試輸出與pl0的測試輸出不匹配,則說明模型在自一致性方面存在問題。 請注意,這只是一個(gè)簡單的示例,實(shí)際應(yīng)用中的輸入和輸出可能更復(fù)雜。 https://arxiv.org/pdf/2310.14053.pdf