You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

Hirundo Gemma 4 31B Hardened

This repository contains a behaviorally hardened derivative of google/gemma-4-31B-it. Hirundo modified the model to reduce prompt-injection susceptibility while preserving its general capabilities.

This is a model-level intervention. It changes the checkpoint itself rather than adding a runtime prompt, output filter, or external guardrail.

About Hirundo

Hirundo develops machine-unlearning technology for removing unwanted data and reducing unwanted behavior in trained AI models. Hirundo's behavioral-unlearning workflow identifies a target behavior, modifies the model, and evaluates the resulting checkpoint on both behavior-specific and general-capability benchmarks.

Learn more:

What Hirundo changed

The target behavior for this checkpoint was prompt injection: cases where adversarial or untrusted instructions cause the model to disregard its intended task or reveal protected context.

The checkpoint was produced in a Hirundo behavioral-unlearning run with the following configuration:

Field Value
Base model google/gemma-4-31B-it
Target behavior Security (prompt injection)
Unlearning aggressiveness 0.7

Evaluation summary

Hirundo compared the hardened checkpoint with the unmodified base checkpoint under the same evaluation setup. For the security evaluations below, lower scores indicate fewer successful attacks or leaks and therefore better performance. Utility results are reported as benchmark scores, where higher is better.

Headline result: PurpleLlama prompt injection

On Meta's PurpleLlama textual prompt-injection benchmark, attack success rate decreased from 12.35% to 3.98%.

Benchmark Base model ASR Hirundo model ASR Relative reduction
PurpleLlama prompt injection 12.35% 3.98% 67.74%

General-capability evaluation

The hardened model was evaluated on 6 general-capability benchmarks.

Benchmark Change vs. base model
AIME25 0.00 pp
GPQA +0.32 pp
IFBENCH +0.34 pp
LiveCodeBench +1.15 pp
MMLU-Pro −0.04 pp
SciCode +0.16 pp

Across the six tasks, the unweighted mean change was +0.32 percentage points. The largest measured decrease was 0.04 percentage points on MMLU-Pro.

The means are descriptive rather than standardized aggregate scores: the benchmarks measure different capabilities and may use different scoring procedures.

Intended use

This checkpoint is intended for:

  • research on model-level prompt-injection mitigation;
  • comparative security and robustness evaluation;
  • development of applications that require a model with lower measured prompt-injection susceptibility than the upstream checkpoint; and
  • further evaluation or fine-tuning by teams that understand the base model and the security requirements of their deployment.

The model should be evaluated in the application's real prompt structure, tooling environment, retrieval pipeline, and threat model before deployment.

Loading with Transformers

from transformers import AutoModelForMultimodalLM, AutoProcessor

model_id = "hirundo-io/gemma-4-31B-it-hardened"
processor = AutoProcessor.from_pretrained(model_id)
model = AutoModelForMultimodalLM.from_pretrained(
    model_id, dtype="auto", device_map="auto"
)

messages = [{"role": "user", "content": "Explain the difference between encryption and hashing."}]
inputs = processor.apply_chat_template(
    messages, add_generation_prompt=True, tokenize=True,
    return_dict=True, return_tensors="pt"
).to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))

Consult the google/gemma-4-31B-it model card for upstream architecture, supported modalities and languages, context length, generation parameters, and base-model considerations.

License

This derivative retains the license of the upstream model. See the repository's LICENSE file and the base-model repository for details.

Citation

If you use this checkpoint, cite the upstream model and identify the checkpoint as Hirundo's prompt-injection-hardened derivative:

@misc{hirundo_gemma_4_31b_hardened_2026,
  title        = {Hirundo Gemma 4 31B Hardened},
  author       = {{Hirundo}},
  year         = {2026},
  howpublished = {\url{https://huggingface.co/hirundo-io/gemma-4-31B-it-hardened}},
  note         = {Prompt-injection-hardened derivative of google/gemma-4-31B-it}
}
Downloads last month
5
Safetensors
Model size
31B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for hirundo-io/gemma-4-31B-it-hardened

Finetuned
(330)
this model

Collection including hirundo-io/gemma-4-31B-it-hardened