arXiv:2507.13858cs.CL2025-07被引 1

可视化Transformer模型内部计算过程,帮助理解大模型推理机制

InTraVisTo: Inside Transformer Visualisation Tool

  • 通过解码每层的词元嵌入,展示模型内部状态变化
  • 用桑基图追踪各层组件间信息流动路径
  • 适合研究大模型内部机理和调试模型行为的学者

近年来,大语言模型(LLMs)的推理能力显著提升,但其规模与复杂性也大幅增加。由于行为不可预测且与预期输出存在偏差,实际应用仍面临挑战。本文提出InTraVisTo(Inside Transformer Visualisation Tool),一种用于研究Transformer架构大语言模型生成每个词元时内部计算过程的新工具。该工具可可视化模型各层的内部状态(通过解码各层词元嵌入)以及跨层组件之间的信息流动(使用桑基图)。我们希望通过InTraVisTo,帮助研究人员和实践者更深入理解模型内部的计算过程,揭示其中的潜在模式与推理机制。

原文摘要 · Abstract (English)

The reasoning capabilities of Large Language Models (LLMs) have increased greatly over the last few years, as have their size and complexity. Nonetheless, the use of LLMs in production remains challenging due to their unpredictable nature and discrepancies that can exist between their desired behavior and their actual model output. In this paper, we introduce a new tool, InTraVisTo (Inside Transformer Visualisation Tool), designed to enable researchers to investigate and trace the computational process that generates each token in a Transformer-based LLM. InTraVisTo provides a visualization of both the internal state of the Transformer model (by decoding token embeddings at each layer of the model) and the information flow between the various components across the different layers of the model (using a Sankey diagram). With InTraVisTo, we aim to help researchers and practitioners better understand the computations being performed within the Transformer model and thus to shed some light on internal patterns and reasoning processes employed by LLMs.

大模型分析可视化Transformer

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。