大语言模型中产生的有向度量结构
Directed Metric Structures arising in Large Language Models
AI总结:
本文探究大语言模型中文本扩展条件概率分布的数学结构,通过负对数概率构建度量多面体与等距嵌入,证明相关对偶定理与格闭包性质,为语法语义问题提供数学对偶框架参考。
摘要:
大语言模型是一类Transformer神经网络,其训练目标是针对语料库中的给定文本,在可能的下一个词上生成概率分布,使得预测出的概率最高的词与训练文本中的实际词一致。本文探究了这类文本扩展的条件概率分布所定义的数学结构。将视角从概率转换为负对数概率后,我们观察到,子文本序完全由文本空间$\u2112(\u2112为文本空间符号)$上通过负对数概率定义的度量结构所编码。随后我们构造了一个度量多面体$P(\u2112)$,并将$\u2112$等距嵌入(称为Yoneda嵌入,即米田嵌入)到$P(\u2112)$中,使得文本映射到某些特殊极射线的生成元。我们阐明$P(\u2112)$是这些极射线生成元的$(\text{min},+)$(热带)线性张成空间,这些生成元还满足一组$(\text{min},+)$线性方程。接着我们证明$P(\u2112)$与新增文本兼容,由此我们推导出文本向量的一种近似方式:将其表示为该文本中各词对应向量的Boltzmann加权线性组合。我们还证明了一个对偶定理,表明文本扩展和文本限制会生成等距的多面体(尽管乍看之下二者差异极大)。此外,我们证明$P(\u2112)$是所谓的$\u2112$的Isbell完备化(伊斯贝尔完备化)(的一个版本)的格闭包,而该完备化实际上是文本极射线生成元的$(\text{max},+)$张成空间。所有构造都有范畴论层面的解释,但本文并未明确使用范畴论,相关范畴论解释在附录中简要说明。在最后一个附录中,我们描述了语法到语义的问题如何契合于一个广为人知的通用数学对偶框架。
英文摘要:
Large Language Models are transformer neural networks which are trained to produce a probability distribution on the possible next words to given texts in a corpus, in such a way that the most likely word predicted is the actual word in the training text. In this paper we find what is the mathematical structure defined by such conditional probability distributions of text extensions. Changing the view point from probabilities to -log probabilities we observe that the subtext order is completely encoded in a metric structure defined on the space of texts $\mathcal{L}$, by -log probabilities. We then construct a metric polyhedron $P(\mathcal{L})$ and an isometric embedding (called Yoneda embedding) of $\mathcal{L}$ into $P(\mathcal{L})$ such that texts map to generators of certain special extremal rays. We explain that $P(\mathcal{L})$ is a $(\min,+)$ (tropical) linear span of these extremal ray generators. The generators also satisfy a system of $(\min+)$ linear equations. We then show that $P(\mathcal{L})$ is compatible with adding more text and from this we derive an approximation of a text vector as a Boltzmann weighted linear combination of the vectors for words in that text. We then prove a duality theorem showing that texts extensions and text restrictions give isometric polyhedra (even though they look a priory very different). Moreover we prove that $P(\mathcal{L})$ is the lattice closure of (a version of) the so called, Isbell completion of $\mathcal{L}$ which turns out to be the $(\max,+)$ span of the text extremal ray generators. All constructions have interpretations in category theory but we don't use category theory explicitly. The categorical interpretations are briefly explained in an appendix. In the final appendix we describe how the syntax to semantics problem could fit in a general well known mathematical duality.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。