Giter VIP home page Giter VIP logo

uq-nlg's Introduction

Code for "Generating with Confidence: Uncertainty Quantification for Black-box Large Language Models" arxiv.

Quick Start

We provided a simple evaluation in notebook/demo.ipynb using 500 samples and the corresponding responses. Note that to get the automatic evaluation based on GPT, you would need to update keys.json with your API keys first.

Replicate Our Experiments

First, set the corresponding paths in _settings.py.

Generate the responses

Use the llama-13b-hf, opt-13b or gpt-3.5-turbo for model, and coqa, triviaqa and nq_open for the dataset below. (You need to download the LLaMA weight first).

python -m pipeline.generate --model llama-13b-hf --dataset coqa

For gpt-3.5-turbo experiments, please update keys.json with your API keys first.

Update GEN_PATHS in _settings.py for next steps.

Run UQ experiments

You can run dataeval/load.py to cache down results first. I use persist_to_disk to cache experiment results (i.e. those @ptd.persistf decorators and ptd.manual_cache calls). Then, please refer to notebook/main.ipynb for an example.

uq-nlg's People

Contributors

zlin7 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.