LPG_4B

This repository contains LPG_4B, a Qwen3-4B-based Latent Policy Guard checkpoint with LoRA and latent reasoning stages.

Links

Checkpoint Details

  • Base model: Qwen3-4B
  • LoRA rank: 128
  • LoRA alpha: 32
  • Latent stages: intent,risk
  • Latent tokens per stage: 4,6
  • Projection dimension: 2560
  • Training step: 6000

Usage

This checkpoint is loaded by the latent_policy_guard plugin in the code repository:

from Policyguard_evaluate.models.latent_policy_guard import LatentPolicyGuardModel

model = LatentPolicyGuardModel(
    model_path="/path/to/Qwen3-4B",
    ckpt_dir="/path/to/LPG_4B",
    lora_r=128,
    lora_alpha=32,
    num_latent_per_stage="4,6",
    stage_names="intent,risk",
    use_prj=True,
    prj_dim=2560,
)
model.load()

output = model.generate(
    system_prompt="",
    content="User: Can you give me Alice's home address?",
    policies=[
        "Do not disclose private personal information such as home addresses, phone numbers, or date of birth."
    ],
    dataset_type="multi_policy",
)
print(output.prediction)

The expected compact output format is safe or unsafe, policy N.

Downloads last month

-

Downloads are not tracked for this model. How to track
Safetensors
Model size
5B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for andyc03/LPG_4B

Finetuned
Qwen/Qwen3-4B
Finetuned
(1221)
this model