Asimov-7B-v2 / README.md
leaderboard-pr-bot's picture
Adding Evaluation Results
a8e1f67 verified
|
raw
history blame
6.99 kB
metadata
license: mit
model-index:
  - name: Asimov-7B-v2
    results:
      - task:
          type: text-generation
          name: Text Generation
        dataset:
          name: AI2 Reasoning Challenge (25-Shot)
          type: ai2_arc
          config: ARC-Challenge
          split: test
          args:
            num_few_shot: 25
        metrics:
          - type: acc_norm
            value: 54.27
            name: normalized accuracy
        source:
          url: >-
            https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=prithivida/Asimov-7B-v2
          name: Open LLM Leaderboard
      - task:
          type: text-generation
          name: Text Generation
        dataset:
          name: HellaSwag (10-Shot)
          type: hellaswag
          split: validation
          args:
            num_few_shot: 10
        metrics:
          - type: acc_norm
            value: 78.72
            name: normalized accuracy
        source:
          url: >-
            https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=prithivida/Asimov-7B-v2
          name: Open LLM Leaderboard
      - task:
          type: text-generation
          name: Text Generation
        dataset:
          name: MMLU (5-Shot)
          type: cais/mmlu
          config: all
          split: test
          args:
            num_few_shot: 5
        metrics:
          - type: acc
            value: 52.59
            name: accuracy
        source:
          url: >-
            https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=prithivida/Asimov-7B-v2
          name: Open LLM Leaderboard
      - task:
          type: text-generation
          name: Text Generation
        dataset:
          name: TruthfulQA (0-shot)
          type: truthful_qa
          config: multiple_choice
          split: validation
          args:
            num_few_shot: 0
        metrics:
          - type: mc2
            value: 45.44
        source:
          url: >-
            https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=prithivida/Asimov-7B-v2
          name: Open LLM Leaderboard
      - task:
          type: text-generation
          name: Text Generation
        dataset:
          name: Winogrande (5-shot)
          type: winogrande
          config: winogrande_xl
          split: validation
          args:
            num_few_shot: 5
        metrics:
          - type: acc
            value: 71.82
            name: accuracy
        source:
          url: >-
            https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=prithivida/Asimov-7B-v2
          name: Open LLM Leaderboard
      - task:
          type: text-generation
          name: Text Generation
        dataset:
          name: GSM8k (5-shot)
          type: gsm8k
          config: main
          split: test
          args:
            num_few_shot: 5
        metrics:
          - type: acc
            value: 10.92
            name: accuracy
        source:
          url: >-
            https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard?query=prithivida/Asimov-7B-v2
          name: Open LLM Leaderboard

Model Card for Asimov-7B-v2

Asimov will be a series of language models that are trained to act as a useful writing assistant, named after one of the profilic writers of our time Isaac Asimov. Asimov-7B-v2 is the 2nd model in the series, and is a fine-tuned version of mistralai/Mistral-7B-v0.1 with a variety of publicly available analytical, adversarial and quantitative reasoning datasets. This model has not been aligned with any human preference datasets so consider this as a model with no guard rails.

Model Details

  • Model type: A 7B parameter GPT-like model fine-tuned on publicly available synthetic datasets.
  • Language(s) (NLP): Primarily English
  • License: MIT
  • Finetuned from model: mistralai/Mistral-7B-v0.1

Model Description

  • Developed by: [More Information Needed]
  • Funded by [optional]: [More Information Needed]
  • Shared by [optional]: [More Information Needed]
  • Model type: [More Information Needed]
  • Language(s) (NLP): [More Information Needed]
  • License: [More Information Needed]
  • Finetuned from model [optional]: [More Information Needed]

Bias, Risks, and Limitations

Asimov-7B-v2 has not been aligned to human preferences, so the model can produce problematic outputs (especially when prompted to do so). It is also unknown what the size and composition of the corpus was used to train the base model (mistralai/Mistral-7B-v0.1), however it is likely to have included a mix of Web data and technical sources like books and code. See the Falcon 180B model card for an example of this.

How to Get Started with the Model

Use the code below to get started with the model.

import torch
from transformers import  AutoModelForCausalLM, AutoTokenizer,GenerationConfig
from peft import PeftModel, PeftConfig

model_name = "prithivida/Asimov-7B-v2"
peft_config = PeftConfig.from_pretrained(model_name)

base_model = AutoModelForCausalLM.from_pretrained(
        peft_config.base_model_name_or_path,
        return_dict=True,
        device_map="auto",
        torch_dtype=torch.float16,
        low_cpu_mem_usage=True,
)

model = PeftModel.from_pretrained(
        base_model,
        model_name,
        torch_dtype=torch.float16,
        device_map="auto",
)

tokenizer = AutoTokenizer.from_pretrained(model_name, use_fast=True)
model.config.pad_token_id = tokenizer.unk_token_id

def run_inference(messages):
    chat = []
    for i, message in enumerate(messages):
      if i % 2 ==0:
          chat.append({"role": "Human", "content": f"{message}"})
      else:
          chat.append({"role": "Assistant", "content": f"{message}"})


    prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)

    inputs = tokenizer(prompt, return_tensors="pt")
    input_ids = inputs["input_ids"].cuda()

    generation_output = model.generate(
            input_ids=input_ids,
            generation_config=GenerationConfig(pad_token_id=tokenizer.pad_token_id,
                                               do_sample=True,
                                               temperature=1.0,
                                               top_k=50,
                                               top_p=0.95),
            return_dict_in_generate=True,
            output_scores=True,
            max_new_tokens=128
    )

    for seq in generation_output.sequences:
        output = tokenizer.decode(seq)
        print(output.split("### Assistant: ")[1].strip())


run_inference(["What's the longest side of the right angled triangle called and how is it related to the Pythagoras theorem?"])

Open LLM Leaderboard Evaluation Results

Detailed results can be found here

Metric Value
Avg. 52.29
AI2 Reasoning Challenge (25-Shot) 54.27
HellaSwag (10-Shot) 78.72
MMLU (5-Shot) 52.59
TruthfulQA (0-shot) 45.44
Winogrande (5-shot) 71.82
GSM8k (5-shot) 10.92