arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2504.15604cs.CLcs.AI
收藏

探索心智理论(ToM)任务中的下一词预测:GPT-2与LLaMA-2 AI模型的对比实验

Exploring Next Token Prediction in Theory of Mind (ToM) Tasks: Comparative Experiments with GPT-2 and LLaMA-2 AI Models

Pavan Yadav, Nikhil Khandalkar, Krishna Shinde, Lokesh B. Ramegowda, Rajarshi Das

AI总结:

本研究对比GPT-2与LLaMA-2在心智理论任务中的下一词预测能力,发现增加上下文复杂度会降低准确性,而LLaMA-2在低温度下表现更优,且推理复杂度越高模型差异越大。

摘要:

语言模型在生成连贯文本和基于输入提示预测下一词方面取得了显著进展。本研究比较了两个知名模型——OpenAI的GPT-2和Meta的Llama-2-7b-chat-hf——在心智理论(ToM)任务上的下一词预测性能。为了评估它们的能力,我们从Explore ToM数据集中选取了10个短篇故事构建了一个数据集。我们通过使用GPT-4以编程方式插入额外句子(infills)来增强这些故事,从而创造出引入不同上下文复杂度水平的变体。这一设置使得分析上下文增加如何影响模型性能成为可能。我们在四种温度设置(0.01、0.5、1.0、2.0)下测试了两个模型,并评估了它们在三个推理层次上预测下一词的能力。零阶推理涉及跟踪状态,无论是当前状态(真实情况)还是过去状态(记忆)。一阶推理涉及理解他人的心理状态(例如,“安妮知道苹果是咸的吗?”)。二阶推理增加了递归性(例如,“安妮认为查尔斯知道苹果是咸的吗?”)。\n我们的结果显示,增加更多的填充句子会略微降低预测准确性,因为增加的上下文增加了复杂性和模糊性。Llama-2在预测准确性上始终优于GPT-2,尤其是在较低温度下,表现出在选择最可能词元时更高的置信度。随着推理复杂性的增加,模型响应分歧更大。值得注意的是,GPT-2和Llama-2在一阶和二阶推理任务中表现出更大的预测变异性。这些发现说明了模型架构、温度和上下文复杂性如何影响下一词预测,有助于更好地理解当前语言模型的优势与局限。

英文摘要:

Language models have made significant progress in generating coherent text and predicting next tokens based on input prompts. This study compares the next-token prediction performance of two well-known models: OpenAI's GPT-2 and Meta's Llama-2-7b-chat-hf on Theory of Mind (ToM) tasks. To evaluate their capabilities, we built a dataset from 10 short stories sourced from the Explore ToM Dataset. We enhanced these stories by programmatically inserting additional sentences (infills) using GPT-4, creating variations that introduce different levels of contextual complexity. This setup enables analysis of how increasing context affects model performance. We tested both models under four temperature settings (0.01, 0.5, 1.0, 2.0) and evaluated their ability to predict the next token across three reasoning levels. Zero-order reasoning involves tracking the state, either current (ground truth) or past (memory). First-order reasoning concerns understanding another's mental state (e.g., "Does Anne know the apple is salted?"). Second-order reasoning adds recursion (e.g., "Does Anne think that Charles knows the apple is salted?"). Our results show that adding more infill sentences slightly reduces prediction accuracy, as added context increases complexity and ambiguity. Llama-2 consistently outperforms GPT-2 in prediction accuracy, especially at lower temperatures, demonstrating greater confidence in selecting the most probable token. As reasoning complexity rises, model responses diverge more. Notably, GPT-2 and Llama-2 display greater variability in predictions during first- and second-order reasoning tasks. These findings illustrate how model architecture, temperature, and contextual complexity influence next-token prediction, contributing to a better understanding of the strengths and limitations of current language models.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑