--- base_model: LiquidAI/LFM2-350M library_name: transformers model_name: LFM2-350M-ToolLLaMA tags: - tool-calling - react-agent - sft - trl - toolbench - liquid-ai - lfm2 - lnn license: other datasets: - gyung/toolbench-lfm-chatml language: - en - ko pipeline_tag: text-generation --- # ๐Ÿ”ง LFM2-350M-ToolLLaMA **๐Ÿ‡บ๐Ÿ‡ธ [English](https://huggingface.co/gyung/LFM2-350M-ToolLLaMA#%F0%9F%87%BA%F0%9F%87%B8-english)** ## ๐Ÿ‡ฐ๐Ÿ‡ท ํ•œ๊ตญ์–ด > **354M ํŒŒ๋ผ๋ฏธํ„ฐ ์†Œํ˜• ๋ชจ๋ธ๋กœ Tool Calling์„ ์ˆ˜ํ–‰ํ•˜๋Š” ReAct ์—์ด์ „ํŠธ** [![Base Model](https://img.shields.io/badge/๐Ÿค—%20Base-LFM2--350M-blue)](https://huggingface.co/LiquidAI/LFM2-350M) [![Dataset](https://img.shields.io/badge/๐Ÿ“Š%20Dataset-ToolBench-green)](https://huggingface.co/datasets/gyung/toolbench-lfm-chatml) [![Paper](https://img.shields.io/badge/๐Ÿ“„%20Paper-arXiv%3A2512.15943-red)](https://arxiv.org/html/2512.15943v1) [Liquid AI์˜ LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M)์„ [ToolBench ๋ฐ์ดํ„ฐ์…‹](https://github.com/OpenBMB/ToolBench)(187,494 ์˜ˆ์‹œ)์œผ๋กœ Full SFTํ•˜์—ฌ, **ReAct(Thought/Action/Action Input) ํ˜•์‹**์˜ Tool Calling์„ ์ˆ˜ํ–‰ํ•˜๋„๋ก ํ•™์Šตํ•œ ๋ชจ๋ธ์ž…๋‹ˆ๋‹ค. ๋…ผ๋ฌธ *"[Small Language Models for Efficient Agentic Tool Calling](https://arxiv.org/html/2512.15943v1)"* (arXiv:2512.15943v1)์˜ ์‹คํ—˜์„ LFM2 ์•„ํ‚คํ…์ฒ˜(LNN ๊ธฐ๋ฐ˜)๋กœ ์žฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค. --- ### Quick Start ```python from transformers import AutoTokenizer, AutoModelForCausalLM import torch model_id = "gyung/LFM2-350M-ToolLLaMA" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto", ) system_prompt = """You are AutoGPT, you can use many tools(functions) to do the following task. At each step, you need to give your thought to analyze the status now and what to do next, with a function call to actually execute your step. Your output should follow this format: Thought: Action: Action Input:""" messages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": "What is the current weather in Seoul, South Korea?"}, ] inputs = tokenizer.apply_chat_template( messages, return_tensors="pt", add_generation_prompt=True ).to(model.device) with torch.no_grad(): outputs = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.1) result = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True) print(result) ``` **์‹ค์ œ ์ถœ๋ ฅ ์˜ˆ์‹œ:** ``` Thought: To find the current weather in Seoul, South Korea, I need to use the "weather" API. I will call the "weather" function with the argument "location" set to "Seoul, South Korea" to retrieve the weather information for that location. Action: weather Action Input: {"location": "Seoul, South Korea"} ``` --- ### ๋ชจ๋ธ ์ƒ์„ธ | ํ•ญ๋ชฉ | ๋‚ด์šฉ | |------|------| | **Base Model** | [LiquidAI/LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M) (LNN ๊ธฐ๋ฐ˜) | | **ํŒŒ๋ผ๋ฏธํ„ฐ** | 354M | | **ํ•™์Šต ๋ฐ์ดํ„ฐ** | [gyung/toolbench-lfm-chatml](https://huggingface.co/datasets/gyung/toolbench-lfm-chatml) (187,494 ํ•™์Šต ์˜ˆ์‹œ) | | **์ถœ๋ ฅ ํ˜•์‹** | ReAct โ€” `Thought: / Action: / Action Input:` | | **ํ•™์Šต ๋ฐฉ์‹** | Full SFT (TRL `SFTTrainer`) | | **์ •๋ฐ€๋„** | BF16 | | **ํ•™์Šต ํ™˜๊ฒฝ** | NVIDIA H100 80GB ร— 1 (VESSL AI) | --- ### ํ•™์Šต ์„ค์ • ๋…ผ๋ฌธ *arXiv:2512.15943v1*์˜ ํ•˜์ดํผํŒŒ๋ผ๋ฏธํ„ฐ๋ฅผ ์žฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค. ```python SFTConfig( output_dir="./sft-output", # === ํ•™์Šต ํŒŒ๋ผ๋ฏธํ„ฐ (๋…ผ๋ฌธ ๊ธฐ๋ฐ˜) === num_train_epochs=1, per_device_train_batch_size=8, # H100 80GB: 350M BF16์ด๋ฉด 16 ์—ฌ์œ  gradient_accumulation_steps=4, # effective batch size = 8 ร— 4 = 32 gradient_checkpointing=True, # === ์ตœ์ ํ™” (๋…ผ๋ฌธ ์„ค์ •) === learning_rate=5e-5, # ๋…ผ๋ฌธ: 5ร—10โปโต lr_scheduler_type="cosine", warmup_steps=100, # ๋…ผ๋ฌธ: 100 warmup steps max_grad_norm=0.3, # ๋…ผ๋ฌธ: aggressive clipping weight_decay=0.01, # ๋…ผ๋ฌธ: AdamW 0.01 optim="adamw_torch", # === ์ •๋ฐ€๋„ (H100: BF16 ๋„ค์ดํ‹ฐ๋ธŒ) === bf16=True, fp16=False, # === ์‹œํ€€์Šค ์„ค์ • === max_length=8192, # ๋…ผ๋ฌธ: 8192 tokens # === ์ฒดํฌํฌ์ธํŠธ + Hub ์—…๋กœ๋“œ === # ์ด ~5,800 steps โ†’ 500 step๋งˆ๋‹ค ์ €์žฅ โ†’ ~12ํšŒ ์ฒดํฌํฌ์ธํŠธ logging_steps=50, save_strategy="steps", save_steps=500, # ์ž์ฃผ ์ €์žฅ (์žฅ์•  ๋Œ€๋น„ + ์ค‘๊ฐ„ ์„ฑ๋Šฅ ๋น„๊ต) save_total_limit=5, # === HuggingFace Hub ์—…๋กœ๋“œ === push_to_hub=True, hub_model_id="gyung/LFM2-350M-ToolLLaMA", hub_strategy="every_save", # ๋งค ์ฒดํฌํฌ์ธํŠธ๋งˆ๋‹ค HF ์—…๋กœ๋“œ # === ๋ฐ์ดํ„ฐ์…‹ ์„ค์ • === dataset_text_field="messages", packing=False, report_to="none", ) ``` - **์ด ํ•™์Šต Step**: 5,891 (187,494 / 32) - **ํ•™์Šต ์‹œ๊ฐ„**: 4์‹œ๊ฐ„ 4๋ถ„ 14์ดˆ (H100 80GB ร— 1) - **์ตœ์ข… Loss**: 0.1668 - **์ฒดํฌํฌ์ธํŠธ**: ๋งค 500 step๋งˆ๋‹ค ์ž๋™ HuggingFace ์—…๋กœ๋“œ #### Training Loss Curve | Step | Loss | Step | Loss | Step | Loss | |------|------|------|------|------|------| | 50 | 1.5385 | 500 | 0.3496 | 2000 | 0.1959 | | 100 | 0.6595 | 1000 | 0.2441 | 3000 | 0.1717 | | 200 | 0.4875 | 1500 | 0.2223 | 4000 | 0.1746 | | 300 | 0.4343 | 1800 | 0.2081 | 5000 | 0.1743 | | | | | | **5850** | **0.1668** | ํ•™์Šต ์ดˆ๋ฐ˜ ๊ธ‰๊ฒฉํ•œ loss ๊ฐ์†Œ ํ›„, ~1000 step ์ดํ›„ ์•ˆ์ •์ ์œผ๋กœ ์ˆ˜๋ ด. ์ตœ์ข… loss **0.1668**. #### ํ•™์Šต ํ†ต๊ณ„ | ํ•ญ๋ชฉ | ๊ฐ’ | |------|----| | **์ตœ๋Œ€ VRAM** | 53.73 GB / 80 GB | | **ํ‰๊ท  ํ•™์Šต ์†๋„** | 12.86 samples/s, 0.40 steps/s | | **ํ‰๊ท  Train Loss** | 0.2236 | | **Mean Token Accuracy** | 95.64% | | **์ด ํ•™์Šต ํ† ํฐ** | ~500M tokens | | **Total FLOPs** | 1.42 ร— 10ยนโธ | #### Framework Versions - **TRL**: 0.20.0 - **Transformers**: 4.54.0 - **PyTorch**: 2.9.1+cu128 - **Datasets**: 4.6.0 - **Tokenizers**: 0.21.4 --- ### ์ตœ์ข… ๋ชจ๋ธ ํ…Œ์ŠคํŠธ #### 1) ๋„๊ตฌ ๋ชฉ๋ก ์—†์ด ์ž์œ  ์ƒ์„ฑ | Query | Thought | Action | Action Input | ํ‰๊ฐ€ | |-------|---------|--------|-------------|------| | "What is the current weather in Seoul?" | โœ… ๋…ผ๋ฆฌ์  | `weather` | `{"location": "Seoul, South Korea"}` | โญโญโญโญโญ | | "Search for the latest news about AI" | โœ… ๋…ผ๋ฆฌ์  | `news_api` | ์ ์ ˆํ•œ ํŒŒ๋ผ๋ฏธํ„ฐ | โญโญโญโญ | | "Find info about movie 'Inception'" | โœ… ๋…ผ๋ฆฌ์  | `search` | `{"query": "Inception"}` | โญโญโญโญ | > ๋„๊ตฌ ์ด๋ฆ„์ด genericํ•œ ๊ฒƒ์€ system prompt์— ๋„๊ตฌ ๋ชฉ๋ก์„ ๋ช…์‹œํ•˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ. ํ˜•์‹๊ณผ ์ถ”๋ก ์€ ์™„๋ฒฝ. #### 2) ๋„๊ตฌ ๋ชฉ๋ก ํฌํ•จ ํ…Œ์ŠคํŠธ โ€” **4/4 (100%)** ToolBench ํ˜•์‹์œผ๋กœ ์‚ฌ์šฉ ๊ฐ€๋Šฅํ•œ ๋„๊ตฌ๋ฅผ system prompt์— ๋ช…์‹œํ•œ ๊ฒฝ์šฐ: | Query | Expected Action | Predicted Action | Match | |-------|----------------|-----------------|-------| | Current weather in Seoul | `get_current_weather_for_weatherapi` | `get_current_weather_for_weatherapi` | โœ… | | Latest news about AI | `search_news_for_newsapi` | `search_news_for_newsapi` | โœ… | | Movie info for 'Inception' | `search_movie_for_imdb` | `search_movie_for_imdb` | โœ… | | Ultimate Oscillator BTCUSDT | `ultimateoscillator_for_qvantana` | `ultimateoscillator_for_qvantana` | โœ… |
๐Ÿ“ ์‹ค์ œ ์‘๋‹ต ์˜ˆ์‹œ (ํด๋ฆญํ•˜์—ฌ ํŽผ์น˜๊ธฐ) **Query**: "Get the Ultimate Oscillator data for BTCUSDT on Binance with daily interval." ``` Thought: I need to call the 'ultimateoscillator_for_qvantana' function to get the Ultimate Oscillator data for BTCUSDT on Binance with a daily interval. The current arguments for the function call are: exchange - "Binance", market - "BTCUSDT", and interval - "1d". This will allow me to retrieve the necessary data for analysis. Action: ultimateoscillator_for_qvantana Action Input: { "exchange": "Binance", "market": "BTCUSDT", "interval": "1d" } ```
> ๐Ÿ’ก ๋„๊ตฌ ๋ชฉ๋ก์ด 2~3๊ฐœ๋กœ ๋ช…ํ™•ํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค์—์„œ๋Š” **100% ์ •ํ™•๋„**. ๋ณต์žกํ•œ ์‹œ๋‚˜๋ฆฌ์˜ค(๋„๊ตฌ 10๊ฐœ+)์—์„œ๋Š” ToolBench eval ๊ธฐ์ค€ ~55%. --- ### ํ‰๊ฐ€ ๊ฒฐ๊ณผ #### ํ‰๊ฐ€ ํ™˜๊ฒฝ - **Hardware**: NVIDIA A100-SXM4-80GB - **ํ‰๊ฐ€ ๋ฐ์ดํ„ฐ**: `gyung/toolbench-lfm-chatml` (eval split, 762 samples) - **์ƒ์„ฑ ์„ค์ •**: `max_new_tokens=512`, `temperature=0.1` #### ํ‰๊ฐ€ ์ง€ํ‘œ | ์ง€ํ‘œ | ์„ค๋ช… | |------|------| | **Completion Rate** | ์˜๋ฏธ ์žˆ๋Š” ์‘๋‹ต(10์ž ์ด์ƒ)์„ ์ƒ์„ฑํ•œ ๋น„์œจ | | **Format Accuracy** | ReAct ํ˜•์‹(`Thought:` + `Action:`) ํฌํ•จ ๋น„์œจ | | **Action Match Rate** | ์ •๋‹ต Action ์ด๋ฆ„๊ณผ ์ •ํ™•ํžˆ ์ผ์น˜ํ•˜๋Š” ๋น„์œจ | #### ๊ฒฐ๊ณผ ๋น„๊ต | ๋ชจ๋ธ | Params | Completion | Format Acc. | Action Match | |------|--------|------------|-------------|--------------| | LFM2-350M **(Base)** | 354M | 100% | 62.7% | 0.0% | | LFM2-350M-ToolLLaMA (1K step) | 354M | 100% | 100.0% | 55.1% | | LFM2-350M-ToolLLaMA (2.5K step) | 354M | 100% | 100.0% | 54.1% | | **LFM2-350M-ToolLLaMA (5.9K step, ์ตœ์ข…)** | **354M** | **100%** | **99.9%** | **56.3%** | | LFM2-1.2B-Tool (Liquid AI ๊ณต์‹) | 1.2B | 100% | 97.9% | 0.0% | | GPT-5-Nano (OpenAI, ํ•™์Šต ์—†์Œ) | โ€” | 100%* | 78.6%* | 8.5%* | | ToolLLaMA-2-7b-v2 (๋…ผ๋ฌธ ์›๋ณธ) | 6.7B | 100% | 99.7% | 75.3% | #### ํ•ต์‹ฌ ์ธ์‚ฌ์ดํŠธ 1. **SFT ํšจ๊ณผ**: ํ•™์Šต ์ „ 0.0% โ†’ ์ตœ์ข… **56.3%** Action Match Rate, Format Accuracy **99.9%** ๋‹ฌ์„ฑ 2. **์ตœ์  ์ฒดํฌํฌ์ธํŠธ**: 1K step(55.1%) โ†’ 2.5K(54.1%) โ†’ 5.9K(**56.3%**) โ€” ์ตœ์ข… ๋ชจ๋ธ์ด ๊ฐ€์žฅ ๋†’์€ ์„ฑ๋Šฅ 3. **LFM2-1.2B-Tool ๋น„๊ต**: 3.5๋ฐฐ ํฐ ๊ณต์‹ ๋ชจ๋ธ(0.0%)์„ ์••๋„ โ€” ํ•™์Šต ๋ฐ์ดํ„ฐ ํ˜•์‹ ์ •๋ ฌ์˜ ์ค‘์š”์„ฑ 4. **ToolLLaMA-7B ๋Œ€๋น„**: 20๋ฐฐ ์ž‘์€ ๋ชจ๋ธ๋กœ 75.3% ๋Œ€๋น„ 56.3% ๋‹ฌ์„ฑ (74.8% ์ˆ˜์ค€) --- ### ๋…ผ๋ฌธ ํ‰๊ฐ€ ๋ฐฉ์‹๊ณผ์˜ ์ฐจ์ด ๋…ผ๋ฌธ์—์„œ ๋ณด๊ณ ๋œ OPT-350M์˜ **Pass Rate 77.55%** ์™€ ๋ณธ ๋ชจ๋ธ์˜ **Action Match Rate**๋Š” **์ง์ ‘ ๋น„๊ต๊ฐ€ ๋ถˆ๊ฐ€๋Šฅ**ํ•ฉ๋‹ˆ๋‹ค. | ํ•ญ๋ชฉ | ๋…ผ๋ฌธ (ToolEval) | ๋ณธ ํ”„๋กœ์ ํŠธ | |------|----------------|-------------| | **ํ‰๊ฐ€ ๋ฐฉ๋ฒ•** | ChatGPT-based judge (4ํšŒ ํŒ์ • + ๋‹ค์ˆ˜๊ฒฐ) | ๋ฌธ์ž์—ด ์ •ํ™• ์ผ์น˜ | | **ํ‰๊ฐ€ ๊ธฐ์ค€** | ํ•ด๊ฒฐ ๊ฒฝ๋กœ์˜ ์ ์ ˆ์„ฑ (Pass/Fail) | Action ์ด๋ฆ„ ์ •ํ™• ์ผ์น˜ | | **ํ…Œ์ŠคํŠธ์…‹** | 1,100 queries (G1~G3, 6๊ฐœ ์นดํ…Œ๊ณ ๋ฆฌ) | 762 samples (eval split) | | **์‹คํ–‰ ๋ฐฉ์‹** | ๋‹ค๋‹จ๊ณ„ ์ถ”๋ก  (์ตœ๋Œ€ 10ํšŒ ๋ฐ˜๋ณต) | ๋‹จ์ผ ํ„ด ์ƒ์„ฑ | > ๐Ÿ’ก ๋…ผ๋ฌธ์˜ ToolEval์€ ๋ชจ๋ธ์ด ์‹ค์ œ๋กœ ์—ฌ๋Ÿฌ ํ„ด์— ๊ฑธ์ณ tool์„ ํ˜ธ์ถœํ•˜๋ฉฐ ๋ฌธ์ œ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ์ „์ฒด ๊ณผ์ •์„ ChatGPT๊ฐ€ ํ‰๊ฐ€ํ•˜๋Š” ๋ฐฉ์‹์ž…๋‹ˆ๋‹ค. ๋ณธ ํ”„๋กœ์ ํŠธ์˜ Action Match Rate๋Š” **์ฒซ ๋ฒˆ์งธ tool ํ˜ธ์ถœ์˜ ์ •ํ™•ํ•œ ์ด๋ฆ„ ์ผ์น˜**๋งŒ ์ธก์ •ํ•˜๋ฏ€๋กœ, ๋” ๋ณด์ˆ˜์ ์ธ(์—„๊ฒฉํ•œ) ์ง€ํ‘œ์ž…๋‹ˆ๋‹ค. #### LLM-as-Judge ํ‰๊ฐ€ (ToolEval ์Šคํƒ€์ผ) ๋…ผ๋ฌธ์˜ ToolEval์— ๊ฐ€๊นŒ์šด ํ‰๊ฐ€๋ฅผ ์œ„ํ•ด, `eval_judge.py`์—์„œ GPT ๊ธฐ๋ฐ˜ judge๋ฅผ ๊ตฌํ˜„ํ•˜์˜€์Šต๋‹ˆ๋‹ค: ```bash # ๋‹จ์ผ ๋ผ์šด๋“œ ํ‰๊ฐ€ (๋น ๋ฅธ ํ…Œ์ŠคํŠธ) python eval_judge.py --input results/eval_results.json --rounds 1 # ๋…ผ๋ฌธ ์žฌํ˜„ (4๋ผ์šด๋“œ ๋‹ค์ˆ˜๊ฒฐ ํˆฌํ‘œ) python eval_judge.py --input results/eval_results.json --rounds 4 ``` ์ด judge๋Š” Action ์ด๋ฆ„์˜ ์ •ํ™•ํ•œ ์ผ์น˜๊ฐ€ ์•„๋‹Œ, **๋„๊ตฌ ์„ ํƒ์˜ ๋…ผ๋ฆฌ์  ์ ์ ˆ์„ฑ**์„ ๊ธฐ์ค€์œผ๋กœ ํŒ์ •ํ•ฉ๋‹ˆ๋‹ค. --- ### ๋ฐ์ดํ„ฐ ํ˜•์‹ ๋ณธ ๋ชจ๋ธ์€ **ChatML** ํ˜•์‹์˜ ๋Œ€ํ™” ๋ฐ์ดํ„ฐ๋กœ ํ•™์Šต๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ```json { "messages": [ {"role": "system", "content": "You are AutoGPT, you can use many tools(functions) to do the following task..."}, {"role": "user", "content": "์‚ฌ์šฉ์ž ์ฟผ๋ฆฌ..."}, {"role": "assistant", "content": "Thought: ...\nAction: tool_name\nAction Input: {\"param\": \"value\"}"}, {"role": "tool", "content": "{\"response\": ...}"} ] } ``` ์›๋ณธ ToolBench์˜ `"function"` ์—ญํ• ์€ LFM2 ChatML ํ˜ธํ™˜์„ ์œ„ํ•ด `"tool"`๋กœ ๋ณ€ํ™˜ํ•˜์˜€์Šต๋‹ˆ๋‹ค. --- ### ์‹ค์ „ ๋ฐฐํฌ ์ „๋žต 354M ๋ชจ๋ธ์˜ ๊ฐ•์ (๋น ๋ฅธ ์ถ”๋ก , ์ €๋น„์šฉ, ์—ฃ์ง€ ๋ฐฐํฌ)์„ ์‚ด๋ฆฌ๋ ค๋ฉด, **๋ผ์šฐํ„ฐ + ๋„๊ตฌ ์„ ๋ณ„ ์ฃผ์ž…** ํŒŒ์ดํ”„๋ผ์ธ์ด ๊ฐ€์žฅ ํšจ๊ณผ์ ์ž…๋‹ˆ๋‹ค. ``` ์‚ฌ์šฉ์ž ์ฟผ๋ฆฌ โ†’ [๋ผ์šฐํ„ฐ: ์ธํ…ํŠธ ๋ถ„๋ฅ˜] โ†’ ํ•ด๋‹น ๋„๊ตฌ 2~3๊ฐœ๋งŒ ํ”„๋กฌํ”„ํŠธ์— ์ฃผ์ž… โ†’ LFM2-350M โ†’ ~100% ์ •ํ™•๋„ ``` | ๋น„๊ต | ๋„๊ตฌ ์ „์ฒด ์ฃผ์ž… (ToolBench์‹) | ๋ผ์šฐํ„ฐ + ์„ ๋ณ„ ์ฃผ์ž… | |------|---------------------------|-------------------| | ํ”„๋กฌํ”„ํŠธ ๋„๊ตฌ ์ˆ˜ | 10~50๊ฐœ | **2~3๊ฐœ** | | Action Match | ~56% | **~100%** | | ํ”„๋กฌํ”„ํŠธ ๊ธธ์ด | ์ˆ˜์ฒœ ํ† ํฐ | ์ˆ˜๋ฐฑ ํ† ํฐ | | ์ถ”๋ก  ์†๋„ | ๋А๋ฆผ | **๋น ๋ฆ„** | ```python # Stage 1: ๋ผ์šฐํ„ฐ (์ธ์ฝ”๋” ๋ชจ๋ธ / ์ž„๋ฒ ๋”ฉ ์œ ์‚ฌ๋„ ๊ธฐ๋ฐ˜) TOOL_CATEGORIES = { "weather": ["get_current_weather_for_weatherapi", "get_forecast_for_weatherapi"], "finance": ["ultimateoscillator_for_qvantana", "typicalprice_for_qvantana"], "news": ["search_news_for_newsapi", "get_top_headlines_for_newsapi"], } # Stage 2: ํ•ด๋‹น ๋„๊ตฌ๋งŒ ํ”„๋กฌํ”„ํŠธ์— ์ฃผ์ž… โ†’ LFM2-350M โ†’ ~100% category = classify_query(user_query) # BERT, ์ฝ”์‚ฌ์ธ ์œ ์‚ฌ๋„ ๋“ฑ tools = TOOL_CATEGORIES[category] # 2~3๊ฐœ๋งŒ ์„ ํƒ prompt = build_prompt(tools, user_query) response = model.generate(prompt) # โ†’ ๊ฑฐ์˜ 100% ``` ์ด๊ฒƒ์ด ๋…ผ๋ฌธ์—์„œ ๋งํ•˜๋Š” **"Small Language Models for Efficient Agentic Tool Calling"**์˜ ์‹ค์ „์  ์˜๋ฏธ์ž…๋‹ˆ๋‹ค: **์ž‘์€ ๋ชจ๋ธ + ์Šค๋งˆํŠธ ๋ผ์šฐํŒ… = ํฐ ๋ชจ๋ธ๋ณด๋‹ค ๋น ๋ฅด๊ณ  ์ €๋ ดํ•˜๊ณ  ์ •ํ™•ํ•œ** ์‹œ์Šคํ…œ. --- ### ์ œํ•œ ์‚ฌํ•ญ - ๐Ÿ“Š **ํ‰๊ฐ€ ์ง€ํ‘œ ํ•œ๊ณ„** โ€” Action Match Rate๋Š” ์—„๊ฒฉํ•œ ๋ฌธ์ž์—ด ๋งค์นญ์œผ๋กœ, ์˜๋ฏธ์ ์œผ๋กœ ๋™์ผํ•œ ๋„๊ตฌ๋ฅผ ๋‹ค๋ฅธ ์ด๋ฆ„์œผ๋กœ ์˜ˆ์ธกํ•œ ๊ฒฝ์šฐ ์‹คํŒจ๋กœ ์ฒ˜๋ฆฌ - ๐Ÿง  **๋‹จ์ผ ํ„ด ํ‰๊ฐ€** โ€” ๋ฉ€ํ‹ฐ ํ„ด ์—์ด์ „ํŠธ ์‹œ๋‚˜๋ฆฌ์˜ค(๋„๊ตฌ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ›๊ณ  ๋‹ค์‹œ ์ถ”๋ก )์— ๋Œ€ํ•œ ํ‰๊ฐ€ ๋ฏธ์‹ค์‹œ - ๐Ÿ—๏ธ **์•„ํ‚คํ…์ฒ˜ ์ฐจ์ด** โ€” ๋…ผ๋ฌธ์€ OPT-350M(Transformer), ๋ณธ ๋ชจ๋ธ์€ LFM2-350M(LNN ๊ธฐ๋ฐ˜)์œผ๋กœ ์ง์ ‘์ ์ธ ์•„ํ‚คํ…์ฒ˜ ๋น„๊ต๋Š” ๋ถˆ๊ฐ€ --- ### ํ–ฅํ›„ ๊ฐœ์„  ๋ฐฉํ–ฅ: ๊ธธ์ด๋ณ„ ๋ถ„ํ•  ํ•™์Šต ํ˜„์žฌ ํ•™์Šต์€ ๋ชจ๋“  ์ƒ˜ํ”Œ์„ `max_length=8192`๋กœ ํ†ต์ผํ•˜์—ฌ ์ฒ˜๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ToolBench ๋ฐ์ดํ„ฐ์˜ ๋Œ€๋ถ€๋ถ„์€ 1K~4K ํ† ํฐ ๋ฒ”์œ„์ด๋ฏ€๋กœ, **๊ธธ์ด๋ณ„๋กœ ๋ฒ„ํ‚ท์„ ๋‚˜๋ˆ  ๋ฐฐ์น˜ ์‚ฌ์ด์ฆˆ๋ฅผ ๋‹ค๋ฅด๊ฒŒ** ์„ค์ •ํ•˜๋ฉด ํ•™์Šต ์†๋„๋ฅผ ํฌ๊ฒŒ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. | ๋ฒ„ํ‚ท | context length | batch size | ํšจ๊ณผ | |------|---------------|------------|------| | ์งง์€ ๋ฐ์ดํ„ฐ | ~1024 | 64~128 | ํŒจ๋”ฉ ๋‚ญ๋น„ ์ตœ์†Œํ™” | | ์ค‘๊ฐ„ ๋ฐ์ดํ„ฐ | ~2048โ€“4096 | 16~32 | ๋Œ€๋ถ€๋ถ„์˜ ๋ฐ์ดํ„ฐ ํ•ด๋‹น | | ๊ธด ๋ฐ์ดํ„ฐ | ~8192 | 8 | ํ˜„์žฌ์™€ ๋™์ผ | - **์†๋„**: ์ „์ฒด ํ•™์Šต ์‹œ๊ฐ„ 50~60% ๋‹จ์ถ• ๊ฐ€๋Šฅ (4์‹œ๊ฐ„ โ†’ ~1.5~2์‹œ๊ฐ„) - **์„ฑ๋Šฅ**: ํŒจ๋”ฉ ๊ฐ์†Œ๋กœ gradient ์ถ”์ •์ด ์•ˆ์ •์ ์ด ๋˜์–ด, ๋™์ผํ•˜๊ฑฐ๋‚˜ ์•ฝ๊ฐ„ ๋‚˜์€ ์„ฑ๋Šฅ ๊ธฐ๋Œ€ - **๊ฐ„ํŽธํ•œ ๋Œ€์•ˆ**: TRL์˜ `packing=True` ์˜ต์…˜ โ€” ์งง์€ ์‹œํ€€์Šค ์—ฌ๋Ÿฌ ๊ฐœ๋ฅผ ํ•˜๋‚˜์— ์ด์–ด๋ถ™์—ฌ ํŒจ๋”ฉ ๋‚ญ๋น„๋ฅผ ์—†์•จ ์ˆ˜ ์žˆ์Œ --- ### ํ•™์Šต ์žฌํ˜„ #### ์‚ฌ์ „ ์ค€๋น„ 1. **HuggingFace ํ† ํฐ** (Write ๊ถŒํ•œ) โ€” [๋ฐœ๊ธ‰ ๋งํฌ](https://huggingface.co/settings/tokens) 2. **GPU ํ™˜๊ฒฝ** โ€” NVIDIA H100/A100 80GB ๊ถŒ์žฅ #### ํ•™์Šต ์‹คํ–‰ ```bash # VESSL AI์—์„œ ์‹คํ–‰ vessl run create -f vessl_notebook.yaml # โ†’ Jupyter์—์„œ notebooks/01_train_trl.ipynb ์—…๋กœ๋“œ ํ›„ ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰ ``` #### ํ‰๊ฐ€ ์‹คํ–‰ ```bash # VESSL AI ๊ฐ™์€ ์ธ์Šคํ„ด์Šค์—์„œ # โ†’ notebooks/03_evaluate.ipynb ์—…๋กœ๋“œ ํ›„ ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰ ``` --- ### ์ฐธ๊ณ  ์ž๋ฃŒ - ๐Ÿ“„ **๋…ผ๋ฌธ**: [Small Language Models for Efficient Agentic Tool Calling](https://arxiv.org/html/2512.15943v1) - ๐Ÿค— **Base Model**: [LiquidAI/LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M) - ๐Ÿ“Š **Dataset**: [gyung/toolbench-lfm-chatml](https://huggingface.co/datasets/gyung/toolbench-lfm-chatml) - ๐Ÿ”ง **ToolBench**: [OpenBMB/ToolBench](https://github.com/OpenBMB/ToolBench) - ๐Ÿ“– **Liquid AI Docs**: [Tool Use Guide](https://docs.liquid.ai/lfm/key-concepts/tool-use) --- ### Citation ```bibtex @misc{vonwerra2022trl, title = {{TRL: Transformer Reinforcement Learning}}, author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec}, year = 2020, journal = {GitHub repository}, publisher = {GitHub}, howpublished = {\url{https://github.com/huggingface/trl}} } ``` ```bibtex @article{qin2023toolllm, title = {ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs}, author = {Qin, Yujia and others}, journal = {arXiv preprint arXiv:2307.16789}, year = {2023} } ``` ```bibtex @article{liquidai2025lfm2, title={LFM2 Technical Report}, author={Liquid AI}, journal={arXiv preprint arXiv:2511.23404}, year={2025} } ``` --- --- ## ๐Ÿ‡บ๐Ÿ‡ธ English > **A 354M parameter ReAct agent for Tool Calling, fine-tuned on ToolBench** [![Base Model](https://img.shields.io/badge/๐Ÿค—%20Base-LFM2--350M-blue)](https://huggingface.co/LiquidAI/LFM2-350M) [![Dataset](https://img.shields.io/badge/๐Ÿ“Š%20Dataset-ToolBench-green)](https://huggingface.co/datasets/gyung/toolbench-lfm-chatml) [![Paper](https://img.shields.io/badge/๐Ÿ“„%20Paper-arXiv%3A2512.15943-red)](https://arxiv.org/html/2512.15943v1) This model is a full SFT of [Liquid AI's LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M) on the [ToolBench dataset](https://github.com/OpenBMB/ToolBench) (187,494 training examples), trained to perform **Tool Calling in the ReAct (Thought/Action/Action Input) format**. It reproduces the experiment from *"[Small Language Models for Efficient Agentic Tool Calling](https://arxiv.org/html/2512.15943v1)"* (arXiv:2512.15943v1) using the LFM2 architecture (LNN-based). --- ### Quick Start ```python from transformers import AutoTokenizer, AutoModelForCausalLM import torch model_id = "gyung/LFM2-350M-ToolLLaMA" tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto", ) system_prompt = """You are AutoGPT, you can use many tools(functions) to do the following task. At each step, you need to give your thought to analyze the status now and what to do next, with a function call to actually execute your step. Your output should follow this format: Thought: Action: Action Input:""" messages = [ {"role": "system", "content": system_prompt}, {"role": "user", "content": "What is the current weather in Seoul, South Korea?"}, ] inputs = tokenizer.apply_chat_template( messages, return_tensors="pt", add_generation_prompt=True ).to(model.device) with torch.no_grad(): outputs = model.generate(inputs, max_new_tokens=256, do_sample=True, temperature=0.1) result = tokenizer.decode(outputs[0][len(inputs[0]):], skip_special_tokens=True) print(result) ``` **Actual Output Example:** ``` Thought: To find the current weather in Seoul, South Korea, I need to use the "weather" API. I will call the "weather" function with the argument "location" set to "Seoul, South Korea" to retrieve the weather information for that location. Action: weather Action Input: {"location": "Seoul, South Korea"} ``` --- ### Model Details | Item | Details | |------|---------| | **Base Model** | [LiquidAI/LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M) (LNN-based) | | **Parameters** | 354M | | **Training Data** | [gyung/toolbench-lfm-chatml](https://huggingface.co/datasets/gyung/toolbench-lfm-chatml) (187,494 examples) | | **Output Format** | ReAct โ€” `Thought: / Action: / Action Input:` | | **Training Method** | Full SFT (TRL `SFTTrainer`) | | **Precision** | BF16 | | **Training Hardware** | NVIDIA H100 80GB ร— 1 (VESSL AI) | --- ### Training Configuration Hyperparameters reproduced from *arXiv:2512.15943v1*. ```python SFTConfig( output_dir="./sft-output", # === Training Parameters (Paper-based) === num_train_epochs=1, per_device_train_batch_size=8, # H100 80GB: 350M BF16 fits 16 easily gradient_accumulation_steps=4, # effective batch size = 8 ร— 4 = 32 gradient_checkpointing=True, # === Optimization (Paper Settings) === learning_rate=5e-5, # Paper: 5ร—10โปโต lr_scheduler_type="cosine", warmup_steps=100, # Paper: 100 warmup steps max_grad_norm=0.3, # Paper: aggressive clipping weight_decay=0.01, # Paper: AdamW 0.01 optim="adamw_torch", # === Precision (H100: native BF16) === bf16=True, fp16=False, # === Sequence Settings === max_length=8192, # Paper: 8192 tokens # === Checkpointing + Hub Upload === # Total ~5,800 steps โ†’ save every 500 โ†’ ~12 checkpoints logging_steps=50, save_strategy="steps", save_steps=500, # Frequent saves (fault tolerance + perf comparison) save_total_limit=5, # === HuggingFace Hub Upload === push_to_hub=True, hub_model_id="gyung/LFM2-350M-ToolLLaMA", hub_strategy="every_save", # Upload to HF at every checkpoint # === Dataset Settings === dataset_text_field="messages", packing=False, report_to="none", ) ``` - **Total Training Steps**: 5,891 (187,494 / 32) - **Training Time**: 4h 4m 14s (H100 80GB ร— 1) - **Final Loss**: 0.1668 - **Checkpoints**: Auto-uploaded to HuggingFace every 500 steps #### Training Loss Curve | Step | Loss | Step | Loss | Step | Loss | |------|------|------|------|------|------| | 50 | 1.5385 | 500 | 0.3496 | 2000 | 0.1959 | | 100 | 0.6595 | 1000 | 0.2441 | 3000 | 0.1717 | | 200 | 0.4875 | 1500 | 0.2223 | 4000 | 0.1746 | | 300 | 0.4343 | 1800 | 0.2081 | 5000 | 0.1743 | | | | | | **5850** | **0.1668** | Rapid loss drop in early training, stabilizing after ~1000 steps. Final loss: **0.1668**. #### Training Statistics | Item | Value | |------|-------| | **Peak VRAM** | 53.73 GB / 80 GB | | **Avg. Throughput** | 12.86 samples/s, 0.40 steps/s | | **Avg. Train Loss** | 0.2236 | | **Mean Token Accuracy** | 95.64% | | **Total Tokens Trained** | ~500M tokens | | **Total FLOPs** | 1.42 ร— 10ยนโธ | #### Framework Versions - **TRL**: 0.20.0 - **Transformers**: 4.54.0 - **PyTorch**: 2.9.1+cu128 - **Datasets**: 4.6.0 - **Tokenizers**: 0.21.4 --- ### Final Model Test #### 1) Free generation (no tool list) | Query | Thought | Action | Action Input | Rating | |-------|---------|--------|-------------|--------| | "What is the current weather in Seoul?" | โœ… Logical | `weather` | `{"location": "Seoul, South Korea"}` | โญโญโญโญโญ | | "Search for the latest news about AI" | โœ… Logical | `news_api` | Appropriate params | โญโญโญโญ | | "Find info about movie 'Inception'" | โœ… Logical | `search` | `{"query": "Inception"}` | โญโญโญโญ | > Generic tool names are expected since no tool list was given. Format and reasoning are perfect. #### 2) With tool list in prompt โ€” **4/4 (100%)** When available tools are specified in the system prompt (ToolBench style): | Query | Expected Action | Predicted Action | Match | |-------|----------------|-----------------|-------| | Current weather in Seoul | `get_current_weather_for_weatherapi` | `get_current_weather_for_weatherapi` | โœ… | | Latest news about AI | `search_news_for_newsapi` | `search_news_for_newsapi` | โœ… | | Movie info for 'Inception' | `search_movie_for_imdb` | `search_movie_for_imdb` | โœ… | | Ultimate Oscillator BTCUSDT | `ultimateoscillator_for_qvantana` | `ultimateoscillator_for_qvantana` | โœ… |
๐Ÿ“ Actual response example (click to expand) **Query**: "Get the Ultimate Oscillator data for BTCUSDT on Binance with daily interval." ``` Thought: I need to call the 'ultimateoscillator_for_qvantana' function to get the Ultimate Oscillator data for BTCUSDT on Binance with a daily interval. The current arguments for the function call are: exchange - "Binance", market - "BTCUSDT", and interval - "1d". This will allow me to retrieve the necessary data for analysis. Action: ultimateoscillator_for_qvantana Action Input: { "exchange": "Binance", "market": "BTCUSDT", "interval": "1d" } ```
> ๐Ÿ’ก **100% accuracy** with 2โ€“3 clear tool choices. For complex scenarios (10+ tools), ToolBench eval shows ~55% Action Match Rate. --- ### Evaluation Results #### Evaluation Setup - **Hardware**: NVIDIA A100-SXM4-80GB - **Eval Data**: `gyung/toolbench-lfm-chatml` (eval split, 762 samples) - **Generation Settings**: `max_new_tokens=512`, `temperature=0.1` #### Metrics | Metric | Description | |--------|-------------| | **Completion Rate** | Ratio of non-empty responses (โ‰ฅ10 chars) | | **Format Accuracy** | Ratio containing ReAct format (`Thought:` + `Action:`) | | **Action Match Rate** | Exact string match with ground truth Action name | #### Results Comparison | Model | Params | Completion | Format Acc. | Action Match | |-------|--------|------------|-------------|--------------| | LFM2-350M **(Base)** | 354M | 100% | 62.7% | 0.0% | | LFM2-350M-ToolLLaMA (1K step) | 354M | 100% | 100.0% | 55.1% | | LFM2-350M-ToolLLaMA (2.5K step) | 354M | 100% | 100.0% | 54.1% | | **LFM2-350M-ToolLLaMA (5.9K step, Final)** | **354M** | **100%** | **99.9%** | **56.3%** | | LFM2-1.2B-Tool (Liquid AI Official) | 1.2B | 100% | 97.9% | 0.0% | | GPT-5-Nano (OpenAI, no ToolBench training) | โ€” | 100%* | 78.6%* | 8.5%* | | ToolLLaMA-2-7b-v2 (Paper Original) | 6.7B | 100% | 99.7% | 75.3% | #### Key Insights 1. **SFT Effect**: Base 0.0% โ†’ Final **56.3%** Action Match Rate, Format Accuracy **99.9%** 2. **Best checkpoint**: 1K(55.1%) โ†’ 2.5K(54.1%) โ†’ 5.9K(**56.3%**) โ€” final model achieves the highest score 3. **vs LFM2-1.2B-Tool**: Outperforms 3.5ร— larger official model (0.0%) โ€” importance of training data format alignment 4. **vs ToolLLaMA-7B**: 56.3% vs 75.3% with a 20ร— smaller model (74.8% of 7B performance) --- ### Difference from Paper's Evaluation The paper's reported OPT-350M **Pass Rate of 77.55%** and this model's **Action Match Rate** are **not directly comparable**. | Aspect | Paper (ToolEval) | This Project | |--------|-----------------|--------------| | **Method** | ChatGPT-based judge (4 rounds + majority vote) | Exact string match | | **Criteria** | Solution path adequacy (Pass/Fail) | Exact Action name match | | **Test Set** | 1,100 queries (G1~G3, 6 categories) | 762 samples (eval split) | | **Execution** | Multi-step reasoning (up to 10 iterations) | Single-turn generation | > ๐Ÿ’ก The paper's ToolEval evaluates the entire multi-turn tool-calling process via ChatGPT judge. This project's Action Match Rate only measures **exact first-turn tool name match**, making it a more conservative (stricter) metric. #### LLM-as-Judge Evaluation (ToolEval Style) For evaluation closer to the paper's ToolEval, a GPT-based judge is implemented in `eval_judge.py`: ```bash # Single round (quick test) python eval_judge.py --input results/eval_results.json --rounds 1 # Paper reproduction (4-round majority voting) python eval_judge.py --input results/eval_results.json --rounds 4 ``` This judge evaluates **logical appropriateness of tool selection** rather than exact string matching. --- ### Data Format The model was trained on **ChatML**-formatted conversation data. ```json { "messages": [ {"role": "system", "content": "You are AutoGPT, you can use many tools(functions) to do the following task..."}, {"role": "user", "content": "User query..."}, {"role": "assistant", "content": "Thought: ...\nAction: tool_name\nAction Input: {\"param\": \"value\"}"}, {"role": "tool", "content": "{\"response\": ...}"} ] } ``` The original ToolBench `"function"` role was converted to `"tool"` for LFM2 ChatML compatibility. --- ### Practical Deployment Strategy To maximize the 354M model's strengths (fast inference, low cost, edge deployment), a **router + selective tool injection** pipeline is most effective. ``` User Query โ†’ [Router: Intent Classification] โ†’ Inject 2-3 relevant tools โ†’ LFM2-350M โ†’ ~100% accuracy ``` | Comparison | All tools injected (ToolBench style) | Router + Selective injection | |------------|-------------------------------------|-----------------------------| | Tools in prompt | 10โ€“50 | **2โ€“3** | | Action Match | ~56% | **~100%** | | Prompt length | Thousands of tokens | Hundreds of tokens | | Inference speed | Slow | **Fast** | ```python # Stage 1: Router (encoder model / embedding similarity) TOOL_CATEGORIES = { "weather": ["get_current_weather_for_weatherapi", "get_forecast_for_weatherapi"], "finance": ["ultimateoscillator_for_qvantana", "typicalprice_for_qvantana"], "news": ["search_news_for_newsapi", "get_top_headlines_for_newsapi"], } # Stage 2: Inject only relevant tools โ†’ LFM2-350M โ†’ ~100% category = classify_query(user_query) # BERT, cosine similarity, etc. tools = TOOL_CATEGORIES[category] # Select only 2-3 prompt = build_prompt(tools, user_query) response = model.generate(prompt) # โ†’ Near 100% ``` This is the practical meaning of **"Small Language Models for Efficient Agentic Tool Calling"**: **small model + smart routing = faster, cheaper, and more accurate** than a single large model. --- ### Limitations - ๐Ÿ“Š **Evaluation metric limitation** โ€” Action Match Rate uses strict string matching; semantically equivalent tools predicted under different names count as failures - ๐Ÿง  **Single-turn evaluation** โ€” Multi-turn agent scenarios (receiving tool results and reasoning again) not yet evaluated - ๐Ÿ—๏ธ **Architecture difference** โ€” Paper uses OPT-350M (Transformer), this model uses LFM2-350M (LNN-based); direct architecture comparison not possible --- ### Potential Improvements: Length-Bucketed Training The current training uses a uniform `max_length=8192` for all samples. However, most ToolBench data falls in the 1Kโ€“4K token range, meaning significant compute is wasted on padding. **Bucketing by sequence length with different batch sizes** could substantially improve training speed. | Bucket | Context Length | Batch Size | Effect | |--------|---------------|------------|--------| | Short data | ~1024 | 64โ€“128 | Minimal padding waste | | Medium data | ~2048โ€“4096 | 16โ€“32 | Covers majority of data | | Long data | ~8192 | 8 | Same as current | - **Speed**: Could reduce total training time by 50โ€“60% (4h โ†’ ~1.5โ€“2h) - **Performance**: Reduced padding leads to more stable gradient estimation โ€” expect equal or slightly better performance - **Simple alternative**: TRL's `packing=True` โ€” concatenates multiple short sequences into one, eliminating padding waste --- ### Reproduction #### Prerequisites 1. **HuggingFace Token** (Write permission) โ€” [Get token](https://huggingface.co/settings/tokens) 2. **GPU Environment** โ€” NVIDIA H100/A100 80GB recommended #### Training ```bash # Run on VESSL AI vessl run create -f vessl_notebook.yaml # โ†’ Upload notebooks/01_train_trl.ipynb in Jupyter and run cells sequentially ``` #### Evaluation ```bash # On the same VESSL AI instance # โ†’ Upload notebooks/03_evaluate.ipynb and run cells sequentially ``` --- ### References - ๐Ÿ“„ **Paper**: [Small Language Models for Efficient Agentic Tool Calling](https://arxiv.org/html/2512.15943v1) - ๐Ÿค— **Base Model**: [LiquidAI/LFM2-350M](https://huggingface.co/LiquidAI/LFM2-350M) - ๐Ÿ“Š **Dataset**: [gyung/toolbench-lfm-chatml](https://huggingface.co/datasets/gyung/toolbench-lfm-chatml) - ๐Ÿ”ง **ToolBench**: [OpenBMB/ToolBench](https://github.com/OpenBMB/ToolBench) - ๐Ÿ“– **Liquid AI Docs**: [Tool Use Guide](https://docs.liquid.ai/lfm/key-concepts/tool-use) --- ### Citation ```bibtex @misc{vonwerra2022trl, title = {{TRL: Transformer Reinforcement Learning}}, author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec}, year = 2020, journal = {GitHub repository}, publisher = {GitHub}, howpublished = {\url{https://github.com/huggingface/trl}} } ``` ```bibtex @article{qin2023toolllm, title = {ToolLLM: Facilitating Large Language Models to Master 16000+ Real-world APIs}, author = {Qin, Yujia and others}, journal = {arXiv preprint arXiv:2307.16789}, year = {2023} } ``` ```bibtex @article{liquidai2025lfm2, title={LFM2 Technical Report}, author={Liquid AI}, journal={arXiv preprint arXiv:2511.23404}, year={2025} } ```