qwen2.5-coder-32b-security-tools-lora
A QLoRA adapter for security testing tasks
2 min readupdated
This repository contains a QLoRA adapter (a small addition to the base model for efficient fine-tuning) for the Qwen2.5-Coder-32B-Instruct language model in the MLX format. The adapter was trained on internal security playbooks and command-line interfaces for 52 utilities. The main research result is negative: the model only learned to mimic the response format rather than memorizing real commands. The authors published this case study as a learning example of how prompt context works more effectively than fine-tuning weights.
Key features
- MLX format: The adapter is optimized for the MLX framework to run on Apple Silicon chips.
- Reproducible dataset: Dataset building scripts and a fully open validation procedure are included.
- Open license: The model and accompanying materials are distributed under the Apache-2.0 license.
- Negative result: Fine-tuning showed that providing tool information via context outperforms baking it into the model weights.
What you can do
- Use for research: Examine the dataset and training configs to analyze why fine-tuning can degrade factual accuracy.
- Apply a context-driven approach: Use utility text specifications in the system prompt instead of changing model weights.
- Run training locally: Reproduce the process using the provided configuration YAML file on Apple Mac hardware.
Example
Running inference on the base model with the trained adapter connected using the mlx_lm library:
from mlx_lm import load, generate
model, tok = load("mlx-community/Qwen2.5-Coder-32B-Instruct-4bit",
adapter_path="path/to/qwen2.5-coder-32b-security-tools-lora")Read more
DetailsBase model: mlx-community/Qwen2.5-Coder-32B-Instruct-4bit
Hardware: Mac Studio (M3 Ultra, 96 GB unified memory)
Training parameters: rank 16, 250 iterations, Adam optimizer
License: Apache-2.0










Comments