/ Модель

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

Контекст
131 072 токена
Параметры
7,5 млрд
Размер весов
16,1 ГБ
Лицензия
Llama 3.1
Архитектура
llama · dense
Базовая модель
Llama-3.1-8B-Instruct
Библиотека
transformers
Опубликована
30 окт 2025

Llama-3.1-8B-Instruct-w16a8-1node-bs8

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

Турецкоязычная юридическая чат-модель на базе Llama 3.1 для ответов и генерации текстов в правовом контексте.

42скачиваний за 30 дней0лайковвеса обновлены9 дек 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Это инструкционно дообученная на юридических данных турецкоязычная модель newmindai на архитектуре Llama 3.1, основанная на meta-llama/Llama-3.1-8B-Instruct. Веса модели сохранены в формате bfloat16; FP8 применялся в ходе обучения для вычислений с активациями и градиентами в эксперименте по ускорению распределённого обучения FSDP2. Модель содержит около 7,5 млрд параметров и поддерживает контекст до 131 072 токенов.

Модель предназначена для диалогов и генерации текста по юридическим вопросам на турецком языке. Её можно применять для подготовки ответов и черновиков юридических текстов, а также для вопросов и ответов по юридическим материалам. В карточке описано сравнение режимов точности и профилирование обучения; она не подтверждает конкретные показатели юридического качества. Лицензия — Llama 3.1, с условиями использования Meta Llama 3.1 Community License.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Abstract

The Llama-3.1-8B-Instruct-w16a8-1node-bs8 model is a Turkish legal instruction-tuned variant of Llama-3.1-8B-Instruct, trained using Float8 mixed precision with the default Tensorwise quantization scaling recipe under the FSDP2 distributed training framework. This model represents the single-node FP8 configuration in the “FSDP2 with Float8 Precision for Faster Training” experiment, designed to evaluate the impact of FP8 activations and BF16 weights on training speed, memory efficiency, and legal-domain performance.

Experiment Context

This model was trained as part of our study for comparing FSDP2 with bfloat16 precision against FSDP2 with FP8 mixed precision bfp16-fp8. We used meta-llama/Llama-3.1-8B-Instruct. The model has been loaded using torch_dtype = bfloat16 and for FP8 + FSDP2 compatibility the model has been wrap per-layer instead of whole model This helped to avoid dimension misalignment issues and during forward and backward passes float8 variats been used for computations where FP8E4M3 for activations (forward pass) and FP8E5M2 for gradients (backward pass, wider range) also we setted the pad_inner_dim for automatically pad dimensions to be divisible by 16 which is required for FP8.

from torchao.float8 import (
    convert_to_float8_training,
    Float8LinearConfig,
    precompute_float8_dynamic_scale_for_fsdp)
config = Float8LinearConfig(
  pad_inner_dim=True,
  enable_fsdp_float8_all_gather=True)
model = convert_to_float8_training(model, config=config)
if use_fp8:
    for i, layer in enumerate(model.model.layers):
        fully_shard(layer, **fsdp_kwargs)
    fully_shard(model.model.embed_tokens, **fsdp_kwargs)
    fully_shard(model.lm_head, **fsdp_kwargs)

Base Model Technical Specifications

  • Parameters: 8 Billion
  • Architecture Family: Llama 3.1
  • Maximum Position Embeddings: 131,072
  • Attention Heads: 32 (num_attention_heads)
  • Key-Value Heads: 8 (num_key_value_heads)
  • Hidden Layers: 32 (num_hidden_layers)
  • Hidden Size: 4,096 (hidden_size)
  • Intermediate Size: 14,336
  • Vocabulary Size: 128,256
  • Precision: bfloat16
  • RoPE Scaling: type llama3, factor = 8.0
  • RMS Norm Epsilon: 1e-05
  • Activation: SiLU

Training Methodology

Training Configuration

  • Model: meta-llama/Llama-3.1-8B-Instruct
  • Sequence Length: 4,096 (seq_len)
  • Epochs: 2
  • Per-Device Micro Batch Size: 2
  • Gradient Accumulation: 4
  • GPUs: 4 (via CUDA_VISIBLE_DEVICES=0,1,2,3)
  • dtype: bf16 && fp8=true
    • Weights: bfloat16
    • Activations: float8
  • Optimizer: AdamW
    • Learning Rate: 2e-5
    • Weight Decay: 0.01
    • Betas: (0.9, 0.95)
    • Epsilon: 1e-8
  • LR Scheduler: Cosine; warmup = 10% (warmup_ratio=0.1) | also warmup_steps=100
  • Max Grad Norm: 1.0
  • Gradient Checkpointing: Enabled
  • Checkpointing: every 10 steps; keep last 5; select best by eval_loss
  • Logging: every step to file; Weights & Biases in offline mode
  • Seed: 100
  • Distributed Training: torch.distributed.run (single node, multi-GPU)
    • FSDP2 (Optimized Fully Sharded Data Parallel)

Setups

  • Precision: Used Half-precision bfloat16 as data type and for computation.
  • Hardware: HPC (EuroHPC/BSC-class) node with 4 × NVIDIA H100 GPUs.
  • Framework: PyTorch with torchrun for distributed training.

Dependencies

packageVersion
Transformers4.57.1
torch2.9.0+cu128
accelerate0.14.1
datasets4.3.0
huggingface-hub0.36.0
tensorboard2.20.0
tensorboard-data-server0.7.2
wandb0.22.1

Job Details

modelJob IDRuntime (mins)NodesGPUsNode-hourGPU-hourmicro-batchbatch-sizegradient_accumulationtotal_batch_size
Llama-3.1-8B-Instruct_w16a8_rw31768103115.75141.9297.71622432
Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp31837629109.00141.8167.26622432
Llama-3.1-8B-Instruct-w16a8-mxtw3176803164.00141.0664.26622432
Llama-3.1-8B-Instruct-w16a16-tw31768074138.75142,3129,2522432
Llama-3.1-8B-Instruct-w16a8-1node-bs831768093123.75142.0628,25022432
Llama-3.1-8B-Instruct-w16a16-4nodes-bs323147843331.75442.1178.467448512
Llama-3.1-8B-Instruct-w16a8-4nodes-bs323147846839.75442.65010.600448512
Llama-3.1-8B-Instruct-w16a16-8nodes-bs323147691422.00842.93311.7334481024
Llama-3.1-8B-Instruct-w16a8-8nodes-bs323147684423.50843.13312.5334481024
Llama-3.1-8B-Instruct-w16a16-8nodes-bs643147691422.00842.93311.7334881024
Llama-3.1-8B-Instruct-w16a8-8nodes-bs643147684423.50843.13312.5334881024
Llama-3.1-8B-Instruct-w16a8-rw_4nodes3347707039.75442.65010.600448512
Llama-3.1-8B-Instruct-w16a8-rw-8nodes3347669023.50843.13312.5334481024
Llama-3.1-8B-Instruct-w16a8-rw_with_gw_hp_4nodes3347717937.43442.4959.982448512
Llama-3.1-8B-Instruct-w16a8-rw-with-gw-hp-8nodes3347661822.13842.95111.8024481024

All 15-models trained on(1Node,4Noes,8Nodes with both bfp16-fp8 && bfp16 configurations and fp8 recipes)

perplexity metric results for bfp16 && bfp16-fp8 configurationsAccuracy metric results for bfp16 && bfp16-fp8 configurationsLoss metric results for bfp16 && bfp16-fp8 configurationsMemory allocation for bfp16 && bfp16-fp8 configurationsUtilization for bfp16 && bfp16-fp8 configurations
perpacctrain_lossmemAloutils
ModelMax Loss (train)Min Loss (train)Avg Loss (train)Final Loss (train)± Std (train)Max Loss (val)Min Loss (val)Avg Loss (val)Final Loss (val)± Std (val)
Llama-3.1-8B-Instruct-w16a8-rw83.16820.57400.81180.64310.27461.06130.83940.89370.8394
Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp83.18370.57630.81160.64200.27511.05990.83910.89330.8391
Llama-3.1-8B-Instruct-w16a8-mxtw83.19830.57470.81150.64460.27581.05620.83840.89230.8384
Llama-3.1-8B-Instruct-w16a16-tw83.12350.72030.97500.33440.76121.91130.89070.98310.1897
Llama-3.1-8B-Instruct-w16a8-1node-bs883.16610.72610.98040.33740.76721.92300.89480.98670.1906
Llama-3.1-8B-Instruct-w16a16-4nodes-bs32323.24520.74140.96650.48440.75041.05380.83820.88440.0725
Llama-3.1-8B-Instruct-w16a8-4nodes-bs32323.28400.74780.97480.49050.75811.07010.84300.89220.0764
Llama-3.1-8B-Instruct-w16a16-8nodes-bs32323.23110.84481.18560.64340.84481.02570.89770.94600.0568
Llama-3.1-8B-Instruct-w16a8-8nodes-bs32323.30030.84731.18660.64810.84731.02030.89920.94450.0539
Llama-3.1-8B-Instruct-w16a16-4nodes-bs64643.23110.84481.18560.64340.84481.02570.89770.94600.0568
Llama-3.1-8B-Instruct-w16a8-8nodes-bs64643.30030.84731.18660.64810.84731.02030.89920.94450.0539
Llama-3.1-8B-Instruct-w16a8-rw_4nodes643.45170.76241.11730.76240.68911.32250.87910.97320.8791
Llama-3.1-8B-Instruct-w16a8-rw_8nodes643.89440.95831.64230.95831.01171.53841.02531.21031.0253
Llama-3.1-8B-Instruct-w16a8-rw_with_gw_hp_4nodes643.45170.74811.10910.74810.70211.33930.86600.96410.8666
Llama-3.1-8B-Instruct-w16a8-rw_with_gw_hp_8nodes643.92890.97021.65140.97021.01271.55371.03771.22221.0377

Implementation

Gpu && Memory usage Profiling

To visualize the usage of the memory and gpu's vram/utilis and more you can profile them with pytorch-profiler tool or nsight systems profiler tool .

  • follow the steps to visualize with Pytorch-profiler :

    1. pip install the versions that mentioned in the dependencies section of these libs tensorboard and tensorboard-data-server.
    2. Visualize pytorch profiles by runing the command provided below.
    tensorboard --logdir="/gpfs/scratch/ehpc317/esavirdi/dual_precision_training/profiles/Llama-3.1-8B-Instruct_tensorwise" --port="6006"
    
  • follow the steps to visualize with nsight systems:

    1. download the files on to you local machine.
    2. download the full_version of the nsys profiler tool from here : https://developer.nvidia.com/nsight-systems/get-started.
    3. open the nsys-rep profiles using the nsight systems gui .

    also you can get a summary of the report using these command lines up to your porpuse :

    nsys stats --report cuda_gpu_kern_sum /path/to/lama3.1_fp16_fp8.nsys-rep
    
    nsys stats --report cuda_gpu_trace /path/to/lama3.1_fp16_fp8.nsys-rep
    
      nsys stats --report cuda_gpu_mem_size_sum /path/to/lama3.1_fp16_fp8.nsys-rep
    

Usage

Note: the final model has saved in bfloat16 format. For inference, load the model in bfloat16 or float16 as shown below:

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "newmindai/Llama-3.1-8B-Instruct-w16a8-1node-bs8"
dtype = torch.bfloat16
tok = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype=dtype,
    device_map="auto"
)

prompt = "Soru: Kişisel Verilerin Korunması Kanunu uyarınca hangi durumlarda açık rıza aranmaz? Cevap:"
inputs = tok(prompt, return_tensors="pt").to(model.device)
with torch.no_grad():
    out = model.generate(
        **inputs,
        max_new_tokens=256,
        do_sample=False
    )

print(tok.decode(out[0], skip_special_tokens=True))

Ethical Considerations and Disclaimers

  • Research & development purposes only; not a substitute for professional legal counsel.
  • Users must ensure compliance with data protection and sector regulations.
  • Potential biases may exist in domain data and model outputs.

Model & Data Card Metadata

  • Total Parameters: 8,030,261,248
  • Serialized Size (approx.): 16,060,522,496 bytes
  • Config precision: bfloat16
  • RoPE: llama3 scaling, factor 8.0

References and Citations

Base Model

@misc{meta_llama31_8b_instruct,
  title={Llama 3.1 8B Instruct},
  author={Meta AI},
  year={2024},
  howpublished={\url{https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct}}
}

Training Dataset

@misc{euro_hpc_legal,
  title={EuroHPC-Legal},
  author={newmindai},
  year={2025},
  howpublished={\url{https://huggingface.co/datasets/newmindai/EuroHPC-Legal}}
}

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

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

GPU в ailist

vLLM

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

Подбираем GPU…

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

0 моделей