/ Модель

Характеристики

Контекст
4 096 токенов
Параметры
3,7 млрд
Размер весов
7,6 ГБ
Лицензия
CC BY-NC 4.0
Архитектура
phi3 · dense
Базовая модель
Phi-3
Опубликована
29 апр 2024

octo-net

Генерация текстаТекст → текст3 профессии

Компактная языковая модель Nexa AI на базе Phi-3 для переформулирования запросов и маршрутизации их к специализированным моделям.

52скачиваний за 30 дней144лайкавеса обновлены5 мая 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Octopus V4 — компактная языковая модель Nexa AI, дообученная на базе Microsoft Phi-3. Она предназначена для работы в качестве управляющего узла в графе специализированных языковых моделей: преобразует запросы пользователя в более точную формулировку и направляет их подходящей модели. В карточке указаны 3,7 млрд параметров, архитектура Phi-3 и контекст 4096 токенов; модель принимает текст и генерирует текст. README описывает сценарии для тем MMLU и приводит пример переформулирования математического вопроса.

Модель ориентирована на компактный запуск, в том числе на устройствах, и использует функциональные токены для выбора специализированной модели. Доступна под лицензией CC BY-NC 4.0, которая ограничивает коммерческое использование.

Сценарии применения

  • переформулирование пользовательских запросов для специализированной модели
  • выбор подходящей модели для вопроса по предметной области
  • подготовка математического вопроса для передачи модели
  • маршрутизация запросов в графе языковых моделей

Ограничения

Модель предназначена прежде всего для маршрутизации и переформулирования запросов; её не следует считать заменой профильных моделей для предметных ответов. Лицензия CC BY-NC 4.0 не допускает коммерческое использование.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Octopus V4: Graph of language models

Octopus V4

Quantized Octopus V4

To run the model on-device, we have prepared quantized models in gguf format for you.

Introduction

Octopus-V4-3B, an advanced open-source language model with 3 billion parameters, serves as the master node in Nexa AI's envisioned graph of language models. Tailored specifically for the MMLU benchmark topics, this model efficiently translates user queries into formats that specialized models can effectively process. It excels at directing these queries to the appropriate specialized model, ensuring precise and effective query handling.

📱 Compact Size: Octopus-V4-3B is compact, enabling it to operate on smart devices efficiently and swiftly.

🐙 Accuracy: Octopus-V4-3B accurately maps user queries to the specialized model using a functional token design, enhancing its precision.

💪 Reformat Query: Octopus-V4-3B assists in converting natural human language into a more professional format, improving query description and resulting in more accurate responses.

Example Use Cases

Query: Tell me the result of derivative of x^3 when x is 2?

# <nexa_4> represents the math gpt.
Response: <nexa_4> ('Determine the derivative of the function f(x) = x^3 at the point where x equals 2, and interpret the result within the context of rate of change and tangent slope.')<nexa_end>

You can run the model on a GPU using the following code.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
import time
torch.random.manual_seed(0)

model = AutoModelForCausalLM.from_pretrained(
    "NexaAIDev/Octopus-v4", 
    device_map="cuda:0", 
    torch_dtype=torch.bfloat16, 
    trust_remote_code=True 
)
tokenizer = AutoTokenizer.from_pretrained("NexaAIDev/Octopus-v4")

question = "Tell me the result of derivative of x^3 when x is 2?"

inputs = f"<|system|>You are a router. Below is the query from the users, please call the correct function and generate the parameters to call the function.<|end|><|user|>{question}<|end|><|assistant|>"

print('\n============= Below is the response ==============\n')

# You should consider to use early stopping with <nexa_end> token to accelerate
input_ids = tokenizer(inputs, return_tensors="pt")['input_ids'].to(model.device)

generated_token_ids = []
start = time.time()

# set a large enough number here to avoid insufficient length
for i in range(200):
    next_token = model(input_ids).logits[:, -1].argmax(-1)
    generated_token_ids.append(next_token.item())
    
    input_ids = torch.cat([input_ids, next_token.unsqueeze(1)], dim=-1)

    # 32041 is the token id of <nexa_end>
    if next_token.item() == 32041:
        break

print(tokenizer.decode(generated_token_ids))
end = time.time()
print(f'Elapsed time: {end - start:.2f}s')

License

This model was trained on commercially viable data. For use of our model, refer to the license information.

Performance

Model Selection

We leverage the latest Language Large Models for a variety of domains. Below is a summary of the chosen models for each category. In cases where no specialized model exists for a subject, we utilize generic models like Llama3-8b.

ModelCategorySubjects
jondurbin/bagel-8b-v1.0Biologycollege_biology, high_school_biology
Weyaxi/Einstein-v6.1-Llama3-8BPhysicsastronomy, college_physics, conceptual_physics, high_school_physics
meta-llama/Meta-Llama-3-8B-InstructBusinessbusiness_ethics, management, marketing
meta-llama/Meta-Llama-3-8B-InstructChemistrycollege_chemistry, high_school_chemistry
abacusai/Llama-3-Smaug-8BComputer Sciencecollege_computer_science, computer_security, high_school_computer_science, machine_learning
Open-Orca/Mistral-7B-OpenOrcaMathabstract_algebra, college_mathematics, elementary_mathematics, high_school_mathematics, high_school_statistics
meta-llama/Meta-Llama-3-8B-InstructEconomicseconometrics, high_school_macroeconomics, high_school_microeconomics
AdaptLLM/medicine-chatHealthanatomy, clinical_knowledge, college_medicine, human_aging, medical_genetics, nutrition, professional_medicine, virology
STEM-AI-mtl/phi-2-electrical-engineeringEngineeringelectrical_engineering
meta-llama/Meta-Llama-3-8B-InstructPhilosophyformal_logic, logical_fallacies, moral_disputes, moral_scenarios, philosophy, world_religions
microsoft/Phi-3-mini-128k-instructOtherglobal_facts, miscellaneous, professional_accounting
meta-llama/Meta-Llama-3-8B-InstructHistoryhigh_school_european_history, high_school_us_history, high_school_world_history, prehistory
meta-llama/Meta-Llama-3-8B-InstructCulturehuman_sexuality, sociology
AdaptLLM/law-chatLawinternational_law, jurisprudence, professional_law
meta-llama/Meta-Llama-3-8B-InstructPsychologyhigh_school_psychology, professional_psychology

MMLU Benchmark Results (5-shot learning)

Here are the comparative MMLU scores for various models tested under a 5-shot learning setup:

ModelMMLU Score
Octopus-V474.8%
GPT-3.570.0%
Phi-3-mini-128k-instruct68.1%
OpenELM-3B26.7%
Lamma3-8b-instruct68.4%
Gemma-2b42.3%
Gemma-7b64.3%

Domain LLM Leaderboard

Explore our collection of domain-specific large language models (LLMs) or contribute by suggesting new models tailored to specific domains. For detailed information on available models and to engage with our community, please visit our Domain LLM Leaderboard.

References

We thank the Microsoft team for their amazing model!

@article{abdin2024phi,
  title={Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone},
  author={Abdin, Marah and Jacobs, Sam Ade and Awan, Ammar Ahmad and Aneja, Jyoti and Awadallah, Ahmed and Awadalla, Hany and Bach, Nguyen and Bahree, Amit and Bakhtiari, Arash and Behl, Harkirat and others},
  journal={arXiv preprint arXiv:2404.14219},
  year={2024}
}

Citation

@misc{chen2024octopus,
      title={Octopus v4: Graph of language models}, 
      author={Wei Chen and Zhiyuan Li},
      year={2024},
      eprint={2404.19296},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Contact

Please contact us to reach out for any issues and comments!

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Можно запустить

Подбираем GPU…

Класс архитектуры
Phi3ForCausalLM
Ревизия весов
a89353a

0 моделей