Downloads · 30 days
21
26% of all-time downloads
soleaf/Llama-3-8B-DiaTool-Ko-SFT-LoRA
Llama-3-8B-DiaTool-Ko-SFT-LoRA is a text generation model from soleaf. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.
Built with Meta Llama 3. This is an independent, adapter-only reproduction of a Korean tool-use SFT stage inspired by DiaTool-DPO. It is not an official Kakao checkpoint, does not include DPO, and is not a drop-in pro…
Downloads · 30 days
21
26% of all-time downloads
All-time downloads
80
Public
Repo size
101 MB
Likes
0
Public
Click a slice to open those files.
.safetensors83.9 MB · 83%
From the Hugging Face model README
Built with Meta Llama 3. This is an independent, adapter-only reproduction of a Korean tool-use SFT stage inspired by DiaTool-DPO. It is not an official Kakao checkpoint, does not include DPO, and is not a drop-in production tool agent.
한국어 도구 호출을 위해 재현 학습한 Meta Llama 3 8B용 LoRA 어댑터입니다. 공식 Kakao 체크포인트가 아니며, DiaTool-DPO 논문의 DPO 단계 이전에 해당하는 연구용 CPT+SFT 베이스라인입니다.
Paper: DiaTool-DPO: Multi-Turn Direct Preference Optimization for Tool-Augmented Large Language Models
| Item | Value |
|---|---|
| Base model | meta-llama/Meta-Llama-3-8B-Instruct |
| Frozen base revision | 8afb486c1db24fe5011ec46dfbe5b5dccdb575c2 |
| Release type | PEFT LoRA adapter only |
| Training stages | English tool-use CPT, then Korean tool-use SFT |
| Context length used for final SFT | 8,192 tokens, packed |
| LoRA | rank 8, alpha 16, dropout 0.05 |
| Target modules | q/k/v/o and gate/up/down projections |
| Trainable parameters | 20,971,520 |
| Prompt protocol | Functionary-style >>>recipient |
This repository uses the following names consistently. All three conditions use
the exact same frozen meta-llama/Meta-Llama-3-8B-Instruct base revision; only
the presence and training stage of the LoRA adapter differ.
Here, base model means the adapter's frozen Instruct checkpoint. It does not
mean the pretrained-only Meta-Llama-3-8B checkpoint.
Meta-Llama-3-8B-Instruct checkpoint by itself; no reproduction LoRA is
loaded.The CPT and SFT LoRAs are not separate stacked adapters. One LoRA was trained first by CPT and then continued by SFT; the base-model weights remained frozen.
| Stage | Language | Sources | Final records | Token count |
|---|---|---|---|---|
| Tool-use CPT | English | Glaive v2 34,598; xLAM 18,321; SGD 5,481 | 58,400 | 25,000,918 |
| Tool-use SFT | Korean | Glaive-ko 12,786; translated/repaired SGD 10,056 | 22,842 | 25,053,337 input / 7,680,890 assistant labels |
The SFT split also had 1,202 source-held-out validation rows. Known FunctionChat overlap was zero after the final contamination and duplication audit. The Korean rows are machine-translated derivatives, and 1,039 rows in the SGD repair lineage were selectively rewritten before quarantine and deduplication. No training examples are shipped with the adapter.
v3.llama3 text, checked for preservation of tool/schema/action content, and
fully scanned for token length. A deterministic 25M-token subset was then
selected in proportion to each source's full-scan token contribution and
packed into 2,048-token blocks.The complete accepted rules, intermediate counts, and known CPT format risk are documented in reports/data_lineage.md.
Evaluation set: 4,639 held-out records, approximately 2.00M tokens, with zero CPT-train overlap.
| Model condition | Loss ↓ | Perplexity ↓ |
|---|---|---|
| Base model only (no adapter) | 1.365780 | 3.9188 |
| Base model + English CPT LoRA | 0.418165 | 1.5192 |
This measures adaptation to English tool/API text. It is not a FunctionChat or general-capability comparison.
| Model condition | Held-out loss ↓ | Behavior checks ↑ |
|---|---|---|
| Base model + English CPT LoRA | 1.0547 | 103/256 (40.23%) |
| Released model (base model + final CPT→SFT LoRA) | 0.5660 | 244/256 (95.31%) |
The behavior checks cover complete requests, missing-slot clarification, tool-result completion, and unavailable-tool no-call behavior.
Evaluation set: 1,306 generated examples. The call subset contains 670 examples; the remaining judge-scored subsets contain 636 examples in total.
| Metric | Score |
|---|---|
| Call | 63.88% |
| Completion | 85.92% |
| Slot | 54.07% |
| Relevance | 21.14% |
| Micro average | 57.73% |
| Macro average | 56.25% |
Interpretation: completion is the strongest FunctionChat axis, while
relevance and call reliability remain weak. Completion, Slot, and Relevance
used a local gpt-oss-120b surrogate judge rather than the paper's official
judge, so these absolute scores are not directly comparable to the paper.
Use this checkpoint for research on Korean function calling, tool-use prompt
formatting, and reproducibility. It is intended to generate either
>>>all\n... for a normal answer or >>>function_name\n{...} for a tool call.
The surrounding application must validate JSON, authorize every tool, enforce
argument schemas, and execute tools in a sandbox.
Do not use unvalidated model output to trigger payments, destructive operations, security-sensitive actions, or high-impact decisions. The model has not been evaluated for production safety, multilingual robustness, prompt injection, or adversarial tool definitions.
First accept the Meta Llama 3 license for the
base model, then
authenticate with hf auth login.
pip install -r requirements.txt
MODEL_ID="soleaf/Llama-3-8B-DiaTool-Ko-SFT-LoRA" python inference_example.py
The recommended path is prompting.py, which reproduces the
training prompt protocol and injects tool schemas. A standard Transformers chat
template is also included for common JSON-schema tools:
from transformers import AutoTokenizer
model_id = "soleaf/Llama-3-8B-DiaTool-Ko-SFT-LoRA"
tokenizer = AutoTokenizer.from_pretrained(model_id)
prompt = tokenizer.apply_chat_template(
[{"role": "user", "content": "서울의 날씨를 알려줘."}],
tools=[{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather",
"parameters": {
"type": "object",
"properties": {"city": {"type": "string"}},
"required": ["city"],
},
},
}],
tokenize=False,
add_generation_prompt=True,
)
The continued pre-training stage used 58,400 English function-calling records (25.0M tokens) from Glaive Function Calling v2, xLAM Function Calling 60k, and Schema-Guided Dialogue. The final SFT stage used 22,842 Korean records (25.1M input tokens; 7.68M assistant-label tokens), packed into 3,452 blocks of 8,192 tokens. The Korean mix contained 12,786 Glaive-derived rows and 10,056 Schema-Guided Dialogue rows after translation, repair, quarantine, and deduplication.
For CPT, all 189,102 available source records were scanned (81.34M tokens), and
the released initializer used a deterministic, source-proportional 25M-token
budget. The CPT data retained 18,460 legacy Glaive <functioncall> records; the
clean Korean SFT stage was therefore responsible for teaching the final
canonical >>>recipient format. This is disclosed as a format-risk limitation,
not hidden as a failed iteration.
Data sources have different licenses and access conditions. In particular, xLAM has gated access conditions, Glaive is Apache-2.0, xLAM is CC-BY-4.0, and the original Schema-Guided Dialogue data is CC-BY-SA-4.0. Full lineage and attribution are in reports/data_lineage.md. No training JSONL is distributed in this model repository.
Final SFT used two data-parallel GPUs, bfloat16 base computation with FP32 LoRA
parameters, packed variable-length attention, gradient checkpointing, and one
pass over all 3,452 blocks. Optimization used AdamW (beta1=0.9, beta2=0.95,
weight decay 0), a peak learning rate of 5e-5, 52 linear warmup steps, 1,726
optimizer steps, and gradient clipping at 1.0. See
reports/training.md.
| Evaluation | Result |
|---|---|
| Base model only (no adapter) → Base model + English CPT LoRA held-out loss | 1.365780 → 0.418165 |
| Base model only (no adapter) → Base model + English CPT LoRA held-out perplexity | 3.9188 → 1.5192 |
| Base model + English CPT LoRA → Released model held-out loss | 1.0547 → 0.5660 |
| Base model + English CPT LoRA → Released model behavior checks | 103/256 → 244/256 |
| FunctionChat Call | 63.88 |
| FunctionChat Completion | 85.92 |
| FunctionChat Slot | 54.07 |
| FunctionChat Relevance | 21.14 |
| FunctionChat Micro / Macro | 57.73 / 56.25 |
FunctionChat was evaluated with a local gpt-oss-120b surrogate judge, not the
official judge used in the paper; these numbers are therefore not directly
comparable with published DiaTool-DPO results. See
reports/evaluation.md for category results and error
analysis.
The adapter is a Llama Material under the Meta Llama 3 Community License. See LICENSE and USE_POLICY.md. The repository name begins with “Llama 3,” and the required Meta notice is included in NOTICE. Example prompt/inference code is under Apache-2.0; see CODE_LICENSE.
If this reproduction is useful, cite the original DiaTool-DPO paper, the upstream Functionary prompt implementation, and the APIGen and Schema-Guided Dialogue works associated with the training-data sources:
@inproceedings{jung2025diatool,
title = {DiaTool-DPO: Multi-Turn Direct Preference Optimization for Tool-Augmented Large Language Models},
author = {Jung, Sunghee and Lee, Donghun and Lee, Shinbok and Seo, Gaeun and Lee, Daniel and Ko, Byeongil and Cho, Junrae and Kim, Kihyun and Kim, Eunggyun and Shin, Myeongcheol},
booktitle = {Proceedings of the 26th Annual Meeting of the Special Interest Group on Discourse and Dialogue (SIGDIAL 2025)},
year = {2025},
address = {Avignon, France}
}
@software{MeetKai_Functionary_2024,
author = {MeetKai},
title = {Functionary},
year = {2024},
url = {https://github.com/MeetKai/functionary},
version = {1.0.0}
}
@article{liu2024apigen,
title = {APIGen: Automated Pipeline for Generating Verifiable and Diverse Function-Calling Datasets},
author = {Liu, Zuxin and Hoang, Thai and Zhang, Jianguo and Zhu, Ming and Lan, Tian and Kokane, Shirley and Tan, Juntao and Yao, Weiran and Liu, Zhiwei and Feng, Yihao and others},
journal = {Preprint},
year = {2024},
url = {https://apigen-pipeline.github.io/}
}
@inproceedings{rastogi2020schema,
title = {Towards Scalable Multi-Domain Conversational Agents: The Schema-Guided Dialogue Dataset},
author = {Rastogi, Abhinav and Zang, Xiaoxue and Sunkara, Srinivas and Gupta, Raghav and Khaitan, Pranav},
booktitle = {Proceedings of the AAAI Conference on Artificial Intelligence},
volume = {34},
number = {05},
pages = {8689--8696},
year = {2020},
url = {https://aaai.org/ojs/index.php/AAAI/article/view/6394}
}
Reference implementation: kakao/diatool-dpo.