/ Модель

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

Контекст
8 192 токена
Параметры
7,5 млрд
Размер весов
16,1 ГБ
Лицензия
Llama 3
Архитектура
llama · dense
Опубликована
29 мая 2024

ORLM-LLaMA-3-8B

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

Дообученная на OR-Instruct модель LLaMA-3-8B для формализации задач исследования операций и генерации кода оптимизации на Python с coptpy.

143скачиваний за 30 дней14лайковвеса обновлены3 апр 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

CardinalOperations/ORLM-LLaMA-3-8B — языковая модель на базе Meta LLaMA-3-8B, дообученная командой CardinalOperations на данных OR-Instruct для задач исследования операций. Она принимает текстовое описание задачи оптимизации и предназначена для построения математической модели и соответствующего кода на Python с использованием coptpy. В карточке приведены сравнения с другими методами на бенчмарках NL4OPT, MAMO и IndustryOR.

Модель содержит 7,5 млрд параметров, использует архитектуру LLaMA для генерации текста и имеет контекст до 8192 токенов. Лицензия — Llama 3. Карточка не приводит подробностей об ограничениях качества за пределами результатов на указанных бенчмарках.

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

  • Преобразование текстовой задачи оптимизации в математическую модель
  • Генерация Python-кода для решения задач оптимизации с coptpy
  • Формализация задач линейного программирования по описанию на естественном языке
  • Подготовка моделей для задач исследования операций

Ограничения

Модель рассчитана на задачи исследования операций с генерацией кода для coptpy; результаты представлены для NL4OPT, MAMO и IndustryOR, поэтому качество на других задачах не установлено.

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

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

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

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

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

Открыть на Hugging Face

see our paper in https://arxiv.org/abs/2405.17743

github repo: https://github.com/Cardinal-Operations/ORLM

Model Details

LLaMA-3-8B-ORLM is fully fine-tuned on the OR-Instruct data and built with Meta LLaMA-3-8B model. More training details can be seen at https://arxiv.org/abs/2405.17743

Model Usage

Prompting Template:

Below is an operations research question. Build a mathematical model and corresponding python code using `coptpy` that appropriately addresses the question.

# Question:
{Question}

# Response:

Please replace the {Question} with any natural language OR question.

Examples

--------------------------OR question wrapped in the template--------------------------
Below is an operations research question. Build a mathematical model and corresponding python code using `coptpy` that appropriately addresses the question.

# Question:
A lab has 1000 units of medicinal ingredients to make two pills, a large pill and a small pill. A large pill requires 3 units of medicinal ingredients and 2 units of filler. A small pill requires 2 units of medicinal ingredients and 1 unit of filler. The lab has to make at least 100 large pills. However, since small pills are more popular at least 60% of the total number of pills must be small. How many of each should be made to minimize the total number of filler material needed?

# Response:
--------------------------top-1 completion output by LLaMA-3-8B-ORLM under greedy decoding--------------------------
## Mathematical Model:
To solve the lab's pill production problem, we need to construct a linear programming model to minimize the total number of filler material needed while satisfying the production requirements for the pills and the proportion constraint. Here is the model formulation:

### Decision Variables:
- \(x\): Number of large pills to be made.
- \(y\): Number of small pills to be made.

### Objective Function:
- Minimize the total number of filler material needed: \[Z = 2x + y\]

### Constraints:
1. Medicinal ingredient usage constraint: \[3x + 2y \leq 1000\]
2. Large pill production requirement: \[x \geq 100\]
3. Proportion constraint for small pills: \[y \geq 0.6(x + y)\]
4. Non-negativity constraint: \[x, y \geq 0\]

### Integer Constraints:
- \(x, y\) must be integers, as the number of pills cannot be fractional.

Using this model, we can apply linear programming techniques to find the optimal number of large and small pills to be made, minimizing the total number of filler material needed while satisfying the production requirements for the pills and the proportion constraint. This will provide the lab with an economically efficient pill production strategy.

## Python Code Solution Using `coptpy`:
Here is a Python script using the `coptpy` library to solve the problem:

\`\`\`python
import coptpy as cp
from coptpy import COPT

# Create a COPT environment
env = cp.Envr()

# Create the model
model = env.createModel("PillProduction")

# Add decision variables
x = model.addVar(vtype=COPT.INTEGER, name="x")  # Number of large pills
y = model.addVar(vtype=COPT.INTEGER, name="y")  # Number of small pills

# Objective function: Minimize the total number of filler material needed
model.setObjective(2 * x + y, sense=COPT.MINIMIZE)

# Constraints
model.addConstr(3 * x + 2 * y <= 1000, name="MaterialLimit")
model.addConstr(x >= 100, name="LargePillRequirement")
model.addConstr(y >= 0.6 * (x + y), name="SmallPillProportion")

# Solve the model
model.solve()

# Output results
if model.status == COPT.OPTIMAL:
    print("Minimum total number of filler material needed: {:.0f} units".format(model.objval))
    print("Number of large pills to be made: {:.0f}".format(x.x))
    print("Number of small pills to be made: {:.0f}".format(y.x))
else:
    print("No optimal solution found.")
\`\`\`

In this script, we first create a `COPT` environment and model. Then, we add two integer decision variables `x` and `y`, representing the number of large and small pills to be made, respectively.

Next, we set the objective function to minimize the total number of filler material needed, which is `2 * x + y`.

Then, we add three constraints:
1. Medicinal ingredient usage constraint: `3 * x + 2 * y <= 1000`
2. Large pill production requirement: `x >= 100`
3. Proportion constraint for small pills: `y >= 0.6 * (x + y)`

Finally, we solve the model and output the results of the optimal solution, including the minimum total number of filler material needed and the number of large and small pills to be made.

This script provides a complete example of using the `coptpy` library to solve the lab's pill production problem, while satisfying all the constraints mentioned in the problem.

Performances

Below is the comparison of performance on the NL4OPT, MAMO, and IndustryOR benchmarks. Values marked with a * are directly copied from original papers, with blanks where data were not reported. The highest results are highlighted in bold.

MethodNL4OPTMAMO EasyLPMAMO ComplexLPIndustryORMicro AvgMacro Avg
Methods based on PLMs
tag-BART47.9%*-----
Methods based on GPT-3.5
Standard42.4%*-----
Reflexion50.7%*-----
Chain-of-Experts58.9%*-----
Methods based on GPT-4
Standard47.3%*66.5%*14.6%*28.0%50.2%39.1%
Reflexion53.0%*-----
Chain-of-Experts64.2%*-----
OptiMUS78.8%*-----
ORLMs based on open-source LLMs
ORLM-Mistral-7B84.4%81.4%32.0%27.0%68.8%56.2%
ORLM-Deepseek-Math-7B-Base86.5%82.2%37.9%33.0%71.2%59.9%
ORLM-LLaMA-3-8B85.7%82.3%37.4%38.0%71.4%60.8%

Citation

@article{huang2024orlm,
  title={ORLM: A Customizable Framework in Training Large Models for Automated Optimization Modeling},
  author={Huang, Chenyu and Tang, Zhengyang and Ge, Dongdong and Hu, Shixi and Jiang, Ruoqing and Wang, Benyou and Wang, Zizhuo and Zheng, Xin},
  journal={arXiv e-prints},
  pages={arXiv--2405},
  year={2024}
}
@article{llama3modelcard,
  title={Llama 3 Model Card},
  author={AI@Meta},
  year={2024},
  url = {https://github.com/meta-llama/llama3/blob/main/MODEL_CARD.md}
}

License

The use of this model is governed by the META LLAMA 3 COMMUNITY LICENSE AGREEMENT.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
94fdc3c

0 моделей