少点错误 前天 18:38
Watch R1 "think" with animated chains of thought
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文介绍了如何通过将R1的“思维过程”可视化,来帮助理解大型语言模型(LLM)的推理机制。通过将思维链转化为文本,利用OpenAI API将其转换为嵌入,并使用t-SNE进行可视化,可以观察到R1在回答问题时的思维演变。文章展示了连续距离和综合图,揭示了R1在不同推理阶段的步进大小差异。此外,还提供了用于数据获取和运行的脚本和代码,以及R1对一系列问题的思考链,帮助读者深入了解LLM的推理过程。

💡通过将R1的思维链转化为文本,并利用OpenAI API将其转换为嵌入,可以实现对LLM推理过程的可视化。

📈连续距离图表展示了R1在不同思考步骤之间的距离变化,帮助理解思维跳跃的大小。通过计算嵌入之间的余弦相似度,可以量化相邻思考步骤的差异。

📊综合图表结合了连续距离和聚合距离信息,更全面地展现了R1的思维过程,揭示了搜索、思考和总结等不同阶段。

📝文章提供了用于获取和运行数据的脚本和代码,方便读者复现和探索R1的思维过程。同时,还提供了R1对多个问题的思考链,例如“自行车如何工作”、“如何平衡个人自由与集体利益”等。

Published on June 17, 2025 10:38 AM GMT

[This spent a couple days on top of HackerNews in February; see here for discussion. Best used as an loose visualization of LLM reasoning. Note that the distances used for the bar and line charts are actual cosine sim, not tSNE artifacts.]

Frames of Mind: Animating R1's Thoughts

We can visualize the "thought process" for R1 by:

Here's what it looks like when R1 answers a question (in this case "Describe how a bicycle works."):

Consecutive Distance

It might be useful to get a sense of how big each jump from "thought i" to "thought i+1" is. The graph below shows the difference between consecutive steps.

By default we calculate cosine similarity between the embeddings and normalize across the set of all consecutive steps to 0, 1. I'm interested in seeing when the bigger or smaller jumps happen in the "thought cycle".

Combined Plot

The combined plot shows both at once.

Aggregate Distances

The graph above shows the aggregate distances for 10 samples. To my eyes it looks like a "search" phase where size of step is large, followed by a stable "thinking" phase, followed by a "concluding" phase.

Usage

I used these prompts:

    Describe how a bicycle works.Design a new type of transportation.Explain why leaves change color in autumnHow should society balance individual freedom with collective good?How would you resolve a conflict between two people with opposing views?What makes a good life?What would happen if gravity suddenly doubled?What's the best way to comfort someone who is grievingWhy do humans make art?Why do people tell jokes?

The chains are available in data/chains. To easily pull from Deepseek's public chat interface, paste the "pull_cot.js" script into your browser console when a chat is open. It will download automatically.

Install requisite packages in Pipfile and run with the function in run.py.



Discuss

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

R1 思维可视化 大型语言模型 推理过程 t-SNE
相关文章