Downloads · 30 days
0
kamaboko2007/llm_advance_031_generation_config
llm_advance_031_generation_config is a text generation model from kamaboko2007. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
This repository provides a highly optimized LoRA adapter fine-tuned from Qwen/Qwen3-4B-Instruct-2507. It is specifically engineered to achieve state-of-the-art performance on AgentBench (specifically ALFWorld and DBBe…
Downloads · 30 days
0
Access
Public
Updated Feb 28, 2026
Parameters
4B
8.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8 GB · 100%
From the Hugging Face model README
This repository provides a highly optimized LoRA adapter fine-tuned from Qwen/Qwen3-4B-Instruct-2507. It is specifically engineered to achieve state-of-the-art performance on AgentBench (specifically ALFWorld and DBBench) by solving the catastrophic forgetting and format-collision problems inherent in multi-task agent fine-tuning.
This repository contains LoRA adapter weights only. The base model must be loaded separately.
The true power of this model lies not just in its weights, but in its custom tokenizer_config.json.
We completely overrode the default chat_template using Jinja2 to act as an "Absolute Defense Shield" and a "Dynamic Heuristics Injector".
Depending on the user's prompt, the tokenizer automatically intercepts the input and injects task-specific System Prompts (Cheat Sheets) just before inference:
When MySQL or SQL is detected in the prompt, the model is forced into a DB Agent persona with the following injected rules:
Action: Operation to execute DESCRIBE table_name; and check the correct schema before retrying."When household or Interact with a is detected, the model is forced into an ALFWorld Agent persona:
THOUGHT:/ACTION:) and strictly enforces the stable Think:/Act: format.Nothing happened), analyze why in your Think: step and choose a DIFFERENT action."To maximize reasoning capabilities without exceeding the 4B model's capacity, we used a highly curated "Golden Ratio" dataset:
Hyperparameters:
q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, down_projBecause the magic is embedded in the Jinja2 chat_template, you must use this tokenizer to see the performance gains.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
base_model_id = "Qwen/Qwen3-4B-Instruct-2507"
adapter_id = "your_huggingface_id/your_model_name" # Change this to your actual repo ID
# 1. Load the customized tokenizer (CRITICAL)
tokenizer = AutoTokenizer.from_pretrained(adapter_id)
# 2. Load Base Model & Attach LoRA
model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
model = PeftModel.from_pretrained(model, adapter_id)
# 3. Standard Inference (The Jinja2 template handles the routing automatically)
messages = [
{"role": "user", "content": "You are a specialized MySQL database agent..."}
]
inputs = tokenizer.apply_chat_template(messages, tokenize=True, add_generation_prompt=True, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=512)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))