NeuralFlow  by valine

Python script for visualizing Mistral 7B intermediate layer outputs

Created 1 year ago
373 stars

Top 76.0% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

NeuralFlow visualizes the intermediate layer outputs of Mistral 7B models, aiding researchers and engineers in fine-tuning and debugging. It generates a 512x256 heatmap from layer outputs, revealing structural changes during training and identifying potential cascading failures.

How It Works

The script processes the output tensors from each layer of Mistral 7B. Each layer's 4096-dimensional tensor is segmented into 512 chunks and arranged vertically to create a 512x256 image. These values are normalized to a 0-1 range and plotted as a heatmap, allowing for visual inspection of model behavior and deviations from initial states.

Quick Start & Requirements

  • Install: Run the Python script directly.
  • Prerequisites: Mistral 7B model weights, Python environment.
  • Configuration: Update model_folder and image_output_folder paths in the script.
  • Resources: Requires sufficient disk space for model weights and output images.

Highlighted Details

  • Visualizes intermediate layer outputs for Mistral 7B.
  • Aids in identifying cascading failures during fine-tuning.
  • Enables animation of intermediate outputs over time.
  • Demonstrates successful generalization in fine-tuned models.

Maintenance & Community

  • Developed as part of independent research.
  • Code cleaned up and made available per user requests on r/locallama.
  • Original discussion thread available on r/locallama.

Licensing & Compatibility

  • License not specified in the README.
  • Compatibility for commercial use or closed-source linking is undetermined.

Limitations & Caveats

The README does not specify the license, leaving commercial use and closed-source linking ambiguous. The visualization's direct interpretability is challenging, relying on visual pattern recognition rather than explicit meaning.

Health Check
Last Commit

8 months ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
5 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%
465
Multimodal LLM for generating/retrieving images and generating text
Created 2 years ago
Updated 1 year ago
Feedback? Help us improve.