NeuralFlow  by valine

Python script for visualizing Mistral 7B intermediate layer outputs

created 1 year ago
367 stars

Top 78.0% on sourcepulse

GitHubView on GitHub
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

6 months ago

Responsiveness

1 day

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

Explore Similar Projects

Starred by Lilian Weng Lilian Weng(Cofounder of Thinking Machines Lab), Patrick Kidger Patrick Kidger(Core Contributor to JAX ecosystem), and
4 more.

glow by openai

0.1%
3k
Generative flow research paper code
created 7 years ago
updated 1 year ago
Feedback? Help us improve.