Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

steering experiments #1

Merged
merged 5 commits into from
Nov 22, 2024
Merged

steering experiments #1

merged 5 commits into from
Nov 22, 2024

Conversation

dtch1997
Copy link
Owner

@dtch1997 dtch1997 commented Nov 22, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a README for layer sweep experiments, detailing workflows and commands.
    • Added scripts for downloading and preprocessing datasets related to persona and risk.
    • Implemented new analysis and visualization functionalities for layer responses.
    • Added a new context manager for dynamic hook management in the pipeline.
    • Introduced functions for calculating steerability metrics.
  • Bug Fixes

    • Improved user feedback during dataset downloading by checking for existing files.
  • Documentation

    • Enhanced documentation for new scripts and functionalities.
  • Chores

    • Updated dependencies and Python version requirements in the project configuration.

Copy link

coderabbitai bot commented Nov 22, 2024

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces multiple new scripts and a README file related to layer sweep experiments in a machine learning context. Key additions include functionality for downloading and preprocessing datasets, analyzing layer responses, and visualizing steerability metrics. New classes and methods enhance the evaluation and scoring of predictions. The pyproject.toml file has been updated with additional dependencies and a modified Python version requirement. A new utility for managing GPU memory and model quantization is also introduced, along with various structural changes to existing modules.

Changes

File Path Change Summary
experiments/layer_sweep/README.md New documentation for executing layer sweeps and generating response curves.
experiments/layer_sweep/analysis.py New file with functions for plotting propensity and layer response curves.
experiments/layer_sweep/download_and_preprocess_datasets.py New script for automating dataset download and preprocessing.
experiments/layer_sweep/layer_sweep_results/steerabilities.json New JSON file containing steerability metrics.
experiments/layer_sweep/run_layer_sweep.py New script for computing steerability across model layers and visualizing results.
experiments/persona_generalization/download_and_preprocess_datasets.py New script for downloading and preprocessing persona datasets.
experiments/persona_generalization/run_steering_experiment.py New script for conducting steering experiments and evaluating steerability.
pyproject.toml Updated dependencies and Python version requirements.
scripts/download_and_preprocess_datasets.py New script for downloading and preprocessing datasets.
scripts/run_steering_experiment.py Removed empty script that contained no functional code.
steering_bench/build_training_data.py New file for constructing steering vector training data with validation.
steering_bench/core/evaluate.py New file for evaluating predictions and propensities.
steering_bench/core/hook.py Modifications to SteeringHook class for enhanced configurability.
steering_bench/core/pipeline.py New context manager method for dynamic hook management.
steering_bench/core/propensity.py New classes for scoring predictions based on various metrics.
steering_bench/dataset/build.py Updated import paths for core types.
steering_bench/dataset/download.py Updated function names for clarity and added file existence checks.
steering_bench/dataset/preprocess.py Renamed preprocessing functions and updated import paths.
steering_bench/metric.py New functions for analyzing steerability metrics.
steering_bench/utils/io.py Minor changes to DataclassEncoder and formatting in jload.
steering_bench/utils/torch.py New file for loading models with quantization and managing GPU memory.

Poem

In the meadow where data flows,
New scripts and functions bloom like rose.
With steerability curves that dance and sway,
We hop along, in a joyful play.
From downloads to plots, our work is bright,
In the world of layers, we take flight! 🐇✨


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@dtch1997 dtch1997 merged commit b571672 into main Nov 22, 2024
@dtch1997 dtch1997 deleted the steering-exp branch November 22, 2024 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant