大型语言模型作为马尔可夫链
Large Language Models as Markov Chains
AI总结:
本研究通过将基于自回归Transformer的语言模型与有限状态空间上的马尔可夫链建立等价关系,从第一性原理分析LLMs的多步推理机制,揭示了其病态行为的成因,并推导出预训练与上下文学习的泛化界限,理论预测与最新Llama和Gemma模型实验结果一致。
摘要:
大型语言模型(LLMs)在广泛的自然语言处理任务及更广泛的领域中表现出极高的效率。然而,对LLMs泛化能力的全面理论分析仍然难以捉摸。在我们的论文中,我们通过在基于自回归Transformer的语言模型与定义在有限状态空间上的马尔可夫链之间建立等价关系来处理这一任务。这使我们能够从第一性原理研究LLMs的多步推理机制。我们将获得的结果与LLMs中观察到的病态行为(如重复和高温下的不连贯回复)联系起来。最后,我们利用所提出的形式化方法,在现实数据和模型假设下推导出LLMs的预训练和上下文学习泛化界限。对最新的Llama和Gemma模型群的实验表明,我们的理论在实践中正确捕捉了它们的行为。
英文摘要:
Large language models (LLMs) are remarkably efficient across a wide range of natural language processing tasks and well beyond them. However, a comprehensive theoretical analysis of the LLMs' generalization capabilities remains elusive. In our paper, we approach this task by drawing an equivalence between autoregressive transformer-based language models and Markov chains defined on a finite state space. This allows us to study the multi-step inference mechanism of LLMs from first principles. We relate the obtained results to the pathological behavior observed with LLMs such as repetitions and incoherent replies with high temperature. Finally, we leverage the proposed formalization to derive pre-training and in-context learning generalization bounds for LLMs under realistic data and model assumptions. Experiments with the most recent Llama and Gemma herds of models show that our theory correctly captures their behavior in practice.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。