Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
F

function_vectors

> 编程语言
Open source

Function Vectors in Large Language Models (ICLR 2024)

199 stars0 likes0 views
WebsiteGitHub

About

Function Vectors in Large Language Models (ICLR 2024)

Function Vectors in Large Language Models

Project Website | Arxiv Preprint | OpenReview

This repository contains data and code for the paper: Function Vectors in Large Language Models.

Setup

We recommend using conda as a package manager. The environment used for this project can be found in the fv_environment.yml file. To install, you can run:

conda env create -f fv_environment.yml
conda activate fv

Demo Notebook

Checkout notebooks/fv_demo.ipynb for a jupyter notebook with a demo of how to create a function vector and use it in different contexts.

Data

The datasets used in our project can be found in the dataset_files folder.

Code

Our main evaluation scripts are contained in the src directory with sample script wrappers in src/eval_scripts.

Other main code is split into various util files:

  • eval_utils.py contains code for evaluating function vectors in a variety of contexts
  • extract_utils.py contains functions for extracting function vectors and other relevant model activations.
  • intervention_utils.py contains main functionality for intervening with function vectors during inference
  • model_utils.py contains helpful functions for loading models & tokenizers from huggingface
  • prompt_utils.py contains data loading and prompt creation functionality

Citing our work

This work appeared at ICLR 2024. The paper can be cited as follows:

bibtex
@inproceedings{todd2024function,
    title={Function Vectors in Large Language Models}, 
    author={Eric Todd and Millicent L. Li and Arnab Sen Sharma and Aaron Mueller and Byron C. Wallace and David Bau},
    booktitle={The Twelfth International Conference on Learning Representations},
    url={https://openreview.net/forum?id=AwyxtyMwaG},
    note={arXiv:2310.15213},
    year={2024},
}

Issues· 3 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Python

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言