Coder Social home page Coder Social logo

bayes_icl's Introduction

This repository hosts the code to reproduce the results in the paper

Fabian Falck*, Ziyu Wang* and Chris Holmes, Is In-Context Learning in Large Language Models Bayesian? A Martingale Perspective, in ICML 2024.

For the moment we are providing the LM samples and plotting scripts. The remaining scripts are being cleaned up and and will be released shortly.

Result plots

The plots in the paper can be reproduced using agg_plot.py as exemplified below. In all commands below, you need to update --root_path to point to the root directory of the LM samples, which can be downloaded from this link.

# Bernoulli MP check
python agg_plot.py --plot bernoulli-mp-check --mpc_models gpt-3d gpt-4 llama mistral --mpc_n 20 50 --bern_N_ratio 0.5 2  # Fig. 3 and Fig. 7 (a,b,e,f)
python agg_plot.py --plot bernoulli-mp-check --mpc_models gpt-3b gpt-3d gpt-3.5 --mpc_n 20 50 100 --bern_N_ratio 0.5 2   # Fig. 8
python agg_plot.py --plot bernoulli-mp-check --mpc_models gpt-3b gpt-3b-ft --mpc_n 50 --bern_N_ratio 2  # Fig. 13 (c,d)
# Gaussian MP check
python agg_plot.py --plot gaussian-mp-check  --mpc_n 20 50  --mpc_N_ratio 0.5 2   # Fig.9 and 10 (a-d) in a different layout
# Synthetic NLP experiment (Fig. 5 and Fig. 13 (a,b))
python agg_plot.py --plot nlp-mp-check 
# Scaling of epistemic uncertainty (Fig. 6 and Fig. 12)
python agg_plot.py --plot bernoulli-eu

There may be a very small variation across runs due to the randomness in bootstrapping.

bayes_icl's People

Contributors

meta-inf avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.