/ Модель

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

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

Llama-3.1-Future-Code-Ja-8B

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

Модель на основе Llama 3.1 для генерации и дополнения кода, особенно на японском и английском языках.

23скачиваний за 30 дней8лайковвеса обновлены3 июн 2025

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Llama 3.1 Future Code Ja — языковая модель примерно на 7,5 млрд параметров, разработанная на основе Meta Llama 3.1. Она предназначена прежде всего для генерации и дополнения кода: модель прошла продолжительное предобучение на данных с кодом и преимущественно японским текстом, затем была объединена с instruct-вариантом Llama 3.1 и дообучена на инструкциях по программированию с помощью SFT и DPO. Модель поддерживает японский и английский языки, более 40 языков программирования, а также заполнение пропусков в коде с учётом контекста до и после пропуска (Fill-in-the-Middle). Контекст составляет до 131 072 токенов.

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

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

  • генерация фрагментов кода по описанию на японском языке
  • дополнение кода в IDE с учётом контекста до и после курсора
  • генерация и объяснение кода по инструкциям на английском языке
  • ответы на общие вопросы и выполнение инструкций на японском языке

Ограничения

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

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

Llama 3.1 Future Code Ja

Llama 3.1 Future Code Ja is a large language model with 8B parameters built on top of the Meta Llama 3.1 model. The model was first experienced continual pre-trained on the mixture of code and mostly-Japanese natural language data. The training data is mainly from The Stack V2 dataset and the subset of LLM-jp Corpus v3, which comprises 204.9B code and 85.7B natural language tokens after carefully designed data cleaning. The model was then merged with the instruct variant of the Meta Llama 3.1 model to acquire abilities to follow general task instructions, followed by supervised fine-tuning (SFT) and direct preference optimization (DPO) on our own magpie-generated code instruction data.

The model officially supports Japanese and English for natural languages and more than 40 programming languages ranging from popular Python, Java etc. to some legacy languages such as COBOL. In addition to causal (left-to-right) inference, the model supports Fill-in-the-Middle (FIM) capability, where the model fills in the blank attending to bidirectional context, a common use case in IDEs.

The model outperforms the original Llama 3.1 model in both Japanese, and English-instructed code completion tasks in various programming languages, and outperforms Qwen families in Japanese generation tasks, attaining a good balance between specialty in code-related tasks and general ability in Japanese.

Usage

Here are the sample inference scripts with transformers. We recommend using vLLM for faster inference.

pip install torch transformers accelerate

Chat

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "future-architect/Llama-3.1-Future-Code-Ja-8B"

model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)

# we recommend using the following system prompt:
# for Japanese completion : "あなたは様々なソフトウェア開発タスクをサポートするAIアシスタントです。"
# for English completion : "You are an AI assistant who support various software development tasks."

message = [
    {
        "role": "system",
        "content": "あなたは様々なソフトウェア開発タスクをサポートするAIアシスタントです。"
    },
    {
        "role": "user",
        "content": "PythonでFizzBuzzを書いてください。",
    },
]

input_ids = tokenizer.apply_chat_template(
    message, add_generation_prompt=True, return_tensors="pt", return_dict=True
).to(model.device)

output = model.generate(**input_ids, max_new_tokens=1024)

print(tokenizer.decode(output[0, input_ids["input_ids"].shape[1]:]))

Fill-in-the-Middle

With the idea that the users may not want line breaks just after their cursor positions, we did not create any middle splits that start with newline symbols (\n), but included them at the end of the prefix instead. This also holds true for the boundaries of suffix and middle splits, causing great sensitivity against which split to include newline symbols. Please remove one new line symbol (if exists) from the beginning of the suffix for improved performance.

You may set a larger repetition penalty to avoid nonsense generations with too many signs.

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

FIM_PREFIX = "<|fim_prefix|>"
FIM_MIDDLE = "<|fim_middle|>"
FIM_SUFFIX = "<|fim_suffix|>"

model_name = "future-architect/Llama-3.1-Future-Code-Ja-8B"

model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_name)

# prepend <|begin_of_text|> to inform that this is the beginning of "the content" (not whole sequence with special tokens)
prefix = "<|begin_of_text|>def fizzbuzz(n"
suffix = "return n"

# PSM mode (infilling)
input_txt = FIM_PREFIX + prefix + FIM_SUFFIX + suffix + FIM_MIDDLE
# SPM mode (reverse infilling)
# input_txt = FIM_PREFIX + FIM_SUFFIX + suffix + FIM_MIDDLE + prefix

# set add_special_tokens to False, so that the tokenizer does NOT add <|begin_of_text|> before special tokens
input_ids = tokenizer(input_txt, add_special_tokens=False, return_tensors="pt").to(model.device)

output = model.generate(**input_ids, max_new_tokens=1024, temperature=0.2, top_p=0.95)

print(tokenizer.decode(output[0, input_ids["input_ids"].shape[1]:]))

Model Performance

Code completion (Japanese)

Note: We do not report scores for two programming languages (Julia and Racket), which we did not include in the training data. All the scores below are pass@1 with 10 trials.

modelsizepycppcsdgojavajsphpplrrbrsscalashswiftts
Llama 3.1 Future Code Ja8B0.63350.52670.36330.15640.62860.46960.55280.48140.29190.29690.18700.44870.44250.32850.38610.5623
Llama 3.18B0.50610.43910.28350.21470.55190.37530.46400.42480.25840.23600.31120.32690.31750.26650.33230.4799
Llama 3.1 Swallow8B0.42130.33290.24560.10260.63700.34680.31120.32730.17580.18070.05030.20900.24870.15250.23540.3258
Qwen2.57B0.60180.51060.36010.23530.75000.50440.54160.52670.30750.34660.36830.50710.39690.33800.45760.6025
Qwen2.5-Coder7B0.66950.63790.46010.16600.71100.54680.66960.58940.34970.41740.35650.60320.49500.35440.52850.6358
Qwen38B0.62560.56830.37090.15830.51560.47780.58140.55470.39690.24660.32170.47630.40750.34180.37150.5239
Gemma 29B0.55490.45900.36080.08970.70520.46010.28630.47330.10990.16150.12050.34170.38500.12090.32720.2346

Code completion (English)

Note: We do not report scores for two programming languages (Julia and Racket), which we did not include in the training data. All the scores below are pass@1 with 10 trials.

modelsizepycppcsdgojavajsphpplrrbrsscalashswiftts
Llama 3.1 Future Code Ja8B0.68350.57950.38290.16920.62790.49870.61490.55650.36520.33170.17520.48460.46620.35950.45250.6390
Llama 3.18B0.63110.47950.31840.20830.59090.47150.55710.46580.32360.26960.42670.37440.38560.29940.37410.5717
Llama 3.1 Swallow8B0.47010.37200.26460.12240.65190.37590.30060.37330.17520.14470.05900.21030.27440.16140.21900.3786
Qwen2.57B0.67320.54910.42530.24550.70000.60130.61370.59130.33730.38320.44290.59230.42630.37150.50950.6535
Qwen2.5-Coder7B0.78900.73730.51520.19360.39350.61840.73850.65280.39690.42240.42300.65450.57250.41580.57970.7434
Qwen38B0.71340.67020.42850.22950.47210.57470.66020.62360.44410.36270.42610.61540.53630.40890.43040.6082
Gemma 29B0.61280.51180.37280.10450.65520.47910.37580.48630.07830.11860.07950.38530.41620.14370.35060.3723

Fill-in-the-Middle

Note: The models with asterisk (*) do not support FIM. We used the SPM prompt in Gong et al., 2024 and truncated the generated output just before the point that matched the beginning of the provided suffix. The scores of Llama models on PSM mode are not reported here since we got almost 0 scores for all those settings. All the scores below are exact match (EM) with 1 trial.

modelsizePSM (py)SPM (py)PSM (js)SPM (js)PSM (java)SPM (java)
Llama 3.1 Future Code Ja8B0.52160.51390.60180.60490.55170.5478
Qwen2.5-Coder7B0.58290.40840.66120.55970.64330.6180
Llama 3.1 8B *8B-0.4468-0.3951-0.3506
Llama 3.1 70B *70B-0.5964-0.5084-0.2910

Japanese tasks

  • JCommonSenseQA (Kurihara et al., 2022, Exact Match)
  • JEMHopQA (Ishii et al., 2024, chr-F1)
  • NIILC (Sekine, 2003, chr-F1)
  • JSQuAD (Kurihara et al., 2022, chr-F1)
  • XL-Sum (Hasan et al., 2021, ROUGE-2)
  • MGSM (Shi et al., 2023, Exact Match)
  • WMT20 en-ja (Barrault et al., 2020, BLEU)
  • WMT20 ja-en (Barrault et al., 2020, BLEU)
modelsizeJCommonsenseQAJEMHopQANIILCJSQuADXL-SUMMGSMWMT20 en-jaWMT20 ja-en
Llama 3.1 Future Code Ja8B0.91240.49830.51180.87580.17790.54800.26240.2028
Llama 3.18B0.88290.45370.40500.88680.14860.50800.21950.2008
Llama 3.1 Swallow8B0.92400.52280.58050.89570.19200.54800.28180.2263
Qwen2.57B0.91420.43940.39980.89080.16900.62400.20910.1909
Qwen2.5-Coder7B0.84720.30140.30450.89060.15330.53600.18160.1598
Qwen38B0.91690.42650.41970.89430.18820.77200.24500.2133
Gemma 29B0.93120.52880.53060.87740.08730.46800.23050.2017

English tasks

  • TriviaQA (Joshi et al., 2017, Exact Match)
  • SQuAD2 (Rajpurkar et al., 2018, Exact Match)
  • GSM8K (Cobbe et al., 2021, Exact Match)
modelsizeTriviaQASQuAD2GSM8K
Llama 3.1 Future Code Ja8B0.62330.37540.7111
Llama 3.18B0.69910.37840.7475
Llama 3.1 Swallow8B0.62960.36280.6126
Qwen2.57B0.51760.26240.7430
Qwen2.5-Coder7B0.45170.33880.7020
Qwen38B0.56310.39220.8749
Gemma 29B0.65730.39440.7908

Evaluation Details

We used the Code Generation LM Evaluation Harness toolkit to evaluate code completion and FIM capabilities.

We adopted the settings below for decoding. We mostly followed the recommendations however, we set max_new_tokens instead of max_tokens to avoid truncation while handling long input sequences.

  • Temperature: 0.2
  • Top-p: 0.95
  • Number of completions to generate: 10 (for completion tasks), 1 (for FIM tasks)
  • Maximum number of new tokens: 512

We followed the evaluation strategy adopted in the Swallow project for Japanese and English tasks. More specifically, we used the llm-jp-eval toolkit for Japanese tasks and the Language Model Evaluation Harness toolkit for English (and some Japanese) tasks.

We adopted the default decoding strategy for all the tasks.

Risks and Limitations

The model is trained on general tasks related to software development, not on organization-specific, and/or non-standardized tasks. We recommend further fine-tuning the model to make it work better with those tasks. The model may produce incorrect output and all the suggestions from the model must be carefully examined before adopting in real-world applications.

Acknowledgements

The model is developed as part of the Generative AI Accelerator Challenge (GENIAC) project. We thank great support from the New Energy and Industrial Technology Development Organization (NEDO) and the Ministry of Economy, Trade and Industry (METI) for financial support.

Contact

  • pj-geniac at future.co.jp

License

META LLAMA 3.1 COMMUNITY LICENSE

Copyright © 2025 by Future Corporation

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей