/ Модель

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

Контекст
8 192 токена
Параметры
69,5 млрд
Размер весов
141 ГБ
Лицензия
MIT
Архитектура
llama · dense
Опубликована
22 июл 2024

lawma-70b

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

Модель Lawma 70B классифицирует юридические материалы по специализированным задачам, основанным на судебных базах данных США.

29скачиваний за 30 дней5лайковвеса обновлены8 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Lawma 70B — языковая модель на архитектуре Llama 3 70B Instruct, дообученная авторами проекта Lawma на более чем 500 тысячах примеров для 260 задач юридической классификации. Данные основаны на базах решений Верховного суда США и апелляционных судов округа Сонгер; суммарный объём обучения составил около 2 млрд токенов. Модель содержит 69,5 млрд параметров, работает с контекстом до 8192 токенов и распространяется в формате Safetensors по лицензии MIT.

Модель предназначена прежде всего для классификации юридических материалов в рамках задач, на которых её дообучали, например для анализа решений судов и юридических исследований. В опубликованной оценке авторы сообщают о средней точности 81,9% на наборе из 260 задач и превосходстве над GPT-4 на 95% из них; эти результаты относятся к их тестированию с выбором ответа и не гарантируют качества на других данных. Модель дообучалась на вопросах с вариантами ответа, а не на общих инструкциях, и обычно выдаёт букву или число. Авторы рекомендуют дополнительно дообучать её под конкретное применение.

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

  • Классификация решений Верховного суда США по юридическим категориям
  • Классификация решений апелляционных судов округа Сонгер
  • Ответы на юридические вопросы с выбором из предложенных вариантов
  • Поддержка количественных исследований судебных решений

Ограничения

Дообучена на конкретных задачах юридической классификации и не предназначена для общих инструкций; ответы обычно имеют вид буквы или числа. Заявленные результаты оценки относятся к задачам и методике авторов и не гарантируют точность на других данных.

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

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

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

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

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

Открыть на Hugging Face

Lawma 70B

Lawma 70B is a fine-tune of Llama 3 70B Instruct on 260 legal classification tasks derived from Supreme Court and Songer Court of Appeals databases. Lawma was fine-tuned on over 500k task examples, totalling 2B tokens. As a result, Lawma 70B outperforms GPT-4 on 95% of these legal classification tasks, on average by over 17 accuracy points. See our arXiv preprint and GitHub repository for more details.

Evaluations

We report mean classification accuracy across the 260 legal classification tasks that we consider. We use the standard MMLU multiple-choice prompt, and evaluate models zero-shot. You can find our evaluation code here.

ModelAll tasksSupreme Court tasksCourt of Appeals tasks
Lawma 70B81.984.181.5
Lawma 8B80.382.479.9
GPT462.959.863.4
Llama 3 70B Inst58.447.160.3
Mixtral 8x7B Inst43.224.446.4
Llama 3 8B Inst42.632.844.2
Majority classifier41.731.543.5
Mistral 7B Inst39.919.543.4
Saul 7B Inst34.420.236.8
LegalBert24.613.626.4

FAQ

What are the Lawma models useful for? We recommend using the Lawma models only for the legal classification tasks that they models were fine-tuned on. The model has been fine-tuned on multiple-choice questions, not on general instructions. Therefore, the model only outputs multiple choice letters (e.g., A, B, C, etc) or numbers. The main take-away of our paper is that specializing models leads to large improvements in performance. Therefore, we strongly recommend practitioners to further fine-tune Lawma on the actual tasks that the models will be used for. Relatively few examples --i.e, dozens or hundreds-- may already lead to large gains in performance.

Should I use Lawma 8B or 70B? Lawma 70B outperforms Lawma 8B on about 67% of the tasks, on average by a small amount, typically between 1 and 2 accuracy points. Therefore, practitioners may prefer to use Lawma 8B for its significantly cheaper inference and fine-tuning, with little cost in terms of model performance.

What legal classification tasks is Lawma fine-tuned on? We consider almost all of the variables of the Supreme Court and Songer Court of Appeals databases. Our reasons to study these legal classification tasks are both technical and substantive. From a technical machine learning perspective, these tasks provide highly non-trivial classification problems where even the best models leave much room for improvement. From a substantive legal perspective, efficient solutions to such classification problems have rich and important applications in legal research.

Example use

from transformers import AutoModelForCausalLM, AutoTokenizer

model_dir = "ricdomolm/lawma-70b"

tokenizer = AutoTokenizer.from_pretrained(model_dir)
model = AutoModelForCausalLM.from_pretrained(model_dir)

def generate_response(input_text):
    inputs = tokenizer(input_text, return_tensors="pt")
    outputs = model.generate(inputs.input_ids, max_length=2048, do_sample=False)
    response = tokenizer.decode(outputs[0], skip_special_tokens=True)

    return response

input_text = """This case may seem at first blush too inconsequential to find its way into our bdoks, but the issue it presents is of no small constitutional significance.
Appellant Paul Robert Cohen was convicted in the Los Angeles Municipal Court of violating that part of California Penal Code § 415 which prohibits “maliciously and willfully disturb [ing] the peace or quiet of any neighborhood or person. ■.. by... offensive conduct... He was given 30 days’imprisonment. The facts upon which his conviction rests are detailed in the opinion of the Court of Appeal of California, Second Appellate District, as follows:
“On April 26, 1968, the defendant was observed in the Los Angeles County Courthouse in the corridor outside of division 20 of the municipal court wearing a jacket bearing the words ‘F the Draft’ which were plainly visible. There were women and children present in the corridor. The defendant was arrested. The defendant testified that he wore the jacket knowing that the words were on the jacket as a means of informing the public of the depth of his feelings against the Vietnam War and the draft.
“The defendant did not engage in, nor threaten to engage in, nor did anyone as the result of his conduct in fact commit or threaten to commit any act. of violence. The defendant did not make any loud or unusual noise, nor was there any evidence that he uttered any sound prior to his arrest.” 1 Cal. App. 3d 94, 97-98, 81 Cal. Rptr. 503, 505 (1969).
In affirming the conviction the Court of Appeal held that' “offensive conduct” means “behavior which has a tendency to provoke others to acts of violence or to in turn disturb the peace,” and that the State had,proved this element because, on the facts of this case, “[i]t was certainly reasonably foreseeable that.such conduct might cause others to rise up to commit a violent act against the person of the defendant or attempt to forceably remove his jacket.” 1 Cal. App. 3d, at 99-100, 81 Cal.

Question: What is the issue area of the decision?
A. Criminal Procedure
B. Civil Rights
C. First Amendment
D. Due Process
E. Privacy
F. Attorneys
G. Unions
H. Economic Activity
I. Judicial Power
J. Federalism
K. Interstate Relations
L. Federal Taxation
M. Miscellaneous
N. Private Action
Answer:"""

output = generate_response(input_text)
print(output)

Citation

This model was trained for the project

Lawma: The Power of Specizalization for Legal Tasks. Ricardo Dominguez-Olmedo and Vedant Nanda and Rediet Abebe and Stefan Bechtold and Christoph Engel and Jens Frankenreiter and Krishna Gummadi and Moritz Hardt and Michael Livermore. 2024

Please cite as:

@misc{dominguezolmedo2024lawmapowerspecializationlegal,
      title={Lawma: The Power of Specialization for Legal Tasks}, 
      author={Ricardo Dominguez-Olmedo and Vedant Nanda and Rediet Abebe and Stefan Bechtold and Christoph Engel and Jens Frankenreiter and Krishna Gummadi and Moritz Hardt and Michael Livermore},
      year={2024},
      eprint={2407.16615},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2407.16615}, 
}

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

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

GPU в ailist

vLLM

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

Подбираем GPU…

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

0 моделей