GithubHelp home page GithubHelp logo

eltociear / temporal-llms Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yfqiu-nlp/temporal-llms

0.0 1.0 0.0 4.69 MB

Materials for paper "Are Large Language Models Temporally Grounded?"

License: MIT License

Shell 1.54% Python 98.46%

temporal-llms's Introduction

Temporal-LLMs

Materials for paper "Are large language models temporally grounded?"

Screentshot

Environment Setup

Configure your conda enviroment from our provided llama-hf_environment.yml by,

conda env create -f environment.yml
conda activate llama-hf

Prerequisite

GPT

Our experiments require the inference with these following models,

  1. davinci,
  2. text-davinci-002,
  3. text-davinci-003.

You will need to prepare your own OpenAI API call and access for these models in advance.

LLaMA Chceckpoints

Our experiments require the inference with these following models,

  1. LLaMA-7B
  2. LLaMA-13B
  3. LLaMA-33B
  4. LLaMA-65B
  5. LLaMA-2-7B
  6. LLaMA-2-13B
  7. LLaMA-2-70B
  8. LLaMA-2-7B-chat
  9. LLaMA-2-13B-chat
  10. LLaMA-2-70B-chat

We recommend you to download all files from huggingface hub in to a local path, see the LLaMA here and here for LLaMA-2.

Usage

McTACO Experiment

Inference for GPT & LLaMA

Using the following scripts for testing GPT and LLaMA with zero/few-shot prompting,

sh run-mctaco-gpt.sh
sh run-mctaco-llama.sh

Evaluation

We provide our evaluation script based on the original McTACO's evaluation. We recommend you to get familiar with its original repository as the first step,

sh eval-mctaco.sh

Run CaTeRS Experiment

Inference for GPT & LLaMA

Using the following scripts for testing GPT and LLaMA models with few-shot prompting,

sh run-caters-gpt.sh
sh run-caters-llama.sh

Evaluation

Our evaluation script is strictly following the evaluation of temporal-bart model. Again, we recommend you to get familiar with its repository as well,

To run the evaluation, simply run this code,

python3 eval-caters.py $OUTPUT_PATH $MODEL_NAME

Taking Llama-2-70b-chat-hf as an example,

python3 eval-caters.py llama-output/caters/caters-fs-pt1-output-icl3/ Llama-2-70b-chat-hf

Run TempEval-QA-bi Experiment

Inference for GPT & LLaMA

You can use the following scripts for inference with GPT,

sh run-tempeval-gpt.sh

You can use the following scripts for doing zero/few-shot + likelihood/decoding-based evaluation, and chain-of-thought experiments for LLaMA models.

sh run-tempeval-llama.sh

Evaluation for Bi-directional Reasoning

To run the bi-directional evaluation in checking model's reasoning consistency, simply run this code,

python3 eval-tempeval-bi.py $OUTPUT_PATH $MODEL_NAME

Taking Llama-2-70b-chat-hf as an example,

python3 eval-tempeval-bi.py llama-output/tempeval-qa-bi/fs-bi-pt1-icl3-output-likelihood/ Llama-2-70b-chat-hf

Evaluation for Chain-of-thought Reasoning

To evaluate the reasoning performance for LLaMA with the chain-of-thought prompting, simply run this code,

python3 eval-tempeval-bi-cot.py $OUTPUT_PATH $MODEL_NAME

Taking Llama-2-70b-chat-hf as an example,

python3 eval-tempeval-bi-cot.py llama-output/tempeval-qa-bi/fs-bi-pt1-icl3-cot-output-likelihood/ Llama-2-70b-chat-hf

Model Outputs

We provide all our model's outputs in all datasets in gpt-output and llama-output for reproducing the results reported in our paper.

Citation

@misc{qiu2023large,
      title={Are Large Language Models Temporally Grounded?}, 
      author={Yifu Qiu and Zheng Zhao and Yftah Ziser and Anna Korhonen and Edoardo M. Ponti and Shay B. Cohen},
      year={2023},
      eprint={2311.08398},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

temporal-llms's People

Contributors

yfqiu-nlp avatar

Watchers

 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.