frames_of_mind  by dhealy05

Tool to visualize LLM chain-of-thought "thought process"

Created 7 months ago
384 stars

Top 74.4% on SourcePulse

GitHubView on GitHub
Project Summary

This project visualizes the "thought process" of AI models by converting chains of thought into embeddings and plotting them using t-SNE. It is targeted at researchers and developers interested in understanding and analyzing AI reasoning patterns. The primary benefit is providing a visual representation of an AI's internal "thinking" steps, potentially revealing phases like searching, stable thinking, and concluding.

How It Works

The project captures AI "chains of thought" as text, then utilizes the OpenAI API to convert these text sequences into numerical embeddings. These embeddings are subsequently processed with t-SNE for dimensionality reduction, allowing for sequential plotting. Cosine similarity between consecutive embeddings is calculated and normalized to a 0-1 range to quantify the "distance" or change between thought steps, highlighting significant shifts in the AI's reasoning.

Quick Start & Requirements

  • Install dependencies via pipenv install.
  • Run analysis with python run.py.
  • Requires Python 3.x and an OpenAI API key.
  • Chains of thought are provided in data/chains/.
  • A JavaScript snippet (pull_cot.js) is available for downloading chat data from Deepseek's interface.

Highlighted Details

  • Visualizes AI thought processes using t-SNE embeddings.
  • Analyzes consecutive embedding distances via normalized cosine similarity.
  • Offers aggregate distance plots to identify reasoning phases (search, thinking, concluding).
  • Includes example prompts and pre-collected chains of thought.

Maintenance & Community

No specific information on maintainers, community channels, or roadmap is provided in the README.

Licensing & Compatibility

The README does not specify a license.

Limitations & Caveats

The project relies on the OpenAI API, incurring costs and requiring an API key. The visualization method (t-SNE) is sensitive to parameter choices and may not always perfectly represent high-dimensional relationships. Data extraction from Deepseek requires manual execution of a JavaScript snippet in the browser console.

Health Check
Last Commit

7 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
0 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and Omar Sanseviero Omar Sanseviero(DevRel at Google DeepMind).

gill by kohjingyu

0%
463
Multimodal LLM for generating/retrieving images and generating text
Created 2 years ago
Updated 1 year ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Chris Van Pelt Chris Van Pelt(Cofounder of Weights & Biases), and
3 more.

lida by microsoft

0.1%
3k
Library for LLM-driven data visualization and infographic generation
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.