Downloads · 30 days
25
13% of all-time downloads
kamaboko2007/llm_advance_024_enhanced_rules
llm_advance_024_enhanced_rules is a text generation model from kamaboko2007. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This repository provides a highly optimized merged model 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
25
13% of all-time downloads
All-time downloads
186
Public
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 merged model 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 the fully merged model (base + LoRA merged). No separate base model loading is needed.
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
import torch
model_id = "your_huggingface_id/your_model_name" # Change this to your actual repo ID
# 1. Load the customized tokenizer (CRITICAL)
tokenizer = AutoTokenizer.from_pretrained(model_id)
# 2. Load merged model directly
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
# 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))