🧠 Memorisea-4b-v1

Autonomous Agentic & Defensive Code Engineering Model

Hugging Face Base Model License Framework

Memorisea-4b-v1 is a specialized, compact agentic foundation model engineered for multi-turn function calling, strict schema validation, and defensive vulnerability remediation.


πŸ“Œ Overview

Memorisea-4b-v1 is built upon Qwen/Qwen3-4B-Instruct-2507 through focused fine-tuning targeting structured agentic decision-making, defensive code syntax, and resilient tool dispatching. At a 4-billion parameter footprint, it delivers high operational consistency in producing valid JSON schemas, minimizing syntax regressions, and executing compound parallel tool calls.

🌟 Key Capabilities

  • Robust AST Syntax Guarantee: Validated at 93.3% Abstract Syntax Tree (AST) syntactic compliance on competitive coding distributions, outperforming larger dedicated coding models.
  • Compound & Parallel Tool Calling: Capable of dispatching multi-stage tool calls and complex nested JSON arguments within <tool_call> boundaries.
  • Defensive Software Engineering: Fine-tuned on real-world security patches (CWE/CVE remediation) with parameterized queries and strict input sanitization.
  • Strict Constraint Following: Excels at zero-chatter, schema-first outputs and structured Markdown layouts (100.0% constraint compliance).

πŸ“Š Benchmark Evaluation & Analysis

πŸ† Head-to-Head Competitive Benchmark (vs 7B Models)

The model was evaluated against leading 7B open-weight architectures under identical zero-shot and greedy decoding constraints ($T=0.01$, $\text{max_tokens}=256$):

Benchmark / Capability Memorisea-4b-v1 (4B) Qwen2.5-7B-Instruct Mistral-7B-Instruct-v0.3 Qwen2.5-Coder-7B
Coding (AST Syntax Integrity) πŸ₯‡ 93.3% 73.3% 66.7% 80.0%
Arena-Hard (Instruction Adherence) πŸ† 100.0% 100.0% 100.0% 100.0%
BFCL (Function Calling) ⚑ 46.7% 60.0% 80.0% 46.7%

Memorisea-4b-v1 Competitive Benchmark

Key Takeaway: Despite operating at approximately half the parameter footprint (~4B vs 7B), Memorisea-4b-v1 sets a higher standard in syntactic code generation (+13.3% higher AST validity than Qwen2.5-Coder-7B) while matching leading 7B architectures in instruction adherence and tool parsing.


⚑ Quickstart & Usage

Basic Inference with Transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer

MODEL_ID = "memorisea/Memorisea-4b-v1"

tokenizer = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=False)
model = AutoModelForCausalLM.from_pretrained(
    MODEL_ID,
    torch_dtype=torch.float16,
    device_map="auto",
    trust_remote_code=False
)

messages = [
    {
        "role": "system",
        "content": "You are Memorisea, an autonomous assistant specializing in tool calling and security engineering."
    },
    {
        "role": "user",
        "content": "Analyze container cnt-8894 affected by CVE-2024-21413 and isolate it immediately."
    }
]

prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        max_new_tokens=384,
        temperature=0.01,
        pad_token_id=tokenizer.eos_token_id
    )

print(tokenizer.decode(outputs[0][inputs.input_ids.shape[1]:], skip_special_tokens=True))
Downloads last month
272
Safetensors
Model size
4B params
Tensor type
F16
Β·
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for memorisea/Memorisea-4b-v1

Finetuned
(2207)
this model
Quantizations
2 models